title: Set wi-fi power saving polling interval on Linux, is it possible?

text: `man iwconfig` states:                  power  Used to manipulate power management scheme parameters and mode.               To set the period between wake ups, enter period `value'. [...]               Examples :                    iwconfig eth0 power period 2                    iwconfig eth0 power 500m unicast                    iwconfig eth0 power timeout 300u all                    iwconfig eth0 power saving 3                    iwconfig eth0 power off                    iwconfig eth0 power min period 2 power max period 4      It happens that at least with my three wireless cards (a _Ralink_ and two _Atheros_ ) none of those commands work, except for `iwconfig {interface} power {on|off}`. The rest of them always return:               Error for wireless request "Set Power Management" (8B2C) :         invalid argument "{whatever I wrote}".      On the other side, `iw help` only reveals these options:                   dev <devname> set power_save <on|off>                 Set power save state to on or off.              dev <devname> get power_save <param>                 Retrieve power save state.      Is it possible to set the polling interval for wireless power saving on Linux? In case it's possible, how to?


title: Detecting the device of a crypto mount

text: I have an external eSATA-hdd on an OpenSUSE 12.2 system. The external hdd has an LVM on a dm-crypt partition. I mount it by powering it up and then doing               rescan-scsi-bus.sh     cryptsetup -v luksOpen     vgchange -ay     mount      Now when I want to power the hdd down, I do                umount      vgchange -an extern-1      cryptsetup -v remove /dev/mapper/extern-1-crypt      echo 1 >/sys/block/sdf/device/delete      Here the device (`sdf`) is currently hardcoded in the script. Can I somehow deduce it in the script from the VG or the crypto device?


title: "ls -lh" reports total size less than sum of individual sizes

text: Under what circumstances would `ls -lh` show a total that is less than the sum of the individual files? For example:               $ ls -lh /var/lib/nova/instances/_base     total 100G     -rw-rw-r-- 1 nova         nova 4.3M 2012-02-14 14:07 00000001     -rw-rw-r-- 1 nova         nova 5.7M 2012-02-14 14:07 00000002     -rw-rw-r-- 1 nova         nova  42G 2012-03-08 15:24 1574bddb75c78a6fd2251d61e2993b5146201319.part     -rw-rw-r-- 1 libvirt-qemu kvm   24M 2012-02-14 14:07 77de68daecd823babbb58edb1c8e14d7106e83bb_sm     -rw-r--r-- 1 libvirt-qemu kvm   65G 2012-03-02 12:43 bd307a3ec329e10a2cff8fb87480823da114f8f4     -rw-rw-r-- 1 libvirt-qemu kvm  160G 2012-02-24 16:06 ephemeral_0_160_None     -rw-rw-r-- 1 libvirt-qemu kvm   80G 2012-02-24 22:38 ephemeral_0_80_None     -rw-r--r-- 1 libvirt-qemu kvm   10G 2012-02-24 22:37 fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f     -rw-r--r-- 1 libvirt-qemu kvm   10G 2012-02-24 11:09 fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f_sm      Edit: now showing some extra flags are per request in comment:               $ ls -aiFlh  /var/lib/nova/instances/_base/     total 143G     29884440 drwxrwxr-x 2 nova         nova 4.0K 2012-03-08 15:45 ./     29884427 drwxr-xr-x 6 nova         nova 4.0K 2012-03-08 15:05 ../     29884444 -rw-rw-r-- 1 nova         nova 4.3M 2012-02-14 14:07 00000001     29884445 -rw-rw-r-- 1 nova         nova 5.7M 2012-02-14 14:07 00000002     29884468 -rw-r--r-- 1 nova         nova  65G 2012-03-08 15:59 1574bddb75c78a6fd2251d61e2993b5146201319.converted     29884466 -rw-rw-r-- 1 nova         nova  58G 2012-03-08 15:35 1574bddb75c78a6fd2251d61e2993b5146201319.part     29884446 -rw-rw-r-- 1 libvirt-qemu kvm   24M 2012-02-14 14:07 77de68daecd823babbb58edb1c8e14d7106e83bb_sm     29884467 -rw-r--r-- 1 libvirt-qemu kvm   65G 2012-03-02 12:43 bd307a3ec329e10a2cff8fb87480823da114f8f4     29884443 -rw-rw-r-- 1 libvirt-qemu kvm  160G 2012-02-24 16:06 ephemeral_0_160_None     29884442 -rw-rw-r-- 1 libvirt-qemu kvm   80G 2012-02-24 22:38 ephemeral_0_80_None     29884447 -rw-r--r-- 1 libvirt-qemu kvm   10G 2012-02-24 22:37 fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f     29884441 -rw-r--r-- 1 libvirt-qemu kvm   10G 2012-02-24 11:09 fe5dbbcea5ce7e2988b8c69bcfdfde8904aabc1f_sm


title: Listing packages in Yum that depend on another installed package

text: I am trying to install a 3rd-party RPM package on RHEL5 which depends on version 3.4 of sqlite. According to Yum I already have 3.3.6 installed. Is there a way to list the installed packages that depend on sqlite 3.3.6?


title: Install dwb browser

text: I try to install dwb on debian wheezy. There is a package but the version is old and I would like a newer version. The version in wheezy does not provide dwbem, suddenly I can not install flaskblock and therefore I can not run grooveshark. I tried to install via backport:               sudo apt-get install -t wheezy-backports dwb      But the version is the same as wheezy. Finally I tried to compile the source but it does not work, dependency problem:               git clone https://portix@bitbucket.org/portix/dwb.git     cd dwb     sudo make install     config.mk:106: *** Cannot find gtk2-libs or gtk3-libs. Arrêt.      Yet I have installed the header like libgtk2.0-dev. I also tried to install the meta package:               sudo apt-get install gtk+2.0      If someone has an idea for me to install a newer version of dwb on wheezy I'm interested.


title: Hardware Timestamping using PTP

text: I'm new to Linux programming. I have an Intel NIC with e1000e driver. I'm working on accurate time stamping of packets being captured from a network.   1. My question is if I want to use RT Linux how can I increase the priority of the time stamping thread. Is this possible?   2. I read about how to work with PTP IEEE 1588. My Intel NIC is capable of hardware timestamping. Thing is I'm not sure it would work in my setup. I have a Transmitter ( which is a micro-controller from mbed with no OS). Then I have a receiver which is a normal Linux machine with an Intel NIC and e1000e. I can only get the packets to be hardware time stamped at the receiver when the transmitter could build packets with PTP. But I think my micro-controller API's do not have that support for PTP. Can I still hardware time stamp the packets?


title: Is there some default password for a new user in Linux

text: I am a Windows user gradually moving towards Linux. In windows we have an option of either having or not having some password for an user.Once we do not put a password we can directly log in to the system.However in Linux this is not possible for every user must have a password.Even if one does not give a password not typing anything and simple pressing return key doesn't log one in(Unlike Windows).Is there some default password set for every user or any other mechanism by means of which a password is always assigned?


title: Solaris service status and dependencies

text: I'm creating service manifests for MySQL and a WebLogic service that depends on the MySQL service. I want all of them to use the management model "wait" (run a process in the foreground). I have some questions about this setup. First, how do I dictate the status of a service? For example, when I created MySQL scripts prior to using services, after launching the `mysqld_safe` script in the background, I would ping it until I got a response; I wanted to make sure it was ready before continuing. Now with the service, it immediately goes to "online" even though I'm not sure if it's actually ready or not. In the case that there is no good solution for that question, I put the MySQL DB pinging in the WebLogic script itself, and the exit with a status of 1 after a certain number of attempts. However, the service will continually restart. How do I force the service to go into maintenance mode after a non- zero exit? Finally, I got the dependencies working in so far as that the WebLogic service won't start without the MySQL service being online, but I have two questions regarding this:   1. How do I make the WebLogic service attempt to start the MySQL service when it is down?   2. When the WebLogic service is already online, how do I make it so that it is taken down if the MySQL service ever goes down?


title: Connecting various process attributes reported by top, ps, /proc/pid/statm, /proc/pid/status, /proc/pid/smaps

text: Here are some of the common attributes I figured out: top(VIRT) , smem(VSS), /proc/pid/statm (1st entry in pages), /proc/pid/status (VmSize), ps(VSZ) top(RES) , smem(RSS), /proc/pid/statm (2nd entry in pages), /proc/pid/status (VmRSS), add all Rss: values in /proc/pid/smaps process mappings, add all Private_.* + Shared_.* values in /proc/pid/smaps process mappings, ps(RSS) top(DATA) , **not reported by smem** , /proc/pid/statm (6th entry in pages), /proc/pid/status (VmData), **not reported by ps** top(CODE) , **not reported by smem** , /proc/pid/statm (4th entry in pages), **not reported by /proc/pid/status** , **not reported by ps** top(SHR) , **not reported by smem** , /proc/pid/statm (3rd entry in pages), **not reported by /proc/pid/status** , **not reported by ps** smem(USS), add all Private_.* values in /proc/pid/smaps process mappings smem(PSS), add all Pss: values in /proc/pid/smaps process mappings smem(Swap), add all Swap: values in /proc/pid/smaps process mappings top(SWAP) = top(VIRT) - top(RES) **Question:** Are there any other relations (as mentioned above) present that I have missed above? Can you share?


title: Which process/program create/write the file which I/O is redirected to?

text: When learning SELinux, I executed `semanage fcontext -l > fcontext.txt` under `/root` directory to dump massive fcontext information to a file. The funny result is: `fcontext.txt` was created, but the size of it is 0. I asked in **#fedora-selinux** IRC channel, a Fedora QA told me try change the type of SELinux context of `fcontext.txt` to `semanage_tmp_t`. It works finally. But what still confusing me is: Which process/program create/write the standard output to the redirected file ? (so that SELinux targetd policy should applied to that process/program)   * The bash shell ? `/bin/bash`   * or semanage (it's a python script) ? `/usr/sbin/semanage`   * or the interpreter - python ? `/usr/bin/python` I thought it should be the bash shell, because I/O redirection is controlled by shell (right?), not the program itself. so semanage/python didn't create the file directly.


title: "globbing" (*) comes from "global command"... Huh?

text: According to legend, in the early days what we now call "globbing" (i.e. using expressions like e.g. `*.c`, `./*.p?`) was supported by one certain program `/etc/glob`, whose name in turn derived from "global command"... I don't know about you, but for me, learning that "glob", "globbing", etc. comes from "global command" is about as illuminating as learning that it came from "globothymic pylotensity"... What on earth is a "global command"?


title: Detecting SSH timeout

text: Is there any way I could trigger a bash script when ssh times out? I have an alias to set the tmux title when starting ssh. The alias also includes a title change _after_ the ssh session, which works if I do a clean exit, but if the session times out, the rest of the alias doesn't run.


title: Linux - LXC; deploying images with tiniest possible X11

text: is it currently possible to setup LXC containers with X11 capabilities? I'm looking forward for the lightest available X11 container (memory-wise), hardware acceleration a plus but not essential. If it is not currently possible, or readily available, is it known what functionality needs to be yet implemented in order to support it?


title: Cannot boot from usb

text: I bought a new computer (Samsung NP900X4D) which came with Windows 8. I want to install linux (Mint 14) but the computer lacks any optical drives, and so the only option (I'm aware of) is using a bootable usb. I created it using UNetbootin from the ISO I downloaded from the official web site and I changed the priority of the boot. The usb is not being recognized and so the windows loader starts up. I tried to install mint from within windows which seemed ok, but once I rebooted I received an error when booting from mint. I tried to remove the installation and try again but now I can't even load windows and I get an error message with only the option to go back to the UEFI firmware settings. I tried different usb sticks, on different ports but to no avail, it's always being unrecognized. I tried to use the stick on a different computer and it recognized the stick and loaded the installation, so it's not a problem with the stick. Also, I'm pretty sure that the first time I tried the stick was recognized, and when I booted through it and selected to run mint it just got stuck, and then I rebooted and the stick is ignored ever since. Any ideas?


title: Monitoring script started by rc.local

text: We have a C program which is started using `rc.local`´. We added a line like this:               /usr/local/bin/pc       to the `rc.local` file. `pc` is a compiled C program. Everything is working fine at the moment. What we are worrying about is `pc` crashing. If it does, is there any way to monitor that and restart the program automatically?


title: Change default Encoding in Terminator

text: The Title stays pretty much for itself. Tried to figure it out myself but I can´t find a config-setting nor a option in the Preferences for the Encoding. Does anybody know how to change the default Encoding in Terminator?


title: dhcpcd can't startup at boot

text: when I run `dhcpcd` after boot everything works fine but when I try to add it to auto start `systemctl enable dhcpcd@eth0.service`, after each boot it's inactive               dhcpcd@eth0.service       loaded inactive dead      start dhcpcd on eth0


title: Linux: Does find | xargs grep have limitations?

text: I've historically performed something like:               find . 2>/dev/null | xargs grep -i something_to_find 2>/dev/null      If my `pwd` is barfoo (`/foo/bar/baz/foofoo/foobar/foobaz/barfoo`) it finds matches. However, if I `cd` to `/foo`, it no longer finds the matches. * * * Conditions:   * permissions are all 775   * the directories are not symbolic links   * they are all on the same file system / server * * * So I'm curious if there is a default `-maxdepth` that is applied to find, or are there other constraints as to why this would not work? * * * ### Additional Info: Some great comments have been posted. Here is some additional info:   * this is for GNU, not POSIX   * `find --version` : GNU find version 4.2.27   * `grep --version` : (GNU grep) 2.5.1   * `xargs --version` : GNU xargs version 4.2.27   * removing the redirection of STDERR has no bearing on the result, or lack thereof   * the path to the files in `barfoo` (known to work) do not have spaces, however files in other directories in `/foo/bar` may have spaces; though, I don't see how that would be problematic   * I realize I wasn't specific on the path, but these are all well-named directories, not to be confused with any devices ### Interesting Finding: The first doesn't work, but the second does:   1. `find . -type f | xargs grep -i something_to_find`   2. `find . -type f -name "*.ext" | xargs grep -i something_to_find` Even odder is that `-name "*.*"` does not work, the file extension has to be given; which could be problematic when searching for something. I'm wondering if there is termination after a max error count, or maximum buffer size. I know there are a lot of files in these directories, but the fact it works when specifying the filetype (limiting results) is interesting.


title: Nginx strangely started to redirect a default location

text: I have setup and known to work some sites on my server. One of these sites using https connection hence it uses following server configuration:               server {             server_name ceremcem.net www.ceremcem.net;              listen 80;                   rewrite ^ https://$server_name$request_uri? permanent;              #return 301 https://$host$request_uri;     }      It redirects all http connections to https. Everything was working correctly till some days ago. Now all sites I have have been forwarding to https://ceremcem.net. I have deleted this configuration file, reloaded nginx but problem still exists. All sites in this server are forced to use https connection, and redirect to ceremcem.net. There is no such redirection in none of the files:               root@server:/etc/nginx/sites-enabled# grep https *     root@server:/etc/nginx/sites-enabled#       How can I debug the problem?               root@server:/etc/nginx/sites-enabled# nginx -v     nginx version: nginx/1.6.0     root@server:/etc/nginx/sites-enabled# uname -a     Linux server.aktos-elektronik.com 3.13-1-amd64 #1 SMP Debian 3.13.10-1 (2014-04-15) x86_64 GNU/Linux


title: How to install CentOS 6.4 on Mac Mini?

text: I have bought a new Mac Mini, and would like to use it as a Linux server. Now I'm trying to install CentOS on it. I downloaded `CentOS-6.4-x86_64-netinstall.iso` and booted the Mac Mini from a USB-stick. But during the installation process I get these errors:               dmar: No ASTR found     IOAPIC id 0 under DRHD base 0xfed9100     HPET id 0 under DRHD base 0xfed91000     Enabled IRQ remapping in x2apic mode     Enabling x2apic     Enabled x2apic     Setting APIC routing to cluster x2apic     Kernel panic - not syncing: No mapping iommu for ioapic 2          Pid: 1, comm: swapper Not tainted 2.6.32-358.el6.x86_64 #1     Call Trace:     ...      Any suggestions what the problem is? Do I need a different binary to be able to run on an Mac? According to a tweet, CentOS 6.4 seem to work, at least on older, Mac Mini's: https://twitter.com/courtneycotton/statuses/312267424605036544 * * * **UPDATE** : the suggestion of adding `noapic` to the boot took me further in the installation process. Now I had to select an installation medium. The choice is `CD/DVD, Hard drive, NFS directory or URL`, and I have a _USB-stick_ , so I choose _Hard drive_. Then I'm supposed to choose a partition that holds the installation image for CentOS, the choice is between `/dev/sda1`, `/dev/sda2`, `/dev/sda3` or `/dev/sdb1`. Here I have really no idea what name my _USB-stick_ has. I have tried with them all, but if I choose e.g. `/dev/sdb1` I later get the message: > The installation source given by device ['/dev/sdb1'] could not be found. > Please check your parameters and try again. I put my iso file on the USB-stick by following the Ubuntu instructions. Any suggestion on how to go further in the installation process?


title: Edit mp3 tags remotely from Windows

text: I have a Windows desktop at home. My mp3's are on a dedicated Debian server. How do I edit the mp3 tags on the Linux server from my windows PC with a GUI software? Is there a GUI software that can connect to Linux and only edit the mp3 tags. I do not want to download the entire mp3 files and then re-upload it. There thousands of mp3s on the server.


title: Processes do not respond to my signals

text: I have a strange behavior on my system. When I invoke a command in the shell (bash version 4.2.45(1)-release), say `top` or `cat`, the running program (the process) does not respond to `Ctrl`+`C`. I even tried to run `kill -2 <pid>` and `kill -15 <pid>`, but it didn't help. However, I can kill processes with `SIGKILL`. I own the process, I even tried to send a signal to the process (signals 2 and 15) as root but it did not respond. I can quit `top` if I press `q`. Any ideas about the problem? Or any hint to troubleshoot it? **UPDATE 1** `cat` and `top` were just examples. All processes have the same behavior. I tried to write a simple program to sleep only (without signal handler) and I had the same behavior. **UPDATE 2** I wrote a small program to sleep only. This time I installed signal handler to catch `SIGTERM` and `SIGINT`. When I invoked `kill -15 <pid>` (and so with `-2`), my program did not receive the signal! I also updated the kernel to `3.11.10-100.fc18.i686` and still having the same problem.


title: grep equivalent of the kwrite regex [A-Z][A-Z]+

text: So, it took me ages, but I finally learned to _think_ in terms of regular expressions, thanks to using them in `kwrite`. But I still don't know how to translate that knowledge to `grep`. I love my `grep`, when I know what I'm doing with it, but the manual has always given me a headache. I'd like to match stuff like the following lines:               CAPITALSFOLLOWING anewline.     CAPI     TALSFOLL owing     ANEW line.      That is, lines that begin with two or more capital letters. But I can't figure out how. In `kwrite`, I would match these lines using:               \n[A-Z][A-Z]+      But `grep`... hmm. I have a feeling like it's something like:               me@ROOROO:~/$ grep "^[A-Z]something" filename      but               me@ROOROO:~/$ grep "^[A-Z][A-Z]+" filename      doesn't work (returns an empty file). A google search for the term 'grep match one or more occurrence' lead me to believe that               me@ROOROO:~/$ grep "^[A-Z][A-Z]*" filename      was the right syntax. But, alas, that doesn't do the trick.


title: How does forking affect a process's memory layout?

text: Please see the following figure showing the memory layout of a process: ![](http://i.stack.imgur.com/XVxqL.png): When someone `forks()`, and a new `task_struct` is assigned, what happens to the addresses of the process? In more or less other words: Imagine there is one process, so the image below holds. Now suppose I do a fork. What happens?


title: How can I remove GRUB2 entries in Fedora 16?

text: Recently, I executed the following command:               grub2-mkconfig -o /boot/grub2/grub.cfg      Now I have 6-7 Linux entries + 1 windows entry. How do I remove older kernel entries? I don't want to remove all the recovery kernel options by using:               GRUB_DISABLE_LINUX_RECOVERY="true"


title: how can I add records to the zone file without restarting the named service?

text: I'm working on centos6.5 and bind9 and I have managed to add records to a DNS zone by doing this steps: creating the key:                dnssec-keygen -a HMAC-MD5 -b 128 -n HOST example.com.      editing conf. file:               // TSIG Key     key "example.com." {          algorithm hmac-md5;          secret "THE KEY GENERATED ABOVE";     };     zone "example.com" IN {          type master;          file "example.com.zone";          allow-update{ key "example.com."; };     };      give the named authorization to the /var/named folder:               # chown -R named:named /var/named     # find . -type d -exec chmod 770 {} \;     # find . -type f -exec chmod 660 {} \;      I have adding records using this script:               #!/bin/bash     #Defining Variables     DNS_SERVER="localhost"     DNS_ZONE="example.com."     USER_NAME="dd2.example.com."     IP="192.168.1.7"     TTL="60"     RECORD=" $USER_NAME $TTL A $IP"     echo "     server $DNS_SERVER     zone $DNS_ZONE     debug     update add $RECORD     show     send" | nsupdate -k Kexample.com.+157+55566.key      it didn't return any error. I test if I add this record by using dig command:               #dig +short dd2.example.com.     192.168.1.7      but the problem that the record added doesn't appear in the zone file 'example.com.zone'. even when I use reload: `rndc reload MYZONE` or `rndc reload`   it returns an error message like this:               [root@dd Shells]# rndc reload example.com.     rndc: 'reload' failed: dynamic zone      but when I restart the named service: `service named restart` the record appears in the zone file. my question is : Is it a way to the record to be added to the zone file without restarting the named service?


title: booting freezes after used scheduler greatest stack depth error

text: I have built the linux kernel 3.14 with debug info. When I tried to boot it gives following error and after that booting freezes. ![enter image description here](http://i.stack.imgur.com/3cb6R.png) Can somebody tell me how to fix this ? Linux Version : Slitaz in Qemu


title: Clarification on permissions with GID & UID in UNIX

text: If Test1 & Test2 are users, then               Test1 : UID : 501, GID :501, groups=501,100     Test2 : UID : 502, GID :502, groups=502,100      What will be the correct option from below and explain how?   * Test1 can't access any file from Test2 because both are having different GID   * Test1 and Test 2 can access each others files because both are having 100 as group


title: Is there a way to search manpages for typical use scenario?

text: I have a relatively small brain, so there is a limit to what I can store up there. I have been using Linux semi-pro-amateur for a few years and still I am amazed at how little commands I know. Simple stuff like "how do I list all my partitions in a terminal" will launch a 15 minute DuckDuckGo-hunt. I am taking a stand! It ends today! So, is there a way to search manpages for stuff like "list partitions" and getting something like:               $ man-search list partitions          Results for "list partitions"     -----------------------------          df - list drives with size or something     du - list directory usage      I think I already know the answer, but ... maybe you can suggest a quicker way to find the utility I need when I need it. Thanks!


title: Preventing battery from charging

text: I'm running on UPS power and would like to prevent the laptop's battery from charging, to increase the amount of power available to other devices. Is there a way to do this? _update_ : The machine is a Dell Latitude D400. If people want more details, just ask. Also, I'm gathering that I need to explain my desired setup a little better. I've gotten a bunch of suggestions about taking the battery out. I'm not sure if people are suggesting to take the battery out while the machine is running — this, as I understand, is not a good idea with most laptops — or to just remove the battery altogether. The latter option is not optimal, because ideally I'd like to use the 30-60 minutes of power in the laptop battery and then switch over to UPS power. The details of the switch-over may constitute a separate question, but if I can't find a way to keep the laptop battery from charging, then removing the battery from the machine altogether may be the best way to do this. I'm not sure yet if this machine will run without a battery, but I'll check that out. Other than the laptop, the UPS is just supporting a cable modem and router and a USB hub. Again in the idealized version of this setup, all the power management changes would be automated, i.e. not require replugging anything or pressing Fn-keys. I'd like the machine to start using laptop battery power when apcupsd indicates that the UPS A/C is out, and then start using UPS power, but not charging the battery, when the battery is almost depleted.


title: How can I configure `anybody` to run X in a one-liner?

text: The common solution posted is to run `sudo dpkg-reconfigure x11-common` which gives a graphical prompt, however, I'm wanting to use this non-interactively. Scenario is that I'm SSH'd into a machine as root (during Vagrant provisioning) and need to run `startx` once as a regular user to generate some config files before proceeding to subsequent steps. I believe the reason I cannot simply `su otheruser startx` is due to Xauthority/me being connected via SSH as another user...


title: Mysterious bash instances using a lot of CPU, how can I debug?

text: I seem to have multiple `bash` processes running that are taking up most of my CPU. This is the output of `top -c`:                 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND              20116 terdon    20   0 35288  14m  292 R 400.0  0.2   0:00.43 /bin/bash            20106 terdon    20   0 35992  15m  280 R  95.9  0.2   0:00.65 /bin/bash            20105 terdon    20   0     0    0    0 R  57.6  0.0   0:00.83 [bash]                This is the output of `ps aux | grep bash | head -3`:               terdon  7487 45.3  0.0      0     0 ?        R    19:31   0:01 [bash]     terdon  7488 66.0  0.0      0     0 ?        R    19:31   0:01 [bash]     terdon  7530 23.0  0.2  37984 17408 ?        R    19:31   0:00 /bin/bash      The PIDs change every time I run the command so it looks like something is constantly respawning `bash`. Details:   * There are multiple `[bash]` entries. If I understand correctly `[process name]` means that the process was launched with no command line arguments.   * The PIDs change so something is spawning these.   * I have logged out and logged back in (I am working in Cinnamon) and the problem persists.  Now, I imagine this will go away if I restart, my main question is what I can use to track these processes down? `top -c` does not help, `pgrep bash` just gives me different lists of PIDs, `lsof /bin/bash` just lists running bash instances and `pstree` shows them as independent processes. In case it is relevant, I am running Linux Mint Debian, kernel 3.2.0-4-amd64, GNU bash, version 4.2.36(1)-release. * * * EDIT: I have since rebooted (I had to) and, as expected, the problem has gone away. I am still interested in useful suggestions of how to track down such processes though.


title: How can I build and install PL/R as a non-privileged user?

text: There is a postgres instance, and I have the ability to build my own instance. Using these instructions I ran:               USE_PGXS=1 make      which worked but then               USE_PGXS=1 make install      did not, with this error: > /bin/sh /usr/lib64/pgsql/pgxs/src/makefiles/../../config/mkinstalldirs > '/usr/lib64/pgsql'   >  mkdir -p -- /usr/share/pgsql/contrib   >  mkdir: cannot create directory `/usr/share/pgsql/contrib': Permission > denied   >  make: _*_ [installdirs] Error 1 Ideally I'd want to install this locally, but I do not know if that is possible. I am on RedHat 5.


title: Hardware code(s) from "sensors" command

text: When running the _sensors_ command in the terminal, the output contains what appears to be some sort of unique identifier for each piece of hardware listed. This is the output, as you can see below, for all the components listed. Is there a way to map these listed identifiers to their respective component; i.e. TB0T = CPU Temp? The machine in question is a MacBook Pro. ![enter image description here](http://i.stack.imgur.com/I964o.png)


title: Which process scheduling algorithm is used by Linux?

text: The Linux operating system switches between running processes to enable multi- tasking. What algorithm is used to determine when to suspend the execution of the currently running process and which process should run next?


title: How does linux handles zombie process

text: Zombie processes are created in Unix/Linux systems. We can remove them via the `kill` command. But is there any in-built clean-up mechanism in Linux to handle zombie processes?


title: Fedora 20 crashes momentarily on every boot, but system still running

text: I am trying to figure out what is causing the momentary crash on every boot up, as observed in the output from `last` command:               user    pts/0        :0               Wed Jul 15 21:07   still logged in     user    :0           :0               Wed Jul 15 20:29   still logged in     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 20:29   still running     (unknown :0           :0               Wed Jul 15 20:29 - crash  (00:00)     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 20:29   still running     user    pts/2        :0               Wed Jul 15 17:51 - 19:17  (01:26)     ...     user    :0           :0               Wed Jul 15 14:15 - 19:27  (05:11)     reboot   system boot  3.15.3-200.fc20. Wed Jul 15 14:12 - 19:27  (05:14)     (unknown :0           :0               Wed Jul 16 14:12 - crash  (00:00)     reboot   system boot  3.15.3-200.fc20. Wed Jul 16 14:12 - 19:27  (05:14)     user    pts/0        :0               Wed Jul 16 09:13 - 10:29  (01:15)      I tried to figure out what's wrong by querying the journald log, but I didn't find anything amiss except some private bus connection error and that sendmail got restarted again.               Jul 15 20:29:44 systemd[1]: Started Sendmail Mail Transport Agent.     Jul 15 20:29:44 systemd[1]: Starting Sendmail Mail Transport Client...     ...     Jul 15 20:29:46 systemd[875]: Failed to open private bus connection: Failed to connect to socket /run/user/42/dbus/user_bus_socket: No such file or directory     ...     Jul 15 20:29:51 systemd[1]: Stopping Sendmail Mail Transport Client...     Jul 15 20:29:51 systemd[1]: Stopping Sendmail Mail Transport Agent...     Jul 15 20:29:51 systemd[1]: Starting Sendmail Mail Transport Agent...     ...     Jul 15 20:29:57 systemd[1862]: Failed to open private bus connection: Failed to connect to socket /run/user/1000/dbus/user_bus_socket: No such file or directory      Can anyone tell me how to figure out what is causing the crash?


title: Understanding iostat with Linux software RAID

text: I'm trying to understand what I see in `iostat`, specifically the differences between the output for md and sd devices. I have a couple of quite large Centos Linux servers, each with E3-1230 CPU, 16 GB RAM and 4 2TB SATA disk drives. Most are JBOD, but one is configure with software RAID 1+0. The servers have very similar type and amount of load, but the `%util` figures I get with `iostat` on the software raid one is much higher than others, and I'm trying to understand why. All servers are usually 80-90% idle with regard to CPU. _Example of`iostat` on a server without RAID:_               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                9.26    0.19    1.15    2.55    0.00   86.84          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdb               2.48     9.45   10.45   13.08  1977.55  1494.06   147.50     2.37  100.61   3.86   9.08     sdc               4.38    24.11   13.25   20.69  1526.18  1289.87    82.97     1.40   41.14   3.94  13.36     sdd               0.06     1.28    1.43    2.50   324.67   587.49   232.32     0.45  113.73   2.77   1.09     sda               0.28     1.06    1.33    0.97   100.89    61.63    70.45     0.06   27.14   2.46   0.57     dm-0              0.00     0.00    0.17    0.24     4.49     1.96    15.96     0.01   18.09   3.38   0.14     dm-1              0.00     0.00    0.09    0.12     0.74     0.99     8.00     0.00    4.65   0.36   0.01     dm-2              0.00     0.00    1.49    3.34   324.67   587.49   188.75     0.45   93.64   2.25   1.09     dm-3              0.00     0.00   17.73   42.82  1526.17  1289.87    46.50     0.35    5.72   2.21  13.36     dm-4              0.00     0.00    0.11    0.03     0.88     0.79    12.17     0.00   19.48   0.87   0.01     dm-5              0.00     0.00    0.00    0.00     0.00     0.00     8.00     0.00    1.17   1.17   0.00     dm-6              0.00     0.00   12.87   20.44  1976.66  1493.27   104.17     2.77   83.01   2.73   9.08     dm-7              0.00     0.00    1.36    1.58    95.65    58.68    52.52     0.09   29.20   1.55   0.46      _Example of`iostat` on a server with RAID 1+0:_               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                7.55    0.25    1.01    3.35    0.00   87.84          Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util     sdb              42.21    31.78   18.47   59.18  8202.18  2040.94   131.91     2.07   26.65   4.02  31.20     sdc              44.93    27.92   18.96   55.88  8570.70  1978.15   140.94     2.21   29.48   4.60  34.45     sdd              45.75    28.69   14.52   55.10  8093.17  1978.16   144.66     0.21    2.95   3.94  27.42     sda              45.05    32.59   18.22   58.37  8471.04  2040.93   137.24     1.57   20.56   5.04  38.59     md1               0.00     0.00   18.17  162.73  3898.45  4013.90    43.74     0.00    0.00   0.00   0.00     md0               0.00     0.00    0.00    0.00     0.00     0.00     4.89     0.00    0.00   0.00   0.00     dm-0              0.00     0.00    0.07    0.26     3.30     2.13    16.85     0.04  135.54  73.73   2.38     dm-1              0.00     0.00    0.25    0.22     2.04     1.79     8.00     0.24  500.99  11.64   0.56     dm-2              0.00     0.00   15.55  150.63  2136.73  1712.31    23.16     1.77   10.66   2.93  48.76     dm-3              0.00     0.00    2.31    2.37  1756.39  2297.67   867.42     2.30  492.30  13.08   6.11      So my questions are: 1) Why is there such a relatively high `%util` on the server with RAID vs the one without. 2) On the non-RAID server the `%util` of the combined physical devices (sd*) are more or less the same as the combined LVM devices (dm-*). Why is that not the case for the RAID server? 3) Why does it seem like the software RAID devices (md*) are virtually idle, while the underlying physical devices (sd*) are busy? My first thought was that it might be caused by RAID checking, but `/proc/mdadm` shows all good. Edit: Apologies, I thought the question was clear, but that seems there is some confusion about it. Obviously the question is not about the difference in the `%util` between drives on one server, but why the total/avg `%util` value on one server is so different from the other. Hope that clarifies any misunderstanding.


title: Backslash with pipe in system command from awk

text: I want to invoke shell command from awk so I am using `system()` but when I am passing expression in I am getting error at backslash. Here is my expression               echo "select * from abc limit 1;"| impala-shell|grep -Eo " a-[0-9]-[0-9]* \| HS[0-9]  \| [0-9]* \| [0-9]* "      But when I am passing it to shell, I'm getting an error `backslash not last character on line`.               system("echo \"select * from abc limit 1;\"| impala-shell|grep -Eo \" a-[0-9]-[0-9]* \| HS[0-9]  \| [0-9]* \| [0-9]* \" ")      I want to get the above command result in awk programming after `system()` ,I know we can access through getline but dont know exact syntax. **EDIT** When using **\|** in system as **"\|"** got following               `warning: escape sequence `\|' treated as plain `|'`       I took some simple example to see **\|** in an expression               system("echo hey i am  \"\\|\" ashish ")     hey i am \| ashish      but when i try within double qoute and single quote yields in               system("echo \" a-[0-9]* \"\\|\" HS[0-9]  \"\\|\" [0-9]* \"\\|\" [0-9]* \" ")     a-[0-9]* | HS[0-9]  | [0-9]* | [0-9]*     //single quote     system("echo \' a-[0-9]* \"\\|\" HS[0-9]  \"\\|\" [0-9]* \"\\|\" [0-9]* \' ")     a-[0-9]* "\|" HS[0-9]  "\|" [0-9]* "\|" [0-9]*      what i am expecting is `a-[0-9]* \| HS[0-9] \| [0-9]* \| [0-9]*`.


title: Issue with zsh segfaulting: how to further assess the issue?

text: I'm using _Linux arch_ 3.15.2-1-ARCH x86_64. I don't use `zsh` (zsh-5.0.5-1) every day, otherwise I would have noticed it _segfaults_ , when I launch it from the `bash` cli:               arch kernel: zsh[2187]: segfault at 8 ip 00007f3b49853083 sp 00007fff2ad39198 error 4 in libc-2.19.so[7f3b497d2000+1a4000]     arch systemd-coredump[2188]: Process 2187 (zsh) dumped core.      Now I remember running it at some point and going through the configuration script(`zsh /usr/share/zsh/functions/Newuser/zsh-newuser-install -f` segfaults too now). So I have done the following:   * Reboot   * The behavior is the same in X or the console   * _Remove_ with configuration and clear package cache, then _reinstall_ : `pacman -Rns zsh; paccache -r; paccache -ruk0; pacman -S zsh`.   * Try to _compile_ using the recipe for _5.0.5-1_ and _5.0.4-1_ : compiles, then goes on to check the binary by executing it, which segfaults in both cases, so this aborts.   * Made sure to _have no_ `.zsh*` file in my home directory - made sure to _have_ the basic `.zsh*` files in my home dir.   * Renamed `/etc/profile`   * Renamed `/etc/zsh/zprofile`   * _zsh-completions_ is/is not installed Ironically, `zsh --version` or `\--help` **work** and echo the relevant info. So what could be the issue with my setup/environment here? * * * Note: ran quick _gdb_ if that brings any insight into what is happening:               (gdb) run     Starting program: /usr/bin/zsh      warning: Could not load shared library symbols for linux-vdso.so.1.     Do you need "set solib-search-path" or "set sysroot"?          Program received signal SIGSEGV, Segmentation fault.     0x00007ffff713e083 in __strchr_sse2 () from /usr/lib/libc.so.6     (gdb) bt     #0  0x00007ffff713e083 in __strchr_sse2 () from /usr/lib/libc.so.6     #1  0x000000000044f2e3 in ?? ()     #2  0x000000000044f7d4 in op ()     #3  0x000000000045003b in ?? ()     #4  0x00000000004505cd in ?? ()     #5  0x00000000004507dc in matheval ()     #6  0x0000000000450829 in mathevali ()     #7  0x00000000004602b0 in ?? ()     #8  0x00000000004624ab in assignsparam ()     #9  0x0000000000463636 in createparamtable ()     #10 0x000000000043f2b5 in setupvals ()     #11 0x0000000000440e14 in zsh_main ()     #12 0x00007ffff70dd000 in __libc_start_main () from /usr/lib/libc.so.6     #13 0x000000000040f7be in _start ()


title: get xautolock status

text: I'm currently using xautolock to automatically lock my screen with slock. However, when I'm watching a movie, I certainly _don't_ want my screen to go black suddenly. I read the manpage and saw that `xautolock -toggle` bound to a keyboard shortcut ought to give me control over the whole thing. **But, I want to see the current status.** Or I will get confused. Does anyone know a way to find the xautolock status, or should I do something like make a file containing the current status and use -enable / -disable, checking the file, and `notify-send`ing something?


title: How would you get all users history

text: I know there is the $HISTFILE variable where i can find the currently logged in users history-file, but how can i be sure to get every history file on the server I was thinking of the following:               sudo find /home/ -name '*_history*'      With output:               root@anders:~# sudo find /home/ -name '*_history*'     /home/seb/.bash_history     /home/adionditsak/.bash_history     /home/jakob/.bash_history     ...      Would this do the trick - or do you have a better way?


title: Is it possible to set mod_expires directives dependent on REMOTE_ADDR?

text: Basically I have a bunch of `mod_expires` directives in my `httpd.conf` like so:               ExpiresByType text/html "access plus 1 hour"      I realize that ultimately, the user's browser determines how long to hold onto something but the above suggestion is too long for the local users (`192.168.0.0/16`) but not long enough for internet visitors. Is it possible to have one set of cache control suggestions for local address and another for the rest of the world (sort of if/else-style)? If so, how would I do that? **EDIT:** This won't help me and I don't have a 2.4 install available to test with right now but if anybody wants to take a crack at posting a solution using 2.4's If/ElseIf/Else directives I'll accept that as an answer and award the bounty.


title: Bash one liner to change configuration parameters

text: I have a config file with following structure.               ValueOne = 1     ValueTwo = 2     ValueThree = 3      I want a one liner bash script to find ValueTwo and change the value to 22222. Any idea? _Not School Thing_


title: Stateful bash function

text: I’d like to implement a function in Bash which increases (and returns) a count with every call. Unfortunately this seems non-trivial since I’m invoking the function inside a subshell and it consequently cannot modify its parent shell’s variables. Here’s my attempt:               PS_COUNT=0          ps_count_inc() {         let PS_COUNT=PS_COUNT+1         echo $PS_COUNT     }          ps_count_reset() {         let PS_COUNT=0     }      This would be used as follows (and hence my need to invoke the functions from a subshell):               PS1='$(ps_count_reset)> '     PS2='$(ps_count_inc)   '      That way, I’d have a numbered multi-line prompt:               > echo 'this     1   is     2   a     3   test'      Cute. But due to the above mentioned limitation doesn’t work. A non-working solution would be to write the count to a file instead of a variable. However, this would create a conflict between multiple, simultaneously running sessions. I could append the process ID of the shell to the file name, of course. But I’m hoping there’s a better solution which won’t clutter my system with lots of files.


title: forgot to luksClose usb persistent partition, is this a problem?

text: Following the Kali Linux documentation for "Adding USB Persistence with LUKS Encryption", I created a persistent partition and encrypted the volume with:               cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb2     cryptsetup luksOpen /dev/sdb2 my_usb     mkfs.ext3 -L persistence /dev/mapper/my_usb     e2label /dev/mapper/my_usb persistence     mkdir -p /mnt/my_usb     mount /dev/mapper/my_usb /mnt/my_usb     echo "/ union" > /mnt/my_usb/persistence.conf     umount /dev/mapper/my_usb      (substituting a volume name for "my_usb") However, I forgot to close the volume (the following line was ophaned on the next page in the documentation, so I didn't see it):               cryptsetup luksClose /dev/mapper/my_usb      Is this a problem? If so, how and is there any way to repair it? This article suggests it is but doesn't say why and the instructions don't work for me. The disk _appears_ to work fine.


title: Find when a hard disk was first installed

text: What's the command in AIX to find the first time a given hard disk was installed?


title: How do I list every file in a directory except those with specified extensions?

text: Suppose that I have a folder containing **.txt** , **.pdf** , and other files. I would like to list the "other" files (i.e., files not having the extensions **.txt** or **.pdf** ). Do you have any advice on how to do this? I know how to list files not having a given extension. For example, if I want to list all files except the **.txt** files, then either               find -not -iname "*.txt"      or               ls | grep -v '\.txt$' | column      seem to work. But, how can I list everything except **.txt** files _or_ **.pdf** files? It seems that I need to use some sort of logical "or" in `find` or `grep`.


title: Transfer programs to another OS

text: I have openSUSE. I can install programs with `yum`.               yum install <progname>      I want to move my install to a new hard disk. How can I transfer programs from one OS to another? My problem is that I have no access to the internet. So how can I install a program on it?


title: How to recover from recursive 'chmod -x' on my home folder

text: I pressed `ENTER` after typing the following stupid command on my home directory:               find . -type f -exec chmod -x '{}' ';'      What do you advise as a fix for this. My guess is that I can't do anything but do something like:               find . -type f -exec chmod og+x '{}' ';'      Or may be do some tricky stuff based on extensions (which doesn't seem very pertinent under Linux). Or may be some of you has an idea or a pointer on how to know which file should be executable under linux and how to detect them to turn them back to executables...


title: Using cut/awk/sed with two different delimiters

text: I have the following cases:                case@test.com      case_1_2@test.com      case_1@test.com      I'm trying to convert these to                case@test.com      case@test.com      case@test.com      So it should remove everything from the first '_' (including it) to the @ (not including that). I have something, but it doesn't really work correctly: Based on this thread: Cut based on Two Delimiters at one go, and this U&L Q&A: Splitting string by the first occurrence of a delimiter.               sed 's/^.*_\([^ ]*\) .*\@\([^$]*\)$/\1 \2/' infile      But no luck. Anyone want to take a chime at it?


title: Why do cpuinfo_cur_freq and /proc/cpuinfo report different numbers?

text: When I do ` sudo watch -n1 cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq ` I get 1.8 - 2.7 GHz. It never goes above 2.7. And when I do ` watch -n1 "cat /proc/cpuinfo | grep MHz" ` I get 768 MHz - 1.8 GHz. It never goes above 1.8. Anyone know what is going on?


title: How do I time how long my pg_restore takes in the command line?

text: I'm trying to track the amount of time the process takes for when I move around my data and upgrade my web app. From the command line, how would I track the amount of time elapsed from when the pg_restore command starts to when it finishes?


title: File and directory naming conventions

text: I want to refactor the files and directories on my system. However I am not sure what is _best practice_. After reading this question and it's answers I assume the most important part is to be consistent. However, this is where I'm stuck. E.g in root, there are directories suck as `/bin` and `/usr`, which all use lower-case letters. But in my user's directory `/home/foobar/`, there are already a bunch of directories such as `~/Pictures`, `~/Documents` and `~/Music` (which are capitalized)! Maybe this is just because I use Ubuntu, but **what is considered best practice**?


title: is there a vim shortcut or can I create one for 'tabe other_file'

text: When possible I create 1 or 2 letter abbreviations for aliases and the like, e.g. `x` for exit or `p` for pwd at the command line. When using vim and doing multiple tabs for different files (which I can switch between with `gt` or `gT` btw) I can edit an additional file with `:tabe filename` which also creates a new tab. Is there any shortcut or is there any way to create one (perhaps using the .vimrc file?) for something like `:ta` or `:tb` or `:tt` or `:tz` etc.


title: sed - replace complex lines in a file using variables

text: How do I replace a complex line in a file using sed? For example I want replace a udev rule in /etc/udev/rules.d/70-persistent- net.rules. This doesn't work:               OLD_RULE='SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:36:4c:e5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"'          NEW_RULE='SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="52:54:00:36:4c:e5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"'               sed -i "s/$OLD_RULE/$NEW_RULE/g" /etc/udev/rules.d/70-persistent-net.rules      The file remains unmodified.


title: write only permissions on samba

text: I am busy setting up a file server in our church office (using samba on a debian machine). I would like to impliment a dropbox-like folder for each user, where othere users may deposit files. Ideally it should work like this: The "owner" (does not necesarily have to be the unix owner) "A" should be able to read and delete files from his own dropbox only (not paste or create new files) All other users should be able to only paste or create files in the "A" directory, no deletion or overwrites. Ideally they should not even be able to list the folder contents. Currently, all regular users belong to a "Users" group, and I have set the directory owners to be their respective users (ie "a" is the owner of the "a" directory inside the "dropboxes/" directory) I tried setting the permissions to 533 and 522 for all these user folders, but I keep on getting the wrong result. I also tried using ACLs, but that, also, did not suceed. The "dropbox" directory lists as follow: drwxrwxr-x 5 root users 4096 Apr 7 01:01 dropboxes Any tips?


title: Dual monitor configuration on Intel Ivy Bridge

text: I'm trying to set up a dual monitor machine with an Intel DH67BL motherboard, Ivy Bridge i5-3450 CPU and dual Samsung 204b monitors. I cant seem to get the computer to recognize more than one of these monitors at a time. I can get either monitor to work using the DVI port directly or with a DVI-VGA cable, or by using the HDMI port with an HDMI-DVI cable. I managed to sort of get them working by substituting 2 smaller monitors and hot-plugging to the 204b's, but this locked me into an appallingly low resolution, and broke as soon as I tried adjusting the resolution. KDE's display settings only shows whichever monitor is currently working as connected. The Samsung 204b's also appear to be outputting bad EDID information, so forcing monitor settings is probably going to be neccesary. Edit: I ended up adding an old nvidia card to the computer, which runs both monitors quite happily.


title: inittab equivalent in fedora 15?

text: I have just installed Fedora 15 on my laptop. I want to study `/etc/inittab` as I studied it in RedHat 9. I don't see any script in `/etc/inittab`. Also , the way the default runlevel can be changed in `inittab` has changed in Fedora 15. If there is a good tutorial to study the changes in Fedora 15? I found https://fedoraproject.org/wiki/Systemd, but was not much useful.


title: dual booting centos5.5 and fedora

text: I already have CentOS 5.5 on my system whose hard disk is ~500GB. I have tried to dual boot with Fedora 16. while installing fedora 16 I have created a ~250GB and ~4GB partitions for "/" and swap. The installation has gone pretty smoothly until a error at the end said that installing bootloader has been unsuccessful. The grub at boot time only shows CentOS entries .Now when I boot into CentOS and run the lvm->lvscan .. it shows 4 partitions (2 swap spaces and two "/" partitions for CentOS and fedora 16). How can boot into Fedora.


title: Language agnostic configuration file format

text: Many projects these days use more than one programming / scripting language, and in standard DRY tradition these should not have separate configuration files if they need the same information. After a small survey in `/etc`, it looks like a lot of incompatible syntaxes are used in Ubuntu:   * `varname=value` - `/etc/adduser.conf`   * `varname: value` - `/etc/debconf.conf`   * `varname = value` - `/etc/deluser.conf`   * `$varname value` `/etc/insserv.conf`   * `varname value` - `/etc/login.defs`   * `set varname value` - `/etc/lftp.conf`   *     [section]         varname = value      `/etc/mke2fs.conf`   *     section         label varname value         set varname value      `/etc/smartd.conf` As far as I can see, none of these are "Yaml or XML or JSON," (one of them is INI though). Which format would you recommend (and why) for a project which needs to provide simple values (`debug = true`, `welcome = "Hello world!"`, `threads = 4`), arrays of simple values (`servers = [dev, test, prod]`), and values which refer to other variables (`thread_msg = "Using $threads threads"`) to Bash, Perl and PHP?


title: How to open chapters of Vim user manual in Vim

text: I opened the Vim user manual with the `:h user-manual | only` command (to open it in one window) and now I want to enter/open the separate text files. I tried to put my cursor over a section, such as |usr_01.txt| , and press CTRL-j but nothing happened.               Overview ~          Getting Started     |usr_01.txt|  About the manuals     |usr_02.txt|  The first steps in Vim     |usr_03.txt|  Moving around     |usr_04.txt|  Making small changes     |usr_05.txt|  Set your settings     |usr_06.txt|  Using syntax highlighting      |usr_07.txt|  Editing more than one file     |usr_08.txt|  Splitting windows


title: How to 'UnJustify!' text in GNU nano

text: I enjoy using `nano` as a respite from my usual GTK-based text editor. I like the simplicity of the interface, and using CTRL-K is the fastest way I know of to edit down long textfiles. However, I have one major gripe: whenever I justify text using CTRL-J, the editor prints the smug little message `Can now UnJustify!` -- yet I have not been able to find a way to unjustify text. Pressing M-U (which a Google search could reveal, M-U not being mentioned at all in the program's help files) simply seems to cause a glitch. The keyboard becomes unresponsive. Am I missing something?


title: Pipe diff file into patch?

text: Is there a way to pipe the diff output into `patch`? The -i parameter is for specifying a diff file, but I just want to do it more dynamically, since I will be updating regularly against a directory that changes frequently. For instacne, something along the lines of               patch -b | diff -Nub . /current-files      ? The man file says               -i patchfile  or  --input=patchfile     Read the patch from patchfile.  If patchfile is -, read from standard input, the default.      But when I try it, I just see the output of the diff on the screen, with no changes applied:               testb $> ls     file.txt          testb $> patch -i - | diff -Nub . ../testa     diff -Nub ./file.txt ../testa/file.txt     --- ./file.txt  2011-07-12 09:40:08.195467000 -0400     +++ ../testa/file.txt   2011-07-12 09:39:11.181666500 -0400     @@ -1,9 +1,7 @@      ijaosdfji      jaiosdfjio      jklasdkml     -asdkml     -s;lnk     -lsadjkl     -asdfas     -asdf     +klasdkml     +nas;lnk     +jklsadjkl          diff -Nub ./file2.txt ../testa/file2.txt     --- ./file2.txt 1969-12-31 19:00:00.000000000 -0500     +++ ../testa/file2.txt  2011-07-12 09:39:44.196235000 -0400     @@ -0,0 +1,6 @@     +aljksdf     +jklasdflkjlknm     +nksalk;     +klaskl;     +ioasjdoiaj     +lkmasd'lkm          testb $> ls     file.txt


title: How to create a list of all applications which were manually installed?

text: I use Fedora and I'd like to have all the package names in a list, but only the ones I installed myself, not the default ones.


title: Liveboot Kali does not detect filesystem

text: _To preempt some questions: yes the boot flag is set, it works correctly when on a computer using EFI_ I used `dd` to burn the Kali .iso (64 bit AMD) onto my USB. It works fine for EFI machines, however if I try to run it on machines without EFI I receive an error message similar to this : `Unable to find Operating System, cannot boot.` I have looked through the files on the USB. `ls`               autorun.inf  dists     g2ldr.mbr  live        setup.exe     boot         firmware  install    md5sum.txt  tools     debian       g2ldr     isolinux   pool        win32-loader.ini      (Output of `tree install live boot isolinux`)               install     ├── gtk     │   ├── initrd.gz     │   ├── install.bat     │   └── vmlinuz     ├── initrd.gz     ├── install.bat     └── vmlinuz     live     ├── filesystem.packages     ├── filesystem.packages-remove     ├── filesystem.squashfs     ├── initrd.img     ├── memtest     └── vmlinuz     boot     └── efi.img     isolinux     ├── advanced.cfg     ├── boot.cat     ├── hdt.c32     ├── install.cfg     ├── isolinux.bin     ├── isolinux.cfg     ├── ldlinux.c32     ├── libcom32.c32     ├── libutil.c32     ├── live.cfg     ├── menu.cfg     ├── splash.png     ├── stdmenu.cfg     └── vesamenu.c32      I noticed that there is only `efi.img` in the boot folder. I am unsure if (like in UNetBootin) the orignal .iso file must be on the USB in order to boot correctly. What do I need to do in order to boot from a "non-EFI" system?


title: How do I ensure that only one instance of my ksh script runs on Solaris using NFS?

text: > **Possible Duplicate:**   >  What Unix commands can be used as a semaphore/lock? I have read many similar post and the solution seems to be to use flock. flock does not exist on my system and I don't have rights to add it. **References:**   1. A "BashFAQ" link provided in a comment in how-to-make-sure-only-one-instance-of-a-bash-script-runs talks about using flock


title: Is it possible to set per-user permissions in Linux?

text: Is this possible? It seems that I have more options to set permissions in Windows than Linux. Let's say I want to give a user full access to a top-level directory but limit their access to certain subdirectories. Going one step further, how would I do this for multiple users?


title: Group+rx permission only in directories using ACL?

text: I need to install `acl` in order to set up a very specific permission structure. Group members should be able to see the files in a directory and change into the subdirectories. However, they should not have permission to read the files! I don't know how to achieve this. The command `setfacl -m d:g:mygroup:rx` will do part of the job, but then all files become readable. So, I need to apply this rule only to the folders `(drwxrwx---)`, everything else should be inaccessible `(rw-------)`.


title: Do memory-backed filesystems (like sysfs and procfs) have superblock and inode table?

text: From "Design and Implementation of the Second Extended Filesystem" I know that ext2 has superblock and inode table stored in disk and superblock will be accessed when mounting the filesystem. Do memory-backed filesystems (procfs, sysfs, debugfs, etc.) have superblock and inode table too?


title: Switch back to path when resume job from background

text: Say I open `~/vim.txt`, push that to background, then `cd` to another path. When I bring that job to foreground, is there an option to switch back to old path? I noticed it says `pwd`, so I assume it is possible.


title: How can I use two modes in emacs (markdown and auctex)?

text: When I edit markdown in emacs I use markdown-mode. However I often have to type some math formulas in the markdown file (processed by `mathjax`). However for those math parts markdown mode is not very comfortable. Is there a way to make emacs automatically switch to latex (auctex) mode (locally) when the point is between two `$` signs for example (`$\mathbb{R}$`) or between two double `$` signs for example               $$     \begin{align}     a = b     \end{align}     $$      ? **Edit** I also want to have the font locking of the "local" mode. **Edit 2** I tried `mmm-mode`, but this doesn't handle font-locking correctly. I guess that `multi-mode.el` or `MuMaMo`-mode might be what I want. But I didn't figure out how to use this in my examples. So, if it is possible to do what I want with one of this or with another mode, it would be great if someone could post detailed steps howto apply it in my case as an answer.


title: What is the Linux equivalent of bootinfo command?

text: **bootinfo** for AIX: > ...shows whether the hardware in use is 32-bit or 64-bit. What command/utility for Linux would do this job?


title: How to get my bluetooth keyboard to be recognized before log in?

text: Because I need to use my keyboard to log in, I would like my keyboard pair automatically, pre-log in. I am using Debian squeeze, and am new to linux. All tutorials I have found seem to require the HIDD package, which has been deprecated (I think) on current Debian releases. Apt-get install returns a package not found in repo response. Does anyone have a method to slove this problem? If it matters, I am using Debian Squeeze on a Raspberry Pi, and an Apple Bluetooth Keyboard/Magic Trackpad.


title: filesystem read only

text: My filesystem is read-only for several days. Searching for somesthing on my `/var/log/messages` and found this.               ****EMITTING CHANGED for /sys/devices/pci0000:00/0000:00:11/host0/target0:0:0/0:0:0:0/block/sda     ****Refreshing ATA SMART data for /sys/devices/pci0000:00/0000:00:11/host0/target0:0:0/0:0:0:0/block/sda     helper(pid 3495):launched job udisks-helper-ata-smart-collect on /dev/sda     helper(pid 3495):completed with exit code 0      I this a health test:               # smartctl -d ata -H /dev/sda      and get the follow output:               smartctl 5.42 2011-10-20 r3458 [x86_64-linux-3.1.0-1.2-default] (SUSE RPM)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED      what can I do to prevent my filesystem to get readonly?


title: Copy markdown input to the clipboard as rich text

text: I'm about to get involved in some collaborative prose writing with a friend of mine via email. As a regular person, he will of course be using MS Word document formats; as a massive nerd, I prefer to use markdown when writing on a computer. What I need is the exact opposite of this question about converting rich text copied from a webpage to markdown. My naive worst-case workflow would be:   1. Write up the document in markdown   2. Use `pandoc -S file.mkd -o temp.html`   3. Open up `temp.html` in a web browser   4. Copy & paste from the page to the open document in libreoffice I am certain that this can be optimised. (Google Docs is not an option in this case). Even though I've answered the main question, I still feel that this could be optimised further. If there is any way to concatenate .doc files (which I will be receiving and which pandoc can write to), perhaps with the libreoffice command-line interface, then I suppose it would be possible to construct an overly-complicated one-liner and avoid having to leave the terminal at all. If anyone finds a way to do that, I will happily accept that answer over my own.


title: How to manipulate a CSV file with sed or awk?

text: How can I do the following to a CSV file using `sed` or `awk`?   * Delete a column   * Duplicate a column   * Move a column I have a big table with over 200 rows, and I'm not that familiar with `sed`.


title: m key not registering in Bourne-Again shell 3.2, OSX. Guesses?

text: Just lowercase `m`, and just when invoked interactively through `/bin/sh`. The keyboard works fine, and usually everything works fine. I almost never use `/bin/sh`, just `/bin/bash`, so it was somewhat surprising when I fired up sh on a whim just now. Bash, not Bourne shell, since I guess sh is just a link to `bash` in OSX, too... But regardless it's odd. Bash version 3.2.48(1). My `~/.inputrc` doesn't contain anything odd, and neither does `~/.profile`, or `/etc/profile`, but I'm guessing at some point months ago I modified a config file to make this happen. Either that or something legitimately screwy is up. I know `~/.bash_profile` and `~/.bashrc` aren't being run (because they print things and modify environment variables in a very distinctive way). Whatever the case, it bugs me. Any guesses where else I should look? edit: On restarting the machine, I'm having the problem invoked both invoked as `/bin/bash` and as `/bin/sh`. Invoking bash with --norc doesn't change the odd behavior, which leads me to believe something system-level has been modified distastefully. `m` is not currently an alias for anything (`type m` brings up nothing) and I can still run commands involving `m` by creating a temporary script file and then sourcing it. xev (and basically every other program) confirms that the issue is not with the m keypress event at the kernel or hardware level.


title: Problem when installing “ia32-libs”

text: I'm using x64 Ubuntu. A few months ago I accidentally messed up the groups/owners of all files on `/`, but managed to fix it using a VirtualBox install of Ubuntu. Now I'm running into a problem that I think is related to that mistake. When I try to reinstall `ia32-libs` (Skype is having problems so I need to reinstall those libs) I get an error message: > /var/lib/dpkg/info/ia32-libs.postinst: 40: /usr/lib32/gdk-pixbuf-2.0/gdk- > pixbuf-query-loaders: Permission denied `ls -al` /usr/lib32/gdk-pixbuf-2.0/` is this:               total 476     drwxr-xr-x  3 root root   4096 2011-09-24 17:08 .     drwxr-xr-x 53 root root 143360 2011-09-24 17:08 ..     drwxr-xr-x  3 root root     40 2011-09-24 04:44 2.10.0     -rwxr-xr-x  1 root root   9648 2011-04-05 00:40 gdk-pixbuf-query-loaders      I have tried to reinstall `gdk-pixbuff-2.0`, but it didn't work. How can I fix this?


title: OpenEmbedded: root account doesn't exist!

text: I'm using the current OpenEmbedded system from: http://git.openembedded.org/openembedded-core/tree/ (For what it's worth, I'm also pulling in layers from http://git.openembedded.org/meta-openembedded/tree/ and http://git.yoctoproject.org/cgit/cgit.cgi/meta-xilinx/tree/.) I have built up a set of recipes and a distro (adapting from an older set of recipes which worked with OpenEmbedded from a couple of years ago), which boots like this:               ...     [    2.441070] EXT3-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.450891] EXT2-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.466262] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)     [    2.474002] VFS: Mounted root (ext4 filesystem) on device 1:0.     [    2.480845] devtmpfs: mounted     [    2.484107] Freeing unused kernel memory: 200K (c066f000 - c06a1000)     INIT: version 2.88 booting     [    3.200537] EXT4-fs (ram0): re-mounted. Opts: data=ordered     bootlogd: cannot allocate pseudo tty: No such file or directory     [    3.341168] random: dd urandom read with 9 bits of entropy available     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     chown: unknown user/group root:root     INIT: Entering runlevel: 5     Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device     ifconfig: SIOCSIFADDR: No such device     Starting Dropbear SSH server: dropbear.     Starting HOSTAP Daemon: nl80211 not found.     Starting syslogd/klogd: done     Starting tcf-agent: OK          MYDISTRO 0.1 zc706-zynq7 /dev/ttyPS0          zc706-zynq7 login: [    8.338466] macb e000b000.ps7-ethernet eth0: link up (1000/Full)     zc706-zynq7 login: root     Password:     Login incorrect     zc706-zynq7 login:      (Never mind the "No such device" errors - I can fix that later.) The problem here is that the usual login method of username="root" (password not even requested) doesn't work. **It appears the root user doesn't even exist here!** Any expected password for root (such as empty, "root", "admin", etc) doesn't work. I can't get into this system. After doing some trial and error debugging, I changed my conf/distro/mydistro.conf to comment out these lines:               ...     # The following features are required by eglibc for a clean build of the sdk.     #DISTRO_FEATURES_LIBC = "libc-libm libc-backtrace libc-spawn libc-locale-code libc-getlogin libc-posix-regexp libc-ftraverse libc-posix-clang-wchar libc-posix-wchar-io libc-inet libc-crypt libc-nsswitch libc-utmp"     #DISTRO_FEATURES = "ext4 usbhost wifi pci ipv4 ipv6 largefile ${DISTRO_FEATURES_LIBC}"      **which causes the default DISTRO_FEATURES to be used fromhttp://git.openembedded.org/openembedded- core/tree/meta/conf/distro/include/default-distrovars.inc** (which is included from http://git.openembedded.org/openembedded- core/tree/meta/conf/distro/defaultsetup.conf, which in turn is included by http://git.openembedded.org/openembedded-core/tree/meta/conf/bitbake.conf on line 682). Now it boots like this:               [    2.446482] EXT3-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.456386] EXT2-fs (ram0): error: couldn't mount because of unsupported optional features (240)     [    2.471774] EXT4-fs (ram0): mounted filesystem with ordered data mode. Opts: (null)     [    2.479516] VFS: Mounted root (ext4 filesystem) on device 1:0.     [    2.486308] devtmpfs: mounted     [    2.489626] Freeing unused kernel memory: 200K (c066f000 - c06a1000)     INIT: version 2.88 booting     [    3.203046] EXT4-fs (ram0): re-mounted. Opts: data=ordered     bootlogd: cannot allocate pseudo tty: No such file or directory     [    3.345494] random: dd urandom read with 8 bits of entropy available     INIT: Entering runlevel: 5     Configuring network interfaces... ifconfig: SIOCGIFFLAGS: No such device     ifconfig: SIOCSIFADDR: No such device     Starting Dropbear SSH server: dropbear.     Starting HOSTAP Daemon: nl80211 not found.     Starting syslogd/klogd: done     Starting tcf-agent: OK          MYDISTRO 0.1 zc706-zynq7 /dev/ttyPS0          zc706-zynq7 login: [    8.348120] macb e000b000.ps7-ethernet eth0: link up (1000/Full)     zc706-zynq7 login: root     root@zc706-zynq7:~#      Yay, the root account works! The question is now: **what is the key missing DISTRO_FEATURE that makes the root account work?**


title: Copying wallpaper images into a single folder

text: In my ubuntu 12.04 set-up, there are lots of wallpaper images in the directory `/usr/share/wallpapers`. For example, one might be               usr/share/wallpapers/Leafs_Labyrinth/contents/images/1600x1200.jpg      What I want to do is travel through the wallpapers directory, pick out all the images of size `1600x...` or `1680x...` and copy them to another folder, but renamed, so that the above image would end up being called `Leafs_Labyrinth1600x1200.jpg`. I can't use `find` alone here; I expect I need to use some sort of shell script, of which I have very little experience. Is there an easy "natural" way to do this?


title: Not allowed to read a file for some reason

text: I have these permissions on a file:               -rw-r----- 1 root www-data 540 Mar 18 21:12 /etc/phpmyadmin/config-db.php      User `vagrant` is a member of group `www-data`:               vagrant@precise64:~$ cat /etc/group | grep www-data     www-data:x:33:vagrant      Why can't I read the file as `vagrant`?               vagrant@precise64:~$ cat /etc/phpmyadmin/config-db.php     cat: /etc/phpmyadmin/config-db.php: Permission denied


title: Rsync auto detect directories with small files and compress them together for transfer

text: I need to transfer some files via rsync and can´t tar them before. So I thought maybe there is a mode which checks the folders content and if it is thousand of small files inside compress that folder for the transfer. However I couldn´t find something like that in the man (http://www.manpagez.com/man/1/rsync/). Is it possible and I didn´t find it or would I have to do this before I use rsync?


title: PulseAudio conflict with ia32-libs?

text: When I was ready to install the PulseAudio server, APT reminded me that this package is conflict with these packages: `amarok browser-plugin-gnash browser- plugin-vlc gimp gnash gnash-common goldendict ia32-crossover ia32-libs ia32-libs-i386:i386 libgegl-0.2-0 libjack0:i386 vlc vlc-nox vlc-plugin-notify vlc-plugin-pulse vlc-plugin-vlsub` Why are `amarok` and `ia32-libs` in conflict with PulseAudio? I am confused if I can still use Amarok when I install PulseAudio or not. I am using Debian Jessie,and with ALSA.


title: Change path in sql script with sed

text: I'm trying to change the path in a oracle sql script from a bash script.               read -e -p "Enter the ORACLE SID: " -i "orcl" ORACLE_SID_VALUE     sed -i "DEFINE tsdir = '/u02/app/oracle/oradata/orcl';/c\DEFINE tsdir = '/u02/app/oracle/oradata/${ORACLE_SID_VALUE}'" schema-install.sql      when I execute the script i get the following error: _sed: -e expression #1, char 2: extra characters after command_ can anyone please help me with the correct sed command. * * * more info just to clarify: in the file schema-install.sql, there is a line defining where the oracle database will stored. DEFINE tsdir = '/u02/app/oracle/oradata/orcl'; I want to change the value _orcl_ to the value I type into the variable ORACLE_SID_VALUE.


title: Something happened to Swap; it is not used by default

text: I always have to go to `gparted` and then turn my swap on. The swap space isn't used by default and if I turn the swap on, the swap is not used! How can I make the swap space be used by default at boot? ![screenshot of System Monitor showing swap as "not available"](http://i.stack.imgur.com/QSJuc.png)


title: Linux on a tegra tablet for programming

text: I would like to use a tablet for some mobile programming. It would be nice to read a pdf and immediately try the code on the same device. I've found various videos and tutorials how to get Ubuntu running on an ex-android tablet so I'd like to ask   * Has anybody of you ever used Linux on arm?   * How about driver support? I heard nvidia is releasing tegra drivers for linux but I guess a tablet without working wlan wouldn't be to nice either.   * Did you ever program on arm? Any problems with compilers, IDEs? Does eclipse work? Just to be clear: I'm not sure if a linux on arm is a good idea to code on. Are there any major problems or limitations you know ?


title: How can I grep the results of FIND using -EXEC and still output to a file?

text: Better to explain on examples. I can:               find . -name "*.py" -type f > output.txt      But how can I store the output to the same file for:               find . -name "*.py" -type f -exec grep "something" {} \      I can't just do               find . -name "*.py" -type f -exec grep "something" {} \ > output.txt


title: Resolving symbolic links (pwd)

text: Say I do the following:               cd /some/path     ln -s /target/path symbolic_name      If then do:               cd /some/path     cd symbolic_name     pwd      I get:               /some/path/symblic_name      and not:               /target/path      Is there a way to have the shell "fully resolve" a symbolic link (i.e. updating CWD, etc.), as if I had directly done:               cd /target/path      ? I need to run some programs that seem to be "aware" or "sensitive" about how I get to my target path, and I would like them to think that I arrived to the target path as if had done `cd /target/path` directly.


title: Gnome Update Manager stays at 100 % system load

text: I experience a strange behaviour on my Debian (Wheezy x64) every time I use the Gnome Update Manager.   1. While downloading the files, the CPU load stays low. ![CPU load low while downloading](http://i.stack.imgur.com/9PZnD.png) (click for better resolution)   2. When the new packages are unpacked the CPU runs hot.![CPU load high while updating](http://i.stack.imgur.com/cFtIc.png) (click for better resolution)   3. After finishing all updates the CPU load stays at 100 % (at least for one core) until I close the update manager.![CPU still high after updating](http://i.stack.imgur.com/qwsea.png) (click for better resolution) While I can perfectly understand (1) and (2) I don't see why (3) is the case. Can you explain? [edit] Before update:                 1  [||                                 3.3%]     Tasks: 80, 154 thr; 2 running       2  [||                                 3.3%]     Load average: 0.15 0.21 0.18        Mem[|||||||||||||||||||||||||||||840/1907MB]     Uptime: 00:37:53       Swp[                               0/2047MB]            PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command      3054 marcel    20   0  327M 15028 10632 S  2.0  0.8  0:01.28 gnome-terminal      1828 root      20   0  161M 22500  9980 R  1.0  1.2  0:43.00 /usr/bin/Xorg :0 -br -verbose -audit      3616 marcel    20   0 19820  1704  1176 R  1.0  0.1  0:01.49 htop      2476 marcel    20   0 1035M  383M 34944 S  1.0 20.1  2:15.71 /usr/lib/iceweasel/firefox-bin      2540 marcel    20   0 1035M  383M 34944 S  0.0 20.1  0:00.66 /usr/lib/iceweasel/firefox-bin      2266 marcel    20   0  396M 56320 13212 S  0.0  2.9  0:14.18 mutter      2282 marcel    20   0  522M 24896 16444 S  0.0  1.3  0:01.81 gnome-panel      2306 marcel    20   0  434M 43896 20636 S  0.0  2.2  0:06.83 mono /usr/lib/docky/Docky.exe      2255 marcel    20   0  382M 42124 11180 S  0.0  2.2  0:01.58 /usr/lib/gnome-settings-daemon/gnome-      2450 marcel    20   0  804M  139M 32548 S  0.0  7.3  0:32.14 /usr/lib/icedove/icedove-bin         1 root      20   0 10608   812   680 S  0.0  0.0  0:00.57 init [2]       300 root      20   0 21756  1824   820 S  0.0  0.1  0:00.07 udevd --daemon       431 root      20   0 21752  1244   336 S  0.0  0.1  0:00.00 udevd --daemon       432 root      20   0 21752  1208   300 S  0.0  0.1  0:00.00 udevd --daemon      1156 root      20   0 18924   964   708 S  0.0  0.0  0:00.00 /sbin/rpcbind -w      1171 statd     20   0 23104  1168   884 S  0.0  0.1  0:00.00 /sbin/rpc.statd      1191 root      20   0 31504   432   208 S  0.0  0.0  0:00.00 /usr/sbin/rpc.idmapd      1378 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.02 /usr/sbin/rsyslogd -c5      1379 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1380 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1377 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.04 /usr/sbin/rsyslogd -c5      1403 root      20   0  3904    76     0 S  0.0  0.0  0:00.00 /usr/sbin/acpi_fakekeyd      1408 messageb  20   0 24604  1936   800 S  0.0  0.1  0:00.40 /usr/bin/dbus-daemon --system      1438 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.01 /usr/sbin/NetworkManager      2358 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.00 /usr/sbin/NetworkManager      1418 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.37 /usr/sbin/NetworkManager      1435 root      20   0 78444  3144  2532 S  0.0  0.2  0:00.02 /usr/sbin/modem-manager      1445 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.11 /usr/lib/policykit-1/polkitd      1440 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.26 /usr/lib/policykit-1/polkitd      1467 daemon    20   0 16632   368   220 S  0.0  0.0  0:00.00 /usr/sbin/atd      1500 root      20   0 22920  1924  1640 S  0.0  0.1  0:00.00 /usr/sbin/bluetoothd      1505 root      20   0  4208   816   504 S  0.0  0.0  0:00.11 /usr/sbin/acpid      1526 avahi     20   0 34096  1696  1404 S  0.0  0.1  0:00.01 avahi-daemon: running [notebook-marce      1527 avahi     20   0 33976   452   212 S  0.0  0.0  0:00.00 avahi-daemon: chroot helper      1579 root      20   0 20364  1056   828 S  0.0  0.1  0:00.00 /usr/sbin/cron      1590 root      20   0 29072  2940  2416 S  0.0  0.2  0:00.07 /sbin/wpa_supplicant -u -s -O /var/ru      1825 root      20   0 72932  3112  2616 S  0.0  0.2  0:00.00 /usr/sbin/gdm3      1804 root      20   0 72932  3112  2616 S  0.0  0.2  0:00.01 /usr/sbin/gdm3      1813 Debian-e  20   0 48736  1012   568 S  0.0  0.1  0:00.00 /usr/sbin/exim4 -bd -q30m     F1Help  F2Setup F3SearchF4InvertF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit      after update (with gnome-update-manager still running):                 1  [||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%]     Tasks: 87, 159 thr; 2 running       2  [|||||                                                     7.2%]     Load average: 0.91 0.45 0.27        Mem[||||||||||||||||||||||||||||||||||||||||||||||||||||947/1907MB]     Uptime: 00:40:25       Swp[|                                                     0/2047MB]            PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command      3645 root      20   0  398M 57908 33632 S 100.  3.0  1:20.62 /usr/bin/python /usr/bin/update-manager      3658 root      20   0  398M 57908 33632 R 100.  3.0  1:18.40 /usr/bin/python /usr/bin/update-manager      1828 root      20   0  164M 23960 10556 S  1.0  1.2  0:47.46 /usr/bin/Xorg :0 -br -verbose -audit 0 -novtswitch -auth /var/run/gdm3/auth-for-De      3054 marcel    20   0  327M 15028 10632 S  1.0  0.8  0:01.63 gnome-terminal      3616 marcel    20   0 19936  1800  1176 R  0.0  0.1  0:03.67 htop      2476 marcel    20   0 1103M  442M 34960 S  0.0 23.2  2:25.30 /usr/lib/iceweasel/firefox-bin      2450 marcel    20   0  804M  139M 32548 S  0.0  7.3  0:32.28 /usr/lib/icedove/icedove-bin      2266 marcel    20   0  398M 56888 13240 S  0.0  2.9  0:15.63 mutter      3618 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.16 /usr/lib/iceweasel/firefox-bin      2306 marcel    20   0  434M 44480 20924 S  0.0  2.3  0:07.73 mono /usr/lib/docky/Docky.exe      2492 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.38 /usr/lib/iceweasel/firefox-bin      2315 marcel    20   0  434M 44480 20924 S  0.0  2.3  0:00.30 mono /usr/lib/docky/Docky.exe      2282 marcel    20   0  522M 25328 16444 S  0.0  1.3  0:02.00 gnome-panel       300 root      20   0 21756  1828   820 S  0.0  0.1  0:00.11 udevd --daemon      3660 root      20   0 57068  6596  2724 S  0.0  0.3  0:00.05 /usr/lib/libgconf2-4/gconfd-2      2255 marcel    20   0  382M 42124 11180 S  0.0  2.2  0:01.75 /usr/lib/gnome-settings-daemon/gnome-settings-daemon      1445 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.13 /usr/lib/policykit-1/polkitd      1440 root      20   0  126M  4064  2828 S  0.0  0.2  0:00.28 /usr/lib/policykit-1/polkitd      2181 marcel    20   0  151M  4408  3172 S  0.0  0.2  0:00.10 /usr/bin/gnome-keyring-daemon --daemonize --login      3628 marcel    20   0  162M  8064  6540 S  0.0  0.4  0:00.03 /usr/bin/gksu -k -D /usr/share/applications/update-manager.desktop -- /usr/bin/upd      3620 marcel    20   0  210M 24800 11484 S  0.0  1.3  0:00.13 /usr/bin/python /usr/bin/update-manager      2487 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:01.34 /usr/lib/iceweasel/firefox-bin      2540 marcel    20   0 1103M  442M 34960 S  0.0 23.2  0:00.66 /usr/lib/iceweasel/firefox-bin         1 root      20   0 10608   812   680 S  0.0  0.0  0:00.57 init [2]      1156 root      20   0 18924   964   708 S  0.0  0.0  0:00.00 /sbin/rpcbind -w      1171 statd     20   0 23104  1168   884 S  0.0  0.1  0:00.00 /sbin/rpc.statd      1191 root      20   0 31504   432   208 S  0.0  0.0  0:00.00 /usr/sbin/rpc.idmapd      1378 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.02 /usr/sbin/rsyslogd -c5      1379 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1380 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.00 /usr/sbin/rsyslogd -c5      1377 root      20   0  115M  1644  1152 S  0.0  0.1  0:00.04 /usr/sbin/rsyslogd -c5      1403 root      20   0  3904    76     0 S  0.0  0.0  0:00.00 /usr/sbin/acpi_fakekeyd      1408 messageb  20   0 24604  1936   800 S  0.0  0.1  0:00.42 /usr/bin/dbus-daemon --system      1438 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.01 /usr/sbin/NetworkManager      2358 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.00 /usr/sbin/NetworkManager      1418 root      20   0  147M  5208  4180 S  0.0  0.3  0:00.38 /usr/sbin/NetworkManager      1435 root      20   0 78444  3144  2532 S  0.0  0.2  0:00.02 /usr/sbin/modem-manager      1467 daemon    20   0 16632   368   220 S  0.0  0.0  0:00.00 /usr/sbin/atd      1500 root      20   0 22920  1924  1640 S  0.0  0.1  0:00.00 /usr/sbin/bluetoothd     F1Help  F2Setup F3SearchF4InvertF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit


title: How can I easily copy one user's profile to another's in GNOME?

text: I have a multi-user environment. I would like them to use one profile (with specific settings like: themes, shortcuts, installed keyboard layouts, wallpaper, main menu items, etc.). Currently I need to set the same settings for each user. Is there any way to just copy some files to another user's profile and have all this stuff already configured?


title: Select a range of logs from daily log archives

text: I have a folder containing daily logs, named as :               system-2013-01-01.log     system-2013-01-02.log     system-2013-01-03.log     system-2013-01-04.log     system-2013-01-05.log     system-2013-01-06.log     system-2013-01-07.log     system-2013-01-08.log     ...     system-2013-01-31.log      How can I select ( and copy ) the logs from 2013-01-01 to 2013-01-15 ?


title: Btrfs subvolume questions

text: Just a few questions about Btrfs:   1. Do I have to mount a Btrfs filesystem before creating subvolumes on it?   2. Can I easily convert an existing directory into a subvolume? (i.e. if I want to make "/home" a separate subvolume can I just go `mk_btrfs_subfolder /home` (or whatever the command is), instead of having to make a new empty subvolume and copying everything over? The commands to do the above would be good but not necessary, just yes/no will be fine and I can Google how.


title: scp force overwrite read only files

text: I was wanting to use `scp` to move some files and overwrite any existing instances of these files on the destination server. Some of them may be read only which, of course, courses the `scp` to fail with "permission denied". I couldn't seem to find a `\--force` type switch for `scp`; is this possible? I am aware of `rsync` but this is not currently available on the destination server.


title: Compilation under Yocto

text: I've got an image installed with Yocto and a custom distribution on it (kernel 3.1). Theoretically, can I compile code with GCC and execute the binaries on my Yocto ? Can I develop an application on it ? Or do I need to compile on another OS, then create my Yocto image with my application compiled ?


title: How to quit GNOME file copy GUI after it hangs

text: Many times I find GNOME file copy GUI tool (Nautilus) irritating when it stops working. It happens when:   * I cancel the copy or move   * I try to copy to blue tooth exchange folder to my friends laptop(when he forgets to permit the operation or if the file is big)   * some other times, it just hangs while copying So I obviously get irritated with this and I want to quit the operation immediately. Unfortunately whenever I try to cancel it, it never works. This happened to me several times so I tried to find the process `ps aux| grep copy or cp` or something like that but I m never successful. Maybe it has become a zombie process I guess.


title: Control browser from command line

text: I have an old router that I have set up as an AP on my home network. For some reason it loses connectivity every few days and needs a reboot. I would like to set up a script to run once every night to do this automatically. I can open the my browser (`iceweasel`) and navigate to my admin page of the router from the terminal:               iceweasel http://admin:password@192.168.1.1/WLG_adv.htm      On the page that this command opens there is a button with this code:               <input onclick="return checkData();" name="Apply" value="Apply" type="submit">      Is there a way of performing the same action as this button from the terminal? I'm using a Debian Linux.


title: Gnome Logout from command

text: How to get logout from Gnome session via command line ? Also Is there any way in GNOME to do "switch user" from command line ?


title: How to use colors/colorschemes/fonts in vim effectively so that the text is as readable as possible

text: I am trying to be more productive in `vim` and as part of this I am trying to make the text presentation i.e. colors etc as nice to the eyesight as possible.   Although I managed to change the default color and cursorline and cursor colors etc, the colors I added where somewhat "random". I.e. what ever I found online. But the result is really not so good and readable.   Do you have a nice template about coloring in vim that I could use to make my life easier and text more readable?   As a side note I am using MacBook which has some transparency in the commandline and this also affects what the appearence is.   Also I am using vim for coding and not regular text editing if this makes a difference.


title: Windows 8 ask for repair when launched from grub

text: I've installed Linux Mint and everything works beautifully. After installing I've used boot-repair to be able to launch windows 8 from grub (as I've read somewhere), after that I have those windows-related options in grub:   1. Windows 8 UEFI bkpbootmgfw.efi   2. Windows Boot UEFI loader   3. Windows Recovery Environment (loader)   4. Windows 8 (loader) when I choose option:   1. I get a windows 8 screen "something went wrong..." and the computer restarts and grub is launched again   2. Preperation of Automatic Repair starts, which scared me so I aborted it (I am worried it would mess my linux partition)   3. I didn't try that (again - is that "linux safe"?)   4. A message is displayed: error: can't find command `drivemap'. error: invalid EFI file path. Press any key to continue. Maybe number 2 would solve my problem I am just scare to run not to mess up my Linux.


title: Do all distrbutions have the same drivers for ATI cards?

text: The problem is that my fan is too loud and working nonstop on my desktop. I have tried so far: Ubuntu 13.04, Linux Mint 15 and I had in both the same fan problem (nonstop working fan and very loud). In Windows 7 it's working nice. Is this only a problem of Gnome distros or KDE or Xfce based would work better for me? My configuration is: * * * **HP Pro 3410 Microtower PC**. Graphic card: **AMD Radeon HD 6570** Board: **2A9C 1.1** Bus Clock: **133 megahertz** BIOS: **American Megatrends Inc. 6.14 11/05/2010** Processor: **3,20 gigahertz Intel Core i3 550** * * * DRIVERS I HAVE TRIED FOR MY GRAPHIC CARD: I have tried these drivers so far: **xserver-xorg-video-ati, version: 1:7.1.0-0ubuntu2** **fglrx Version: 2:9.010-0ubuntu3** **fglrx-updates Version 2:9.012-0ubuntu1** But the fan is still blowing like a maniac.


title: Passing a code block as an anon. function

text: Is it possible to treat a block of commands as an anonymous function?               function wrap_this {        run_something        # Decide to run block or maybe not.        run_something else     }          wrap_this {        do_something        do_somthing else     }          # Do something else          wrap_this {        do_something_else_else        do_something_else_else_else     }      (I realize you create a function or file for each block, but I find this option clearer and easier to read in certain situations.) `while` does it with `do/done` and `function` does it with `{ multiple lines }`. I realize BASH does not have anonymous functions, but is it possible to pass multiple commands to another function, like you can do when defining a function or `while`?


title: Can't get BIND and NS to work properly

text: I just got myself an unmanaged Dedicated VPS from OVH and I don't have a prior experience of setting up servers or DNS servers but I followed a couple of tuts and installed webmin and created NS Zones for my Domain but now I'm having a weird issue where mxtoolbox and intodns.com are saying that no NS records are found for my Domain although I did register ns1.example.com and ns2.example.com with my domain registrar (which is Network Solutions in this case) but it still keeps failing and I am unable to access the website. I have been looking for a solution for 2 days now and I still haven't gotten one. Also, I am using CentOs 6.3. Here is my BIND config which I got from Webmin               //     // named.conf     //     // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS     // server as a caching only nameserver (as a localhost DNS resolver only).     //     // See /usr/share/doc/bind*/sample/ for example named configuration files.     //     options {     listen-on port 53 { 127.0.0.1; 198.245.51.xxx;};     listen-on-v6 port 53 { ::1; };     directory   "/var/named";     dump-file   "/var/named/data/cache_dump.db";         statistics-file "/var/named/data/named_stats.txt";         memstatistics-file "/var/named/data/named_mem_stats.txt";     allow-query     { localhost; any; };                      ## IP Range ##     allow-transfer  { localhost; 198.245.51.xxx; };                        ## Slave     DNS IP ##      recursion yes;     dnssec-enable yes;     dnssec-validation yes;     dnssec-lookaside auto;     /* Path to ISC DLV key */     bindkeys-file "/etc/named.iscdlv.key";     managed-keys-directory "/var/named/dynamic";     forwarders {         198.245.51.xxx;         8.33.137.xxx;         };     };     logging {         channel default_debug {                 file "data/named.run";                 severity dynamic;         };     };     zone "." IN {     type hint;     file "named.ca";     };     include "/etc/named.rfc1912.zones";     include "/etc/named.root.key";     zone "example.org" {     type master;     file "/var/named/example.org.hosts";     allow-transfer {         8.33.137.xxx;         };     also-notify {         8.33.137.xxx;         };     };     zone "221.51.245.198.in-addr.arpa" {     type master;     file "/var/named/198.245.51.xxx.rev";     };      **My IP table rules** :- ![enter image description here](http://i.stack.imgur.com/eybKA.png) **My hosts file:-**               Do not remove the following line, or various programs     that require network functionality will fail.          127.0.0.1       localhost.localdomain localhost          198.245.51.xxx  ns1          198.245.51.xxx  example.org          198.245.51.xxx  ns1.example.org          198.245.51.xxx  ns1.example.org.      **My resolv.conf file** :-               namserver 198.245.51.xxx     ns1.example.org 198.245.51.xxx     ns2.example.org 8.33.137.xxx     nameserver 127.0.0.1     nameserver 213.186.33.xx     search ovh.net      **intodns.com results** :- ![enter image description here](http://i.stack.imgur.com/KxRlk.png) **Note:- Just in case there is any confusion regarding the domain** _example.org_ , I just use this alias to mask my domain name but I'm pretty sure you guys already figured that out so just putting it out there. **UPDATE:-** **My Zone File:-**               $ttl 38400     example.org.    IN  SOA ns1.example.org. admin.example.org. (             1368243151             10800             3600             604800             38400 )     example.org.    IN  NS  ns1.example.org.     example.org.    IN  A   198.245.51.xxx     www.example.org.    IN  A   198.245.51.xxx     ns1.example.org.    30m IN  A   198.245.51.xxx     example.org.    IN  NS  ns2.example.org.     ns2.example.org.    IN  A   8.33.137.xxx     198.245.51.xxx.example.org. IN  PTR ns1     198.245.51.xxx.example.org. IN  PTR example.org      **My Zone overview** :- _Zone_   **_Zone_** : Root zone **_Type_** : Root **_Zone_** : 0 **_Type_** : Master **_Zone_** : 0000::1 **_Type_** : Master **_Zone_** : 127.0.0.1 **_Type_** : Master **_Zone_** : 198.245.51.xxx **_Type_** : Master **_Zone_** : localhost Master **_Zone_** : localhost.localdomain **_Type_** : Master **_Zone_** : example.org **_Type_** :Master; **My dig results** :-               [xxxx@xxxxxx ~]# dig ns1.example.org          ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.4 <<>> ns1.example.org     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19537     ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1          ;; QUESTION SECTION:     ;ns1.example.org.            IN      A          ;; ANSWER SECTION:     ns1.example.org.     1800    IN      A       198.245.51.xxx          ;; AUTHORITY SECTION:     example.org.         38400   IN      NS      ns1.example.org.     example.org.         38400   IN      NS      ns2.example.org.          ;; ADDITIONAL SECTION:     ns2.example.org.     38400   IN      A       8.33.137.xxx          ;; Query time: 4 msec     ;; SERVER: 127.0.0.1#53(127.0.0.1)     ;; WHEN: Sat May 11 23:01:48 2013     ;; MSG SIZE  rcvd: 100      Please let me know if you need anymore info.