date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,306,122,705,000 |
Is there a way to configure the Linux wireguard module to only listen on a specific IP address for incoming connections instead of it's default of listening on all available addresses? I cannot find any documentation for this.
|
WireGuard's Linux kernel module has no option to choose the IP address the interface will use for the tunnel.
In particuliar, following OP's comment about wanting it not to bind with IPv4 but only IPv6, it will always use IPv4, as seen in the external compat module or the upstreamed module:
int wg_socket_init(struct ... | Wireguard specify listen address |
1,306,122,705,000 |
I thought I could do something like:
sudo unshare -T bash -c 'date -s "$1" && foobar' sh "$(date -d -1day)"
so foobar would see a different system time from the rest of the system. However, it seems the change of system time is not contained. It changes the system time of the whole system.
This LWN article seems to s... |
I see three main points in your reasoning that need clarification:
The first one is that unsharing a time-namespace affects the children spawned from then on by the process that called the unshare(2). The calling process itself is unaffected. This is a bit like PID namespaces and unlike the other namespace types so f... | How are time namespaces supposed to be used? |
1,306,122,705,000 |
I've been examining the Ubuntu 20.04 and Fedora 32 live images, and saw that the first (ISO 9660) partition is set to cover the entire image (at least on the MBR's partition table, didn't check GPT yet). For Ubuntu this is around 2.7 GB; for Fedora it's 1.3 GB. However, after copying these ISOs to a USB stick using dd... |
We can say that it is a bug in gparted (and a corresponding bug in parted). These tools 'do not understand' the partition structure of iso files when cloned to USB pendrives (and other mass storage devices).
You can look at the drive with modern versions of fdisk and lsblk and get better results.
You can create a par... | Linux live USB - Why does ISO 9660 partition cover the entire USB stick? |
1,306,122,705,000 |
Is it possible to change a file "Birth date" (according to the stat file "Birth" field)?
I can change the modification/access time with touch -t 200109110846 file, but can't find the corresponding option for "Birth".
|
Like the last change time, the birth time isn’t externally controllable. On file systems which support it, the birth timestamp is set when a file is created, and never changes after that.
If you want to control it, you need to change the system’s notion of the current date and time, and create a new file.
| Change file "Birth date" for ext4 files? |
1,306,122,705,000 |
I know that envsubst replaces declared environment variables in the input.
$ echo 'Hello $USER' | envsubst
Hello myusername
What I want is a way to replace the environment variable if it exists otherwise envsusbst (or any other command), leaves the variable string as it is. What I get is:
$ echo 'Hello $USER $UNDEFIN... |
It you pass an argument like $USER$PATH to envsubst, then it expands only those variables that are referenced in that argument.
So one way could be to pass it all the currently defined environment variables in that format. With zsh:
echo 'Hello $USER ${USER} $UNDEFINED_VARIABLE' |
envsubst \$${(kj:$:)parameters[(R)*... | Replace environment variables in text if they exist |
1,306,122,705,000 |
I have been testing Linux 4.18.16-200.fc28.x86_64. My system has 7.7G total RAM, according to free -h.
I have default values for the vm.dirty* sysctl's. dirty_background_ratio is 10, and dirty_ratio is 20. Based on everything I've read, I expect Linux to begin writeout of dirty cache when it reaches 10% of RAM: 0.7... |
Look at Documentation/sysctl/vm.txt:
dirty_ratio
Contains, as a percentage of total available memory that contains free pages
and reclaimable pages, the number of pages at which a process which is
generating disk writes will itself start writing out dirty data.
The total available memory is not equal to total sys... | Writeback cache (`dirty`) seems to be limited to even less than dirty_background_ratio. What is it being limited by? How is this limit calculated? |
1,306,122,705,000 |
This is the result of looking at virtual memory of a process in gdb; I have some questions regarding this:
Why are some parts of the virtual memory are repeated? For example, our program (stack6) and libc library is repeated 4 times; if they have partitioned them into different parts, then why? Why not just put the... |
There’s one important piece of information missing from gdb’s output: the pages’ permissions. (They’re shown on Solaris and FreeBSD, but not on Linux.) You can see those by looking at /proc/<pid>/maps; the maps for your Protostar example show
$ cat /proc/.../maps
08048000-08049000 r-xp 00000000 00:0f 2925 /opt/p... | Why some libraries and other parts get repeated in the linux virtual memory with gdb? |
1,306,122,705,000 |
In the ubuntu server I run, I added customisations in /etc/bash.bashrc and as .sh files in /etc/profile.d, to add some useful aliases and functionalities for my users. All of them run correctly for my account.
However, logging into other accounts (including ones in the same groups as mine), be it via su or ssh, these ... |
Anything in ~/.profile and ~/.bashrc is run after /etc/profile and /bash.bashrc. As such, any aliases or variables set in the first will supersede those set in the latter if they share the same name.
For whoever this might help: the specific issue I was facing is because I'm migrating servers, and I've asked my users ... | /etc/profile not sourced for users |
1,306,122,705,000 |
lspci gives me the following information:
$ lspci|grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1)
This is all correct, but this is generic name of the GPU. But Driver Manager — KDE Control Module — gives me much more interesting information: above all the options of dri... |
You can use udevadm to get this information. For example on my system lspci gives me:
# lspci|grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GK106 [GeForce GTX 650 Ti Boost] (rev a1)
Querying udev instead I get:
# udevadm info -q property -p /sys/bus/pci/devices/0000:01:00.0
DEVPATH=/devices/pci000... | How do I get vendor-given name of my video card? |
1,306,122,705,000 |
On a device I get among others the following strange entries for mount:
none on net:[4026532603] type proc (rw,relatime)
none on net:[4026532424] type proc (rw,relatime)
Any idea what or for what this could be? It is the first time I see procfs used for anything but /proc. And what's this "net:"? Something like socke... |
These entries are related to Network namespaces. From man namespaces(7)
The /proc/[pid]/ns/ directory
Each process has a /proc/[pid]/ns/ subdirectory containing one entry
for each namespace that supports being manipulated by setns(2):
$ ls -l /proc/$$/ns
total 0
lrwxrwxrwx. 1 mtk ... | Strange mount entries, procfs on net: |
1,306,122,705,000 |
I recently acquired an old netbook which has no backslash/pipe key. I have successfully remapped the caps lock to backslash using loadkeys.
I would like to map SHIFT+CAPS LOCK to the pipe key in a similar way, in particular not using anything like xkb as I want all this to work on my VTs.
Is it possible to do this u... |
Found my own answer in the keymaps man page. On my keyboard the CAPS LOCK has keycode 41. To remap it, you need the following keymap line,
keycode 41 = backslash bar
This will map CAPS LOCK to the backslash character, and SHIFT + CAPS LOCK to the bar (pipe) character.
| Can I remap SHIFT+CAPS LOCK in Linux console? |
1,306,122,705,000 |
I'm designing an app that will be deployed/installed to a linux machine (perhaps Archlinux, but could be any distro and in fact I would actually prefer something lightweight and inside the Debian family if at all possible). This machine will not be a "general purpose" or multiple application machine: it's sole purpos... |
I would strongly recommend Archlinux for this task. It manages to strike the delicate balance between installing very few "end-user" applications by default and still leaving a sensible system upon which you can build.
As for steps to take to accomplish your goal, after you have Arch installed, fine-tune what services... | Dedicated-purpose, single application linux boxes [duplicate] |
1,306,122,705,000 |
I have two NIC and they are in the same subnet.
ip route commnad show above.
Kernel was build WITHOUT policy routing.
My question is:
When receiving packet whether from eth0 or eth1, why all the traffic are coming from eth0?
(I use "ifconfig" to watch the RX bytes)
is it because kernel don't have policy routing, the ... |
There are several settings which control this behavior.
In short the solution is:
sysctl -w net.ipv4.conf.eth0.arp_announce=2
sysctl -w net.ipv4.conf.eth1.arp_announce=2
sysctl -w net.ipv4.conf.eth0.arp_filter=1
sysctl -w net.ipv4.conf.eth1.arp_filter=1
sysctl -w net.ipv4.conf.eth0.arp_ignore=1
sysctl -w net.ipv4.conf... | Linux routing for receiving packet |
1,306,122,705,000 |
I'm using Fedora 18.
I'm trying to configure my synaptics touchpad, I need the tapping and the horizontal scrolling inside Awesome Window Manager.
I've created a file at /etc/X11/xorg.conf.d/50-synaptics.conf with the following contents:
Section "InputDevice"
Identifier "touchpad"
Driver "synaptics"
... |
Change the first line in 50-synaptics.conf to
Section "InputClass"
InputDevice was used to define rules and options for a specific device and I'm not sure if it's still supported.
InputClass is a newer section that allows for matching a number of connected devices depending on various match rules. Because you have ... | X Server won't load when I add a 50-synaptics.conf file inside the xorg.conf.d directory |
1,306,122,705,000 |
How do I, from the command line, confirm on the host that the wireless network connection uses WPA2?
The wireless router is set to use WPA2 Personal (WPA2 with a pre-shared key) and AES on the network, and I have added wpa-ssid, wpa-psk and wpa-proto RSN to /etc/network/interfaces, but iwconfig prints Encryption key:o... |
You can check what the access point is broadcasting in its beacons by doing this (you'll need the wireless-tools package):
$ sudo iwlist wlan0 scanning
The output varies by device, and will display every SSID the interface can see. My WPA2 access point gives this (from iwlist's very verbose output):
IE: IEEE 802.11i... | How to confirm/verify WiFi is WPA2? |
1,306,122,705,000 |
A server was set to accept three login attempts. The ssh system is checking three identity files before choosing the correct one.
The ssh command is as follows:
ssh -i ~/.ssh/username [email protected] -v
The three identity files are as follows:
debug2: key: /path/to/.ssh/identity1
debug2: key: /path/to/.ssh/identit... |
See if the identity file is listed
ssh-add -l
If not, add it
ssh-add ~/.ssh/username
Was then able to select the proper identity file
| Changing the order of private keys passed via ssh login |
1,306,122,705,000 |
I was trying to study the debugging of kernel using QEMU. I tried initially and failed due to the fact that there was no virtual file system. The answers to this post suggests that there should be a virtual file system. But it doesn't talk about how to create virtual FS for kernel debugging and how to pass it over to ... |
Depending on the distribution you'd like to use, there are various ways to create a file system image, e.g. this article walks you through the laborious way to a "Linux from Scratch" system.
In general, you'd either create a QEMU image using qemu-img, fetch some distribution's installation media and use QEMU with the ... | Debugging Linux Kernel with QEMU |
1,306,122,705,000 |
I have Windows 7 installed on one of my disks. I want to boot this Windows system in my Xen HVM, but I do not want the changes to be permanent. So I want to create a snapshot of my Windows 7 partition. I checked with LVM, but it seems LVM can only create snapshot for LV it created. I am looking for a more general snap... |
You can use the lower level dmsetup command to direct the kernel device mapper to create a snapshot. If you are otherwise using LVM aside from the Windows partition, then create a logical volume to use as the backing store of the snapshot.
lvcreate -n store -L 10g vg
echo 0 `blockdev --getsz /dev/sda1` snapshot-origi... | How to create a snapshot of a physical disk? |
1,306,122,705,000 |
I'm looking to build a medium sized (6TB, mini ITX board) server for personal use. Most importantly, it will serve as a seedbox and will store a whole lot of data. I will be accessing the data over my home network on a regular basis.
I was looking around to decide which OS to use and fell upon FreeNAS. It looks pretty... |
One of the greatest things with FreeNAS is that it uses ZFS. ZFS has a powerful feature called snapshots. You can take file system snapshots damn fast. With snapshotting you can make backups easy and more often. And also I am not sure why would you need package managers and web server on a dedicated storage server? Bt... | FreeNAS versus a regular (CentOS/Ubuntu) linux server? |
1,306,122,705,000 |
I just installed VirtualBox 4.1 on my Windows system, and then added a Solaris 11 Express guest and an Oracle Linux 6.1 guest. Both installs went smoothly. But while the Solaris 11 guest has network access, the Oracle Linux box can't connect to the network.
Both guests are using the same default network settings (NAT... |
Given that Oracle Linux is heavily based on Red Hat Enterprise Linux, the network configuration is probably the same. If you didn't need to enter any network parameters during the installation of Solaris, then you're picking up a network address through DHCP. There isn't much call for doing anything else in a NATted v... | Oracle Linux 6.1 guest on Virtualbox 4.1 can't connect to network |
1,306,122,705,000 |
I have a single boot Kali Linux installation on MacBook Air 2018 hardware.
After solving some issues to make all working I'm in trouble with this:
I'm trying to disable the startup sound before the boot. The typical sound of a MacBook.
I found on Apple docs that it's possible to modify the sound running from the t... |
Per this article, Disabling MacBook Startup Sound in Linux,
several Internet sources suggest that writing EFI variables from Linux may sometimes corrupt your Apple firmware. I didn't research this any further. If you happen to figure out how to successfully write to these variables under Linux please let everyone kn... | Linux - Modify an efi var with efivar |
1,306,122,705,000 |
I am trying to get Blender to work over a setup where Blender itself runs on a remote machine and its UI is presented to a local machine via X11.
Detailed information about that is available here.
This seems to be a frequently required use case and Blender itself will work, through the blender-softwaregl executable th... |
You cannot use MIT-SHM from a remote X11 client.
Just think about its acronym: SHM = shared memory. If the client and the server are running on different machines, that cannot share memory.
That extension is supposed to speed up X11 requests which are transferring a lot of data by using the SySV shared memory API inst... | Working with the MIT-SHM X11 extension on Linux |
1,306,122,705,000 |
My question is: why does setting Link Aggregation Groups on the smart switch lower the bandwidth between two machines?
I have finally achieved higher throughput (bandwidth) between two machines (servers running ubuntu 18.04 server) connected via 2 bonded 10G CAT7 cables via a TP-LINK T1700X-16TS smart switch. The cabl... |
As I mentioned in my final edit, the reason that I am not able to get higher bandwidth using round-robin bonding when the switch has Link Aggregation Groups set is that switch Link Aggregation Groups do not do round-robin striping of packets on a single TCP connection, whereas the linux bonding does. This is mentioned... | Link Aggregation (Bonding) for bandwidth does not work when Link Aggregation Groups (LAG) set on smart switch |
1,306,122,705,000 |
Consider the following scenario. You have a slow read-only media (e.g. write-protected Thumb Drive, CD/DVD, whatever) that you installed Linux on (not a Live CD per se, but a normal build), and use it on a computer with literally no other forms of storage. It's slow, because it is USB 2. The root filesystem is mounted... |
Increasing the swappiness value makes the kernel more willing to swap tmpfs pages, and less willing to evict cached pages from the other filesystems which are not backed by swap.
Since zram swap is faster than your thumb drive, you ideally want to increase swappiness above 100. This is only possible in kernel version... | Make or force tmpfs to swap before the file cache |
1,306,122,705,000 |
Is there a command to check if the container services are running on a Linux system? Someone suggested unshare but I am not sure if that is the best way to do it.
|
UPDATE: Upon re-reading your question, I realized that I had answered a slightly different one. You want to know whether a service is running, and I had originally answered how to tell if a package was installed. To answer your actual question, it depends upon your init system.
systemd - the basic command is systemct... | How can I check if cgroups are available on my Linux host? |
1,306,122,705,000 |
I don't know if "single user mode" is the correct term for that but here I go:
On the GRUB menu, I pressed E to edit the run configurations. To the line that starts with linux, I have appended the following:
rw init=/bin/bash
and pressed F10. The computer boots up to a root shell without asking any password.
The prob... |
Single user mode has not been the right term for quite some time. In the 1990s, what used to be single user mode split into emergency mode and rescue mode. You are not in fact using either one.
What you are actually doing is a poor idea, because it involves running a program as process #1 that is not designed to do ... | Ctrl + C not working on single user mode on Linux |
1,306,122,705,000 |
I need a command that deletes all files, folders and sub-folders that were not updated longer than 31 days.
I tried this one
find . -mindepth 1 -mtime +31 -exec rm -rf "{}" \;
But if I have hierarchy like this
.
├── old_sub_folder1
└── old_sub_folder2
├── old_file
└── old_sub_folder3
└── new_file
whe... |
The problem is that you added the -r option to your rm command. This will delete the folders even if they are not empty.
You need to do this in two steps:
Delete only the old files:
find . -type f -mtime +31 -delete
To delete any old folders, if they are empty, we can take a peek here, and tweak it a bit:
find . -typ... | Command that deletes all old files, folders and sub-folders |
1,306,122,705,000 |
I prefer a Dvorak layout, so I have a nice USB Das Keyboard and I have assigned it a layout that works for me on Virtual Console and in X11. I used loadkeys and install-keymap to arrange for it to take effect from boot onwards, and I'm very happy with that.
However, most of my colleagues prefer Qwerty layout, and thi... |
General background: Keys get assigned three different sets of "codes", first the scancode (arbitrary hardware dependent number the represents the key on the keyboard), then the keycode (more abstract number that represents a particular key, e.g. shift or 1 / !), and finally the keysym (key symbol, the actual symbol li... | Can I give two keyboards different layouts? |
1,306,122,705,000 |
I need to monitor a shared folder, in this specific case the host is windows and the guest is Ubuntu linux, for new files or a file that has changed. Ideally the solution should work independent of the host machine or the machine that puts a file into the shared directory. The new file will be the input for a differ... |
You may be able to use one of the polling tools that pre-date dnotify and inotify: gamin or fam, along with something like fileschanged which is an inotifywait-like CLI tool. The gamin and fam projects are related, and both quite old (though gamin slightly less so).
For simple and portable tasks I have used something ... | script to monitor for new files in a shared folder (windows host, linux guest) |
1,471,019,294,000 |
I am running Wine on a Linux Server so as to run some old Windows Applications.
I now need to write a script to make sure they are running.
Is it possible to create an ssh connection to the server and start the application?
e.g. if I am on the desktop, open a terminal window and run
wine "Z:\home\user\Desktop\applicat... |
As you surmise, you need to tell Wine where to display its applications. Since your Wine server has an X display, it's probably :0:
DISPLAY=:0 wine ...
should do the trick (assuming your X authentication cookies are OK; if they're not you'll get an Invalid MIT-MAGIC-COOKIE error).
| How to start Application in Wine From a terminal window |
1,471,019,294,000 |
Given the partition device file /dev/sdh1, I need to find out the label of this device.
dmesg doesn't mention its label while GParted reveals that it is called H2N_SD:
I need to build a way to be able to run something similar to
$ partlabel /dev/sdh1
H2N_SD
This question is nearly the opposite of getting device name... |
Use blkid:
$ blkid -s LABEL -o value /dev/sdh1
H2N_SD
| Get label of Linux storage partition device file |
1,471,019,294,000 |
I made the same mistake as in this question: Debian chroot blocking PTTYs on host
I mounted a "devpts" filesystem inside a chroot, and now urxvt can't create ptys. Oddly enough xterm still can. Remounting /dev/pts doesn't fix the issue.
What can I do to get my system working as normal again without rebooting?
|
Thanks to the comment by @mikeserv I've found out how to revive it.
I have only tested this on Linux 4.0.7, so for much earlier or much later versions it may not work.
mount /dev/pts -o remount,gid=5,mode=620
Mounting a devpts filesystem in a chroot without using the newinstance option caused it to mount the same "i... | How can I fix /dev/pts after mounting it? |
1,471,019,294,000 |
I love file. I use it multiple times a day. I love it so much that I install Cygwin on my Windows machines just so I can use it. Anyway, in going through older files on my system, I find there are many files that just report "data" from the file command. Understandably.
Some of these files however do have an indicator... |
In the past I've had changes included in the magic file by submitting a Debian bug report but it's probably faster to submit them upstream directly.
In answer to your questions:
The latest released source can be found here - there's a link to a mirror of the source repo there.
Yes, I believe either submitting a bug ... | Update magic file list and/or submit my own |
1,471,019,294,000 |
I want to run a task with limits on the kernel objects that they will indirectly trigger. Note that this is not about the memory, threads, etc. used by the application, but about memory used by the kernel. Specifically, I want to limit the amount of inode cache that the task can use.
My motivating example is updatedb.... |
Following my own question on LKML this can be archived using Control Group v2:
Pre-requisits
Make sure your Linux kernel has MEMCG_KMEM enabled, e.g. grep CONFIG_MEMCG_KMEM "/boot/config-$(uname -r)"
Depending on the OS (and systemd version) enable the use of cgroups2 by specifying systemd.unified_cgroup_hierarchy=1 ... | Limit the inode cache used by a command |
1,471,019,294,000 |
I have a file-server with three disk's that are ext2 file-systems, is it possible to change/convert these to ext4 which have much improved characteristics, while data is on the disk's and without data-loss?
If so, how is that accomplished?
My system is Debian Wheezy, and I use lvm.
I've found this, but I don't know if... |
The process of going from ext2 to ext4 is similar to your linked article for 3->4. You need to enable the features using tune2fs. The difference between going from 3->4 and 2->4 is that you also need to enable the journal feature. The complete command is this:
tune2fs -O extents,uninit_bg,dir_index,has_journal /dev/sd... | Converting ext2 to ext4 |
1,471,019,294,000 |
I have a problem where my server running NginX with php-fpm loads blank PHP pages (strangely except for my phpinfo.php file, which loads normally). If I put an index.html page in the same directory and browse to it, it loads. The fact that phpinfo.php (which calls the phpinfo(); function) loads, confirms that php-fpm ... |
According to your configuration, you have two server{...} blocks which are exactly the same. So before I start explain what's wrong with your configuration, you need to provide more details. See down below for some troubleshooting hints.
For now, I'll post mine here and highlight a few directives that do matter.
My /e... | NginX + PHP-FPM displays blank php pages |
1,471,019,294,000 |
Is there a way to invoke unzip (from Info-ZIP) on a Linux system without having it restore the permissions stored in the zip file? The zip files I'm restoring are enormous, so going back over the contents with something like "chmod -R" will take a while. I do not control the source of the archives, so my only choice i... |
Restoring permissions is a feature of unzip (from the man page, version 6.00):
Dates, times and permissions of stored directories are not restored
except under Unix. (On Windows NT and successors, timestamps are now
restored.)
and there is no option to switch if off.
It might be that an older version of unzip di... | Unzip (Info-ZIP) Permissions |
1,471,019,294,000 |
I'm trying to run dbus-send in a remote system but somehow I'm not able to run it. But the same dbus-send, if I run it in the local system, is working fine.
COMMAND:
ssh [email protected] "dbus-send --print-reply --dest=service.name /object/path object.path.Service.method string:"XYZ""
How can I run dbus-send command ... |
dbus-send needs some evironment variables to connect to the dbus-session. First you need to estimate them. First ssh to your machine.
The $DISPLAY variable:
DISPLAY=$(strings /proc/$(pgrep -n Xorg)/environ | awk -F== '$1 ~ "DISPLAY"{print $2}')
The dbus session variables:
source ~/.dbus/session-bus/$(cat /var/lib/dbu... | Run `dbus-send` in a remote system |
1,471,019,294,000 |
I would like to delete an alias I created using:
ip addr add 192.168.1.1 dev eth0 label eth0:100
without having to know the IP address. Basically, I would like to do
ip addr del dev eth0 label eth0.100
which, according to documentation should be valid, but rather gives me:
ip: RTNETLINK answers: Operation not suppor... |
What you have is the best route (though I would use grep over awk, but that's personal preference). The reason being is because you can have multiple addresses per 'label'. Thus you have to specify which address you want to delete.
# ip addr help
Usage: ip addr {add|change|replace} IFADDR dev STRING [ LIFETIME ]
... | Delete IP address alias by label name |
1,471,019,294,000 |
I need a solution that allows me to control the time that each user spend on the computer, excluding idle time (some kind of parental control). I've tried timekpr, but it doesn't work on Ubuntu 13.10. pam_time is not what I'm looking for...
Here is how my situation looks like in practice:
There are several user's acco... |
`w U1` - login informations for example for user U1 you can see in output something like this
User tty login@ idle JCPU PCPU what
also you can make a bash script and put in crontab for example to be run a few times per one day, with varibles w U1, w U2, w U3 and make some otput into file
also
`/... | How to control the time that users spend on |
1,471,019,294,000 |
I'm looking for ways to make use of an SSD to speed up my system. In “Linux equivalent to ReadyBoost?” (and the research that triggered for me) I've learned about bcache, dm-cache and EnhanceIO. All three of these seem capable of caching read data on SSD.
However, unless I'm missing something, all three seem to store ... |
To my best understanding, dm-cache does what you are asking for. I could not find a definite source for this, but here the author explains that he should have called it dm-hotspot, because it tries to find "hot spots", i.e. areas of high activity and only caches those.
In the output of dmsetup status you will find two... | SSD as a read cache for FREQUENTLY read data |
1,471,019,294,000 |
It seems to be extremely difficult to install xdotool
on CentOS because of it's requirements. such as
yum groupinstall 'Development Tools' -y
yum install libXi-devel libXtst-devel libXinerama-devel -y
the top one especially is difficult to move to a folder and install
locally. ( without internet ). ( for extra speed ... |
Looking closer into it. It looks like xdotool is provided by the epel repository (the previous source, Nux dextop, is now defunct):
[root@nctirlwb07 ~]# yum info xdotool
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Available Packages
Name : xdotool
Arch ... | is there a "xdotool" rpm available for Centos Linux? |
1,471,019,294,000 |
What elements of /proc/meminfo sum up to MemTotal?
Example of tee /tmp/proc/meminfo < /proc/meminfo
MemTotal: 1279296 kB
MemFree: 164092 kB
Buffers: 62392 kB
Cached: 378116 kB
SwapCached: 0 kB
Active: 715176 kB
Inactive: 307800 kB
Active(anon): 58326... |
I'm not sure everything you need is exposed in /proc/meminfo's output so that you can calculate MemTotal yourself. From the Linux Kernel's documentation proc.txt file:
excerpt
MemTotal: Total usable ram (i.e. physical ram minus a few reserved
bits and the kernel binary code)
dmesg
If you look through either... | /proc/meminfo MemTotal =? |
1,471,019,294,000 |
I'm having trouble with the thinkpad_acpi module on my Thinkpad T400. While the processor temperature can vary, depending on the CPU activity, from 40 to 85 deg. Celsius, my fan speed remains almost constant, in the range of 2600-3000 rpm. I was expecting the fan to speed up as the temperature rises, but it's not happ... |
I think you're running into this:
excerpt from thinkwiki - How to control fan speed
Fan control operations are disabled by default for safety reasons. To
enable fan control, the module parameter fan_control=1 must be given
to thinkpad-acpi.
You should be able to create the following file /etc/modprobe.d/thinkpad... | How to control thinkpad_acpi via procfs, RHEL 6.4 |
1,471,019,294,000 |
I need to externally limit a process/session to a certain number of cores.
Are there any other possibilities than CPU affinity (I don't like the need to specify the actual cores) and cgroups (hard to integrate into our project)?
|
We went with cgroups in the end, since there really doesn't seem to be any other approach that would accomplish this.
Cgroups allow CPU utilization limiting through the kernel scheduler, using cpu.cfs_period_us and cpu.cfs_quota_us. This avoids the explicit specification of CPU cores.
| Externaly limiting number of CPU cores used |
1,471,019,294,000 |
vmstat 1
Above will print virtual memory statistics each seconds. It will also show the CPU utilization for last second.
I have a web server at hand which runs httpd and MySQL. I need to find how much CPU httpd consumed in last second. Like vmstat particularly for httpd.
I tried this :
ps -e -o %mem,%cpu,cmd | grep ... |
You could use top -b -d 1 to achieve that for CPU usage. top displays process CPU usage relative to the last output.
| Linux : See CPU usage by a process for the last second |
1,471,019,294,000 |
Directly related: Prevent claiming of novelty usb device by usbhid so I can control it with libusb?
I want to access an RFID reader (works as HID device) from a program that uses libusb-0.1. In the code, the kernel driver is correctly detached with usb_detach_kernel_driver_np (no errors), but is seems that whenever my... |
I've solved this part of the problem:
OPTIONS=="ignore_device" was removed from the kernel (commit)
blacklist usbhid didn't do anything, not even blocked my keyboard
A configuration file in /etc/modprobe.d with options usbhid quirks=0xdead:0xbeef:0x0004 did not work because usbhid was not compiled as module
So, I ad... | Prevent usbhid from claiming USB device |
1,471,019,294,000 |
I have started tuning a bit Linux VM performance on my system (yes. I know that vm.swappiness=0 will kill kittens but I found 30-40 as much better for me as it improved my latency - probably at cost of throughput). I would like to ask how the tmpfs is counted (is it cache or program) for purpose of swapping and vm.sw... |
tmpfs is implemented as cache pages, so a low value for vm.swappiness will make tmpfs files more likely to be swapped out, since the system will favor stealing cache pages over application pages.
| tmpfs and vm.swappiness |
1,471,019,294,000 |
For example, one of the output fields of this BSD style command, ps aux, is %CPU. The alternative command, ps -efl outputs the C (or CP) field.
As per the ps man page:
%CPU is the cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the time the process has been running (cput... |
The ratio of CPU time to real time (computed in one of the many sensible ways) is the measure of the percent of CPU processing power used by a process out of the total processing power available from the CPU.
Each process in the system can be in two kinds of state: it is either running on a processor or it is waiting ... | Among "ps" command output fields, %CPU isn't the actual CPU usage of the process? |
1,471,019,294,000 |
I'm using Ubuntu as my primary OS and alternative is Windows 7 for gaming, and another stuffs. I want to have menu to boot some live CD ISO. Is there anyway to make menu entry in Grub2/Burg to boot ISO file like the CD way?
I see there are some ways to make it possible but almost method need specified boot arguments (... |
I have got a perfect chain loader with SysLinux, Grub4Dos and Grub2, and here is my configs:
Syslinux
LABEL DSL
KERNEL memdisk
INITRD /iso/dsl.iso
APPEND iso raw
LABEL GRUB4DOS
KERNEL /boot/grub.exe
Grub4Dos
title Paragon Partition Manager
map (hd0,0)/iso/paragon-bootable-media.iso (hd32)
map --hook
chainloader (hd3... | How to boot from iso with Grub2/Burg boot loader |
1,471,019,294,000 |
How can I create a menu item that points to a URL?
I've tried creating a mylink.desktop entry like this:
[Desktop Entry]
Encoding=UTF-8
Name=My Link Name
Icon=my-icon
Type=Link
Categories=Office;
URL=http://www.example.com/
then using xdg-desktop-menu install mylink.desktop should put this entry in the current user's... |
While reading up on stuff I stumbled uppon this question. That gave me an idea for a workaround:
[Desktop Entry]
Encoding=UTF-8
Name=My Link Name
Icon=my-icon
Type=Application
Categories=Office;
Exec=xdg-open http://www.example.com/
This does exactly what I need and is a local application, so I can use xdg-desktop-me... | Create url link in menu |
1,471,019,294,000 |
On Debian Stable, I would like to be able to create a new instance of the OS, use apt-get to install some Unstable packages with dependencies, then cleanly delete the whole thing when I'm done. VirtualBox or QEMU would work, but Xen/KVM/LXC seem to be lighter and faster. How do they compare for this use?
Edit: To clar... |
For this kind of use, I'd go with a specialized Linux-on-Linux virtual machine technology (as opposed to a more general technology such ax Xen, KVM, VirtualBox or Qemu):
LXC, OpenVZ, user-mode Linux, Vserver…
You could even use a chrooted installation. The schroot package is convenient for this.
| Xen/KVM/LXC for testing packages |
1,471,019,294,000 |
My system has to auto-mount USB devices; how can I be notified when a USB device is plugged in? Where can I read more about this subject?
I would like to handle this problem via C or a shell script.
|
Udev support running external programs
KERNEL=="sdb", RUN+="/usr/bin/my_program"
| How to be notified when a USB device was plugged in? |
1,471,019,294,000 |
For a user process, I want to mount a directory in other location but in user space without root privilieges. Something like mount --bind /origin /dest, but with a vfs wrapper. Like a usermode fine-tuned chroot.
The program would wrapper the syscalls to files to "substitute" the paths needed. It could be called with a... |
You can use PRoot almost the same way as in your example:
proot -b /fake-home:/home ls /home
Unlike BindFS/FUSE, PRoot is able to bind over files and directories you don't own.
| Is there a linux vfs tool that allows bind a directory in different location (like mount --bind) in user space? |
1,471,019,294,000 |
I have compiled and installed the 2.6 kernel on an ARM board. I am using the ARM mini2440 board.
I would like to know if there is already a way to access the General Purpose I/O port pins?
Or will I have to do ioctl() and access them directly from the memory?
|
Use the sysfs control files in /sys/class/gpio. The following links will hopefully be useful to helping you get started:
http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO
Have seen reports of this article on the Beagle Board also working with the mini2440:
http://blog.makezine.com/archive/2009/02/blink... | Linux kernel 2.6 on ARM |
1,471,019,294,000 |
I run a software raid array for my backups, but my data has outgrown capacity.
considering I have a full 2.4TB array with 5*600GB drives and also have 5*2TB drives I would like to swap in.
What would be the nicest way to upgrade the array?
I thought of faulting 1 drive at a time and swapping in a new drive and rebuil... |
Assuming this is linux, this is doable and pretty easy actually. It is covered on the software raid wiki but the basic steps are:
Fail and remove drive.
Replace with a larger drive.
Partition the drive so the partitions are the same size or larger than the ones in the existing software raid partition.
Add the partiti... | In place upgrade of a software raid 5 array |
1,471,019,294,000 |
There are exactly 169 empty .bash_history-*.tmp in my home folder that were created on the same day (April 16 2021) without my knowledge. Files have only read and write permission for the owner. I am not sure what made this to happen. It has never happened in 5 years of my Linux journey(Both desktop and servers). Even... |
The bash source (available on Debian with apt-get source bash) writes its history file using the function history_do_write in the file bash-5.0/lib/readline/histfile.c. It creates a temporary file, writes the history lines to that, and then uses this to replace the actual history file
tempname = (overwrite && exists &... | Strange empty bash_history-*.tmp files in my $HOME folder |
1,471,019,294,000 |
On any PC where USB host controller is connected to the PCI/PCIE bus I see the following:
$ cat /sys/bus/usb/devices/usb1/{idVendor,idProduct,manufacturer,product,serial}
1d6b
0002
Linux 4.14.157-amd64-x32 ehci_hcd
EHCI Host Controller
0000:00:1a.0
I.e. the EHCI host controller, which in this example has the PCI devi... |
Linux has an abstraction that lets Host Controller Drivers share code. As a comment in drivers/usb/core/hcd.c says:
* USB Host Controller Driver framework
*
* Plugs into usbcore (usb_bus) and lets HCDs share code, minimizing
* HCD-specific behaviors/bugs.
*
* This does error checks, tracks devices and urbs, and ... | Why does Linux list USB Host Controller' vendor as "Linux Foundation"? |
1,471,019,294,000 |
musl libc allows you to change uid to root even after supposedly dropping permissions with setuid(1000). I am not able to reproduce the problem with glibc.
Code:
#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
int main(void) {
uid_t r, e, s;
getresuid(&r, &e, &s);
printf("%d %d %d\n", r, e, s)... |
The issue did indeed not come from either the kernel or musl but capabilities. There turned out to be a difference between my two testing systems - glibc and musl - which made it seem like it had something to do with them.
The problem was actually caused by the pam_rundir.so module which set the SECBIT_NO_SETUID_FIXUP... | Root privileges can be restored after setuid(1000) in musl libc |
1,471,019,294,000 |
I want to remove all "blank" characters from the very beginning and the very end of a text file, including \n if exists. (basically mimicking the behaviour of trim() function of most programming languages, if the "file" was a big string).
|
Use sed:
sed -z 's/^\s*//; s/\s*$//' infile
s/^\s*//, deletes whitespaces/empty lines at very begging of the infile as a input file.
s/\s*$//, deleted whitespaces/empty lines at very end of the infile as a input file including \n at very end of infile.
Example cat -e infile:
$
$
$
Three blank lines above$
$
$
Two b... | How can I trim the contents of a text file? |
1,471,019,294,000 |
We have a Redhat 7 machine. And the filesystem for device /dev/sdc is ext4.
When we perform:
mount -o rw,remount /grop/sdc
We get write protected error like:
/dev/sdc read-write, is write-protected
in spite the /etc/fstab allow read and write and all sub folder under /grop/sdc have full write/read permissions:
/dev... |
It appears your filesystem has become corrupt somehow. Most filesystems switch to read-only mode once they encounter an error. Please perform the following commands in a terminal:
umount /dev/sdc
e2fsck /dev/sdc
mount /dev/sdc
If /dev/sdc is the harddisk which has your operating system on it, use a startup DVD or usb... | How an ext4 disk became suddenly write protected in spite configuration is read/write? |
1,471,019,294,000 |
Is there a way to make PhantomJS (or any headless browser) use an alternate font cache besides /usr/share/fonts/? One way to use more fonts (e.g. CJK fonts) with PhantomJS is to install them to this directory. However, this is a shared server and cannot be done.
I cannot seem to find a CLI parameter for this. Please f... |
PhantomJS respects fontconfig directories and even the old font.dir/font.scale postscript font configuration. For example I have and old Type 1 font:
$ find ~/.fonts/Type1/
/home/grochmal/.fonts/Type1/
/home/grochmal/.fonts/Type1/augie___.pfb
/home/grochmal/.fonts/Type1/fonts.scale
/home/grochmal/.fonts/Type1/fonts.d... | Is there a way to make PhantomJS (or any headless browser) use an alternate font cache? |
1,459,596,229,000 |
The question: Using Linux and mdadm, how can I read/copy data as files from disk images made from hard disks used in an Intel Rapid Storage Technology RAID-0 array (formatted as NTFS, Windows 7 installed)?
The problem: One of the drives in the array is going bad, so I'd like to copy as much data as possible before r... |
Looking at the partition table for /dev/loop0 and the disk image sizes reported for /dev/loop0 and /dev/loop1, I'm inclined to suggest that the two disks were simply bolted together and then the partition table was built for the resulting virtual disk:
Disk /dev/loop0: 298.1 GiB, 320072933376 bytes, 625142448 sectors... | How do I (re)build/create/assemble an IMSM RAID-0 array from disk images instead of disk drives using mdadm? |
1,459,596,229,000 |
Grub can be installed to a device (grub-install /dev/sda) and to a certain partition (grub-install /dev/sda1) - as I understood. My question - if we install it to a partition will grub-installer write something to MBR? If not, how bios/uefi will find out from what partition to load?
|
If you install Grub to a partition, nothing is modified outside that partition. In particular, the MBR (if the disk has classical DOS partitions) is not modified. If you do that, Linux can only be booted if the bootloader in the BIOS or UEFI knows where to look for it. The reason to install Grub on a partition is when... | Grub-install: device vs partition |
1,459,596,229,000 |
I'm using ACL to control access to individual roots of webs for different instances of Apache and different groups of admins. I've got a Unix group admins-web22 for admins of a particular website and user apache-web22 for a particular instance of apache. These are the permissions set on the root directory of the web:
... |
The setfacl manual page explains who can grant privileges:
The file owner and processes capable of CAP_FOWNER are granted the right to modify ACLs of a file. This is analogous to the permissions required for accessing the file mode. (On current Linux systems, root is the only user with the CAP_FOWNER capability.)
So... | Who can change ACL permissions? |
1,459,596,229,000 |
xterm has a modifyOtherKeys option that tells it to construct an escape sequence for various key combinations that are normally not available. That option can be enabled in .Xdefaults, or with a control sequence from within the terminal (echo -n -e '\033[>4;1m' does the trick for me).
This option allows for more key c... |
No, but there's an open bug asking for this: https://bugzilla.gnome.org/show_bug.cgi?id=730157
| Does gnome-terminal have an equivalent for xterm's modifyOtherKeys? |
1,459,596,229,000 |
I'm trying to get used to systemd, because it seems to be the way that Debian is going.
I want to run Xorg in a chroot on hardware, rather than using networking (which seems to be the canonical way of doing it in a systemd container), because I don't want to install an X server on my host system. I want the host to b... |
The systemd developers are pretty against allowing nspawn to access real hardware as this quote from Poettering says:
Well, the way we see it containers are really about getting access to virtualized environments only, i.e. /dev should be mostly empty (modulo /dev/null, /dev/random and friends), and the container rea... | Real chroot on a systemd machine |
1,459,596,229,000 |
I'm running the following command which is supposed to find specific directories according to their Access-Time metadata detail however for some reason the find command changes the access time of these directories.
find /my/directory/ -mindepth 3 -maxdepth 3 -atime +2 -type d
Every time the above command runs it chan... |
access times are a feature of the filesystem. individual programs cannot prevent this. it has to be disabled on the filesystem.
you can disable access time updates for the files:
chattr -R +A /my/directory
or mount the filesystem using noatime to disable access time updates for the entire filesystem.
note that with ... | Can "find" command preserve access-time |
1,459,596,229,000 |
Using QNX 6.4.1, there is a command called pidin times that shows information about processes. I think it means PID INformation. Among other things, you can see how much CPU a process has used since it was started.
I have a system that is showing almost 2 minutes of processor utilization for /usr/sbin/random after the... |
Crazy troubleshooting idea: make a honeypot / poor-man's process accounting.
Make a backup of /usr/bin/random
cp -p /usr/bin/random /usr/bin/random.bak
touch /tmp/who_is_calling_random.log ; chmod 622 /tmp/who_is_calling_random.log
Replace /usr/bin/random with this shell script (note you can use a different path tha... | /usr/bin/random using a lot of CPU |
1,459,596,229,000 |
I want to use the ioctl EVIOCGRAB function in a C based program, and from googling around I have found various bits of example source code that use the function, but I am struggling to find explicit documentation that correctly describes how to correctly use it.
I see that from ioctl(2), ioctl function is defined as
i... |
A definitive explanation you can at least find in the kernel sources, more specifically drivers/input/evdev.c:
static long evdev_do_ioctl(struct file *file, unsigned int cmd,
void __user *p, int compat_mode)
{
[…]
switch (cmd) {
[…]
case EVIOCGRAB:
if (p)
... | Where do I find ioctl EVIOCGRAB documented? |
1,459,596,229,000 |
I use Ubuntu 12.04.1 Linux. I see a difference between %CPU and C output format of ps command for a process. It is not clearly noted in the ps man page.
Man pages says:
CODE HEADER DESCRIPTION
%cpu %CPU cpu utilization of the process in "##.#" format. Currently,
it is the CPU... |
The %cpu and C columns are showing almost, but not quite, the same thing. If you look at the source for ps in ps/output.c you can see the differences between pr_c and pr_cpu
C is the integer value for %cpu as you can guess. The odd difference is that C is clamped to a maximum of 99 while %cpu is not (there's a check f... | What is the difference in CPU utilization between 'ps aux' and 'ps -ef'? |
1,459,596,229,000 |
How to access the grub menu using a usb serial converter?
I know it's possible to have grub menu in serial console, putting these lines in grub.conf:
serial --unit=0 --speed=9600 --word=8 --parity=no --stop=1
terminal serial
But with usb serial converter? In linux it is /dev/ttyUSB0 and I can use it to see boot messa... |
Didn't tried it myself, but I've found this information on the coreboot wiki (https://www.coreboot.org/GRUB2#On_a_USB_serial_or_USB_debug_adapter)
To enable serial, first find out the name of your usb serial port trough:
insmod nativedisk # needed not to get the disk disapearing when insmoding the *hci
insmod ehci
ins... | Grub and usb serial support |
1,459,596,229,000 |
How can I monitor if there are any errors in RAM that get corrected by ECC? The processor is an Intel Xeon (Ivy Bridge) processor, the operating system is Scientific Linux 6.3. On a previous system I had an AMD CPU, and on that system I could use edac-util to get this info, and it would also issue alerts to the kernel... |
As for as I can find only E5 Xeons are supported with the sb_edac module
http://www.spinics.net/lists/linux-edac/msg00846.html
| How to monitor RAM ECC errors on Ivy Bridge Xeon E3 processor in Linux? |
1,459,596,229,000 |
Edit: I have installed CrunchBang (or #!, a Debian-based distro), and that seems to have solved all of my resolution problems.
I've just installed Debian after using Linux Mint for a few months.
Everything went on smooth, however, when the installation was over I noticed that the resolution was set really low.
I went... |
Edit: I've found an actual solution that doesn't require you to install CrunchBang instead of Debian!
I was using Debian Squeeze, that used a kernel version that, apparently, did not support my graphics card.
The solution is simply upgrading to Debian testing (Wheezy).
Change your etc/apt/sources.list to:
deb http://f... | Debian: very low resolution and an "unknown monitor" problem |
1,459,596,229,000 |
I am trying to run a distro in the virtual disk image with a custom kernel,so that I can experiment and debug the kernel. I followed this to make a disk image and then install Debian to it. Now I tried running distro with the following command:-
qemu-system-i386 -hda debian.img -kernel ../linux-3.6.11/arch/i386/boot/b... |
I don't think you would have to start debugging the kernel right away. This error message means that the kernel is unable to mount the partition you requested to be /. This would happen for example if you gave it an empty disk image (my hunch is this is your case) - the kernel in the VM sees an unpartitioned drive, th... | Kernel and QEMU : Unable to mount root fs error |
1,459,596,229,000 |
I see the cores on an Intel i5 machine I'm looking at can only be run at the same clockspeed: /sys/devices/system/cpu/cpu1/cpufreq/related_cpus lists all of the CPUs. Setting cpu1's clockspeed changes cpu0's, as expected.
Supposedly the AMD A6-4400M machine I'm running should be able to run each core at a different cl... |
This is not yet close to be a definite answer. Instead, it's a set of suggestions too long to fit in comments.
I'm afraid you might slightly misinterpret the meanings of sysfs cpufreq parameters. For instance, on my Core Duo laptop, the related_cpu parameters for both cores read 0 1 - which, according to your interpr... | Can I run multiple cores at different clock speeds? |
1,459,596,229,000 |
I'm trying to setup two network profiles in Centos. One for at home, one for at work.
The home profile has a fixed IP address, fixed gateway and DNS server addresses. The work profile depends on DHCP.
I've created a 'home' and a 'work' directory in /etc/sysconfig/networking/profiles. Each has the following files conta... |
As it follows from the RedHat's documentation on networking profiles, you should not use base interface name (eth0) for profile interfaces, but have one called as eth0_work and so on. BTW, you don't need to restart network configuration, since profile switching handles it by its own. An example:
# system-config-networ... | How to configure network profiles in Centos? |
1,459,596,229,000 |
I inserted a new pendrive. The following is the dmesg output:
[127321.248105] usb 2-2: new high speed USB device using ehci_hcd and address 9
[127321.380898] scsi11 : usb-storage 2-2:1.0
[127322.381159] scsi 11:0:0:0: Direct-Access XXXXXXXX U1170CONTROLLER 0.00 PQ: 0 ANSI: 2
[127322.384481] sd 11:0:0:... |
You have to make at least one file system on the pendrive (and a partition table, certainly). The first file system you make should be the /dev/sdb1 which is then mountable. For example:
root# mkfs.xfs /dev/sdb1 && mount /dev/sdb1 /mnt -t auto
will run.
Of course, you could add more than one file system to the pendri... | Pen Drive Not detected in Linux |
1,459,596,229,000 |
Google could not help me with this problem. I hope you guys can.
When I boot my computer, the first few screens presented to me by BIOS and boot menu are stretched to fit the LCD screen. Once Linux boots, however, the screen shrinks so one pixel of the console font uses only one pixel of the screen, causing the usable... |
Using only the nomodeset kernel option got me the results I wanted, the console now fills the entire screen.
| In linux console (no X), how to stretch console screen to fit monitor |
1,459,596,229,000 |
As far as I understand Wine runtime does better if some libraries are copied from MS Windows, but some Windows system libraries really are not to be used with Wine (some can even make it stop working, and many are simply useless).
So what files make sense and are safe to copy from MS Windows into Wine system?
I own a ... |
You should use winetricks to install the files instead, some files needs specific changes to wine registery which winetricks handle.
| What files should I copy from Windows into Wine? |
1,459,596,229,000 |
I am setting up a redhat ec2 instance and by default the software I am using (called qradar) created the following volumes on the two 500g ebs storage devices attached to the instance:
$ lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
storetmp rootrhel -wi-ao---- ... |
An extra 80 GB in EC2 EBS costs something under $12 per month. On-line manipulations are likely to take more than one hour of your work, and a risk of downtime if something goes wrong - how much is that worth for you?
Pay for some extra capacity, add it to your instance as a third disk xvdc, initialize it as a LVM PV ... | Volume Management: How to move space from one partition to another? |
1,459,596,229,000 |
In How do I extract the filesystem image from vmlinux.bin? and https://wiki.gentoo.org/wiki/Custom_Initramfs#Salvaging methods are presented for getting and unpacking an embedded initramfs/initrd included in the kernel image.
Now I would like to insert the modified file system (cpio + possibly packed using e.g. lzma) ... |
As mentioned in the answer to a similar question about replacing ELF sections discussed at reverseengineering.se simply using dd might be enough under some circumstances apart from the new archive not being larger, e.g. whether there are relocations.
| Repack the filesystem image from vmlinux.bin (embedded initramfs) without rebuilding? |
1,459,596,229,000 |
Nmap scanning network for SNMP enabled devices:
sudo nmap -sU -p 161 --script default,snmp-sysdescr 26.14.32.120/24
I'm trying figure out how make that nmap return only devices that have specific entries in snmp-sysdescr object:
snmp-sysdescr: "Target device name"
Is that possible?
|
Nmap doesn't contain much in the way of output filtering options: --open will limit output to hosts containing open ports (any open ports). -v0 will prevent any output to the screen.
Instead, the best way to accomplish this is to save the XML output of the scan (using the -oX or -oA output options), which will contain... | Nmap scan for SNMP enabled devices |
1,459,596,229,000 |
I have recently decided to install FreeBSD on my desktop but I still have several computers running GNU/Linux and I would like to share disk partitions between the two OSs, in particular:
The computer using FreeBSD will also have a GNU/Linux distribution installed and I would like to have a shared partition that can ... |
You can use ext2. Support for ext2 has existed in FreeBSD for a while and can probably be considered stable. Of course it is native in GNU/Linux as you know.
You could also use ext3 but without journal and extended attributes (use mount options in Linux /etc/fstab), which would increase some limits.
This is probably... | Filesystem to share disks between Linux and FreeBSD |
1,459,596,229,000 |
I'm trying to download a file from a linux server i'm already connected to.
I know you can use scp to connect to and pull down a file from a host, but that requires still being on local.
I could scp the file back to my local machine, but the local machine is not accessible from the host.
Is there a way to just pull d... |
Your machine hostname is not resolvable from the remote host. You should do this the other way round. From your local host:
scp xyz@remote:/home/user/test /home/user
Or the other way is to set up remote port forwarding, so you will be able to connect from your remote machine to your local host. Your command can look ... | How do I download a file from a host i'm already connected to over ssh [duplicate] |
1,459,596,229,000 |
I am trying to format an sdcard following this guide. I am able to successfully create the partition table, but attempting to format the Linux partition with mkfs yields the following output:
mke2fs 1.42.9 (4-Feb-2014)
Discarding device blocks: 4096/1900544
where it appears to hang indefinitely. I have left the p... |
I actually suspect you are being bitten by a much talked ext4 corruption bug in kernel 3 and 4. Have a look at this thread,
http://bugzilla.kernel.org/show_bug.cgi?id=89621
There have been constant reports of corruption bugs with ext4 file systems, with varying setups. Lots of people complaining in forums. The bug se... | Formatting an sdcard with mkfs hangs indefinitely |
1,459,596,229,000 |
Is there any user space tool that can retrieve and dump the list of bad blocks in a NAND flash device? I've checked the mtdinfo command line utility, and also searched /proc and /sys, but couldn't find anything.
I am looking for something suitable for use from a shell script.
I could parse dmesg as the kernel prints b... |
I have not been able to find any user space utility doing what I need. The closest I have found is the nanddump utility from mtd-utils, which can dump NAND contents, including bad blocks.
| Print list of bad blocks in NAND flash from user space |
1,459,596,229,000 |
How do I set a tiled background image in urxvt? I have tried the following alternatives in my .Xresources file:
URxvt*backgroundPixmap: /home/jgg/Pictures/tiles/escheresque_ste.png;style=tiled
URxvt.backgroundPixmap: /home/jgg/Pictures/tiles/escheresque_ste.xpm
URxvt.backgroundPixmap: /home/jgg/Pictures/tiles/escher... |
Use the -pixmap option to set the background image for RXVT. For instance, I have a set of small .png tiles that I pick at random using the following one-liner:
urxvt -pixmap "`find /path/to/tiles/ -name '*.png' | sort -R | head -n 1`;style=tiled"
You could easily turn the above into an alias or script.
| How to set a background image for urxvt? |
1,459,596,229,000 |
Is it possible to configured UFW to allow UPNP between computers in the home network?
Everything works if I turn off the firewall. I can see in syslog the firewall is blocking me. I've tried all sorts of tips out there like open 1900, 1901, 5353, these all seemed like random attempts. I know the issue is UPNP reque... |
You seem to be close to the answer. The easiest thing to do is to temporarily turn off the firewall let your media boxes run for a couple of minutes and then check the output from lsof
lsof -i :1025-9999 +c 15
The -i lists "files" corresponding to an open port, use -i4 to restrict to IPv4 only. The number list restri... | Uncomplicated Firewall (UFW) and UPNP |
1,459,596,229,000 |
This is a follow up to my crazy mdadm problem. I'm trying to figure out what might have caused sda to get out of sync in the first place. The only thing I can think of is that I had just run a bunch of updates and was rebooting to reload the kernel upgrade. Is it possible that both drives hadn't synced? would the syst... |
It certainly does on a clean shutdown:
The Debian mdadm FAQ implies the kernel does the right thing:
8. (One of) my RAID arrays is busy and cannot be stopped. What gives?
It is perfectly normal for mdadm to report the array with the root
filesystem to be busy on shutdown. The reason for this is that the root
filesy... | Will the system make sure that mdadm is sync-ed before completing a reboot? |
1,459,596,229,000 |
There are several scheduling options in Linux, which can be set to a process with the help of a chrt command line. And I can't seem to grasp one of them... Which is SCHED_BATCH. In fact, it's description contradicts itself in several sources. But before, I'll summarize the facts I managed to get about all the scheduli... |
SCHED_BATCH
From man sched(7), about SCHED_BATCH:
…this policy will cause the scheduler to always assume that the thread
is CPU-intensive. Consequently, the scheduler will apply a small
scheduling penalty with respect to wakeup behavior, so that this
thread is mildly disfavored in scheduling decisions.
Apparentl... | SCHED_BATCH description confusing - what does it actually do? |
1,459,596,229,000 |
art_file (cat -A output):
.::""-, .::""-.$
/:: \ /:: \$
|:: | _..--""""--.._ |:: |$
'\:.__ / .' '. \:.__ /$
||____|.' _..---"````'---. '.||____|$
||:. |_.' `'.||:. |$
||:.-'` .-----. ';:. |$
||/ .' ... |
The trouble is each line has a different length. The easiest solution is to give a large enough width to pr:
pr -mtw 150 art_file caption_file
If you want the caption text to get closer, I suggest
awk '
l<length && NR<=n{l=length}
NR!=FNR{
printf "%-"l"s", $0
getline line < "caption"
print line
}
' ... | What is the correct way to merge two ASCII art files side by side while preserving alignment? |
1,459,596,229,000 |
Making a Bluetooth GATT server on a Linux machine is done using BlueZ. The preferred way to use modern (5.50) BlueZ is through the dbus API.
The documentation on this topic states:
GATT local and remote services share the same high-level D-Bus API.
Local refers to GATT based service exported by a BlueZ plugin or an... |
I was also getting puzzled with this and i found that we are not able to see the dbus object as this example does not define a well-known/requested-name for this service on the dbus.
As per busctl documentation for being able to query the service, you would need to have a name associated with it. While this example G... | Locating the object path for a GATT server in BlueZ |
1,489,492,456,000 |
I was going to post this in ServerFault originally but I thought this might be a better place. Let me know if you think there is a better place to post this question.
I have an user-space application which performs networking through Java NIO's API (aka epoll on Linux) For demonstration and diagnostic purposes, I ha... |
The problem ended up being using rate-control with the default configured sockets was creating a situation where the internal TCP buffer size was automatically-adjusting to larger and larger size due to the slow read out times. (the default max size is like 6MB) When the size was automatically growing, the TCP compac... | High softirq when using rate control networking |
1,489,492,456,000 |
When I open any archive (for example zip) in midnight commander it open it and as I understand it caches its content. When you open this archive second time MC uses its cache. How to reset this cache? I ask because my archives change but I see the old content. Ctrl+R doesn't help.
|
I got the answer from developers at mailing list:
This is known issue:
https://www.midnight-commander.org/ticket/62
https://www.midnight-commander.org/ticket/2454
As workaround, menu Command -> "Active VFS list", select wanted zip VFS and press "Free VFSs now".
| Midnight Commander - rescan compressed archive |
1,489,492,456,000 |
When I scan a barcode in a text console (CTRL+ALT+F1 or not running X) I get the correct input, but when I try with an application running on X, I don't get the correct barcode.
The scanner is configured to return the barcode followed by an 'n'. Under X I only get the 'n', not the preceding barcode.
I ran xev to see ... |
Often you can reconfigure your barcode reader to output better usable output. The configuration is often done by scanning special barcodes - look at the documentation.
| barcode scanner input when running xorg and evdev |
1,489,492,456,000 |
While studying for the RHCE, I came across a situation where stdin redirection does not work in bash:
# file /tmp/users.txt
/tmp/users.txt: cannot open `/tmp/users.txt' (No such file or directory)
# semanage login -l > /tmp/users.txt
# file /tmp/users.txt
/tmp/users.txt: empty
However, this works:
# file /tmp/users... |
It is probably bug in SELinux policy with regards to semanage binary (which has its own context semanage_t) and /tmp directory, which has its own context too - tmp_t.
I was able to reproduce almost same results on my CentOS 5.6.
# file /tmp/users.txt
/tmp/users.txt: ERROR: cannot open `/tmp/users.txt' (No such fil... | Why does redirection (>) not work sometimes but appending (>>) does? |
1,489,492,456,000 |
In learning some assembly programming I have found the documents of the Linux Standard Base very useful. It seems they tell me how things are supposed to be (on standard based systems), not just how they are in the implementation I have in front of me. On the wikipedia article there are two 2005 articles linked that... |
Linux standards base is a set of APIs that are guaranteed to be available on an LSB compliant installation. This mostly requires installing some other free software libraries that most distributions already have available - such as POSIX compliant libc, C++ compiler support, Python, Perl, GTK+ and Qt.
All major Linux ... | What is the state of the Linux Standard Base? |
1,489,492,456,000 |
I need to use a custom kernel option at compile time (ACPI_REV_OVERRIDE_POSSIBLE) in order for my graphical card to work correctly with bumblebeed and nvidia drivers on my Dell XPS 15 9560. I'm using ArchLinux.
Every few days, there is a new kernel release (4.11.5, 4.11.6, ...).
How should I handle those kernel updat... |
That config line should exist in the /proc/config.gz file of any kernel you previously configured it in. You could do what I do, in a two-liner, on my Gentoo systems:
su -
cd /usr/src && cp -a linux-<new version> /dev/shm/ && ln -s /dev/shm/linux-<new version> linux && cd linux && zcat /proc/config.gz > .config && mak... | How to handle linux kernel updates when using a custom kernel? |
1,489,492,456,000 |
On a modern 64-bit x86 Linux, how is the mapping between virtual and physical pages set up, kernel side? On the user side, you can mmap in pages from the page cache, and this will map 4K pages in directly into user space - but I am interesting in how the pages are mapped in the kernel side.
Does it make use of the "w... |
On a modern 64-bit x86 Linux?
Yes. It calls kmap() or kmap_atomic(), but on x86-64 these will always use the identity mapping. x86-32 has a specific definition of it, but I think x86-64 uses a generic definition in include/linux/highmem.h.
And yes, the identity mapping uses 1GB hugepages.
LWN article which mentions ... | How is the page cache mapped in the kernel on 64-bit x86 architectures? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.