How to tell Linux Kernel > 3.0 to completely ignore a failing disk?

I am asking this question here in the hope that some Linux-kernel guru can have an answer. This question has been asked on AskUbuntu and on SuperUser without answers: thinking better, it is really Linux-kernel specific, so I think its natural place is on this forum. I have a Samsung laptop (Chronos s7) with one SATA hard disk on bus `ata:1`, which is detected as `/dev/sda`, an 8G SSD on `ata:2`, `/dev/sdb`, and various other devices on the rest of SATA interface. The problem is that the SSD disk is   * soldered to the main board (unmovable)    * busted (it just gives I/O errors for any operation)    * it does not appear in the bios (probably because it is broken) Now this disk:   * delays the boot three to five minutes trying to probe the failing disk, which is annoying;   * but the most annoying thing is that the system fails to suspend due to `/dev/sdb` failing.  Notice that I can live with the delay at boot --- what worries me is the resume/suspend thing. * * * **So the question is:** can I tell the kernel to avoid even probing the device on ata:2? In older kernel (<3.0), when I was still able to dig a bit into the source, there was a command-line parameter of the style `hdb=ignore` that would have done the trick. I have tried all the tricks proposed below with `udev` and `libata:force` kernel parameters, to no avail. Specifically, the following does not work:   1. Adding to one of the following `/etc/udev/rules.d/` a file (in early execution like `00-ignoredisk.rules` or in late as `99-ignoredisk.rules` or in both places)              SUBSYSTEMS=="scsi", DRIVERS=="sd", ATTRS{rev}=="SSD ", ATTRS{model}=="SanDisk iSSD P4 ", ENV{UDISKS_IGNORE}="1"       nor              KERNEL=="sdb", ENV{UDISKS_IGNORE}="1"      nor a lot of intermediate solutions --- this makes the disk not accessible after boot, but it is probed at boot, and still checked when suspending --- causing the suspend to fail.   2. Editing the system files `/lib/udev/rules.d/60-persistent-storage.rules` (and `udisks`, `udisks2`) changing               KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-|md", GOTO="persistent_storage_end"      to              KERNEL=="ram*|loop*|fd*|nbd*|gnbd*|dm-|md|sdb*", GOTO="persistent_storage_end"      again, this has some effect, masking the disk from userspace, but the disk is still visible to the kernel.   3. Booting with all the possible combinations (well, a lot of them) of the `libata:force` parameters (found for example here) in order to disable DMA, lower speed or whatever about the failing disk --- does not work. The parameter is used, but the disk is still probed and fails. Full `udevadm info -a -n /dev/sdb` pasted to http://paste.ubuntu.com/6186145/ `smartctl -i /dev/sdb -T permissive` gives:              root@samsung-romano:/home/romano# smartctl -i /dev/sdb -T permissive     smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.8.0-31-generic] (local build)     Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net          Vendor:               /1:0:0:0     Product:                   User Capacity:        600,332,565,813,390,450 bytes [600 PB]     Logical block size:   774843950 bytes     >> Terminate command early due to bad response to IEC mode page      which is clearly wrong. Nevertheless:              root@samsung-romano:/home/romano# fdisk -b 512 -C 970 -H 256 -S 63 /dev/sdb     fdisk: unable to read /dev/sdb: Input/output error      (SSD data from http://ubuntuforums.org/showthread.php?t=1935699&p=11739579#post11739579 ).


How to add pattern to bash completion (for unzip)?

When I type               unzip <tab>      I get a list of all files ending in `.zip`, which is the standard behavior of tab completion for the `unzip` command. However, I also want bash completion for `unzip` list files which end in `.udp`, in addition to `.zip` files. How can I achieve this behavior in my local `.bashrc`?


how to include a new file into a patch

I try to make a patch as introduced here.   Say I have two directories `pp1(modified version)` and `pp0(clean version)`, I make a patch file `pp0.patch` with the `diff` command:                diff -crB pp0 pp1 > pp0.patch      The problem is if there is a file only in pp1, it won't be included into the patch. How to work around it? **UPDATE** :   I firstly change into the directory of pp0 and test whether the patch will succeed                 patch --dry-run -p1 -i /path-to-pp0.patch      Though I've added `--new-file` to the `diff` command, those only in `pp1` are not listed in the result **UPDATE** :   I've accidentally patched the wrong file so                 diff -crb --new-file pp1 pp0 > pp0.patch      or                 diff -crNb pp1 pp0 > pp0.patch      will do


Detect if an ELF binary was built with gprof instrumentation?

Is it possible to check if given program was compiled with GNU gprof instrumentation, i.e. with '-pg' flag passed to both compiler and linker, _without_ running it to check if it would generate a `gmon.out` file?


Gentoo versus Funtoo

I've heard that Funtoo is a somewhat improved version of Gentoo, but I haven't been able to find any concrete sources for this. Funtoo's website says this: > Funtoo Linux features native UTF-8 support enabled by default, a git-based, > distributed Portage Tree and funtoo overlay, an enhanced Portage with more > compact mini-manifest tree, automated imports of new Gentoo changes every 12 > hours, GPT/GUID boot support and streamlined boot configuration, enhanced > network configuration, up-to-date stable and current Funtoo stages, all > built using Funtoo's Metro build tool. Are those features actually worth the trouble of choosing Funtoo over Gentoo? Is the difference that noticeable?


Booting Laptop with external monitor stalls

Whenever I try to boot linux with an external monitor attached to my laptop, it hangs after checking the battery state with the following message repeated several times:               ...crtc_helper_set_config...      The only solution is to boot without the monitor attached, then attach it, and readjust my settings (turning off laptop screen, etc). Some have told me this is a kernel issue, others just shrug. Any ideas for a solution?


Does mc (Midnight Commander) have favourites for directories?

If I am in remote directory on different server via ssh I want to do to directory like `/var/lib/edumate/backup` without typing the whole path. Is there any way to do that in mc?


Why would someone choose FreeBSD over Linux? What are the advantages of FreeBSD compared to Linux? (My shared hosting provider uses FreeBSD.)


How can I display file info of a man?

I know when you are in a man page it will display the file name at the bottom inside the man. How can I do the same thing manually?


Installing AMD Radeon HD 7400M series fedora 20

I just installed fedora 20 on my second pc and its running pretty hot, I found a driver on the site http://support.amd.com/en- us/download/desktop?os=Linux%20x86_64. And i unpack it and i try sh sudo sh amd-driver- installer-13.35.1005-x86.x86_64.run and I get this Supported adapter detected. Check if system has the tools required for installation. fglrx installation requires that the system have kernel headers for 3.7 release. /lib/modules/3.11.10-301.fc20.i686+PAE/build/include/generated/uapi/linux/version.h cannot be found on this system. One or more tools required for installation cannot be found on the system. Install the required tools before installing the fglrx driver. Optionally, run the installer with --force option to install without the tools. Forcing install will disable AMD hardware acceleration and may make your system unstable. Not recommended. and I dont know what to do to het this right i have already tried: yum install kernel-devel kernel-headers gcc -y http://www.amd.com/US/PRODUCTS/NOTEBOOK/GRAPHICS/7000M/7400M/Pages/radeon-7400m.aspx


Search through kernel make menuconfig configuration menu entries

When I run make menuconfig inside /usr/src/linux directory, the kernel configuration wizard appears. How can I search through the menu entries inside the make menuconfig wizard? I've tested /, but / it appears that / searches only through the .config file. I.e. when I search for "pci dma", there are no results, however there exists an appropriate kernel menu entry to enable DMA for PCI devices. I was able to find the text of the menu entries inside Kconfig files. The Kconfig files are located in many subdirectories of /usr/src/linux directory. Still, searching through Kconfig files doesn't give me the actual "tree" view of the option I want to find. The command I used to find that one out: `grep -i --directories=recurse 'kprobes' /usr/src/linux --color=always | less` How can I search through the menu entries inside the make menuconfig wizard? ![enter image description here](http://i.stack.imgur.com/r67pV.jpg) //edit: A working solution: `find /usr/src/linux/ -name 'Kconfig' -exec egrep -i -B 1 '(tristate|bool|menu)' '{}' \; | grep -i -B 1 --color=always 'Device Drivers'` This will show up, what kernel .config name contains the .config label specified. All I have to do now is to look for the config name inside make menuconfig (by using /).


Binding lsmod module name with kernel configuration menu entry

Lets suppose I have a module named "mptsas". How can I find out, what kernel configuration menu entry (make menuconfig inside /usr/src/linux) corresponds to that module? By 'corresponds' I mean what menu entry compiles the appropriate module into the kernel. ![enter image description here](http://i.stack.imgur.com/wwI2H.png) //edit: it works very nicely: ![enter image description here](http://i.stack.imgur.com/ZR17K.jpg)


only one workspace

In the process of upgrading in Linux Mint, I've gotten a strange star-studded window with a spiraling spaceship but NO workspace options.               $ uname -a     3.1.0-1-686-pae #1 SMP Sun Dec 11 20:40:16 UTC 2011 i686 GNU/Linux      and `/etc/lsb-base` yields the distribution as: `debian "Linux Mint Xfce Edition"`. In Linux desktops, I have formerly been able to request a workspace manager via a right click in the lower or upper border. Now I get no response to a right click in any location!


Is it safe to close shell just by clicking "X" or using "ctrl+d"?

Is it safe to close shell just by clicking "X" or using "ctrl+d" while logged in as root with su or is it safer to close it by typing "exit"? Is there any difference (security-wise) at all or is it the same and it does not matter which way you use?


missing pieces of certain letters in text in Linux Mint

My problem is that as I type this message, in the second word, "problem", there are horizontal slices of missing bits in both the l and the m. Following perusal of a similar question on the askUbuntu site, my problems persist. Here are the results of my following several suggestions (answers) that were given: I've tried the `gksudo nvidia-settings` and `sudo fc-cache -v -f` suggestions to no avail /etc/lsb-base yields the distribution as: debian "Linux Mint Xfce Edition" `lspci | grep VGA` produces `00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Integrated Graphics Controller (rev 04)` One suggestion suggested reinstalling an nVidia driver. Since I have an Intel VGA controller, is that suggestion pertinent? I was directed to "Administration - Hardware Drivers" but no such option is in my current "Applications" menu options. I currently have an new, odd desktop (window manager?) Another suggestion was to make an addition to xorg.conf in `/etc` or `/etc/X11`. I have no such file, only a directory: `/usr/share/X11/xorg.conf.d`


why does grep -A n give more lines than n?

I am verifying UID/GID for certain users using the dscacheutil command. Using grep with -A flag gives me what I need but the number of lines doesn't make sense. Output below:               Edit8:~ edit08$ dscacheutil -q user | grep -A 6 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     password: ********     uid: 2013     Edit8:~ edit08$ dscacheutil -q user | grep -A 4 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     Edit8:~ edit08$ dscacheutil -q user | grep -A 2 "userX"     name: userX     password: ********     uid: 2063     --     dir: /Users/userX     shell: /bin/sh     gecos: User X     Edit8:~ edit08$ dscacheutil -q user | grep -6 "userX"     uid: 2012     gid: 1010     dir: /Users/userB     shell: /bin/sh     gecos: User B          name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          name: userA     password: ********     uid: 2013     Edit8:~ edit08$ dscacheutil -q user | grep -A 2 "userX"     name: userX     password: ********     uid: 2063     --     dir: /Users/userX     shell: /bin/sh     gecos: User X     Edit8:~ edit08$ dscacheutil -q user | grep -A 3 "userX"     name: userX     password: ********     uid: 2063     gid: 1021     dir: /Users/userX     shell: /bin/sh     gecos: User X          Edit8:~ edit08$       While my logic dictates the magic number of lines would be 6, in fact it is 3. Anybody? Thanks


Understanding tc qdisc and iperf

I'm trying to limit bandwidth with `tc` and check the results with `iperf`. I started like this:               # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 35213 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-10.0 sec   830 MBytes   696 Mbits/sec      The two instances are directly connected with through Ethernet. I then set up a `htb` `qdisc` with one default class to limit bandwidth to 1mbit/sec:               # tc qdisc add dev bond0 root handle 1: htb default 12     # tc class add dev bond0 parent 1: classid 1:12 htb rate 1mbit      But I don't get what I expect:               # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 35217 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-12.8 sec   768 KBytes   491 Kbits/sec      If I double the rate, the measured bandwidth does not change. What am I missing? Why doesn't the the measured bandwidth correspond to the 1mbit from the `rate` parameter? What parameters do I need to set to limit the bandwidth to an exact given rate? However, the `man` page says that `tbf` should be the `qdisc` of choice for this task: > The Token Bucket Filter is suited for slowing traffic down to a precisely > configured rate. Scales well to large bandwidths. `tbf` requires parameters `rate`, `burst` and (`limit`| `latency`). So I tried the following without understanding how `burst` and (`limit`| `latency`) affect the available bandwidth:               # tc qdisc add dev bond0 root tbf rate 1mbit limit 10k burst 10k      This got me a measured bandwidth of 113 Kbits/sec. Playing around with those parameters didn't change that much until I noticed that adding a value for `mtu` changes things drastically:               # tc qdisc add dev bond0 root tbf rate 1mbit limit 10k burst 10k mtu 5000      resulted in a measured bandwidth of 1.00 Mbits/sec. What parameters would I need to set to limit the bandwidth to an exact given rate? Should I use the `htb` or `tbf` queueing discipline for this? **EDIT** : Based on these resources, I have made some tests:   * https://help.ubuntu.com/community/UbuntuBonding   * https://help.ubuntu.com/community/LinkAggregation   * /usr/share/doc/ifenslave-2.6/README.Debian.gz http://lartc.org/ I have tried the following setups. ## On a Physical Machine `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto br0     iface br0 inet dhcp     bridge_ports eth0      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.4 port 51804 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.9 sec  1.62 MBytes  1.14 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.4 port 51804     [  4]  0.0-13.7 sec  1.62 MBytes   993 Kbits/sec      ## On a Virtual Machine without Bonding `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet dhcp      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.7 port 34347 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.3 sec  1.62 MBytes  1.21 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.7 port 34347     [  4]  0.0-14.0 sec  1.62 MBytes   972 Kbits/sec      ## On a Virtual Machine with Bonding (tc configured on eth0) `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     allow-bond0 eth0     iface eth0 inet manual         bond-master bond0         bond-primary eth0 eth1          auto eth1     allow-bond0 eth1     iface eth1 inet manual         bond-master bond0         bond-primary eth0 eth1          auto bond0     iface bond0 inet dhcp         bond-slaves none         bond-mode 1     #    bond-arp-interval 250     #    bond-arp-ip-target 192.168.2.1     #    bond-arp-validate 3      Measurement with `iperf`:               # tc qdisc add dev eth0 root handle 1: htb default 12     # tc class add dev eth0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.9 port 49054 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-11.9 sec  1.62 MBytes  1.14 Mbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.9 port 49054     [  4]  0.0-14.0 sec  1.62 MBytes   972 Kbits/sec      ## On a Virtual Machine with Bonding (tc configured on bond0) `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto eth0     allow-bond0 eth0     iface eth0 inet manual         bond-master bond0         bond-primary eth0 eth1          auto eth1     allow-bond0 eth1     iface eth1 inet manual         bond-master bond0         bond-primary eth0 eth1          auto bond0     iface bond0 inet dhcp         bond-slaves none         bond-mode 1     #    bond-arp-interval 250     #    bond-arp-ip-target 192.168.2.1     #    bond-arp-validate 3      Measurement with `iperf`:               # tc qdisc add dev bond0 root handle 1: htb default 12     # tc class add dev bond0 parent 1: classid 1:12 htb rate 1mbit     # iperf -c 192.168.2.1     ------------------------------------------------------------     Client connecting to 192.168.2.1, TCP port 5001     TCP window size: 23.5 KByte (default)     ------------------------------------------------------------     [  3] local 192.168.2.9 port 49055 connected with 192.168.2.1 port 5001     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-13.3 sec   768 KBytes   475 Kbits/sec      Whereas the `iperf` server calculated a different bandwidth:               [  4] local 192.168.2.1 port 5001 connected with 192.168.2.9 port 49055     [  4]  0.0-14.1 sec   768 KBytes   446 Kbits/sec      The result does not change if I remove `eth1` (the passive interface) from the bond. # Conclusion _Traffic Control_ on a bond interface does not work, or at least not as expected. I will have to investigate further. As a workaround one could add the _queueing disciplines_ directly to the interfaces belonging to the bond.


Walking through files in directory randomly

How to change `for track in *.mp3; do` so that all `.mp3` files in the current directory are walked through but in a random way?


Unable to change permissions of file system root

When I write ls -la the output is :               tusharmakkar08-Satellite-C660 tusharmakkar08 # ls -la     total 88     drwxr-x---+ 10 root root  4096 Apr 18 19:43 .     drwxr-xr-x   4 root root  4096 Mar 18 17:35 ..     drwxr-xr-x   4 root root 32768 Jan  1  1970 CFB1-5DDA     drwxrwxrwx   2 root root  4096 Feb 23 00:09 FA38015738011473     drwxrwxrwx   2 root root  4096 Apr 17 14:00 Local     drwxrwxrwx   2 root root  4096 Mar 19 05:04 Local\040Disk1     drwxrwxrwx   2 root root  4096 Apr 18 19:43 Local\134x20Disk1     drwxrwxrwx   2 root root  4096 Feb 23 00:09 Local Disk     drwxrwxrwx   1 root root 24576 Apr 19 15:15 Local\x20Disk1     drwxrwxrwx   2 root root  4096 Feb 23 00:08 PENDRIVE      Now I want to change the permissions of CFB1-5DDA .. but i am unable to do so . When I write               chmod 777 CFB1-5DDA      still the permissions remain unchanged. The output of               sudo blkid -c /dev/null      is               tusharmakkar08-Satellite-C660 tusharmakkar08 # sudo blkid -c /dev/null     /dev/sda2: UUID="FA38015738011473" TYPE="ntfs"      /dev/sda3: LABEL="Local Disk" UUID="01CD72098BB21B70" TYPE="ntfs"      /dev/sda4: UUID="2ca94bc3-eb3e-41cf-ad06-293cf89791f2" TYPE="ext4"      /dev/sda5: UUID="CFB1-5DDA" TYPE="vfat"      The output of               cat /etc/fstab       is               tusharmakkar08-Satellite-C660 tusharmakkar08 # cat /etc/fstab     # /etc/fstab: static file system information.     #     #                          #Entry for /dev/sda4 :     UUID=2ca94bc3-eb3e-41cf-ad06-293cf89791f2   /   ext4    defaults    01     #Entry for /dev/sda2 :     UUID=FA38015738011473   /media/sda2 ntfs-3g defaults,locale=en_IN   0   0     #Entry for /dev/sda5 :     UUID=CFB1-5DDA  /media/tusharmakkar08/CFB1-5DDA vfat    defaults    0   0     /dev/sda3   /media/tusharmakkar08/Local\134x20Disk1 fuseblk defaults,nosuid,nodev,allow_other,blksize=4096  0   0     /dev/sda3   /media/tusharmakkar08/Local\x20Disk1    ntfs-3g defaults,nosuid,nodev,locale=en_IN  0   0          #/dev/sda3  /media/tusharmakkar08/Local\134x20Disk1 ntfs    defaults,nls=utf8,umask=0222,nosuid,nodev   0   0      And the output of               mount      is               tusharmakkar08-Satellite-C660 tusharmakkar08 # mount     /dev/sda4 on / type ext4 (rw)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)     cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)     cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)     cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)     cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)     cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)     cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)     cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)     cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)     cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event)     /dev/sda2 on /media/sda2 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)     /dev/sda5 on /media/tusharmakkar08/CFB1-5DDA type vfat (rw)     /dev/sda3 on /media/tusharmakkar08/Local\x20Disk1 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)     gvfsd-fuse on /run/user/tusharmakkar08/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=tusharmakkar08)


Why is dmesg called dmesg?

Is there any explanation/history behind the name of the command `dmesg` (which prints out some kernel messages)?


How to change title in gnome-terminal profile

I know how to load a specific terminal profile as well as loading a config file that the terminal reads, but every time I try to set the title and save the config file, it still returns to the default. I can only change the window title for that session and only with in the menus. If I try something like gnome-terminal --title="MyTerminal" this brings up a terminal, but the title is still at its default. So, how do I change the title from the command line and within a config file.


Monitor directory and if a file is requested then rsync on demand

Is there a tool that monitors a certain directory and if a program tries to access a file in that directory, the program loads that file from another place transparent for any application that tries to load that file? The background is that I have a local development enviroment for a large server application. At the moment I sync all the files created by the users on the production system from time to time via `rsync` to my local machine. But the amount of data has become too big. I can not store the several hundreds of gigabytes from the production environment on my local dev machine. So is there a way of mimicking the files from the external system and load/sync them only from the external system if they are really needed? Writing changes to these "monitored" directories should nevertheless take only place locally.


What happens to the old binary when a new one compiled from source?

I've compiled git from source after git from the repository was already installed via the package manager. In that process, the "from source" git took its place as the "main system git".               user@jeanny:~$ git --version     git version 1.8.3.2      Is there a way to set the git from the repo as the "main system git"?


Why "Linux Generic" use RPM extension in MySQL download page?

I need to install MySQL 5.5 from source in Ubuntu 10.04. So I'm trying to find tar.gz source from here. But when choosing "Linux Generic" from the drop down menu, it is showing an RPM extension I wonder why? Can we install from source using RPM package in Ubuntu now? It's like a joke but this prevents me from installing it now.


USB Dongle Not Working - Debian Wheezy, Cambridge Silicon Radio

I can't get my USB dongle to recognise my USB keyboard. I have tried both on Windows and they work suggesting it is a linux issue. The scan function simply never finds the keyboard. Also, hciconfig sometimes shows connection timeout. Any help greatly appreciated - or even if someone can recommend somewhere to buy a good cheap dongle known to work with Debian wheezy. Package versions:               media:~# dpkg -l | grep bluez     ii  bluez                                  4.99-2                                          i386         Bluetooth tools and daemons     ii  bluez-alsa:i386                        4.99-2                                          i386         Bluetooth ALSA support     ii  bluez-firmware                         1.2-3                                           all          Firmware for Bluetooth devices     ii  bluez-gstreamer                        4.99-2                                          i386         Bluetooth GStreamer support     ii  bluez-hcidump                          2.4-1                                           i386         Analyses Bluetooth HCI packets     ii  bluez-utils                            4.99-2                                          all          Transitional package     ii  libbluedevil1:i386                     1.9.2-1                                         i386         Qt wrapper for bluez      Kernel:               media:~# uname -a     Linux media 3.2.0-4-686-pae #1 SMP Debian 3.2.46-1 i686 GNU/Linux      When you try and use it:               media:~# hciconfig -a     hci0:   Type: BR/EDR  Bus: USB             BD Address: 00:1F:81:00:08:30  ACL MTU: 1021:4  SCO MTU: 180:1             UP RUNNING             RX bytes:2672 acl:0 sco:0 events:52 errors:0             TX bytes:436 acl:0 sco:0 commands:60 errors:14             Features: 0xff 0x3e 0x09 0x76 0x80 0x01 0x00 0x80             Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3             Link policy: RSWITCH HOLD SNIFF             Link mode: SLAVE ACCEPT             Name: 'Accel-OB2'             Class: 0x420104             Service Classes: Networking, Telephony             Device Class: Computer, Desktop workstation             HCI Version: 2.0 (0x3)  Revision: 0x44             LMP Version: 2.0 (0x3)  Subversion: 0x3             Manufacturer: Cambridge Silicon Radio (10)          media:~# hcitool scan     Scanning ...     media:~# hcitool scan     Scanning ...     media:~# hcitool scan     Scanning ...      (tried multiple bluetooth things to pair with) lsusb -v output:               Bus 004 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)     Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.00       bDeviceClass          224 Wireless       bDeviceSubClass         1 Radio Frequency       bDeviceProtocol         1 Bluetooth       bMaxPacketSize0        64       idVendor           0x0a12 Cambridge Silicon Radio, Ltd       idProduct          0x0001 Bluetooth Dongle (HCI mode)       bcdDevice           19.15       iManufacturer           0        iProduct                0        iSerial                 0        bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength          177         bNumInterfaces          2         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xc0           Self Powered         MaxPower                0mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           3           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            3               Transfer Type            Interrupt               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0010  1x 16 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x82  EP 2 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0040  1x 64 bytes             bInterval               0         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0020  1x 32 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       1           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0009  1x 9 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0009  1x 9 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       2           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0011  1x 17 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0011  1x 17 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       3           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0019  1x 25 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0019  1x 25 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       4           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0021  1x 33 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0021  1x 33 bytes             bInterval               1         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        1           bAlternateSetting       5           bNumEndpoints           2           bInterfaceClass       224 Wireless           bInterfaceSubClass      1 Radio Frequency           bInterfaceProtocol      1 Bluetooth           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x83  EP 3 IN             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0031  1x 49 bytes             bInterval               1           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x03  EP 3 OUT             bmAttributes            1               Transfer Type            Isochronous               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0031  1x 49 bytes             bInterval               1     Device Status:     0x0000       (Bus Powered)


urxvt map esc key to key sequence

This question is a spin-off of Rebinding "clear prompt" in mutt I use vim keybindings a lot and like using `esc` to abort commands. I've now moved to mutt but it is not possible to bind `esc` to 'abort' in Mutt (see above). Instead, I would like to map `esc` to `esc`+`Ctrl-g`. My hope is to get the `esc` key to send both key sequences. That way `esc` is a kind of universal abort key for vim and mutt. I've mapped `Ctrl-g` to 'no operation' in .vimrc with `nmap <C-g> <nop>` so there's no conflict in Vim. Preferably I would like this mapping to be set in .Xdefaults or .Xresources so that the strange `esc` to `esc`+`Ctrl-g` mapping only applies to urxvt (my terminal em) and programs run inside it. By making this apply more globally in Xinput or Xmodmap I will have to stay on the lookout for what this mapping does to other (possibly non-cli) programs. That said, any suggestions are welcome :)


Create shortcut for PHP

I have `XAMPP` installed and my PHP is: `/opt/lampp/bin/php-5.3.8` Every time I need to execute a PHP file I need to do this: `/opt/lampp/bin/php-5.3.8 testando.php` Is there another way to execute it besides using symbolic link? I did this on `/etc/init.d/`: `sudo ln -s /opt/lampp/bin/php-5.3.8 php` Why when I need to run PHP I have to do this `./php` instead of just `php`? And is there a way to do this without the `./`? Like it was installed via `apt-get`?


How can I stress test a command line tool?

I'd like to try to stress-test a PHP script I've written, which accesses the filesystem, to see how it copes with load and parallel access. I'd like to run this script `x` times in `y` different processes parallelly. Is there a tool for this?


After Logoff from any user getting black screen

Presently I'm suffering a new problem. When I log-off my Linux system from any profile it's showing a black screen (graphical view has gone). After that I'm not able to login graphically. If I switch to the console that works for me. To get the graphical view again I have to restart the system each time. Please help me to resolve this issue.


notify-send not working under ssh

Maybe this is answered somewhere else, but I didn't see it. I am running Ubuntu 14.04. When I SSH into my machine, for example:               ssh <user>@<machineip> notify-send "Hello"      I don't see anything on the monitor where I am logged into the machine. If I prefix "notify-send" with `DISPLAY=:0.0` or `DISPLAY=:0` nothing different happens. I just never see any notification on the current session. Is there some trick/switch to getting this working? In case this isn't clear, allow me to reiterate: From Computer A, I SSH into Computer B. Within the SSH session, I wish to execute notify-send to run on Computer B. I expect a growl-type notification to appear on the monitor of Computer B.


waiting for network in a bash script

I'm running a script that relies on network being up and a network share be mounted. The script runs on login (which happens automatically after boot). The problem is that by the time the script runs, I usually do not have an IP address yet (DHCP). At the moment I just sleep the script for 15s, but I don't like this approach at all, since I want to be able to tell the user if something is wrong. What my plan is, is loop while I don't have an IP address yet and continue when I do. Crucially, it has to time out after a while. What I came up with is to `if [ ifconfig | grep "192.168.100" ];` but what happens is that grepconsumes the `];` and doesn't like it. Then bash also gets upset, because it can't find the `];` which grep ate. And then I haven't even implemented the time-out. Someone suggested keeping a variable, and sleeping for, say, a second in each iteration and increase this variable each time. Here is my complete (non working) script (I'm fairly new to bash scripting):               x=0     while [ ifconfig | grep "192.168.100." > /dev/null ]; do         echo "no nework"         if "$x" -gt 200; then             #Time out here             exit 1         x=$((x+1))         sleep .1         fi     done          #continue with rest of script...      Any pointers in the right direction would be greatly appreciated!


How to set the path OSX applications use

I'm running Mountain Lion 10.8.4, and have my environment all customized through `~/.profile` so that when I run GUI apps like Sublime Text or Eclipse from the command line               open /Applications/Sublime\ Text\ 2.app      they inherit my `$PATH` settings, allowing the app to run external commands not in OSX's very limited default path. However, I'd really like to be able to open programs through Finder or the Dock and give them the same path I use on the command line. `launchctl setenv PATH $PATH` doesn't work in 10.8. How do I set this up?


Keyboard shortcut to move window to other monitor in Linux Mint

I can right click a program in the panel and have an option to move it to my other monitor. Any idea how to determine what command it is executing in the background to achieve this? _screenshot of GUI method_   ![ss of GUI method](http://i.stack.imgur.com/PC1rA.png) OS: Linux Mint 15 (cinnamon)


No room on ep ring?

I just switched to tty1, and I'm getting all kinds of output. It all looks like this:               [timestamp] xhci_hcd 0000:00:14.0: ERROR no room on ep ring      It's happening over 100 times per second, every 5 seconds or so, on every tty. Other similar questions say it's happening because of external drives, but the only drive I have mounted is /dev/sda1 (root), as well as a swap partition on /dev/sda5 EDIT: Here's `mount` as root:               sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=1008641,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=808160k,mode=755)     /dev/disk/by-uuid/eb5e28f7-395f-4556-aff4-8c8910a6295c on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=4924640k)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)     fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)     gvfs-fuse-daemon on /home/lucas/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)     gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=0,group_id=0)     truecrypt on /tmp/.truecrypt_aux_mnt1 type fuse.truecrypt (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)     /dev/mapper/truecrypt1 on /media/truecrypt1 type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)      (Note that this issue started before the truecrypt volume was mounted) My `dmseg` has been completely bloated out, nothing but this message. After rebooting, my dmesg is back to normal. It's _way_ too long to post here, so here's a pastebin link: dmesg


Why are there so few "running" processes?

On all of BSD/Linux/MacOS and Solaris, I made an observation - no matter how busy the system is, `top` always reports very few (usually 1-2) running processes. According to my limited understanding, a process is in "running" state if it is using CPU time, or waiting for CPU time to become available. So, here is a scenario: I use SSH to tunnel VNC, then run `top` on remote machine, in a Terminal emulator:   * `top` itself is listed as a "running" process (understandable)   * `sshd` is listed, but not "running"   * `Xvnc` is listed, but not "running" But `sshd` is tunneling VNC traffic, `Xvnc` is what keeps me updated with screen content, how can they not be using CPU time? If they are using CPU time, then how come they are not "running"?


Awesome floats some programs by default

I have Kubuntu with KDE and replaced KWin with Awesome WM. It works well, except that it floats Konsole and Dolphin consistently. While using KWin, I set up some KWin rules to fix the windows size, but I have deleted those rules in the KDE system settings by now, the issue persists. How can I have Dolphin and Konsole tiled by default?               awesome v3.4.15 (Never Gonna Give You Up)      • Build: Apr 28 2013 18:48:19 for x86_64 by gcc version 4.8.0 (buildd@batsu)      • D-Bus support: ✔      My rc.lua.


What is wrong with this code?

I have a script that goes like this:               while :     do        Start_Time=$(date +"%s")                MAIN PROGRAM GOES HERE (CROPPED TO SHORTEN THINGS)             Run_Time=$(( $(date +"%s") - $Start_Time ))             if [[ $Run_Time < $Wait_Time ]]        then           Delay_Time=$(( $Wait_Time - $Run_Time ))           sleep $Delay_Time        else           echo "Delay exceeded"            echo $Run_Time           echo $Wait_Time        fi     done      And my problem is that sometimes even if the run time is smaller than the wait time it fails the < test Here is an output from the last run:               Delay exceeded     Run_Time 4     Wait_Time 30


How to handle internet disconnection while upgrading Ubuntu?

I am about to upgrade Ubuntu 13.04 to Ubuntu 13.10. Internet speed is slow and so it would take many hours for the same. So, is there any tool or way to handle or take care of this. Suppose my Internet disconnects while upgrading, how to take care of that? Can it be resumed later at whatever point the Internet disconnects?


Move and empty /home partition of Ubuntu

My partitions are:   * Ubuntu's `/` on `/dev/sda1`   * Ubuntu's `/home` on `/dev/sda6/`   * Crunchbang's `/` on `dev/sda7` Now I want to install Backtrack, but for this I need to get rid of Ubuntu's `/home` and move its content somewhere else (whichever of the other partitions). How should I go about and do that without messing up the partitions table and the boot loader? ![Partitions table](http://i.stack.imgur.com/Z2B7C.png)


Graphical Interfaces cutomization and theming

I'm currently using Linux Mint 15, Cinnamon 1.8. I really like it except for the customization and theming part. In Widows 7, themes also affect the windows of programs or you can set colors. Is this not possible in Linux? In my Linux Mint I installed a black/dark theme. It affects the task bar, main menu and system tray panel but not the windows of the applications. It really looks ugly because the windows are still the default gray color while the task bar and main menu is black/dark. Is this the same for all graphical interface in Linux? or is this just cinnamon?


Secure Remote Backups Using Duplicity

The recent take-down of codespaces got me thinking about off-site backup processes (which I currently perform manually with password entry). I have been reading tutorials showing how to automate backups through duplicity. These tend to revolve around using an SSH key to automate the authentication process to the backup server. However, this seems full of holes to me. If the server being backed up is compromised to the point where the malicious user has gained access then they could automatically login to the backup server and remove the backups. Assuming that the admin used `/usr/bin/nologin` in the `/etc/passwd` file for the backup user (I have no idea how much this can be relied upon or if it would prevent duplicity from working remotely anyway), then the malicious user could still get duplicity to wipe the backups by using the `duplicity remove- older-than [time now]` command. Is the only safe solution to send the files to the backup server using rsync over ssh and have a "master user" on the backup server perform local iterative backups of all the user accounts to its own storage area (e.g. only it has permissions to its own files, but it has permission to read all the other accounts files)? Or is there a way to prevent duplicity from removing backups and prevent remote login?


php5-curl installation aborts due to ucf failing on /etc/php5/mods-available/curl.ini

I've screwed my raspbian (debian) installation. To fix this I'm going through reinstalling every single packacke. This is tiresome (or rather: slow) but works in general. Where I'm absolutely stuck is reinstalling the php packages I need most:               apt-get install php5-curl          Setting up php5-curl (5.4.4-14+deb7u10) ...     dpkg: error processing php5-curl (--configure):      subprocess installed post-installation script returned error exit status 10      As other php5 modules are failing as well I'm reluctant to just remove the post install scripts- I'd need to remove a couple of them to get php installing. To see whats wrong with the post install I've run it manually:               pi@prodpi ~ $ sudo sh -x /var/lib/dpkg/info/php5-curl.postinst configure && echo &?     pi@prodpi ~ $ + set -e     + inidir=/etc/php5/mods-available     + [ configure = configure ]     + inifile=curl.ini     + sed -ne s/^; priority=\([0-9]\+\)$/\1/p /usr/share/php5/curl/curl.ini     + priority=20     + ucf /usr/share/php5/curl/curl.ini /etc/php5/mods-available/curl.ini          [2]+ Exit 10        Only running the last command gives:               pi@prodpi ~ $ sudo ucf -v /usr/share/php5/curl/curl.ini /etc/php5/mods-available/curl.ini     ucf: The new file is /usr/share/php5/curl/curl.ini     ucf: The Destination file is /etc/php5/mods-available/curl.ini     ucf: The Source directory is /usr/share/php5/curl     ucf: The State directory is /var/lib/ucf     The hash file exists     egrep [[:space:]]\/etc\/php5\/mods\-available\/curl\.ini$ /var/lib/ucf/hashfile     ucf: The new file is /usr/share/php5/curl/curl.ini     ucf: The Destination file is /etc/php5/mods-available/curl.ini     ucf: The Source directory is /usr/share/php5/curl     ucf: The State directory is /var/lib/ucf     The hash file exists      It does however exit with code 20, not 10- so I'm not sure I'm really looking in the right place. Running with `-d9` shows:               root@prodpi:/home/pi# ucf -v -d9 /usr/share/php5/curl/curl.ini /etc/php5/mods-available/curl.ini     ucf: The Debug value is 9     ucf: The new file is /usr/share/php5/curl/curl.ini     ucf: The Destination file is /etc/php5/mods-available/curl.ini     ucf: The Source directory is /usr/share/php5/curl     ucf: The State directory is /var/lib/ucf     The hash file exists     egrep [[:space:]]\/etc\/php5\/mods\-available\/curl\.ini$ /var/lib/ucf/hashfile     The new start file is      `/usr/share/php5/curl/curl.ini\'     The destination is         `/etc/php5/mods-available/curl.ini\' (`\/etc\/php5\/mods\-available\/curl\.ini\')     The history is kept under  \'/usr/share/php5/curl\'     The file may be cached at \'/var/lib/ucf/cache/:etc:php5:mods-available:curl.ini\'     The destination file does not exist.     The old md5sum does not exist.     The new file exists, and has md5sum:     4e260877185bdf259be69a8165c00ab2  /usr/share/php5/curl/curl.ini     Historical md5sums are not available     ucf: The Debug value is 9     ucf: The new file is /usr/share/php5/curl/curl.ini     ucf: The Destination file is /etc/php5/mods-available/curl.ini     ucf: The Source directory is /usr/share/php5/curl     ucf: The State directory is /var/lib/ucf     The hash file exists     root@prodpi:/home/pi# $?     bash: 20: command not found      What can I do to find/cure the source of the post installation issues?


How to detect if input is from argument, file or terminal

In bash, is there a way to know if a given script has been invoked with:               $ myscript.sh myfile      or:               $ myscript.sh < myfile      Inside some scripts I always have accessed the contents of `myfile` with `$1`, but now I'd like to change the behavior as different cases. EDIT: I also would like a third case when invoked without any redirection:               $ myscript.sh


Turn NumLock on on startup?

I usually edit in **Vim** ,and when pressing `+`, I'd rather move my hand to the right part of the keyboard where `+` resides rather than doing `shift` \+ `=`. But when `NumLock` is not on, in Vim it just opens a new line above and inserts the letter **_k_**. And every time I start my PC `NumLock` is off. I would like to know if there is any `xmodmap` trick to turn on `NumLock`,so I could add it to my `.xinitrc`.And it would be even better if I could add it to my `.map` file which swaps `Escape` and `CapsLock` which I load with `loadkeys` in my `/etc/rc.local` on startup. I am using **_Arch Linux_**.


Does this dispatcher produce zombie process?

I have such a dispatcher shell script.               while read line     do         java TestProg $line &     done < $tasklist      On the zombie process Wikipedia page, it says > if a parent fails to call wait, the zombie will be left in the process > table, causing a resource leak in the script above I didn't use the `wait` function (I wrote many dispatcher shell script this way). I'm wondering if I need use `wait` like this so that I can prevent from zombie processes:               while read line     do         java TestProg $line &     done < $tasklist     wait


how to export all numbers that are unique in few text files into another file?

I have `a.txt`,`b.txt`,`c.txt`. Each has different numbers as below: **a.txt:**               12     14     111     1     15     2      **b.txt**               12     18     22     23     1     2      **c.txt**               12     14     15     16     17     1200      The output should contains all the numbers from all files, but without any duplication. Is there a command to export such a thing into txt file? The actual txt files includes hundreds of rows.


Something like a symbolically linked file, but with change details attached?

Is there a file type or method for using files in which certain files look and behave like symbolically linked files, but contain extra meta information for changing the data when they are read? **For example:**   If I have a file called `hello-world.txt`, and I build a symbolically linked file pointing to it,               ln -s /path/to/hello-world.txt /path/to/symlink      I can not change the contents of the `symlink` without changing `hello- world.txt`, as well as changing all of the other files that point to `hello- world.txt`. I realize that symbolically/hard linked files are suppose to remain the same(because they are the same file in a sense), but it would be great, if I could write a file that references a particular file, and then also provides change details that get applied every time the file is read. I tried to create my own file type using plain text that looked like this:               /path/to/file/being/referenced     change statement     change statement     ...      I would then give these files their own file extension and mime type, and create an intermediate program to redirect to the referenced file, and basically try to mimic the behavior of a symbolic link. The problem is, the file doesn't "really" reference another file, and so actually reading the file(by using the cat command, or having a c++ processor pull in the file, etc), will not get the same information back that a symbolically linked file would. I'm not sure if I can provide a hook for this kind of thing, and have a program output the correct text for whatever is reading it. Maybe something with piped files? I dunno. What would be the best way to achieve this kind of behavior on the file system? Perhaps an analogy that best describes the kind of dynamic capabilities I want files to have, is how php files work on the web. The same file can be referenced using additional parameters, and that changes the contents of a file read by the user.


Automounting with udev takes too much time

Specifically, using udev to automount usb memory sticks takes about 3-4 seconds according to its own logs. It may not sound like that much, but it is on an embedded distribution for a system that previously used a much lighter OS where they where ready to use at less than 1 second. I do not have to make it that fast, but it is currently slow enough to annoy the users of the system. In short, what options do I have when it comes to speeding it up?


is my linux ARM 32 or 64 bit?

under an intel I know I can look at the outcome of `uname -m` to know if my OS is 32 or 64 bit, but under ARM this gives:               armv7l      I deduced from               file /usr/bin/ls      that I'm on a 32-bit OS, but how can I know this in an easier way?


Local DNS rewrite from host to host for web requests

Is there some de-facto way for rewriting certain hostnames to other ones? Something like `/etc/hosts` for host to host instead of ip to host. Is this possible or should I create a local dns cname for that host? **Update regarding the comments** I want to use the local name that resolves to remote domain. The browser is just an example. I'm actually writing an ios app that requests resources from the internet, but I'd like to use local name for simulator-only runs. So to put it in another way I want my app to request http://localalias/, but that system would actually fetch http://remotehost.com/.


Find connections per ip on an OpenWRT router?

How can I list the number of connections per client on the `FORWARD` chain of an OpenWRT router? I know how to list the number of connections per IP address on the router:               netstat -ntu | tail -n +3 |       # list open TCP and UDP connections     awk '{print $5}' | cut -d: -f1 |  # extract client IP addresses     sort | uniq -c | sort -nr         # show number of occurrences and sort by it      I want to do the same with connections that are going through the router's `FORWARD` chain.


Limit the max connections per IP using OpenWRT?

Would the following `iptables` command on an OpenWRT router assure that no one client has more than 50 active connections?               $ iptables -I FORWARD -m connlimit --connlimit-above 50 -j REJECT --reject-with tcp-reset     iptables v1.4.6: Couldn't load match `connlimit':File not found      If so, what package do I need to install to be able to use `--connlimit`?


Installing developer libraries for Fedora 19 without internet connection

I am trying to use Fedora 19 on my Lenovo yoga 13. A common issue with this setup is that the laptop's wifi does not work out of the box on any linux distribution yet. This question and also this question is very similar to mine, in which the askers found working wlan drivers but had trouble installing them. However, in my scenario to `make & make install` the driver, I apparently need the following packages:               kernel-headers kernel-devel gcc patch      Because I don't have working wireless or an ethernet port, I effectively can not use `yum` to install these from the internet. I have attempted downloading the rpm packages myself on another machine, transferring them via a flash drive, and using `rpm -Uhv` to install each one, but they appear to need endless dependencies that I do not have from installing Fedora 19 via a live USB. I gave up after a few hours of trying to navigate these lists of dependencies. Is there a better way of installing required development packages in order to install a driver when I have no internet connection?


Run nvm (bash function) via sudo

I want to write a init script that should basically run               nvm use v0.11.12 && forever start /srv/index.js      as the user `webconfig`. `nvm` is a shell function that is declared in `~webconfig/.nvm/nvm.sh`, which is included via `source ~/.nvm/nvm.sh` in `webconfig`'s `.bashrc`. I tried the following:               sudo -H -i -u webconfig nvm          echo "nvm" | sudo -H -i -u webconfig      but they fail with > -bash: nvm: command not found   >  -bash: line 1: nvm: command not found When I run `sudo -H -i -u webconfig` and enter `nvm` manually in that shell, it works. What am I doing wrong?


Script from cron doesn't create archive

I'm using:               # cat /etc/redhat-release     CentOS release 6.4 (Final)      Have an script in user's crontab:               $ crontab -l     0 7 * * * /home/teamcity/scripts/TC_backup.sh      If I run this script under this very user - it's create needed archive:               $ /home/teamcity/scripts/TC_backup.sh     ...      And from local-scripts-log:               $ cat /var/log/teamcity_backup.log | tail -n 20     Exporting TeamCity data directory: Exporting build logs     Exporting TeamCity data directory: Exporting personal changes     Finalizing export...     Export has completed successfully.     Backup file created: /home/teamcity/backups/TeamCity_20140117_172034.zip     Backup finished     Done.                  Free disc space: 147G;        Used disc space: 125M.                  Last archives available:          55M Jan 17 17:21 TeamCity_20140117_172034.zip     55M Jan 17 17:14 TeamCity_20140117_171318.zip     16M Dec 17 18:43 TeamCity_20131217_184333.zip             Backup finished at 2014-01-17--17-21      And have files:               $ ls -l /home/teamcity/backups/     total 127656     -rw-rw-r-- 1 teamcity teamcity 16777213 Dec 17 18:43 TeamCity_20131217_184333.zip     -rw-rw-r-- 1 teamcity teamcity 56914703 Jan 17 17:14 TeamCity_20140117_171318.zip     -rw-rw-r-- 1 teamcity teamcity 57022673 Jan 17 17:21 TeamCity_20140117_172034.zip      But - I haven't any `*.zip` from other days. In cron-log I see that script started without errors:               Jan 12 07:00:01 lms-teamcity CROND[11878]: (teamcity) CMD (/home/teamcity/scripts/TC_backup.sh)      Contents of the script:               BDIR="/home/teamcity/backups/"     LOGFILE="/var/log/teamcity_backup.log"     ARHNAME="TeamCity"     backup () {         /home/teamcity/TeamCity/bin/maintainDB.sh backup --all -M -F $BDIR/$ARHNAME >> $LOGFILE     }     backup      What can be the cause? UPD: 2> errorlog.file doesn't give result:               $ crontab -l     0 7 * * * /home/teamcity/scripts/TC_backup.sh 2> /var/log/teamcity_backup_error.log          $ file /var/log/teamcity_backup_error.log     /var/log/teamcity_backup_error.log: empty      In cron-log also no any errors:               ...     Jan 20 09:00:01 lms-teamcity CROND[24816]: (setevoy) CMD (/home/setevoy/scripts    /db_con_test-4.sh)     Jan 20 09:00:01 lms-teamcity CROND[24818]: (teamcity) CMD (/home/teamcity/scripts/TC_backup.sh 2> /var/log/teamcity_backup_error.log)     Jan 20 09:00:01 lms-teamcity CROND[24817]: (root) CMD (/usr/lib64/sa/sa1 1 1)     ...


Is there an easy way to programmatically extract IP address?

Is there an easy way to programmatically extract IP address, without tedious parsing of `ifconfig`? I would not mind simple command output processing using `sed` to do it but not processing multiline files from `/etc` some place. What I am trying to do is modify my `.bashrc` to display the IP address of the host in the greeting message. I am using `Ubuntu 12.04` but decided to post here instead of the Ubuntu forum because I consider this to be not distro-specific.


Clearing the "old" scrollback buffer

This might seem to be a duplicate question but it isn't. I know that I can use `printf "\033f"` to clear the scrollback buffer of the "current" session but that doesn't work for old sessions. My problem is I access several VM's through XVP viewer (a java web browser based VNC) and if I don't make a effort to clear the screen before logging out every time everything can be viewed by scrolling the screen. Please suggest a way to clear this old scrollback buffer. PS: Rebooting clears it but I can't do that on production VMs


How do I filter a glob in zsh

Basically I can use a glob in zsh to a list. Often, it turns out, I would like to filter that list, grep'ishly I'm wondering though, if I need to do that. Does zsh have a method to filter a list? I fear this is an obvious question, but it's a low yield day today, mentally.


Linux mint 12: change default editor and terminal

I have the sublime text editor located in `usr/bin`. How can I make it the default editor so I can do `sublime /var/www/test.php`? And can I change the default terminal to `yakuake`?


Screen caption custom colors

I am having trouble customizing the color of my caption in screen. I can use the 8 standard colors supported (as well as their brighter versions), but I am unable to define a custom color. The docs for screen state: "Colors are coded either as a hexadecimal number or two letters". It does not seem to define anywhere what format to write the hex number in. I have tried several random ways but so far none seem to work. Does anyone know how to use a custom color in screen?


qt related catastrophic crash in OpenSCAD

When using OpenSCAD, if I try to "Save As" or "Open" then OpenSCAD vanishes along with my work without giving so much as even an explanation (wow I miss those Windows error dialogs sometimes!) I launched OpenSCAD from the console to see if it would give me any useful messages and I get the following:               OpenGL Program Link OK:     Vertex shader(s) linked, fragment shader(s) linked.     OpenGL Program Validation results:     Validation successful.     Cannot mix incompatible Qt library (version 0x40805) with this library (version 0x40804)     Aborted (core dumped)      I'm running under KDE/Arch Linux, and suspect this is some Qt issue hence posting here rather than the OpenSCAD forums. * * * `kwin --version` gives:               QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.     Qt: 4.8.5     KDE Development Platform: 4.11.3     KWin: 4.11.3      * * * None of the `qt*` commands respond to `--version`, but I have the following info: `pacman -Qi qt3`: 1:3.3.8b-7 `pacman -Qi qt4`: 1:4.8.5-6 `pacman -Qi qt5-base`: 5.1.1-5 * * * I'm guessing that some qtN package is a slightly different version to the rest of my qtN installation and that is why OpenSCAD is suffering from SIDS - so I have `yaourt` re-installing qt3, qt4, qt5 all from source while I type this. Is the update/reinstall likely to work? Are there any better solutions? Also, is the `session D-Bus connection` issue something that I should worry about?


Nameservers setup in CentOS 6

I have a domain registered externally from where I have my VPS, but I need to connect these two in order to have the domain forward to my host. I know that I have to take my host's nameservers and replace them at my Domain Registrar's website. The question is: Where do I get my nameservers?... I've read about `/etc/resolv.conf` and I actually added my nameservers there like this:               ns1.mywebsite.org 8.8.8.8     ns2.mywebsite.org 8.8.4.4      The IPs are actually like that, I didn't know with what to replace them. So how do I set up my nameservers correctly and have the domain point to my host? **P.S: I'm using Webmin to manage my VPS.**


How can I make VIM a full fledged IDE

How could I make VIM a full fledged IDE by using different supported plugins for YUI, JQuery and git integration etc.


How to soft kill gui applications via terminal?

Is there a way to close a GUI application in friendly " _please quit yourself now_ " way, without graphical access to the applications window? For example, if Gnome/X display crashes to black, I'd like to switch to tty2 and close applications like firefox in a way which lets them save their config etc. At best without further user queries.


Cifs mount a windows share that goes offline

I have a windows share on my workstation that I need on my CentOS 7 server. I have this set up in my fstab as the following: `//XXX.XXX.X.XX/Share /mnt/workstation cifs username=X,password=X 0 0` This is working as long as my workstation is online. Once my workstation is offline it'll give errors on the /mnt/ directory and WinSCP will not connect. I have to umount the share and remount it for it to work again. Is there a better way to do this instead of remounting the drive every time?


List available updates but do not install them

I want my cron-run reporting script to notify me in case there are updates for my packages. Is the a way to make `apt-get` give me the list of available updates but don't do anything more?


Choose other timezone when install Debian?

![screenshot](http://i.stack.imgur.com/b3myZ.png) Why can't I select English and choose timezone outside US?


md5sum command binary and text mode

The GNU `md5sum` command has two modes: _binary_ mode and _text_ mode. I guess the difference is only on how newline characters are handled? Am I right? On GNU/Linux, the two modes always produce same result, so the only use of `-b` and `-t` options is to indicate the flag (`*` or ``) used before the file name? In what circumstances can the modes produce different results? On Windows/MacOS systems? (Versions for these platforms available?)


Fedora 12 No wireless networks detected

I have just bought a Dell Inspiron 1510 and loaded Fedora 12 along with Windows. I cannot detect any wireless networks through my network applet on the tool bar.               $:lscpi     12:00.0 Network controller: Broadcom Corporation Device 4727 (rev 01)     13:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02) I installed the following rpms:               kmod-wl-2.6.31.5-127.fc12.i686.PAE-5.10.91.9.3-3.fc12.6.i686     kmod-wl-PAE-5.10.91.9.3-3.fc12.6.i686     broadcom-wl-5.10.91.9.3-1.fc12.noarch and restarted the system but it still doesn't work.


Escape sequences with "echo -e" in different shells

I just noticed that it seems like the flag `-e` does not exist for the `echo` command in my shell on Linux. Is this just a messed up setting or is it "normal"? Some code as an example:               #!/bin/sh     echo -e "\e[3;12r\e[3H"      Prints:               -e \e[3;12r\e[3H      This worked before! I guess some `stty` commands went terribly wrong and now it does not work anymore. Somebody suggested that my `sh` was actually just `bash`.


Mount MTP device in FreeBSD

I have an Android tablet which uses MTP instead of USB Mass Storage for transferring files. I'd like to mount it in a FreeBSD machine. I tried the method described here.   1. I installed mtpfs by going to `/usr/ports/sysutils/mtpfs` and running `make install clean` as I usually do to install ports.   2. I enabled FUSE support by adding `fusefs_enable="YES"` in `/etc/rc.conf`.   3. I also added `fuse_load="YES"` to `/boot/loader.conf`. (This is not in the original procedure, I was trying to get it to work)   4. Added `vfs.usermount=1` to `/etc/sysctl.conf`.   5. After that, I rebooted the machine. I tried to mount the tablet by running `mtpfs /mnt/`. As a non privileged user I receive a 'Permission denied' message. As root it apparently works. But cd'ing into the directoy I receive a 'Not a directory' message, which is the same problem described in the linked thread. I'm assuming there is something left out of the original instructions. If there's any alternative to mtpfs, I'm also interested in hearing about that.


How do I reset a USB device using a script?

I have a USB GSM modem that does not always work property (Huawei E367u-2) Sometimes it gets reset (USB device disconnect/reconnect in logs) and when it comes back up, it has different ttyUSB numbers. Sometimes on boot, usb_modeswitch seems to just not get fired. The computer is a Raspberry Pi running Raspbian. I have a simple solution to this, every minute `cron` runs the following script:               If WVDIAL is not running:         Run WVDIAL      I want to change the script to be this:               If /dev/ttyUSB0 is not present:         If DevicePresent(12d1:1446):             ResetDevice(12d1:1446)         ElseIf DevicePresent(12d1:1506)             ResetUSB(12d1:1506)     If WVDIAL is not running:         Run WVDIAL      Obviously this is pseudo-code, but I have the following lines that I need to string together but I can't figure out how: This loads wvdial if it is not running:               #! /bin/sh      # /etc/init.d/wvdial          ### BEGIN INIT INFO     # Provides:          TheInternet     # Required-Start:    $remote_fs $syslog     # Required-Stop:     $remote_fs $syslog     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Simple script to start a program at boot     # Description:       A simple script from www.stuffaboutcode.com which will start / stop a program a boot / shutdown.     ### END INIT INFO          # If you want a command to always run, put it here          # Carry out specific functions when asked to by the system     case "$1" in       start)         echo "Starting GPRS Internet"         # run application you want to start         /sbin/start-stop-daemon --start --background --quiet --exec /usr/bin/wvdial internet         ;;       stop)         echo "Stopping GPRS Internet"         # kill application you want to stop         /sbin/start-stop-daemon --stop --exec /usr/bin/wvdial          ;;       *)         echo "Usage: /etc/init.d/noip {start|stop}"         exit 1         ;;     esac          exit 0      This lets me find the `/sys` path to a certain device:               for X in /sys/bus/usb/devices/*; do         echo "$X"         cat "$X/idVendor" 2>/dev/null         cat "$X/idProduct" 2>/dev/null         echo     done      And this resets a USB device if you know the correct /sys path:               echo 0 > /sys/bus/usb/devices/1-1.2.1.1/authorized     echo 1 > /sys/bus/usb/devices/1-1.2.1.1/authorized      So, I need to string the last 2 sections and a test to `/dev/ttyUSB0` into a section that goes under the "If you want a command to always run. put it here" section   * How can I do that?   * Is there a better way to do this?


Shell spawned backgrounded process is still hanging

It seems processes spawned after `||` make the parent shell hang with them. For example, do in your terminal               $ cat <<"EOF" >/tmp/hello_im_still_here     #!/usr/bin/env bash     killall emacsclient     pgrep emacsclient || emacsclient -c &     EOF     $ chmod +x /tmp/hello_im_still_here     $ ./tmp/hello_im_still_here      and check it               $ pstree | grep emacsc          |-hello_im_still_---emacsclient      Changing the line forking the process to               pgrep emacsclient || (nohup emacsclient -c) &      doesn’t help.


Kernel module blacklist not working

I'm trying to figure out how to blacklist modules, and I'm trying it on the usb storage. Unfortunatelly it seems ot have no effect, and I get the module in even if it's not used (apparently). My experiment is taking place on an Ubuntu 12.04.3 LTS.               raptor@raptor-VirtualBox:/etc/modprobe.d$ lsmod | grep usb     usb_storage            39720  0      usbhid                 46054  0      hid                    82511  2 hid_generic,usbhid     raptor@raptor-VirtualBox:/etc/modprobe.d$ cat blacklist.conf | grep usb     blacklist usb_storage     blacklist usbmouse     blacklist usbkbd


Decoding "prog > file 2>&1"

I am having some difficulty understanding the construct `prog > file 2>&1`. I have read that it means "Send _stdout_ and _stderr_ to file". But my question is how? I understand that `prog > file` basically sends _stdout_ to file. I also understand that `prog 2>&1` means that the _stderr_ should be sent to _stdout_. But I am not able to connect the dots for `prog > file 2>&1`. Can experts here help me decode this.


How to install RPM package on Angstrom

I'm using an embedded system with the Angstrom distribution on it. Now i'd like to configure a GPRS-Modem for it. So I downloaded the linux-driver from the homepage of the manufacterer to install it on my embedded system. But the package is a RPM-File, and the readme-file gives me the command:               rpm -ivv <packagename>          But there is no "rpm" command on my embedded-system (only opkg), and this isn't working for a rpm package. Help would be greatly appreciated.


What does the command "chattr +c /some/dir/" do?

I'm trying to keep a bunch of plain text files compressed using the extended attribute option - `c` on a debian ppc64 system. I ran the following commands:               # mkfs.ext4 /dev/test/compressed     # mount /dev/test/compressed /mnt/compressed/     # mkdir /mnt/compressed/some/txts/     # chattr +c /mnt/compressed/some/txts/     # df -l          # cp /some/txts/* /mnt/compressed/some/txts/     # sync     # df -l      To my surprise, the output of `df -l` tells me the files I copied weren't compressed at all. I also tried to mount the test file system with the option `user_xattr` and I tried creating it with `mkfs.ext4dev`, but neither worked. I also checked the output of the commands `lsattr /mnt/compressed/some/txts/`; every line has a `c` in it. Did I miss something? How come the xattr option `c` doesn't work as expected?


How can I use SED or AWK to replace placeholders in a template file with variable content that contains special characters?

CentOS 6.3 I'm trying to get a small script to send an email containing a copy of email headers in the body (for the purpose of internal reporting). The template file contains the following:               Alert Report          Alert has triggered at TMPDATE          HEADERS     -------     TMPHEADERS          SOURCE IP     ---------     TMPSOURCEIP      I want my script to find and replace the "TMP" place holders with actual information relevant to the alert. The date and source IP variables seem to work fine but if/when I try to find/replace the TMPHEADERS, it causes strange symptoms including the entire output to be blank. I'm reasonably certain that it has to do with the headers containing lots of special characters (@ % & etc). Can someone please advise on how best to accomplish this via bash? My current code looks like this:               cat /test/emailtemplate | sed s/TMPHEADERS/"$HEADERS"/ > /test/output      ## UPDATE As per request, here's an example set of headers I'm trying to insert into the template file (IP addresses and email address have been changed to protect the innocent :-) ):               From foo@yahoo.com Thu Apr 25 20:18:19 2013     Return-Path: <foo@yahoo.com>     Received: from nm30-vm0.bullet.mail.ne1.yahoo.com (nm30-vm0.bullet.mail.ne1.yahoo.com [98.138.11.36])     by serv.example.com (8.14.4/8.14.4) with ESMTP id r3Q3IJVV009411     for <test@example.com>; Thu, 25 Apr 2013 20:18:19 -0700     Received: from [108.108.108.108] by nm30.bullet.mail.ne1.yahoo.com with NNFMP; 26 Apr 2013 03:18:19 -0000     Received: from [98.138.87.11] by tm15.bullet.mail.ne1.yahoo.com with NNFMP; 26 Apr 2013 03:18:17 -0000     Received: from [127.0.0.1] by omp1001.mail.ne1.yahoo.com with NNFMP; 26 Apr 2013 03:18:17 -0000     X-Yahoo-Newman-Property: ymail-3     X-Yahoo-Newman-Id: 92334348.43667.bm@omp10122422401.mail.ne1.yahoo.com     Received: (qmail 29701 invoked by uid 65501); 26 Apr 2013 03:18:17 -0000     DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1366946297; bh=yjMzVONHAyJxQob7tLNdIN2RpfGHWVw1Kb5Qr+enYF8=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=CQGilBx8NertE4j75dsfsdfs+IKRzIx5vlH5YdzqFLd4ThfEyMs11sdfsdfsdXsAH1yteACnwSER+QXJQ80BfLGbJnIWm+29I8A4geOPIHGKoOUCnPaD+/0bHfAps0JIcwEju8Tcvg4VDVWw=     DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws;     s=s1024; d=yahoo.com;     h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type;     b=5TIRL55VM2J2lPLsX9iCE4sdlkfjlEM2245M6qzg1oGrnZd61ykL4xQSsc3cYNz95fwNy67aRRC89n6xcti28ee5rjmlK0MDIskSB5sKlv165mNjmzF1LNx6uFXalI8QGSwiQt2uWLYvI7RrTVeZFELDfFVZyqygEl5k=;     X-YMail-OSG: EDT4ym4VM1lVQMdtAQ5zqfE59jR1Mtip4vVL1fBzNxFdGvA     YjAJ3MXC1EusloknrsPx3drxzR1b4PFErK.UhdgWePhK7TTCHhhju4XP4i7x     76WASceqp77T5itvZmilv5UuICJw3BCEd0fdADctfBYhLNwoALxjp6cnJMmE     Z4dYVtlp5vUFqg1pHxqGOXqrtjeZffM4dMftnn.Q8LlVEkj3pZ6ZJV_kKFtj     vGEGS5PAW0tIHWPEqVERYzmDOfF5sVSQLayPi6EM_i1OE038434laijEWbH0     nZt1Vkg3syO0t1BaTLN4B1bXeS8cv3GlbLO4ot7zVwA3sH4UhsC5M6xiWNFU     3iroObJ5BObL99VO3ktvC4KzekAWJ_fE85TQJhQKj6Iolgb4xlWa2x414xuA     awO4pJI9grDjycUcmhmKwLZEt_.0OBLfSi5MSviaiCNMuU5qIdHm7VCGdORP     Mc68rDkpmJE9I9Z.QZfhH5cFxqqmpyIOMTs0iIBGYz5d9QHMWCuo-     Received: from [102.102.102.102] by web12341105.mail.ne1.yahoo.com via HTTP; Thu, 25 Apr 2013 20:18:17 PDT     X-Rocket-MIMEInfo: 002.001,VGVzdGluZyAxMjMgTGEgbGEgbGEBMAEBAQE-     X-Mailer: YahooMailWebService/0.8.141.536     Message-ID: <136634397.44849.YahooMailNeo@web126205.mail.ne1.yahoo.com>     Date: Thu, 25 Apr 2013 20:18:17 -0700 (PDT)     From: Test Account <foo@yahoo.com>     Reply-To: Test Account <foo@yahoo.com>     Subject: Test     To: "test@example.com" <test@example.com>     MIME-Version: 1.0     Content-Type: multipart/alternative; boundary="102743210-1541163991-1366946297=:49149"


Is there a way to redirect requests from foo.com to a VM on that server?

I saw a tutorial about redirecting client requests to a specific port to a VM inside the server using IPTables. Is there a way to redirect client requests for foo.com to a VM using only IPTables? or should I go for squid proxy server?


ld-uClibc.so missing

I am trying to run an executable on Angstrom Linux, but ash tells me               -sh: ./myEx: not found      I've checked with readelf the program interpreter and it is               root@beagleboard:~# readelf -l myEx | grep interpreter       [Requesting program interpreter: /lib/ld-uClibc.so.0]      This program interpreter is missing. I've tried to symbolic link `ld- linux.so.3` to `ld-uClibc.so.0` but I think it's not correct and with no good results. I don't know where to install that or if I have to cross compile it from sources.


extracting ip address from a file

I'm trying to extract all the IP address from a file. **FILE**               *>i85.95.2.160/29   172.16.24.4              0    200      0 64515 4445 15412 i     *>i85.112.80.0/28   172.16.24.4              0    200      0 6774 64521 i     *>i85.112.80.96/27  172.16.24.4              0    200      0 6774 64521 i     *>i85.115.64.96/27  172.16.24.4              0    200      0 2300 64961 i      **OUTPUT**               85.95.2.160     85.112.80.0     85.112.80.96     85.115.64.96      This is what I have so far:               $ awk < ips '{ print $1 }' grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' ips | sort | uniq      The problem is that from the list of IP addresses it goes from the beginning up to:               84.241.254.8/29      It does not extract any of the following ip addresses:               84.241.254.32     85.115.240.0     91.232.100.72     103.248.251.48     121.58.160.79     160.218.26.16     200.6.224.96     223.255.231.240      Any ideas why these aren't getting extracted?


Is there any alternative to genext2fs in RHEL?

I am tryting to make initrd file system following [this tutorial][1] My host system is RHEL 6 64 bit. I am unable to get the required command: `genext2fs` No rpm is available for it, neither yum is helping me. I hope there is an alternate to this command.


My server processes die some time

Someone who could tell me what is happening? I count as a web server:   **Debian 7.4   1 TB HDD   2 GB RAM   Processor Intel 2399.998 MHz      ** This server is used for Web services, because every so often I have start the service MySQL, Apache etc ... by dying. And my problem is that I automatically kills processes. What can it be?


Compile source with later libraries on one server and use the binary on an older server

I may have a noob question regarding the compiling software from source. I need the latest `libpcre3-dev` library to compile a software from source, however, the current distribution of the OS (Ubuntu) on my server only has the older version of `libpcre3-dev` and no backport is available. I am thinking to compile the binary on a separate server with the latest version of `libpcre3-dev` and install the binary back to my actual server. I have two questions:   1. Does this work? My main concern is that the `libpcre3` on my server is still the older version, does the binary still need the latest corresponding `libpcre3` at runtime even if it is compiled with the latest `libpcre3-dev`?   2. What is the best way of installing the binary back to my server? Simply copy the binary or make it into a `.deb` package and then install using the package manager (if possible)?


Change colors for the Pantheon terminal emulator

I am using Elementary OS (based on Ubuntu 12.04) and I would like to change the coloring scheme for Pantheon Terminal window. Here's what I've tried:   1. Elementary Tweaks   2. Dconf Editor   3. shell commands               $ gsettings set org.pantheon.terminal.settings background '#090911111a1a'      $ gsettings set org.pantheon.terminal.settings foreground '#d9d9e6e6f2f2'      $ gsettings set org.pantheon.terminal.settings palette '#000000000000:#acac6d6d7474:#7474acac6d6d:#acaca4a46d6d:#6d6d7474acac:#a4a46d6dacac:#6d6dacaca4a4:#e6e6e6e6e6e6:#262626262626:#d6d6b8b8bcbc:#bcbcd6d6b8b8:#d6d6d3d3b8b8:#b8b8bcbcd6d6:#d3d3b8b8d6d6:#b8b8d6d6d3d3:#ffffffffffff'      None of those things worked. This is what I would like to use: https://github.com/Mayccoll/Elementary-OS-Terminal-Colors


2.6.35 usb-serial kernel patch

I am working with an ARMV71 chip, with embedded Debian 2.6.35.9 - However, the entire source tree of linux-source-2.6.35-9/drivers/usb/serial seems to be buggy. Trying to make the module "usbserial.ko" and "qcserial.ko" - in order to access a wwan card - fails. I am following this tutorial and the make command produces this :               [snip]     drivers/usb/serial/usb-serial.c:959: error: 'struct usb_serial_port' has no member named 'write_urbs'     drivers/usb/serial/usb-serial.c:959: error: 'struct usb_serial_port' has no member named 'write_urbs'     drivers/usb/serial/usb-serial.c:959: warning: type defaults to 'int' in declaration of 'type name'     drivers/usb/serial/usb-serial.c:959: warning: type defaults to 'int' in declaration of 'type name'     drivers/usb/serial/usb-serial.c:959: error: negative width in bit-field '<anonymous>'     drivers/usb/serial/usb-serial.c:960: error: 'struct usb_serial_port' has no member named 'write_urbs_free'     drivers/usb/serial/usb-serial.c:960: error: 'struct usb_serial_port' has no member named 'write_urbs_free'     drivers/usb/serial/usb-serial.c:961: error: 'struct usb_serial_port' has no member named 'write_urbs'     drivers/usb/serial/usb-serial.c:962: error: 'struct usb_serial_port' has no member named 'write_urbs'     drivers/usb/serial/usb-serial.c:967: error: 'struct usb_serial_port' has no member named 'bulk_out_buffers'     drivers/usb/serial/usb-serial.c:969: error: 'struct usb_serial_port' has no member named 'bulk_out_buffers'     drivers/usb/serial/usb-serial.c:974: error: 'struct usb_serial_port' has no member named 'write_urbs'     drivers/usb/serial/usb-serial.c:977: error: 'struct usb_serial_port' has no member named 'bulk_out_buffers'     drivers/usb/serial/usb-serial.c: In function 'fixup_generic':     drivers/usb/serial/usb-serial.c:1334: error: 'struct usb_serial_driver' has no member named 'process_read_urb'     drivers/usb/serial/usb-serial.c:1334: error: 'struct usb_serial_driver' has no member named 'process_read_urb'     drivers/usb/serial/usb-serial.c:1334: error: 'usb_serial_generic_process_read_urb' undeclared (first use in this function)     drivers/usb/serial/usb-serial.c:1334: error: (Each undeclared identifier is reported only once     drivers/usb/serial/usb-serial.c:1334: error: for each function it appears in.)     drivers/usb/serial/usb-serial.c:1335: error: 'struct usb_serial_driver' has no member named 'prepare_write_buffer'     drivers/usb/serial/usb-serial.c:1335: error: 'struct usb_serial_driver' has no member named 'prepare_write_buffer'     drivers/usb/serial/usb-serial.c:1335: error: 'usb_serial_generic_prepare_write_buffer' undeclared (first use in this function)     make[1]: *** [drivers/usb/serial/usb-serial.o] Error 1     make: *** [_module_drivers/usb/serial] Error 2     [snap]      Turns out, these are know errors. I tried to update my system, but i have to go on with the supplied kernel image, as uboot is not detecting the new kernel (3.2.0), keepson booting the 2.6.35 one. Therefore, i think i am in need of patches - which i can not simply find in google. Please help me to find the patches.


How can I create a hard to kill process

I want to create a program that will be difficult to stop (even for the administrator) once it is started (with root privileges). Once started the process should continue to start itself at startup until asked to stop. The stopping process should take some time (I.e. should be expensive). I know this may sound like a malicious software, but I want it for a genuine reason. I want to run site blockers on my Laptop (on which I am the admin). And I want to make it difficult for myself to stop them. The solution that I thought of is the following-   1. The process should run with a different name each time it is run, so that I cannot predict the process name and kill it.   2. The process will save itself in /etc/rc5.d at shutdown   3. The process will encrypt its name using a cypher in some known location. The stopping process will have to use bruteforce to recover the program name and kill it. I would like to find a good solution for this task.


Why is there Apple copyright on lpadmin, lpq and lpstat pages?

I am on Ubuntu 12.04. Why do lpadmin,lpq, lpstat man pages have Apple copyright on them?


43 seconds to mount swap on /dev/mapper/cryptswap1

My Linux Mint takes longer than I would expect it to boot. Checking `dmesg` I see the following consecutive entries:               [    8.335668] Adding 9767484k swap on /dev/mapper/cryptswap1.  Priority:-1 extents:1 across:9767484k SS     [   51.030010] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: user_xattr      I suspect the `Adding [...]` operation is taking a long time, from what I'm interpreting from this log. "Should" this take so long to complete? Does this perhaps indicate an issue with mounting?


How to understand why the packet was considered INVALID by the `iptables`?

I set up some `iptables` rules so it logs and drops the packets that are INVALID (`--state INVALID`). Reading the logs how can I understand why the packet was considered invalid? For example, the following:               Nov 29 22:59:13 htpc-router kernel: [6550193.790402] ::IPT::DROP:: IN=ppp0 OUT= MAC= SRC=31.13.72.7 DST=136.169.151.82 LEN=40 TOS=0x00 PREC=0x00 TTL=242 ID=5104 DF PROTO=TCP SPT=80 DPT=61597 WINDOW=0 RES=0x00 ACK RST URGP=0


How to allow access to a directory and don't allow access to a sub-directory in Apache?

I have asked this question on apache mailing-list but I didn't get the answer I want. I want to allow a directory " /var/www/html/ldap" to two users according to IPs (192.168.1.2 192.168.1.7):               <Directory /var/www/html/ldap>           Order allow,deny           Allow from 192.168.1.2 192.168.1.7           Satisfy any           AuthName "LDAP Authentication"           AuthType Basic                AuthBasicProvider ldap           AuthzLDAPauthoritative off           AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)           Require valid-user     </Directory>      but I don't want to allow a sub directory to 192.168.1.7 (I want it to be allowed only to 192.168.1.2): I have tried to add:               <Directory /var/www/html/ldap/manager>           Order allow,deny           Allow from 192.168.1.2           Satisfy any           AuthName "LDAP Authentication"           AuthType Basic                AuthBasicProvider ldap           AuthzLDAPauthoritative off           AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)           Require valid-user     </Directory>      but it seems that 192.168.1.7 can reach to manager directory because it is a part of ldap directory, how can I forbid this? UPDATE: as Raza suggest I have tried to something like that: for the main directory:                <Directory /var/www/html/ldap>               Order allow,deny               Allow from 192.168.1.2 192.168.1.7               Satisfy any               AuthName "LDAP Authentication"               AuthType Basic                    AuthBasicProvider ldap               AuthzLDAPauthoritative off               AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)               Require valid-user         </Directory>      for the sub-directory:                <Directory /var/www/html/ldap/manager>               Order Deny,Allow               Deny From All               Allow From 192.168.1.2               Satisfy any               AuthName "LDAP Authentication"               AuthType Basic                    AuthBasicProvider ldap               AuthzLDAPauthoritative off               AuthLDAPURL ldap://192.168.1.3/dc=example,dc=com?uid?sub?(objectClass=*)               Require valid-user         </Directory>      Note: I don't want to be asked for authentication(LDAP AUTH) for both 192.168.1.2 and 192.168.1.7 on both directories (main-directory and sub-directory).


phpstorm 7 permission error

i have `phpstorm 7.1.4` `IDE` on `manjaro(arch base linux)`.   when i run `php` code with `phpstorm` on :               http://localhost:49193/ex.php      in page : `No input file specified.`   my code not run or execute. i check `phpstorm` output to find error and see this:               /usr/bin/php-cgi -e -b localhost:49193     PHP Warning:  Unknown: open_basedir restriction in      effect.File(/run/media/masoudjjgh/d2/kar/amlak/p.php5) is not within the allowed      path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in      Unknown on line 0     PHP Warning:  Unknown: failed to open stream: Operation not permitted in      Unknown on line 0      i think problem with permission and i run it with `root` but still get this error.   now i think problem with `php-cgi` permission and i don't know how fix it.


Why are Linux installs bigger than I've read? Some beginner questions

1. I've read in different textbooks that say Linux is light-weight(e.g. It could fit on a 1.4MB floppy). So why is the download from the Ubuntu or Fedora CD sized or larger?   2. Do the device drivers extend the kernel? For example: if I have new hardware and I have installed the device driver, will my kernel code get extended or is the driver installed as a service for the kernel to use?   3. When using a LiveCD such as Ubuntu, when system boots does all 700MB of the OS get loaded to RAM or just parts of it? I ask these questions because I feel they're common beginner questions and I think it would be good to have them all in one place.