title: How to "grep -v" private/broadcast IPv4 addresses?

text: time nmap -n -iR 0 -sL | cut -d " " -f 5 | egrep -v "^10.*|^172.[16\-32].*|^192.168.*|^[224\-255].*" > RANDOM-IPS.txt      so the important part is:               egrep -v "^10.*|^172.[16\-32].*|^192.168.*|^[224\-255].*"      **Q** : Is this a good regexp? /So I will generate all the 2^32 IPv4 addresses, and "grep -v" the private/broadcast ranges./ Or are there any better ways to generate the usable IPv4 addresses on the internet?


title: Save sessions to file in xmonad

text: Is it possible to save an xmonad session to a file and reload it on the fly? I don't want to save only the last session but to be able to save different sessions to different files and reload it if I want.


title: immutable-like flag for perms

text: Is there any `chattr` flag that would allow me to lock a file's unix permissons, and not change them without resetting the flag? The file itself should still be modifiable, I just want to prevent ... ignorant people ... from changing the permissions to something wrong accidentally.


title: What file to I have to edit to make static dns server in CentOS

text: Almost every distro I know will wipe `/etc/resolv.conf` on reboot (I think dhcp does this) and thus the place to add static dhcp entries varies per distro. How to I add static dns servers to a CentOS server? so that I know that my entries will survive a reboot?


title: How to find out total memory resource usage with ps?

text: With `ps` command I can find out how much memory each program uses:               ps -u mertnuhoglu -o pcpu,rss,pid,command      Is it possible to find out the sums of each type of resource usage as well, easily?


title: SAS hardrive 600GB 10k is not detecting in my linux server

text: I have inserted one new 600 GB HDD to my Linux server. Green light is glowing but in my Oracle Enterprise Linux 5.5 OS it is not showing after executing the command below:               fdisk -l     grep -H . /sys/block/sd*/device/model


title: What causes /dev/disk/by-label to be populated?

text: I've noticed that Linux distributions typically have a /dev/disk/by-label directory, but this isn't always the case (For example, the CirrOS Linux test image doesn't have one). What's required on a Linux system for the /dev/disk/by-label directory to be properly populated?


title: sshfs: experiencing data loss

text: I am connecting to a filesystem on a remote server via sshfs. What I do is just to modify these files with emacs. From time to time I am experiencing data loss. While I work on a file and try to save the changes I get that the file has changed on the disk and Emacs asks me if I want to save the changes or not. So I choose no, if I choose yes the modification are not saved on the remote cluster but only on the local mount point. Now I was working on a file, Emacs told me that the file had been modified on the disk, so I choose to not save the changes and then Emacs asks me if I want to keep the recent modification I said no, and the file is completely gone. I don't know what it is wrong with this, because I have used sshfs many other times and it has always been fine. I am using Mac 10.6.8, sshfs 2.4 and fuse4x library version: FUSE 2.8.7 / fuse4x 0.9.2


title: How to input two arguments with getopts

text: Hi friends I am writing a simple bash script; My script installs ppa. The problem is I can't add two arguments. I want write a simple:               ./ppa.sh -i ppa:chris-lea/node.js nodejs      **I tried it; but doesn't read the second argument 'nodejs'...**               #! /bin/sh      # Install/add PPA or Program           while getopts ":i:e:" option;     do      case $option in       i)        echo received -i with $OPTARG     ang='sudo apt-add-repository'        ;;       e)        echo received -e with $OPTARG     ang='other line'        ;;       :)        echo "option -$OPTARG needs an argument"     exit        ;;       *)        echo "invalid option -$OPTARG"      exit        ;;      esac          # done         if [ "`echo $OPTARG | cut -d ':' -f1`" == "ppa" ]; then     echo 'is a ppa'         $ang $OPTARG ; sleep 2s && sudo apt-get update; clear             sudo apt-get -y install $OPTARG2         fi     done      Sorry my english is bad :/


title: Printing a file from local computer using printer connected to remote server

text: On the remote server, I use `lp` command to print documents. I can connect to this server through SSH. How can I print a file directly from my local computer using that printer?


title: How to use GoToMeeting in Linux

text: My employer wants me and the team of developers to communicate with them using `gotomeeting.com` service. Is it possible to use GoToMeeting in Debian? I know that officially GoToMeeting supports only Mac and Win. The reason: I am very happy with software development under Linux and don't want to migrate to Windows just because of one or two programs.


title: SED change only start of line and preserve end of line

text: Basically I have a situation where I frequently need to modify my hosts file to access different servers at my workplace. In an attempt to automate the process. I've been trying to use `sed` to make the changes I need. Basically I am trying to preserve the whole line for some IP's and comment out other IP's. For IP's that start with `10.4.` To uncomment via `sed`, I've attempted this               sed -i '/#10\.4\..*/c\10\.4\..*' /etc/hosts      which replaced all the matching lines with `10.4..*` instead of preserving the whole line. I've also attempted this in an attempt to use a group/match:               sed -i '/#10\.4\.(.*)/c\10\.4\.\1' /etc/hosts      but this just silently fails without making any changes at all. What am I doing wrong?


title: Importing an excerpt from a file into a script

text: I'm trying to import an excerpt from a file into a script for processing.               LIST=$(sed '1,/+++NETWORKLIST+++/d' < /path/to/file | sort -t ";" -k2,2r)      My problem is that this script is not deleting the material I don't want to pass on - I want to delete all the lines up to and including NETWORKLIST. (Beyond that point is entirely a list, with fields separted by semicolons, which I want to pass on to be sorted.) How do I pass on just an experpt from a file?


title: Raid 5 rebuild with wrong stripe size & no failed disks - is data lost?

text: I'm curious if there are hidden complexities to RAID5 and RAID5 rebuilds. My understanding is that (in a 3 disk array) a rebuild would just directly compute the parity of disks 1 & 2 and write that parity to disk 3 (or whatever disk was replaced). If it is really this simple, is there any way for a rebuild to cause data loss if no disks were actually replaced? For example... "hypothetically", if I configured my raid array with all disks & original data still there, but set the wrong symmetry, wrong stripe size, disks in the wrong order, etc, and then for some reason I resynced or reconstructed the array, could data be lost (or even changed at all)?


title: Detect init system using the shell

text: This may have more to do with detecting operating systems, but I specifically need the init system currently in use on the system. Fedora 15 now uses systemd, Ubuntu uses Upstart, while others use variations of System V. I have an application that I am writing to be a cross-platform daemon. The init scripts are being dynamically generated based on parameters that can be passed in on configure. What I'd like to do is only generate the script for the particular init system that they are using. This way the install script can be run reasonably without parameters as root and the daemon can be "installed" automagically. This is what I've come up with:   * Search for systemd, upstart, etc in /bin   * Compare /proc/1/comm to the systemd, upstart, etc   * Ask the user **What would be the best cross/platform way of doing this?** Kind of related, **Can I depend on bash to be on the majority of *nix or is it distribution/OS dependent?** Target platforms:   * Mac OS   * Linux (all distributions)   * BSD (all versions)   * Solaris, Minix, and other *nix


title: Convenient way to check if system is using systemd or sysvinit in BASH?

text: I am defining common bash files which I want to use across different distributions. I need a way to check if system is using systemd or sysvinit (/etc/init.d/). I need this so I run appropriate command to start the service. What would be safe way to check for this? I currently check for existance of systemctl command, but is that really an option as there might be the case where systemctl command might be available, but it wouldn't necessarily mean that systemd is actually used? Here is an excerpt from my current bash script:               #!/bin/sh     if [ command -v systemctl >/dev/null ]     then         systemctl service start     else         /etc/init.d/service start     fi


title: Bash script to identify which init system the system currently using

text: I have to create a script that will mount my /usr folder as aufs. I compressed it using squashfs. I've managed to install a working systemd init in ubuntu which I am currently using. Because the mounting procedure in systemd is almost parallel, relying on fstab will not work and I have to use `.mount` scripts. The reason why I could not rely on fstab is because it is required to mount the squashfs as readonly first then I would remount it as aufs for it to be read-write. When I use upstart again, the script shall work assisting the fstab and also mounting the /usr as aufs in the process. I am almost done with the script but my script should not work when I use systemd because it may collide with the `.mount` files. Is there any way to check whether I run systemd or upstart in a bash script? I tried using `if [ -e /sys/fs/cgroup/systemd ] ; then exit 2` but it did not work when I use upsatrt. I've also check this but it doesn't answer my question completely.


title: What should be the right dhcp configuration for generating a new network over eth0?

text: Even not under a real server like scenario, I'm testing with **`dhcpd`** for learning and practice purposes. I'm using Ubuntu 12.04 LTS. I want to _offer_ a network by my **`eth0`** interface. I receive ip and so internet by **`wlan0`**. These are the ip adresses: **`192.168.0.1`** is my home router.   **`192.168.19.6`** is my wlan0 ip. (Assigned by MAC adress)   **`192.168.0.196`** is my eth0 ip. (Assigned by MAC adress case I plug in to the router)   So, as it might be assumed, my home router dhcp mask is **`255.255.0.0`**. I want to test it at first with my raspberry. So over my eth0 bears a new network, and it or _they_ (case I plug a switch) get ip adresses from my dhcp server. This is what I've set for **`/etc/network/interface`** file:               auto lo     iface lo inet loopback          auto eth0     iface eth0 inet static            address 192.168.0.196            netmask 255.255.255.0            gateway 192.168.0.196      This is what I've set for **`/etc/dhcp/dhcpd.conf`** file:               option domain-name-servers 8.8.8.8,8.8.4.4;          subnet  192.168.0.0 netmask 255.255.255.0{        option routers 192.168.0.196;        range  192.168.0.10  192.168.0.120;     }      And I looked for a way to make my clients get access to internet, found this:               sudo iptables -A FORWARD -o wlan0 -i eth0 -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT     sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT     sudo iptables -t nat -F POSTROUTING     sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE      However, when I get _networking_ and _network-manager_ services restarted with that configuration I'm losing my wlan0 connection and not even my clients get ip not even way out to internet. I simply want to receive and consume connection by wlan0, generate a new network over eth0 and share my wlan0 internet through it. What's wrong in my configuration?


title: How to make dns resolve faster

text: I changed name server of one domain. Then I flush dns               root@host [~]# /etc/init.d/named restart     Stopping named:                                            [  OK  ]     Starting named:                                            [  OK  ]     root@host [~]# ping wallpaperx.org     PING wallpaperx.org (76.73.5.22) 56(84) bytes of data.     64 bytes from 76.73.5.22: icmp_seq=1 ttl=53 time=36.0 ms     64 bytes from 76.73.5.22: icmp_seq=2 ttl=53 time=36.7 ms     64 bytes from 76.73.5.22: icmp_seq=3 ttl=53 time=35.9 ms     64 bytes from 76.73.5.22: icmp_seq=4 ttl=53 time=35.9 ms      Well, ping still points to the old server. Why?


title: zsh completion: getting file names from a specific directory

text: OK, a little background: I use a Mac, and I do as much as possible in the CLI. In particular, I frequently pop in a USB stick, `cp` or `mv` a file over, and then immediately wish to eject (unmount and disconnect) it. This can usually be accomplished in a handful of keystrokes, except for unmounting it, which requires (in 10.7) going to an empty desktop space (usually two spaces away at least), selecting the disk, and pressing "command-e". Frankly, this unmount procedure is, by several orders of magnitude, the most time-consuming and tedious part of the process. It would be far more natural and efficient to simply be able to type, say:               ej<tab> J<tab>      Say my USB stick mounts at /Volumes/Jefferson. What I would expect to get from my 6 keystrokes is the following:               eject /Volumes/Jefferson      This should run the command:               diskutil unmount /Volumes/Jefferson      So, I wrote a nice little function:               eject() {         diskutil unmount /Volumes/$1     }      And a completion function to go with it:               compdef '_files -g "/Volumes/*"' eject        There is a problem with this, however. The `_files` function generates complete paths. Now, I could change the line in my "eject" function to `diskutil unmount $1`, and things would work, but then I have no ability to type the first letter of the mount point name, since the path starts with /Volumes/. For instance, if I type `J<tab`, I will get autocompletion for the files in the PWD. I would have to type `/Volumes/J<tab>` to get the desired completion. So, is there a completion function which grabs filenames from a predefined, specific location, rather than generating complete paths? I'd really like to get this down to 6 keystrokes.


title: Upgrade MySQL 5.0.88 to 5.1.69

text: I am upgrading my MySQL installation on a Fedora 10 (and 14) box (in test first.) I have made a system image (it is a VM) and have downloaded MySQL Server Community 5.1.69-1 from the MySQL site. Once downloaded, and placed in the `/usr/etc` folder, I ran the following:               [root@padev ~]# cd /usr/etc     [root@padev etc]# ls -l     total 20336     -rw-r--r-- 1 root root 20799393 2013-04-30 14:34 MySQL-server-community-5.1.69-1.rhel5.i386.rpm     [root@padev etc]# rpm -Uvh MySQL-server-community-5.1.69-1.rhel5.i386.rpm     error: Failed dependencies:         libgcc_s.so.1 is needed by MySQL-server-community-5.1.69-1.rhel5.i386         MySQL conflicts with mysql-5.0.88-1.fc10.x86_64         MySQL-server conflicts with mysql-server-5.0.88-1.fc10.x86_64     [root@padev etc]#      I thought that the `-U` portion would invoke an upgrade and thus the second and third items in the error would be disregarded. I'm a bit of a Unix/Linux newbie, so I don't know how to upgrade `libgcc` either.


title: Why linux uses swap memory when there are still tons of physical memory unused

text: root@host [/home4/nudenude/public_html/hello/cache]# top -r             top: unknown argument 'r'     usage:  top -hv | -abcHimMsS -d delay -n iterations [-u user | -U user] -p pid [,pid ...]          root@host [/home4/nudenude/public_html/hello/cache]# top     top - 09:15:22 up 32 days,  7:12,  2 users,  load average: 274.18, 268.12, 262.50     Tasks: 863 total, 215 running, 630 sleeping,   3 stopped,  15 zombie     Cpu(s): 13.8%us, 85.7%sy,  0.4%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st     Mem:  16313868k total,  7121660k used,  9192208k free,   679320k buffers     Swap:  4194296k total,   311896k used,  3882400k free,   478132k cached            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      6051 nudenude  20   0  103m  29m 4892 R  4.2  0.2   0:14.04 php      6472 nudenude  20   0 97048  26m 5272 R  4.2  0.2   0:13.07 php      7181 nudenude  20   0  100m  30m 4928 R  4.2  0.2   0:11.31 php      7196 nudenude  20   0  105m  26m 5264 R  4.2  0.2   0:11.19 php      8003 nudenude  20   0  105m  32m 5288 R  4.2  0.2   0:09.42 php      8008 nudenude  20   0  107m  29m 4960 R  4.2  0.2   0:09.42 php      8050 nudenude  20   0  105m  34m 5276 R  4.2  0.2   0:09.32 php      8052 nudenude  20   0 98664  23m 5300 R  4.2  0.1   0:09.32 php      8067 nudenude  20   0  104m  28m 5296 R  4.2  0.2   0:09.31 php      8257 nudenude  20   0 96608  25m 5304 R  4.2  0.2   0:09.02 php     10640 nudenude  20   0 96032  22m 4932 R  4.2  0.1   0:04.40 php     12082 investgr  20   0 87588  16m 4928 R  4.2  0.1   0:00.23 php      5962 nudenude  20   0  103m  33m 4900 R  3.9  0.2   0:14.19 php      6095 nudenude  20   0  105m  29m 5276 R  3.9  0.2   0:13.96 php      6467 nudenude  20   0  103m  28m 5280 R  3.9  0.2   0:12.97 php      6488 nudenude  20   0  102m  26m 5280 R  3.9  0.2   0:12.96 php      My server got 16 GB memory. Of which 7GB is still free. Yet the server uses 4GB SWAP memory and 85.7% of memory is used by system. Why? Also look at the colum. VIRT 103m, RES 29m. So most memory is not even physical. Why?


title: What does SWAP mean in top?

text: It says                  p: SWAP  --  Swapped size (kb)       The non-resident portion of a task's address space.             q: RES  --  Resident size (kb)       The non-swapped physical memory a task has used.            RES = CODE + DATA.      Okay, what does "non-resident portion" mean? Does SWAP mean that hard disk is used as additional memory?


title: How long are Debian stable releases supported? like Debian Wheezy

text: I am Ubuntu user; while I know that Ubuntu 12.04 is LTS and will be supported until April 2017, I'd like to know what the projected support lifetime of Debian Wheezy will be.


title: Bypass sshd AllowTCPFowarding=no by installing own forwarder?

text: In the man pages for `sshd_config`, for the `AllowTCPForwarding` option, it states: > **AllowTcpForwarding** > > Specifies whether TCP forwarding is permitted. The default is “yes”. Note > that disabling TCP forwarding does not improve security unless users are > also denied shell access, as they can always install their own forwarders. Can someone please elaborate? I do not understand how someone can install their own forwarder to circumvent TcpForwarding. Would one have to install a proxy server of sorts and then create a tunnel to the remote proxy server?


title: Routing public ipv6 traffic through openvpn tunnel

text: What I'm trying to do is to route IPv6 traffic through a vpn tunnel. That way, I should be able to use IPv6 in a network that doesn't support IPv6. I have a VPS which has an IPv6 block assigned. Part of this block I want to use for openvpn clients. The range I had in mind was `2001:db8::111:800:0/112` (prefix is anonymized), because openvpn only supports /64 and /112 as subnets. IPv6 through the tunnel is already working, from the client, I can ping the server (`2001:db8::111:800:1`), and also interfaces on the server (`2001:db8::111:100:100` and `2001:db8:216:3dfa:f1d4:81c0`). Though, when trying to ping google.com from the client, I get no response (ping timeout). In order to debug this issue, I have used tcpdump to capture traffic on the server, and I can see the ping packets going out, but no replies comming back. Adding log rules to ip6tables shows the same, packets going out, but nothing comming in. I used an online traceroute tool which gets a timeout from my server. I also tried to set the ip directly on the interface, which does result in the ip (`2001:db8::111:800:1001`) to be reachable, so I think this is a routing problem. I have enabled forwarding for ipv6 through `/proc/sys/net/ipv6/conf/all/forwarding`. ip6tables has policy allow for all chains. **My question is, what exactly is needed for linux to accept that packet for an ip that is not assigned to an interface and route it further?** Just a route that exists doesn't seem enough. Here is the setup for my client and server. Please let it know if more information is needed. **Client**               # ip -6 addresses     10: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qlen 100         inet6 2001:db8::111:800:1001/112 scope global             valid_lft forever preferred_lft forever          # ip -6 routes     2001:db8::111:800:0/112 dev tun0  proto kernel  metric 256      2000::/3 dev tun0  metric 1024       **Server**               # ip -6 address     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000         inet6 2001:db8:216:3dfa:f1d4:81c0/64 scope global dynamic             valid_lft 86254sec preferred_lft 14254sec         inet6 2001:db8::111:100:100/128 scope global             valid_lft forever preferred_lft forever     12: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qlen 100         inet6 2001:db8::111:800:1/112 scope global             valid_lft forever preferred_lft forever          # ip -6 route     2001:db8::111:100:100 dev eth0  proto kernel  metric 256      2001:db8::111:800:0/112 dev tun0  proto kernel  metric 256      2001:db8::/64 dev eth0  proto kernel  metric 256  expires 86194sec     default via fe80::230:48ff:fe94:d6c5 dev eth0  proto ra  metric 1024  expires 1594sec


title: Change packages from country local to global

text: I want to reinstall all packages in Ubuntu 13.10 that were downloaded from my country local repository to change them to global repository versions. I can work on system that is completely English, so it is not a problem. How can I exchange these packages (nearly all or find the country local)? I would like not to loose configurations. If there is possibility that I would loose configurations - what folders should I backup to restore them later?


title: Recursively apply a command to modify all files in a directory

text: I have a command that reads a file, and outputs a modified version on `stdout`:               ./convert /path/to/file      How can I recursively apply this command to all files in a directory, and **overwrite the existing contents of each file with the result from the command above**? I found this question which is very similar, but all solutions offered involve outputting the results to a single file, which is not what I want.


title: What to do about an outdated, but easily fixed, PKGBUILD in AUR?

text: I've found an outdated PKGBUILD on AUR. The source URL that it references doesn't exist anymore. It can easily be fixed by incrementing a version number. What is the proper way of solving this? I've already left a comment, but should I also flag the package as out-of-date? Should I send the fixed PKGBUILD somewhere?


title: Using xargs with input from a file

text: Say I have a file with the following               bob     john     sue      Now these directly corrospond to (in this case) URL pattern such as `http://example.com/persons/bob.tar`, `john.tar`, `sue.tar`. I would like to take these lines and run them through `xargs`. I don't know what is passed to the command being executed though. How do I access the parameter either from the prompt (say I want to simply echo each line like `cat file | xargs echo $PARAM`) or from a bash script.


title: List explicitly installed packages

text: In Gentoo there is the file `/var/lib/portage/world` that contains packages that I explicitly installed. By explicit I mean, packages that I choose, not including anything installed by default, or pulled in by the dependencies. Is there a similar file or a command to find that information in Ubuntu?


title: untar specific file to present date in linux

text: I am using Centos and I am installing one Debian application with multiple- instance. I have created 3 multiple-instance successfully and it is running good. Because of Debian application, the application is extracting in two different folders one is inside python folder i.e /usr/lib/python2.6/site- packages/openerp-7.0_20140802_231142-py2.6.egg/ and another one is inside home folder home/openerp2/openerp2. This is two folder is created while extracting the file inside /home/openerp2 automatically. My question is, I tried to creat 4th instance and tried to extract the file but it is extracting inside previous python folder i.e /usr/lib/python2.6/site-packages/openerp-7.0_20140802_231142-py2.6.egg/ and overwriting on it. By I am not able to do customization for that particular instance. How to solve it?


title: Search a pattern and print preceding lines starting with another pattern

text: I need to grep for a pattern and once I find it, I need to look for another pattern preceding that and print all those lines in between those. Better example:               1 a     2 a     3 a     4 a     5 a     6 b     7 c     8 d     9 xyz     10 xyz     11 a     12 a      Grep for `xyz` and then grep for first `a` preceding `xyz` line and print all the lines. Output (first preceding occurrence of `a`, I don;t care about other `a`'s in the file):               5 a      6 b     7 c     8 d     9  xyz     10 xyz


title: Applying a regex to stdin

text: In programing we often see the use of Regular Expressions. One of the most common forms is:               newText = text.replace( /regex/, 'replacementString' )      If **stdin** is `text` and **stdout** is `newText`, what would the bash equivalent be to the above code?


title: GCC: set architecture to pass to linker

text: GNU C compiler passes the wrong architecture name to the linker. For example `gcc helloworld.i` throws the error `ld: unknown/unsupported architecture name: -arch arm`. After some experimenting with LD, it seems `armv7` is the architecture I should use. The compiling and assembling operations seem to work fine. It appears that the compiler collection (iphone-gcc) is designed to work with an older version of the linker provided through the open-source Darwin CC Tools, not the newer LD64 I have installed provided as a stand-alone outside the CC tool collection. **Is there any way to tell GCC to pass another architecture to the linker?** Passing `-Wl,-arch,armv7` or `-Xlinker -arch -Xlinker armv7` to GCC gives the same error.


title: Opensuse 13.1 wifi doesn't work (intel k53E laptop)

text: I downloaded opensuse to dual boot from a CD and got everything installed. At first, my wifi was working. Then I went to school and it stopped working and wouldn't connect to anything even when I went home. I re-downloaded Linux and it was fine until I went back to school and it stopped working again. Someone told me it didn't like the way I authenticate things. I use kde wallet and I tried stuff without it and it still didn't work. I also tried rfkill but my wifi wasn't hard blocked. Any ideas? My friend thinks I'm being hardblocked I can only connect to unsecured networks


title: Udev Rule file for Modem not working

text: I am using modem for sending sms which has 16 ( ttyUSB0 to ttyUSB15 ) ports. I want to make udev rule to give device name "AMPM" and ports should be name Port1, Port2,...Port16. Check out this output of lsusb and udevadm command on port ttyUSB0               kk@kk:~$ lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 003 Device 004: ID 0461:4d22 Primax Electronics, Ltd     Bus 001 Device 015: ID 0409:005a NEC Corp. HighSpeed Hub     Bus 001 Device 016: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC     Bus 003 Device 003: ID 413c:2003 Dell Computer Corp. Keyboard     Bus 001 Device 017: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC     Bus 001 Device 018: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC     Bus 001 Device 019: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC     kk@kk:~$                    kk@kk:~$ udevadm info -q all -n /dev/ttyUSB0     P: /devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1:1.0/ttyUSB0/tty/ttyUSB0     N: ttyUSB0     S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0     S: serial/by-path/pci-0000:00:1a.7-usb-0:3.1:1.0-port0     E: DEVLINKS=/dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0 /dev/serial/by-path/pci-0000:00:1a.7-usb-0:3.1:1.0-port0     E: DEVNAME=/dev/ttyUSB0     E: DEVPATH=/devices/pci0000:00/0000:00:1a.7/usb1/1-3/1-3.1/1-3.1:1.0/ttyUSB0/tty/ttyUSB0     E: ID_BUS=usb     E: ID_MM_CANDIDATE=1     E: ID_MODEL=Quad_RS232-HS     E: ID_MODEL_ENC=Quad\x20RS232-HS     E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC     E: ID_MODEL_ID=6011     E: ID_PATH=pci-0000:00:1a.7-usb-0:3.1:1.0     E: ID_PATH_TAG=pci-0000_00_1a_7-usb-0_3_1_1_0     E: ID_REVISION=0800     E: ID_SERIAL=FTDI_Quad_RS232-HS     E: ID_TYPE=generic     E: ID_USB_DRIVER=ftdi_sio     E: ID_USB_INTERFACES=:ffffff:     E: ID_USB_INTERFACE_NUM=00     E: ID_VENDOR=FTDI     E: ID_VENDOR_ENC=FTDI     E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd     E: ID_VENDOR_ID=0403     E: MAJOR=188     E: MINOR=0     E: SUBSYSTEM=tty     E: UDEV_LOG=3     E: USEC_INITIALIZED=7668235100      I am getting fail in following udev rule.               SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-15]*", ATTRS{idVendor}=="0403", ATTRS{product}=="6011", NAME=="AMPM" , SYMLINK=="AMPM", GROUP="tty", MODE="0660"


title: What a 64 bit Linux can do that 32 bit linux can't?

text: I ordered a server from fdcserver. Then I realized that, unless changed, fdcserver actually provides 32 bit operating as default. I logged in using SSH, typed `uname -m`, and to my horror I saw that I was actually running a 32 bit Linux. I will definitely change this near the end of the month. Meanwhile, what are the limitation of this 32 bit operating system? Can I use all 32 GB of memory the server has installed?


title: Run Apache2 as root

text: I am teaching a security class and I would like to show them how it is very stupid to run apache as root (that means I don't need to be preached to about how stupid it is; I agree with you) I'm having problems with setting the CFLAG when compiling to have apache stop holding my hand. Could you give me a step by step. Thanks.


title: Why are there so many virtual terminal devices?

text: I've been reading the Advanced Linux Programming book and it mentions about virtual terminals which, if I understood it correctly, it is a Linux-specific feature (not in Unix) to allow multiple login consoles in a non X11 system. You create virtual terminals by pressing ALT-F2. I'm running Linux Mint and in my /dev folder though I see many tty devices and I don't know what they are for. Here is the grepped output:               crw-rw-rw-  1 root tty       5,   0 Jan  2 19:45 tty     crw--w----  1 root tty       4,   0 Jan  2 19:10 tty0     crw-rw----  1 root tty       4,   1 Jan  2 19:10 tty1     crw--w----  1 root tty       4,  10 Jan  2 19:10 tty10     crw--w----  1 root tty       4,  11 Jan  2 19:10 tty11     crw--w----  1 root tty       4,  12 Jan  2 19:10 tty12     crw--w----  1 root tty       4,  13 Jan  2 19:10 tty13     crw--w----  1 root tty       4,  14 Jan  2 19:10 tty14     crw--w----  1 root tty       4,  15 Jan  2 19:10 tty15     crw--w----  1 root tty       4,  16 Jan  2 19:10 tty16     crw--w----  1 root tty       4,  17 Jan  2 19:10 tty17     crw--w----  1 root tty       4,  18 Jan  2 19:10 tty18     crw--w----  1 root tty       4,  19 Jan  2 19:10 tty19     crw-rw----  1 root tty       4,   2 Jan  2 19:10 tty2     crw--w----  1 root tty       4,  20 Jan  2 19:10 tty20     crw--w----  1 root tty       4,  21 Jan  2 19:10 tty21     crw--w----  1 root tty       4,  22 Jan  2 19:10 tty22     crw--w----  1 root tty       4,  23 Jan  2 19:10 tty23     crw--w----  1 root tty       4,  24 Jan  2 19:10 tty24     crw--w----  1 root tty       4,  25 Jan  2 19:10 tty25     crw--w----  1 root tty       4,  26 Jan  2 19:10 tty26     crw--w----  1 root tty       4,  27 Jan  2 19:10 tty27     crw--w----  1 root tty       4,  28 Jan  2 19:10 tty28     crw--w----  1 root tty       4,  29 Jan  2 19:10 tty29     crw-rw----  1 root tty       4,   3 Jan  2 19:10 tty3     crw--w----  1 root tty       4,  30 Jan  2 19:10 tty30     crw--w----  1 root tty       4,  31 Jan  2 19:10 tty31     crw--w----  1 root tty       4,  32 Jan  2 19:10 tty32     crw--w----  1 root tty       4,  33 Jan  2 19:10 tty33     crw--w----  1 root tty       4,  34 Jan  2 19:10 tty34     crw--w----  1 root tty       4,  35 Jan  2 19:10 tty35     crw--w----  1 root tty       4,  36 Jan  2 19:10 tty36     crw--w----  1 root tty       4,  37 Jan  2 19:10 tty37     crw--w----  1 root tty       4,  38 Jan  2 19:10 tty38     crw--w----  1 root tty       4,  39 Jan  2 19:10 tty39     crw-rw----  1 root tty       4,   4 Jan  2 19:10 tty4     crw--w----  1 root tty       4,  40 Jan  2 19:10 tty40     crw--w----  1 root tty       4,  41 Jan  2 19:10 tty41     crw--w----  1 root tty       4,  42 Jan  2 19:10 tty42     crw--w----  1 root tty       4,  43 Jan  2 19:10 tty43     crw--w----  1 root tty       4,  44 Jan  2 19:10 tty44     crw--w----  1 root tty       4,  45 Jan  2 19:10 tty45     crw--w----  1 root tty       4,  46 Jan  2 19:10 tty46     crw--w----  1 root tty       4,  47 Jan  2 19:10 tty47     crw--w----  1 root tty       4,  48 Jan  2 19:10 tty48     crw--w----  1 root tty       4,  49 Jan  2 19:10 tty49     crw-rw----  1 root tty       4,   5 Jan  2 19:10 tty5     crw--w----  1 root tty       4,  50 Jan  2 19:10 tty50     crw--w----  1 root tty       4,  51 Jan  2 19:10 tty51     crw--w----  1 root tty       4,  52 Jan  2 19:10 tty52     crw--w----  1 root tty       4,  53 Jan  2 19:10 tty53     crw--w----  1 root tty       4,  54 Jan  2 19:10 tty54     crw--w----  1 root tty       4,  55 Jan  2 19:10 tty55     crw--w----  1 root tty       4,  56 Jan  2 19:10 tty56     crw--w----  1 root tty       4,  57 Jan  2 19:10 tty57     crw--w----  1 root tty       4,  58 Jan  2 19:10 tty58     crw--w----  1 root tty       4,  59 Jan  2 19:10 tty59     crw-rw----  1 root tty       4,   6 Jan  2 19:10 tty6     crw--w----  1 root tty       4,  60 Jan  2 19:10 tty60     crw--w----  1 root tty       4,  61 Jan  2 19:10 tty61     crw--w----  1 root tty       4,  62 Jan  2 19:10 tty62     crw--w----  1 root tty       4,  63 Jan  2 19:10 tty63     crw--w----  1 root tty       4,   7 Jan  2 19:10 tty7     crw--w----  1 root tty       4,   8 Jan  2 19:10 tty8     crw--w----  1 root tty       4,   9 Jan  2 19:10 tty9


title: Generating/validating checksums in a single line?

text: When I generate checksums for my files, I have to do a bit of extra work to get them formatted properly:               CHECKSUM="$(shasum "$file" | cut -b 1-40)"     echo -n "$CHECKSUM" > "$file.sha"      This is to ensure that in the file, I only have the checksum itself (hence `cut`) and that at the end of the file, there's no newline (hence `echo -n`). Validating the checksums also requires a bit extra work:               CHECKSUM="$(shasum "$file" | cut -b 1-40)"     echo -n "$CHECKSUM" | diff - "$file.sha"      Is there an easier, more compact way of creating and validating checksums without storing the path? I prefer not to store the path in the checksum along with the file as it makes the files less portable IMO.


title: Continue for loop by keyboard

text: I have user account on a linux machine which I do not know its exact IP address. But I know a range which it is ran on one of them. I want to check which server is my desired server. There are some Microsoft servers, some Linux servers and some servers that are down as well. I have a shell script to check each server:               #!/bin/sh     for i in $(seq 1 127)     do         echo "192.168.1.$i:"         ssh 192.168.1.$i -l user_name     done      This code goes to each IP. If it ran ssh, it prompts for password, if ssh did not run, it tries the next ip and if server is down, it waits for a long time. Also if the server has ssh and prompts for a password, I can not escape from it by keyboard from such a server. How can I escape from these two types by keyboard and go to the next IP without terminating the program? For example `CTRL` + `C` terminates the program.


title: How to make GTK application use the theme options configured in the GNOME Tweak Tool (and not the KDE's GTK configuration) when I'm under GNOME?

text: I'm using **openSUSE 13.1** initially installed as a **KDE4** Desktop environment (it's the default corporate install at my work). Now I would like to use the GNOME desktop. So, I installed **GNOME 3.10** with the standard openSUSE gnome desktop pattern through zypper (`patterns-openSUSE-gnome`). Now, my problem is that under the GNOME desktop, the GNOME Tweak Tool configuration is completely ignored for pure GTK apps (it is ok for full GNOME apps like `gedit` or `yast-gnome`). GTK applications actually use the settings found under `KDE System Settings` > `Application` > `GTK`. I have an older openSUSE desktop (12.3 / KDE4 / Gnome 3.6.2) that works correctly :   * Under KDE : GTK apps are themed using `KDE System Settings` > `Application` > `GTK` settings.   * Under GNOME : GTK apps are themed using `GNOME Tweak Tool`. It seems that under GNOME, KDE-GTK configuration is being used in favor of GNOME Tweak Tool configuration. **How to make GTK application use the theme options configured in the GNOME Tweak Tool (and not the KDE's GTK configuration) when I'm under GNOME ?** **EDIT:** To make sure the problem didn't came from the corporate pre-install I did the following test in a VM :   1. Install a fresh openSUSE 13.1 with GNOME Desktop only (choose GNOME in the install dialog) and log in using GNOME :     * All apps display well (yast, gedit, firefox)   2. Install the KDE4 openSUSE pattern, then log in using KDE4, then logout and log back using GNOME :     * **Icons in yast (gnome yast) get changed by KDE4 icons** , besides that, it has the GNOME/GTK look     * Gedit still display well (default GNOME/GTK look)     * **Firefox and Meld have the KDE4 oxygen look** So it seems that the problem comes from this version of KDE4 (the one that comes with openSUSE 13.1) that takes over GTK whether or not the desktop is KDE4... In the past, KDE4 was more gentle ...


title: usbhid can't find input interrupt endpoint

text: I have Scientific Linux 6.5 installed. From the beginning (on this computer) I constantly see this line jump in between all starting commands during the start up of the system (when I press `esc` to see the start up log been written):               usbhid: 9-2:1.1: couldn't find an input interrupt endpoint      I had no big problem with that, so I ignored it until now. Recently I am trying to edit my programs in `emacs` in a pure terminal environment (by pressing `Ctrl+Alt+F2`) and in the middle of my work this line jumps in again! I wanted to see what is causing it and how I can fix this issue. Here is an example. I wrote this text in emacs:               This is a test to show the problem.          This line was a clean sentance, I kept the cursor      in it to show how the line jumps in.           It is not too common but it jumps in every once and a while.      After waiting a while, the line jumped where the cursor was at that moment (after "how" in the third line.): ![enter image description here](http://i.stack.imgur.com/bkwd6.jpg) The line remains there but only in appearance! When I press backspace on it it deletes the underlying sentance and I can only go over the region that it over laps with the undelying line. Ultimately, when I save it, I don't see it either, futher proving that it is only there in appearance, not in the actual buffer. When I run `lshw -c input` as root, I get the following output:               [root@mycomputer myid]# lshw -c input      *-usb                           description: Mouse        product: Kinzu        vendor: SteelSeries        physical id: 2        bus info: usb@9:2        version: 0.30        capabilities: usb-1.10        configuration: driver=usbhid maxpower=100mA speed=12.0MB/s      *-usb        description: Keyboard        product: USB Keyboard        vendor: Holtek Semiconductor, Inc.        physical id: 2        bus info: usb@3:2        version: 3.90        capabilities: usb-1.10        configuration: driver=usbhid maxpower=100mA speed=1.5MB/s


title: Unable to set capability CAP_SETFCAP by user

text: The question is about capabilities. I need to allow user to set capabilities using setcap. When I call it by root all goes fine, eg `$ sudo setcap cap_dac_override,cap_dac_read_search+ep ./bin_file`               $ getcap ./bin_file     ./bin_file = cap_dac_override,cap_dac_read_search+ep      but when i run the command with user privileges...               $ /sbin/setcap cap_dac_override,cap_dac_read_search+ep ./bin_file     unable to set CAP_SETFCAP effective capability: Operation not permitted      I added the following string into `/etc/security/capability.conf`:               cap_setfcap,cap_dac_override,cap_dac_read_search user      but it still doesn't work.


title: Compress online videos directly with ffmpeg

text: Can we compress an online video with an http url using `ffmpeg` directly? If possible please give me a command that can compress online video directly & save on my PC. I am using Ubuntu.


title: Sort all directories based on their size

text: I'd like to sort all the directories/files in a specific directory based on their size (using _du -sh "name"_ ). I need to apply this command to all directories in my location, then sort them based on this result. How can I do that ?


title: if condition, loop in grep

text: Could someone please provide help for me. I tried to start writing a shell script but am getting hung up with this issue. I need to `grep` commands "adb shell ps" and find in it 3 processes with names:   1. proc1   2. proc2   3. proc3 And if these processes are present in the `grep` output, then continue work with the script, else check the `grep` 5 times within the interval - 30 seconds. Finally - if my process doesn't start, just exit form script.


title: How to make IPv6 static routes persistent on CentOS?

text: Static routes are forgotten once the network service is restarted. However, IPv4 static routes can be made persistent by adding them to `/etc/sysconfig/static_routes`. This file is read by the network service when (re)starting and the static routes are added to the routing table. This is the relevant code from `/etc/init.d/network`               # Add non interface-specific static-routes.     if [ -f /etc/sysconfig/static-routes ]; then         grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do             /sbin/route add -$args         done     fi      However, no such file seems to exist for IPv6 static routes, which are lost upon network restart. Is editing the `/etc/init.d/network` script the only way? (So that it reads from a manually created file storing IPv6 routes and adds them to routing table when network (re)starts).


title: How to silence spam or unwanted email from email-lists with Procmail?

text: I joined an email-list. I found it low-quality and I don't have time to follow their discussions. Then I informed the head to remove my email but they haven't done it. How can I can silence their emails with Procmail? It is some sort of email-list `Envelope-to:personal@something.com`. They send it from `tiedotus@edistyspuolue.fi`. How can I silence them, i.e. not to get their emails to fill my mailbox, not to bother me with their emails?               :0:     * ^FROM:.*@edistyspuolue.fi     * ^TO:personal@something.com     /dev/null


title: My debian-menu.xml is missing

text: I have a relatively new Debian installation -- when it was first installed, it was without a gui, but I ran `apt-get install xinit` and `apt-get install openbox`, so when I run `startx` I get an openbox session. My openbox menu is rather limited, and `.xsession-errors` shows               Openbox-Message: Unable to find a valid menu file "debian-menu.xml"     Openbox-Message: Unable t o find a valid menu file "/var/lib/openbox/debian-menu.xml"      When I check `/var/libopenbox/debian-menu.xml` there's nothing there. Is it possible to fix it so that openbox can show debian menu items? Edit: The following is an excerpt from my `~/.config/openbox/rc.xml` file:               <menu>       <!-- You can specify more than one menu file in here and they are all loaded,            just don't make menu ids clash or, well, it'll be kind of pointless -->            <!-- default menu file (or custom one in $HOME/.config/openbox/) -->       <!-- system menu files on Debian systems -->       <file>/var/lib/openbox/debian-menu.xml</file>       <file>debian-menu.xml</file>       <file>menu.xml</file>       <hideDelay>200</hideDelay>       <!-- if a press-release lasts longer than this setting (in milliseconds), the            menu is hidden again -->       <middle>no</middle>       <!-- center submenus vertically about the parent entry -->       <submenuShowDelay>100</submenuShowDelay>       <!-- time to delay before showing a submenu after hovering over the parent            entry.            if this is a negative value, then the delay is infinite and the            submenu will not be shown until it is clicked on -->       <submenuHideDelay>400</submenuHideDelay>       <!-- time to delay before hiding a submenu when selecting another            entry in parent menu -->            if this is a negative value, then the delay is infinite and the            submenu will not be hidden until a different submenu is opened -->       <applicationIcons>yes</applicationIcons>       <!-- controls if icons appear in the client-list-(combined-)menu -->       <manageDesktops>yes</manageDesktops>       <!-- show the manage desktops section in the client-list-(combined-)menu -->     </menu>


title: mutt: save message to specific folder

text: I have several folders defined in Mutt:               mailboxes           "~/Mail/inbox"     mailboxes           "~/Mail/sent"     mailboxes           "~/Mail/archive"      I can save (move) a message to archive, by pressing `s` and then `?` to see a list of folders, and then I can choose `archive` from the list. Since I always want only to save to `archive` I would like to have a macro, so that pressing `s` automatically saves selected message to `archive`, without asking me. Can somebody please help? **EDIT:** I now have following macro, to save messages to my "archive" folder:               macro index,pager S "<tag-prefix><save-message>=archive<enter>\       :set delete=yes<enter><sync-mailbox>:set delete=no<enter>"      the problem is, the messages stay in index marked as deleted. They are not "synced" immediately. Second, the `<enter>` at the end acts as `<display- message>`, so that when I press `S`, I end up in the pager of the current message. In a similar way, I am trying to implement the `trash` folder in mutt. The following is taken from the Mutt MacroSamples               set maildir_trash=yes     set wait_key=no     folder-hook . 'bind index q quit'     folder-hook inbox 'macro index q ":unset maildir_trash;push \"T~D\\n<tag-prefix-cond>m=trash\\n<end-cond><quit>\"\n"'      but this does not work either. Insted mutt asks me:               Append messages to etmaildir_trash;push"T~D\n<tag-prefix-cond>m=trash\n<end-cond><quit>"/maildir_trash;push"T~D\n<tag-prefix-cond>m=trash\n<end-co ([yes]/no):      what ever I press, nothing happens (the folders trash/{cur,new,tmp} do exist)


title: I try to add passwords to the "pass" password manager. But my attempts fail with "no public key" GPG errors. Why?

text: I am trying to install Pass: the standard Unix password manager, however, when I try to add passwords to the appliation I get these errors               gpg: Kelly's Passwords: skipped: No public key     gpg: [stdin]: encryption failed: No public key      ### GPG Public Keys? When I type in the command `gpg --list-keys` I get:               /home/khays/.gnupg/pubring.gpg     ------------------------------     pub   2048R/64290B2D 2012-11-05     uid                  Kelly Hays <hays.kelly@gmail.com>     sub   2048R/0DF57DA8 2012-11-05      I am a little lost of how to remedy this, any ideas?


title: Is there a way to detect null bytes (␀, NUL, \0) in sed?

text: Related to another question, in order to fuzzily detect binary files, is there a way to detect ␀ bytes in `sed`?


title: A list of available DBus services

text: Is there such a thing as list of available DBus services?   I've stumbled upon a few (like those provided by NetworkManager, Rhythmbox, Skype, HAL).   I wonder if I can find a rather complete list of provided services/interfaces.


title: Configuring different subnet IPs for a single physical interface on Wheezy?

text: I have a VPS that has been assigned three IP addresses. Let's say that these are 192.168.123.45/24, 192.168.225.98/23 and 192.168.225.99/23. (The actual addresses are globally routable, but that is irrelevant for the purposes of this question. The netmask lengths, however, are like that.) The two subnets have different gateways, each in the respective subnet (obviously). Originally, only 192.168.123.45/24 was configured, through `auto` and `inet` stanzas in /etc/networking/interfaces specifying `eth0`. Now I am trying to configure the other two IP addresses as well. The naïve approach of just adding `auto eth0:1` and `inet eth0:1` stanzas to `interfaces` netted me an error `RTNETLINK answers: File exists - Failed to bring up eth0:1.`. Googling suggested I should do `ifconfig eth0 add ...` followed by `ifconfig eth0:1 netmask ... gw ...`, but this feels fragile. **What is the proper way to, on Debian Wheezy, set up virtual interfaces** (or even without virtual interfaces) **for a single physical interface where the virtual interfaces are to be on different subnets?**


title: can't initialise/detect 16550A UART at unusual io port address

text: I've got a board based on the Vortex86DX CPU which is an x86 based microcontroller. It has five 16550A UARTS, four (COM1-COM4) of which are at the usual io port addresses (0x3f8, 0x2f8, 0x3e8, 0x2e8) but the fifth (COM9) is at 0x010, irq 9. Vortex86DX The first four UARTS are detected, I have no problem with them. The problem is that I can't get the fifth one (COM9) to work in Linux. COM9 works in a stand alone DOS application, but I can't even detect it from Linux. What I've done so far:   * added my extra UART to /drivers/tty/serial/8250/   * enabled DEBUG_AUTOCONF in /drivers/tty/serial/8250/8250.c so I can see when and which addresses are being probed.   * editted /arch/x86/kernel/setup.c because io port 0x010 overlapped an existing region reserved for dma1  Result: the kernel failed to probe the UART at address 0x010 So I wrote an io port probing utility to directly read from io port 0x010, and I could not detect any 16550A registers in the 0x010 to 0x017 region. It appears there is nothing there. I have been trying to write and read back data from the scratch register (offset +7), but I get nothing at address 0x017. The datasheet for the CPU doesn't say much. It indicates there is a control bit in a Southbridge register that does "something" for COM9. I wrote a PCI utility that wrote to this bit, but it didn't seem to enable the COM port or change anything when I did the io port probing. Any help would be appreciated at this point!


title: 'xorg.conf' and hybrid graphics

text: Is there any sane way to be able to configure X server and have working hybrid graphics at the same time? Whenever I add "xorg.conf" X server stops loading driver for second (discrete) GPU. Configuration file I've tried:               Section "Device"         Identifier  "Card0"         Driver      "intel"         BusID       "PCI:0:2:0"         Option      "AccelMethod"       "sna"         Option      "TearFree"      "true"         Option      "SwapbuffersWait"   "false"     EndSection          Section "Device"         Identifier  "Card1"         Driver      "radeon"         BusID       "PCI:1:0:0"     EndSection          Section "Screen"         Identifier  "screen1"         Device      "Card0"     EndSection      With this X server simply skips loading "radeon" driver, no GPU PRIME support then.


title: Expanding root partition in SUSE Linux

text: I have a server where the space distribution among partitions is as follows:               GSSJMB02:~ # df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/cciss/c0d0p5      25G  5.9G   18G  25% /     udev                  3.9G  144K  3.9G   1% /dev     /dev/cciss/c0d0p9      64G  129M   61G   1% /apps     /dev/cciss/c0d0p1     244M   12M  219M   6% /boot     /dev/cciss/c0d0p10     16G  129M   15G   1% /home     /dev/cciss/c0d0p7     5.0G  618M  4.1G  13% /opt     /dev/cciss/c0d0p8     9.9G  228M  9.2G   3% /var     GSSJMB02:/gsn/sw       25G  5.9G   18G  25% /mnt/nfs/gsn/sw     GSSJMB02:/gsn/nodes    25G  5.9G   18G  25% /mnt/nfs/gsn/nodes      Here the filesystem `/dev/cciss/c0d0p5` has less space than I require. And filesystem `/dev/cciss/c0d0p9` has a lot of unusable space. Can I increase the space of `/dev/cciss/c0d0p5` by taking out some from `/dev/cciss/c0d0p9`?


title: What counts as a file modification or change?

text: Does renaming affect the file modify or access time? Is there a list somewhere of what changes which times?


title: Automount not equivelent to mount?

text: I'm struggling to get automount to work as desired. If I run the following: `sudo mount -t nfs server:/path/to/share /path/to/mount_point` I get the mount appearing fine. However, if I add the following line to my `auto_master`: `/path/to/mount_point server:/path/to/share` it creates the mount point directory but the contents aren't visible. When I observe the output of the `mount` command, they are different:   * Using the first (manual mount) approach the following entry is returned by `mount`:              server:/path/to/share on /path/to/mount_point (nfs)        * Using `automount` I get the following entry returned by `mount`:              map server:/path/to/share on /path/to/mount_point (autofs, automounted, nobrowse)      I assumed that by default, `automount` mounts via NFS and is equivalent to the manual mount. What is the correct way to use `automount` to acheive the behaviour of the (correctly working) manual mount? The share is hosted on a Linux NIS domain and I am accessing from a Mac (BSD Unix).


title: How can my HDD swap without a swap partition?

text: I have no swap partition on my disk because I prefer having the OOM reaper kill anything it wants **quickly** rather than having to wait 10 minutes for my swap partition to get filled + 5 other minutes to launch the OOM reaper + crash. Basically, my problem is:   1. launch "eat_all_my_memory";   2. wait 10 minutes with an unresponsive system (HHD LED always on);   3. in the meantime, try to switch to a TTY;   4. wait a couple of minutes to actually switch;   5. enter the user name and the password;   6. wait a couple of minutes;   7. log in;   8. log off because of the OOM reaper;   9. repeat from 5 until it works;   10. use top and see that a kworker is "working";   11. get killed again;   12. get a message from the reaper saying that "eat_all_my_memory" was killed;   13. Memory is freed. It took 12 minutes last time. My attempts to log in in a TTY seem to have no effect on the whole cycle time. I have a couple of question then:   1. Why does my system even write anything on the disk? There is no swap!!!   2. Where does it write to?   3. There is still no way to tell the OOM killer to kill the biggest user process or the one eating most of the memory in a minimum time. Til then, is there some way to get the OOM killer just do its job without trying to do anything with the disk? I've had the problem with Debian, Ubuntu and now Archlinux so this does not seem to be distro specific. **EDIT: excerpts of the log file** I launched the offending command around 15:28. It seems that the system actually takes a lot of time before figuring out that there is nothing left.               déc. 11 15:28:56 hostname dbus[475]: [system] Failed to activate service 'org.freedesktop.ModemManager1': timed out     déc. 11 15:29:40 hostname dbus[475]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.ModemManager1.service': Unit dbus-org.freedesktop.ModemManager1.service failed to load: No such file or directory.     déc. 11 15:30:31 hostname dbus-daemon[475]: dbus[475]: [system] Failed to activate service 'org.freedesktop.ModemManager1': timed out     déc. 11 15:30:46 hostname systemd[1]: Starting Getty on tty2...     déc. 11 15:30:46 hostname systemd[1]: Started Getty on tty2.     déc. 11 15:31:56 hostname systemd[1]: Starting Session 2 of user username.     déc. 11 15:31:56 hostname systemd[1]: Started Session 2 of user username.     déc. 11 15:31:57 hostname systemd-logind[472]: New session 2 of user username.     déc. 11 15:31:58 hostname systemd[1]: getty@tty2.service holdoff time over, scheduling restart.     déc. 11 15:31:58 hostname systemd[1]: Starting Getty on tty2...     déc. 11 15:31:58 hostname systemd[1]: Started Getty on tty2.     déc. 11 15:32:10 hostname systemd[1]: Stopped Session 2 of user username.     déc. 11 15:32:18 hostname systemd-logind[472]: Removed session 2.     déc. 11 15:33:01 hostname systemd[1]: Starting Session 3 of user username.     déc. 11 15:33:02 hostname systemd[1]: Started Session 3 of user username.     déc. 11 15:33:15 hostname systemd-logind[472]: New session 3 of user username.     déc. 11 15:33:37 hostname systemd-logind[472]: Failed to save session data for 3: No space left on device     déc. 11 15:35:00 hostname dbus-daemon[475]: dbus[475]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.nm-dispatcher.service': Unit dbus-org.freedesktop.nm-dispatcher.service failed to load: No such file or directory.     déc. 11 15:35:00 hostname kernel: chromium invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=300     déc. 11 15:34:52 hostname systemd[1]: getty@tty2.service holdoff time over, scheduling restart.     déc. 11 15:34:52 hostname systemd[1]: Stopping Getty on tty2...     déc. 11 15:34:52 hostname systemd[1]: Starting Getty on tty2...     déc. 11 15:34:52 hostname systemd[1]: Started Getty on tty2.     déc. 11 15:34:52 hostname systemd-logind[472]: Removed session 3.     déc. 11 15:35:00 hostname kernel: chromium cpuset=/ mems_allowed=0     déc. 11 15:35:00 hostname kernel: CPU: 0 PID: 9811 Comm: chromium Not tainted 3.12.3-1-ARCH #1     déc. 11 15:35:00 hostname kernel: Hardware name: Dell Inc. Latitude E6400                  /0X574R, BIOS A20 12/21/2009     déc. 11 15:35:00 hostname kernel:  0000000000000000 ffff8800502179a8 ffffffff814ee3db ffff8800ab6588b0     déc. 11 15:35:01 hostname kernel:  ffff880050217a38 ffffffff814ec36e ffff8800502179c8 ffffffff81062d66     déc. 11 15:35:01 hostname kernel:  ffff880050217a10 ffffffff810f3354 0000000000000000 ffff8800bf449b28     déc. 11 15:35:01 hostname kernel: Call Trace:     déc. 11 15:35:01 hostname kernel:  [<ffffffff814ee3db>] dump_stack+0x54/0x8d     déc. 11 15:35:01 hostname kernel:  [<ffffffff814ec36e>] dump_header+0x7f/0x200     déc. 11 15:35:01 hostname kernel:  [<ffffffff81062d66>] ? put_online_cpus+0x56/0x80     déc. 11 15:35:01 hostname kernel:  [<ffffffff810f3354>] ? rcu_oom_notify+0xe4/0x100     déc. 11 15:35:01 hostname kernel:  [<ffffffff81138dd6>] oom_kill_process+0x206/0x390     déc. 11 15:35:01 hostname kernel:  [<ffffffff81139557>] out_of_memory+0x437/0x480     déc. 11 15:35:01 hostname kernel:  [<ffffffff8113f3e9>] __alloc_pages_nodemask+0xad9/0xaf0     déc. 11 15:35:01 hostname kernel:  [<ffffffff8117eaa9>] alloc_pages_current+0xa9/0x160     déc. 11 15:35:01 hostname kernel:  [<ffffffff81136297>] __page_cache_alloc+0x97/0xc0     déc. 11 15:35:01 hostname kernel:  [<ffffffff81137c38>] filemap_fault+0x188/0x430     déc. 11 15:35:01 hostname kernel:  [<ffffffff8115c2bf>] __do_fault+0x6f/0x590     déc. 11 15:35:01 hostname kernel:  [<ffffffff811610e8>] handle_mm_fault+0x398/0x10f0     déc. 11 15:35:01 hostname kernel:  [<ffffffff814f8c59>] __do_page_fault+0x1e9/0x5f0     déc. 11 15:35:01 hostname kernel:  [<ffffffff81168177>] ? do_mmap_pgoff+0x357/0x3e0     déc. 11 15:35:01 hostname kernel:  [<ffffffff814f906e>] do_page_fault+0xe/0x10     déc. 11 15:35:01 hostname kernel:  [<ffffffff814f5c88>] page_fault+0x28/0x30     déc. 11 15:35:01 hostname kernel: Mem-Info:     déc. 11 15:35:01 hostname kernel: Node 0 DMA per-cpu:     déc. 11 15:35:01 hostname kernel: Node 0 DMA per-cpu:     déc. 11 15:35:01 hostname kernel: CPU    0: hi:    0, btch:   1 usd:   0     déc. 11 15:35:01 hostname kernel: CPU    1: hi:    0, btch:   1 usd:   0     déc. 11 15:35:01 hostname kernel: Node 0 DMA32 per-cpu:     déc. 11 15:35:01 hostname kernel: CPU    0: hi:  186, btch:  31 usd:  30     déc. 11 15:35:01 hostname kernel: CPU    1: hi:  186, btch:  31 usd:  64     déc. 11 15:35:01 hostname kernel: active_anon:690683 inactive_anon:9400 isolated_anon:0                                           active_file:92 inactive_file:104 isolated_file:0                                           unevictable:37 dirty:3 writeback:24 unstable:0                                           free:14229 slab_reclaimable:4844 slab_unreclaimable:6907                                           mapped:9344 shmem:12110 pagetables:9731 bounce:0                                           free_cma:0     déc. 11 15:35:01 hostname kernel: Node 0 DMA free:12148kB min:232kB low:288kB high:348kB active_anon:3024kB inactive_anon:44kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB managed:15908kB mlocked:0kB dirty:0kB writeback:0kB mapped:40kB shmem:44kB slab_reclaimable:32kB slab_unreclaimable:160kB kernel_stack:40kB pagetables:200kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes     déc. 11 15:35:01 hostname kernel: lowmem_reserve[]: 0 2984 2984 2984     déc. 11 15:35:01 hostname kernel: Node 0 DMA32 free:44768kB min:44820kB low:56024kB high:67228kB active_anon:2759708kB inactive_anon:37556kB active_file:368kB inactive_file:416kB unevictable:148kB isolated(anon):0kB isolated(file):0kB present:3117364kB managed:3058728kB mlocked:148kB dirty:12kB writeback:96kB mapped:37336kB shmem:48396kB slab_reclaimable:19344kB slab_unreclaimable:27468kB kernel_stack:3424kB pagetables:38724kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:1540 all_unreclaimable? yes     déc. 11 15:35:01 hostname kernel: lowmem_reserve[]: 0 0 0 0     déc. 11 15:35:01 hostname kernel: Node 0 DMA: 5*4kB (UEM) 4*8kB (UE) 6*16kB (UE) 1*32kB (E) 7*64kB (UEM) 0*128kB 3*256kB (UEM) 3*512kB (UEM) 1*1024kB (E) 2*2048kB (ER) 1*4096kB (M) = 12148kB     déc. 11 15:35:01 hostname kernel: Node 0 DMA32: 402*4kB (UER) 661*8kB (UEM) 437*16kB (UE) 141*32kB (UE) 96*64kB (UEM) 16*128kB (UE) 3*256kB (U) 0*512kB 15*1024kB (M) 1*2048kB (M) 0*4096kB = 44768kB     déc. 11 15:35:01 hostname kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB     déc. 11 15:35:01 hostname kernel: 12341 total pagecache pages     déc. 11 15:35:01 hostname kernel: 0 pages in swap cache     déc. 11 15:35:01 hostname kernel: Swap cache stats: add 0, delete 0, find 0/0     déc. 11 15:35:01 hostname kernel: Free swap  = 0kB     déc. 11 15:35:01 hostname kernel: Total swap = 0kB     déc. 11 15:35:01 hostname kernel: 783436 pages RAM     déc. 11 15:35:01 hostname kernel: 14777 pages reserved     déc. 11 15:35:01 hostname kernel: 557929 pages shared     déc. 11 15:35:01 hostname kernel: 739735 pages non-shared     déc. 11 15:35:01 hostname kernel: [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name     déc. 11 15:35:01 hostname kernel: [  152]     0   152   157732       79     284        0             0 systemd-journal     déc. 11 15:35:01 hostname kernel: [  184]     0   184     8115      317      19        0         -1000 systemd-udevd     déc. 11 15:35:01 hostname kernel: [  471]     0   471    82124      530      56        0             0 NetworkManager     déc. 11 15:35:01 hostname kernel: [  472]     0   472     6454       79      18        0             0 systemd-logind     déc. 11 15:35:01 hostname kernel: [  474]     0   474    20099      626      41        0             0 cupsd     déc. 11 15:35:01 hostname kernel: [  475]    81   475     4604      317      14        0          -900 dbus-daemon     déc. 11 15:35:01 hostname login[17681]: pam_unix(login:session): session opened for user username by LOGIN(uid=0)     déc. 11 15:35:01 hostname kernel: [  478]     0   478    47623      185      28        0             0 gdm     déc. 11 15:35:01 hostname kernel: [  491]     0   491    69089      264      38        0             0 gdm-simple-slav     déc. 11 15:35:01 hostname kernel: [  495]     0   495    52967    17799     112        0             0 Xorg     déc. 11 15:35:01 hostname kernel: [  496]     0   496    65758      934      32        0             0 accounts-daemon     déc. 11 15:35:01 hostname kernel: [  502]   102   502   126663     1810      46        0             0 polkitd     déc. 11 15:35:01 hostname kernel: [  504]     0   504    78582     1823      52        0             0 colord     déc. 11 15:35:01 hostname kernel: [  515]     0   515     7563      150      19        0             0 wpa_supplicant     déc. 11 15:35:01 hostname kernel: [  525]   120   525     7213      100      19        0             0 systemd     déc. 11 15:35:01 hostname kernel: [  527]   120   527    12666      255      29        0             0 (sd-pam)     déc. 11 15:35:01 hostname kernel: [  533]     0   533     2152       46      10        0             0 dhcpcd     déc. 11 15:35:01 hostname kernel: [  557]     0   557    56854      316      40        0             0 upowerd     déc. 11 15:35:01 hostname kernel: [  614]     0   614     2152       46      10        0             0 dhcpcd     déc. 11 15:35:01 hostname kernel: [  745]     0   745    98980     2352      64        0             0 gdm-session-wor     déc. 11 15:35:01 hostname kernel: [  748]  1000   748     7213       99      19        0             0 systemd     déc. 11 15:35:01 hostname kernel: [  749]  1000   749    12666      263      29        0             0 (sd-pam)     déc. 11 15:35:01 hostname kernel: [  752]  1000   752    91654     1159      41        0             0 gnome-keyring-d     déc. 11 15:35:01 hostname kernel: [  754]  1000   754   138634      493      99        0             0 gnome-session     déc. 11 15:35:01 hostname kernel: [  768]  1000   768     3976       38      13        0             0 dbus-launch     déc. 11 15:35:02 hostname kernel: [  769]  1000   769     4912      513      14        0             0 dbus-daemon     déc. 11 15:35:02 hostname kernel: [  772]  1000   772     3166       80      10        0             0 ssh-agent     déc. 11 15:35:02 hostname kernel: [  775]  1000   775    84370      678      33        0             0 at-spi-bus-laun     déc. 11 15:35:02 hostname systemd[1]: Starting Session 4 of user username.     déc. 11 15:35:02 hostname systemd-logind[472]: New session 4 of user username.     déc. 11 15:35:02 hostname systemd[1]: Started Session 4 of user username.     déc. 11 15:35:02 hostname login[17681]: LOGIN ON tty2 BY username     déc. 11 15:35:02 hostname kernel: [  779]  1000   779     4395      116      13        0             0 dbus-daemon     déc. 11 15:35:02 hostname kernel: [  782]  1000   782    31222      198      32        0             0 at-spi2-registr     déc. 11 15:35:02 hostname kernel: [  791]  1000   791   341490     2546     212        0             0 gnome-settings-     déc. 11 15:35:02 hostname kernel: [  803]  1000   803    50098      217      32        0             0 gvfsd     déc. 11 15:35:02 hostname kernel: [  809]  1000   809    93198      652      88        0             0 pulseaudio     déc. 11 15:35:02 hostname kernel: [  810]   133   810    42165       55      19        0             0 rtkit-daemon     déc. 11 15:35:02 hostname kernel: [  816]  1000   816    88701      219      39        0             0 gvfsd-fuse     déc. 11 15:35:02 hostname kernel: [  827]  1000   827    44128      285      21        0             0 dconf-service     déc. 11 15:35:02 hostname kernel: [  830]     0   830    88452      393      37        0             0 udisksd     déc. 11 15:35:02 hostname kernel: [  837]  1000   837   103711      438      97        0             0 gsd-printer     déc. 11 15:35:02 hostname kernel: [  846]  1000   846    17304      135      37        0             0 gconf-helper     déc. 11 15:35:02 hostname kernel: [  848]  1000   848    11426      202      27        0             0 gconfd-2     déc. 11 15:35:02 hostname kernel: [  850]  1000   850    89925     1001      40        0             0 ibus-daemon     déc. 11 15:35:02 hostname kernel: [  854]  1000   854    71274      207      40        0             0 ibus-dconf     déc. 11 15:35:02 hostname kernel: [  856]  1000   856    82143      550      89        0             0 ibus-x11     déc. 11 15:35:02 hostname kernel: [  865]  1000   865   490808    84757     496        0             0 gnome-shell     déc. 11 15:35:02 hostname kernel: [  873]  1000   873    52301      253      36        0             0 ibus-engine-sim     déc. 11 15:35:02 hostname kernel: [  886]  1000   886   122524     1764      70        0             0 gnome-shell-cal     déc. 11 15:35:02 hostname kernel: [  892]  1000   892   302273     2741     165        0             0 evolution-sourc     déc. 11 15:35:02 hostname kernel: [  895]  1000   895    95391      499      54        0             0 mission-control     déc. 11 15:35:02 hostname kernel: [  899]  1000   899   288823     8032     184        0             0 goa-daemon     déc. 11 15:35:03 hostname kernel: [  908]  1000   908    74163      402      43        0             0 gvfs-udisks2-vo     déc. 11 15:35:03 hostname kernel: [  913]  1000   913    52309      264      38        0             0 gvfs-goa-volume     déc. 11 15:35:03 hostname kernel: [  917]  1000   917    68304      236      34        0             0 gvfs-afc-volume     déc. 11 15:35:03 hostname kernel: [  922]  1000   922    49096      756      31        0             0 gvfs-gphoto2-vo     déc. 11 15:35:03 hostname kernel: [  926]  1000   926    46023      192      26        0             0 gvfs-mtp-volume     déc. 11 15:35:03 hostname kernel: [  928]  1000   928    27234      346      23        0             0 gvfsd-metadata     déc. 11 15:35:03 hostname kernel: [  969]  1000   969   393544    16251     221        0             0 evolution-calen     déc. 11 15:35:03 hostname kernel: [  970]  1000   970   121647     1552      99        0             0 zeitgeist-datah     déc. 11 15:35:03 hostname kernel: [  983]  1000   983   108204     2348      64        0             0 tracker-store     déc. 11 15:35:03 hostname kernel: [  989]  1000   989   134035     1425      84        0             0 tracker-miner-f     déc. 11 15:35:03 hostname kernel: [  994]  1000   994    89533      839      43        0             0 zeitgeist-daemo     déc. 11 15:35:04 hostname kernel: [  995]  1000   995   187376     2301     198        0             0 evolution-alarm     déc. 11 15:35:04 hostname kernel: [ 1093]  1000  1093   184129     1392     136        0             0 nm-applet     déc. 11 15:35:04 hostname kernel: [ 1100]  1000  1100    73740      286      45        0             0 telepathy-logge     déc. 11 15:35:04 hostname kernel: [ 1147]  1000  1147    68498      198      36        0             0 gvfsd-burn     déc. 11 15:35:04 hostname kernel: [ 1165]  1000  1165    12786      107      28        0             0 gnome-keyring-d     déc. 11 15:35:04 hostname kernel: [ 1389]  1000  1389   398982     8110     302        0             0 nautilus     déc. 11 15:35:04 hostname kernel: [ 1398]  1000  1398    88619      795      40        0             0 gvfsd-trash     déc. 11 15:35:04 hostname kernel: [ 1457]  1000  1457   203280    24474     225        0             0 lyx     déc. 11 15:35:04 hostname kernel: [ 1559]  1000  1559   183224     3012     149        0             0 gnome-terminal-     déc. 11 15:35:04 hostname kernel: [ 1562]  1000  1562     2092       30      10        0             0 gnome-pty-helpe     déc. 11 15:35:04 hostname kernel: [ 1563]  1000  1563    10912      634      25        0             0 zsh     déc. 11 15:35:04 hostname kernel: [ 1593]  1000  1593    57029     4140     110        0             0 gvim     déc. 11 15:35:04 hostname kernel: [ 2607]  1000  2607   102633      532      67        0             0 gvfsd-dav     déc. 11 15:35:04 hostname kernel: [ 3103]  1000  3103    10908      627      27        0             0 zsh     déc. 11 15:35:04 hostname kernel: [ 3148]  1000  3148   133807    31626     181        0             0 ipython2     déc. 11 15:35:04 hostname kernel: [ 3162]  1000  3162    98936     1056      60        0             0 gvfsd-http     déc. 11 15:35:04 hostname kernel: [ 3302]  1000  3302   107936      982      42        0             0 gvfsd-sftp     déc. 11 15:35:04 hostname kernel: [ 3308]  1000  3308     8996      212      21        0             0 ssh     déc. 11 15:35:04 hostname kernel: [ 5660]     2  5660    14912      126      31        0             0 dbus     déc. 11 15:35:04 hostname kernel: [ 8987]     0  8987     3653       42      11        0             0 rsync     déc. 11 15:35:04 hostname kernel: [ 9769]  1000  9769   511482    26442     351        0             0 chromium     déc. 11 15:35:05 hostname kernel: [ 9773]  1000  9773    93826     1522     144        0             0 chromium     déc. 11 15:35:05 hostname kernel: [ 9774]  1000  9774     1594       20       9        0             0 chrome-sandbox     déc. 11 15:35:05 hostname kernel: [ 9775]  1000  9775   104526     1647     158        0             0 chromium     déc. 11 15:35:05 hostname kernel: [ 9781]  1000  9781    42248      284      78        0             0 nacl_helper     déc. 11 15:35:05 hostname kernel: [ 9782]  1000  9782   159825     1664     139        0             0 chromium     déc. 11 15:35:05 hostname kernel: [ 9811]  1000  9811   329690    27929     379        0           300 chromium     déc. 11 15:35:05 hostname kernel: [ 9821]  1000  9821   321850    24448     515        0           300 chromium     déc. 11 15:35:05 hostname kernel: [ 9828]  1000  9828   305135     5463     199        0           300 chromium     déc. 11 15:35:05 hostname kernel: [ 9834]  1000  9834   305197     7785     219        0           300 chromium     déc. 11 15:35:05 hostname kernel: [13644]  1000 13644    11491      702      27        0             0 zsh     déc. 11 15:35:05 hostname kernel: [14978]  1000 14978   510597     4097     190        0             0 epiphany     déc. 11 15:35:05 hostname kernel: [15037]  1000 15037   490075     7884     183        0             0 WebKitWebProces     déc. 11 15:35:05 hostname kernel: [16463]  1000 16463   606648   342911     976        0             0 python2     déc. 11 15:35:05 hostname kernel: [17520]  1000 17520   307237     7027     213        0           300 chromium     déc. 11 15:35:05 hostname kernel: [17570]  1000 17570   308086     8086     216        0           300 chromium     déc. 11 15:35:05 hostname kernel: [17577]  1000 17577   308518     7981     210        0           300 chromium     déc. 11 15:35:05 hostname kernel: [17665]     0 17665    15239      114      36        0             0 login     déc. 11 15:35:05 hostname kernel: Out of memory: Kill process 16463 (python2) score 447 or sacrifice child     déc. 11 15:35:05 hostname kernel: Killed process 16463 (python2) total-vm:2426592kB, anon-rss:1366496kB, file-rss:5148kB


title: Lock CD/DVD drive (prevent eject)

text: On my laptop the eject button for the CD/DVD drive is placed in a very unfortunate position and I hit it a dozen times per day and the tray pops out. I found many solutions which seemed to work for other people: From `man eject`: > -i on | 1 | off | 0 > > This option controls locking of the hardware eject button. When enabled, the > drive will not be ejected when the button is pressed. This is useful when > you are carrying a laptop in a bag or case and don't want it to eject if the > button is inadvertently pressed. This seems to be exactly what I need. `eject -i on` successfully returns:               CD-Drive may NOT be ejected with device button      However, hitting the device button still ejects the drive. As suggested in another answer invoking               echo 1 > /proc/sys/dev/cdrom/lock      did not help either, `lock` already contains 1. The information from `/proc/sys/dev/cdrom/info` suggests that locking is possible:               drive name:            sr0     drive speed:           24     drive # of slots:      1     Can close tray:        1     Can open tray:         1     Can lock tray:         1     Can change speed:      1     Can select disk:       0     Can read multisession: 1     Can read MCN:          1     Reports media changed: 1      The cdctl tool is not in the Debian repository and it does not build on my system. How do I lock my drive so that hitting the hardware switch on the drive would no pop out the drive?


title: How to setup a growable loopback device?

text: I know I can create and use a loopback device like this:               # Create the file     truncate disk.img --size 2G     # Create a filesystem     mkfs.ext4 disk.img     # Mount to use     mount disk.img /mnt     # Clean up     umount /mnt      However in this case the disk image is fixed at 2GB. It's 2GB when it's empty, and it's 2GB when it's full. It will not grow. Is there a kind of loopback device that can grow in size? Or, is there a kind of loopback device that only needs as much space that it stores?


title: Ido mode and recently opened files

text: I recently switched to `ido-mode` in emacs. When I run `C-x C-f` (`ido-find-file`) pressing `M-r` to do a regex search in the recently used files doesn't work any more. Is there a way to enable this regex search for recently used files in `ido- mode`, too?


title: Does Linux unmount the root partition when the partition is about 80% full?

text: **Summary** Linux seems to be unmounting the root partition, `/dev/sda6`. I noticed that `sda6` is about 80% full. Does Linux unmount this root partition when it gets 80% full, to stop you adding more files? The unmounted `/dev/sda6` seems to be preventing me from accessing `/media/sda7`, where I have many video files. The output below shows "/dev/sda7 /media/sda7" as unmounted. However, SOMETIMES "mount" does show it to be mounted (but /dev/sda6 as unmounted). Could you suggest a fix please? My system is Knoppix on hard disc (effectively Debian). **Full Details** Following shows `/etc/fstab` and `mount` command output.               $ cat /etc/fstab       \# DEFAULT BASE FSTAB, UNCONFIGURED       proc       /proc         proc       noauto             0 0       sysfs      /sys          sysfs      noauto             0 0       /dev/sda6 / reiserfs relatime 0 0       /dev/sda5 none swap defaults 0 0       \# Added by KNOPPIX          noauto,users,exec 0 0       \# Added by KNOPPIX       /dev/sda7 /media/sda7 reiserfs noauto,users,exec 0 0       \# Added by KNOPPIX       /dev/sr0 /media/sr0 auto noauto,users,exec 0 0       \# Added by KNOPPIX       /dev/sda3 /media/sda3 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppix 0     0       \# Added by KNOPPIX       /dev/sda2 /media/sda2 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppix 0     0       \# Added by KNOPPIX       /dev/sda1 /media/sda1 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppix 0     0            $ mount       /dev/root on / type reiserfs (rw,relatime)       proc on /proc type proc (rw,relatime)       sysfs on /sys type sysfs (rw,relatime)       usbfs on /proc/bus/usb type usbfs (rw,relatime)       tmpfs on /tmp type tmpfs (rw,relatime,size=2097152k)       udev on /dev type tmpfs (rw,relatime,size=20480k)       tmpfs on /dev/shm type tmpfs (rw,relatime,size=2097152k)       devpts on /dev/pts type devpts (rw,relatime,mode=1777)       ramfs on /mnt/JG-ramdisc type ramfs (rw,relatime)


title: Limit FTP access only to /var/www/ and no other directories

text: I have listed a few users on `vsftpd.chroot_list`. I want them to have access to only `/var/www/` and **not** any other directories. I believe, I made necessary changes on the `vsftpd.conf` file. But these users are able to access other directories as well. My `/etc/vsftpd.conf` file has the following entries:               #     # Customization     #     # Some of vsftpd's settings don't fit the filesystem layout by     # default.     #     # This option should be the name of a directory which is empty.  Also, the     # directory should not be writable by the ftp user. This directory is used     # as a secure chroot() jail at times vsftpd does not require filesystem     # access.     secure_chroot_dir=/var/run/vsftpd/empty     #     # This string is the name of the PAM service vsftpd will use.     pam_service_name=vsftpd     #     # This option specifies the location of the RSA certificate to use for SSL     # encrypted connections.     rsa_cert_file=/etc/ssl/private/vsftpd.pem          ##########New Lines#######     user_config_dir=/etc/vsftpd/users     passwd_chroot_enable=YES


title: How to run PC-BSD iso from GRUB with only Linux installed

text: I'm working on Ubuntu, and I wanted to try BSD. I downloaded a PC-BSD iso (PCBSD9.2-RELEASE-x64-DVD-USB-latest.iso). I wanted to know if it is possible to use "loopback" to run that image even if I have no BSD kernel installed. Here is my `40_custom`:               #!/bin/sh          exec tail -n +3 $0          # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.          menuentry "PCBSD" {                insmod loopback                echo Loadind...                set isofile="/PCBSD.iso"                loopback loop (hd0,2)$isofile     } But it doesn't work.


title: BASH_ALIASES not equal to alias

text: I've just recognized that (in Debian 7, within Bash 4.2.37) the output of `BASH_ALIASES` isn't equal to that of `alias` - which, according to gnu.org's Bash Manual, should be the case: > `BASH_ALIASES` > > An associative array variable whose members correspond to the internal list > of aliases as maintained by the alias builtin. (see Bourne Shell Builtins). > Elements added to this array appear in the alias list; unsetting array > elements cause aliases to be removed from the alias list. I get `ls='ls --color=auto'` for `alias` but an empty line for `BASH_ALIASES`. ## Question: _Should it be that way? Could this cause any problems in the future_? As I am just curious and battling with all the options for each command causing me enough headache so I really keep quite a distance from making things even more complicated with homebrew aliases, I wonder if this could be a source of trouble in the near future…


title: Octave - warning: unable to open X11 DISPLAY

text: My setup is as follows: Octave 3.6.4 Mac OS X Mavericks 2009 Macbook Pro I'm trying to run Octave in Terminal, with gnuplot. I'm trying to plot matrices in a graph, as part of an online Coursera Machine Learning course. I'm getting the following error when opening Octave in Terminal: `warning: unable to open X11 DISPLAY` I've opened XQuartz, I've set display using `export DISPLAY=:0.0`. After extensive searching, I thought the problem might be that the X server wasn't running. I've tried using the command `startx`, although it just hangs on `waiting for X server to begin accepting connections`.. and eventually gives up. I'm lost - any ideas?


title: Run a GUI OS via a hypervisor from a Linux server terminal?

text: Is there a way to run a VM hypervisor, such as VirtualBox directly, from say, CentOS? Let's suppose that I want a high-efficiency server, but it can host guests with GUI-enabled OS's. Additionally, this can be booted directly via a terminal in a non GUI-enabled Linux distro?


title: Service httpd is failing to start - fcgid can't create shared memory

text: I'm not sure why, but when I try to start the httpd service, it will not start. Server config:               OS: CentOS 5.10     PHP: 5.5.7     Apache: 2.2.3        1. I built mod_fcgid from source, put it into the /etc/httpd/modules directory.    2. I appended `LoadModule fcgid_module modules/mod_fcgid.so` to the list of modules   3. I commented out `LoadModule cgi_module modules/mod_cgi.so` since I will not need it.   4. I created a wrapper script for php and placed it into /var/www/cgi-bin:   5. I created a handler for PHP that points to the wrapper.   6. Then I try to start the httpd service The following is the error that I get in /var/log/httpd/error_log:               [Mon Dec 16 12:18:26 2013] [notice] SELinux policy enabled; httpd running as context user_u:system_r:httpd_t:s0     [Mon Dec 16 12:18:26 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Mon Dec 16 12:18:26 2013] [notice] SSL FIPS mode disabled     [Mon Dec 16 12:18:26 2013] [notice] Digest: generating secret for digest authentication ...     [Mon Dec 16 12:18:26 2013] [notice] Digest: done     [Mon Dec 16 12:18:26 2013] [emerg] (17)File exists: mod_fcgid: Can't create shared memory for size 1200712 bytes      I'm not sure if this is a permissions issue, or something with SELinux perhaps - or maybe suEXEC? I would appreciate any guidance, since I'm not even sure where to start searching.


title: Having Cheese automatically take a pic and quit

text: I use Cheese as my webcam software. I am trying to figure out a way to have it :   * Start   * Click a pic   * Exit when a script is executed. The script should not be asking for permissions and there shouldn't be any interruptions. So far,               #!/bin/bash      cheese      I could only get it to do step 1. How do I do steps 2 and 3? The doc files don't mention an such option and I don't want to change the source code. (I don't mind camorama either)


title: Cylon-Linux: is there a Spanish locale?

text: I would like to know if it is possible to install the Spanish language. Being a derivative of Ubuntu, it is installed the same way, but even assigning language and local time during installation, only the English language option appears to me to run the system. I tried enabling it from system configuration and from the terminal, but I can not do so. Is it becasue the distro does not support it, or because it is not in their repositories? Or, is it possible to use Ubuntu repositories or Debian to enable Spanish?


title: Why "sshd Bad prime description" errors?

text: I've noticed that all our FreeBSD machines throw sshd Bad prime description in line xxx (insert a large number of values for xxx). Presumably this is not something they are all supposed to be doing (despite the fact that there's no visible problems with functionality). Unfortunately, I've not been able to find any useful resources on the web that relate to this problem. Any pointers for troubleshooting/making this obnoxious message go away?


title: Make Linux load specific driver for given device (Realtek NIC)

text: This is a driver issue on a vintage machine (AMD K8, Nvidia chipset) running Linux 3.11 (Mint distro, but I don't think it matters).               claudius ~ # uname -a     Linux claudius 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     claudius ~ # lspci     00:00.0 Host bridge: NVIDIA Corporation nForce3 250Gb Host Bridge (rev a1)     00:01.0 ISA bridge: NVIDIA Corporation nForce3 250Gb LPC Bridge (rev a2)     00:01.1 SMBus: NVIDIA Corporation nForce 250Gb PCI System Management (rev a1)     00:02.0 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)     00:02.1 USB controller: NVIDIA Corporation CK8S USB Controller (rev a1)     00:02.2 USB controller: NVIDIA Corporation nForce3 EHCI USB 2.0 Controller (rev a2)     00:05.0 Bridge: NVIDIA Corporation CK8S Ethernet Controller (rev a2)     00:08.0 IDE interface: NVIDIA Corporation CK8S Parallel ATA Controller (v2.5) (rev a2)     00:0a.0 IDE interface: NVIDIA Corporation nForce3 Serial ATA Controller (rev a2)     00:0b.0 PCI bridge: NVIDIA Corporation nForce3 250Gb AGP Host to PCI Bridge (rev a2)     00:0e.0 PCI bridge: NVIDIA Corporation nForce3 250Gb PCI-to-PCI Bridge (rev a2)     00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration     00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Address Map     00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] DRAM Controller     00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] K8 [Athlon64/Opteron] Miscellaneous Control     01:00.0 VGA compatible controller: NVIDIA Corporation NV34 [GeForce FX 5200] (rev a1)     02:05.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller (rev 10)      I want the kernel to load an alternative driver for my Realtek 8169 PCI ethernet card, which you can see it at the end of the list as `02:05.0`. Here's the detail:               claudius ~ # lspci -s 02:05.0 -vv -nn     02:05.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8169 PCI Gigabit Ethernet Controller [10ec:8169] (rev 10)         Subsystem: Realtek Semiconductor Co., Ltd. RTL8169/8110 Family PCI Gigabit Ethernet NIC [10ec:8169]         Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-         Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Interrupt: pin A routed to IRQ 19         Region 0: I/O ports at e800 [size=256]         Region 1: Memory at febffc00 (32-bit, non-prefetchable) [size=256]         Expansion ROM at febc0000 [disabled] [size=128K]         Capabilities: [dc] Power Management version 2             Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-      The issue is that the `r8169` simply doesn't work. It may even make Linux crash. I blacklisted it in `/etc/modprobe.d/`. The solution seems to be using the `r8168` driver instead. (There's also a related question on this site.) You can download the source from Realtek, compile and install it, which I did. If you `modprobe r8168`, it loads fine but doesn't associate with the hardware, so the card doesn't show up in `ifconfig`. I think this has to do with the `modalias` (encodes the hardware info) and the device/driver mapping in `/lib/modules/*/modules.alias`.               claudius ~ # cat /sys/devices/pci0000\:00/0000\:00\:0e.0/0000\:02\:05.0/modalias      pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00      This is my card. Here's the Realtek driver mappings in the system:               claudius ~ # grep r816 /lib/modules/3.11.0-12-generic/modules.alias     alias pci:v00001186d00004300sv00001186sd00004C00bc*sc*i* r8169     alias pci:v000010ECd00008169sv*sd*bc*sc*i* r8169     alias pci:v000010ECd00008167sv*sd*bc*sc*i* r8169     alias pci:v00001186d00004300sv00001186sd00004B10bc*sc*i* r8168     alias pci:v000010ECd00008168sv*sd*bc*sc*i* r8168      I tried adding this line to the end of the file (knowing that you're not supposed to make manual edits):               alias pci:v000010ECd00008169sv000010ECsd00008169bc02sc00i00 r8168      Then unloaded and reloaded `r8168` but that doesn't configure the card and there's nothing in `dmesg`. What's the proper way to map my NIC to the `r8168` driver? Do I have to rebuild the driver so it claims it can handle my card? Or is there some config data I have to add in the proper place?


AIX 'rm' command has no '-v' parameter for verbose output as stated by IBM's documentation. Normally I would run (in linux)               rm -rfv <myfile>      to (r)ecursively and (f)orcably delete files and get the verbose output. Since I can only run in AIX:               rm -rf <myfile>      How can I get the verbose output echoed into the terminal?


title: Automatically load a user function at startup with awk?

text: I guess this answer from awk separator preferences already gives a hint, but I thought I'd ask explicitly: Is there an equivalent to a `.bashrc` file for `awk`, where I could define my own library functions, which would be automatically (pre)loaded at every call to `awk` - and without using `-f` or `@include` at the command line?


title: telnet: "No environment-specified terminal type."

text: If I batch SSH this command:               echo close | /usr/bin/telnet IPADDRESS 657      Then I get this output:               No environment-specified terminal type.      but why? The OS FROM I'm SSHing is a Linux, and the OS where I'm SSHing TO is AIX.


title: How to get to recovery mode if grub screen does not appear?

text: I cannot login my Ubuntu12.04 (which is VM running on OSX using VMWARE FUSION 6) because I have changed permission of `/tmp` for some purpose before rebooting the machine. Thus I tried to boot Ubuntu in recovery mode by pressing `shift` key while booting the machine (in order to change the permission of `/tmp`), but it was not possible because no grub screen appears while booting. How can I get into recovery mode if grub does not appear?


title: Run program with environment set to variables in a file

text: I would like to run a program (in this case Python) with only the environment variables defined in a file, say `vars.env`:               FOO=bar     X=12      Here's a simply Python script that prints the environment:               import os     print os.environ      If I run `env -i python script.py`, os.environ is empty as expected. Likewise, if I run               $ env -i FOO=bar X=12 python env.py      I get               env: {'X': '12', 'FOO': 'bar'}      However what I would like to do is load the environment from my `vars.env` file when running the script. How can I accomplish this? EDIT: One thing that I could do is cat this env file, like `env -i `cat vars.env` python env.py` but I would prefer to be able to source it in some way.


title: What are the repositories for downloading Xplico?

text: I have been trying to download Xplico for my Kali Linux from the following repository:               deb http://repo.xplico.org/ $(lsb_release -s -c) main      even though this repository is displayed on their official website this doesn't seem to work at all.


title: Random named file in home directory, possibly hacked?

text: I am running Fedora 20, and today I found a file that looks highly suspicious in my home directory. The name of the file appears to be a base64 encoded string, but doesn't decode to anything meaningful: `n5LJFcZz+8slfpALAFzHk8msAh9vsDCiYwKvzw8uAirPE00Jq9HqTSvlT9ChhjZtA==` The contents of the file are here: http://pastebin.com/6Ba6zZem Any idea on what I am looking at? I am going to run rkhunter on my machine, is there anything else I should do? update: The file is owned by my username, which is the only user on this machine: `$ stat n5LJFcZz+8slfpALAFzHk8msAh9vsDCiYwKvzw8uAirPE00Jq9HqTSvlT9ChhjZtA== File: ‘n5LJFcZz+8slfpALAFzHk8msAh9vsDCiYwKvzw8uAirPE00Jq9HqTSvlT9ChhjZtA==’ Size: 888 Blocks: 8 IO Block: 4096 regular file Device: fd05h/64773d Inode: 3021277 Links: 1 Access: (0664/-rw-rw-r--) Uid: ( 1000/mvandemar) Gid: ( 1000/mvandemar) Context: unconfined_u:object_r:user_home_t:s0 Access: 2014-07-23 12:51:37.316782678 -0400 Modify: 2014-05-28 18:25:21.362568805 -0400 Change: 2014-05-28 18:25:21.364568810 -0400 Birth: -` I have no idea what I was doing 2 months ago at that time. `lsof` had no output at all. `sshd` is not running on my machine (nor do I see any ssh logins via last), although I do see this command via htop: `/usr/bin/ssh-agent /bin/sh -c exec -l /bin/bash -c "cinnamon-session- cinnamon"` Not sure what else I should look for.