Will Linux start killing my processes without asking me if memory gets short?

I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some of my processes were `Killed`, as my terminal reported to me. Several programs had already successively completed before the programs that were later `Killed` started, but all the programs afterwards failed in a segmentation fault (which may or may not have been due to a bug in my code, keep reading). I looked at the usage history of the particular cluster I was using and saw that someone started running several memory-intensive processes at the same time and in doing so exhausted the real memory (and possibly even the swap space) available to the cluster. As best as I can figure, these memory- intensive processes started running about the same time I started having problems with my programs. Is it possible that Linux killed my programs once it started running out of memory? And is it possible that the segmentation faults I got later on were due to the lack of memory available to run my programs (instead of a bug in my code)?


Command to list in real time all the actions of a process

I cannot remember this command (and googling was unsuccessful), but there is a way to get the list of actions performed by a process, that outputs something like                 # listprocessactions -p 1234       0.321 Open "A" /var/log/nginx/supersite.log       0.322 Write to /var/log/nginx/supersite.log       0.401 Close /var/log/nginx/supersite.log       0.555 Opens TCP connection with slashdot.org       ...      I'm interested in the files aspect (open / RW files).   The question is what is that command (and if possible in which package on deb / ubuntu)


avconv with negative audio quality value

Is it possible to set the `-q:a` parameter to a negative value? For example, the value of `-1` is a valid quality level for the Vorbis codec.


Why `sed` does not return exit status if regex does not matched ?

I'm trying to search and replace some line from files, but when I run `sed` if that regex not match then `sed` does not return any status code, So instead of adding one more condition with `grep`, is there way in `sed` and Why `sed` does not return exit status ? Problem : ![enter image description here](http://i.stack.imgur.com/M1HHk.png)


How does word count work for newline (-l)? Number of newlines or lines

I wonder how does `wc` work? Most times it seems to return the number of lines, but sometimes it seems to be newlines? In the man page its newlines. But:               [jiewmeng@JM textFiles]$ echo -e "\n\n" | wc -           3       0       3 -      If the above returns the number of newlines, it should just return 2? Also I got this wierd file:               [jiewmeng@JM textFiles]$ cat testA.txt      The quick     brown fox     jumped over     the lazy      dog.[jiewmeng@JM textFiles]$ wc testA.txt       4  9 50 testA.txt      In the above case, it appears to be returning the number of newlines?


How to change default "reading" program?

right now when I run `man smth` or similar `less` is used to view it. However, on Mac OS X, I really like scrolling with touchpad instead on `up`/`down` or `page-up`/`page-down` buttons. Is there a way to just print text into the terminal instead of using `less` or `more`?


Are the boost headers separately packaged under Fedora?

The boost C++ library consists of several components. Some components do include shared libraries, other don't. Under a Fedora 14 system I've looked a bit around with `yum search boost` and `rpm -qR` and indeed like with other distributions the boost library is split into several packages. For example there is boost-program-options which only contains the shared libraries of the boost program-options component. It seems that package `boost` depends on all shared-library sub-packages. There is `boost-devel` which seems to provide all headers and depends on all shared-library sub-packages (via boost). Am I right that it is not possible to just install the boost headers via yum (using the default repositories) without all boost shared library packages?


Prevent a package from being installed?

I installed Python 2.7 from source. A dependency of some packages is python. Is there a way I can prevent the install of a lesser version of Python, or let apt know it's already been fulfilled?


restore suse grub

I upgraded my ubuntu and that resulted in its grub loader being used. I have a triboot of windows, ubuntu and suse. I prefer the suse bootloader which I was using before the ubuntu updates. I would like to restore the suse boot loader from yast. How do i do it?


Get scan codes in octal format

Using `showkey -s` I can get the scancode of a key as a hex-number. How can I get it directly as an octal number?


Why does AWK not like dots in one of two substitutions?

I'm trying to use AWK in a bash script to look for a placeholder string in a template file and replace it with the contents of a variable that (can) contain various special characters. Example:               awk -v SOURCEIP="$SOURCEIP" REVERSEDNS="$REVERSEDNS" '{        gsub(/^_TMPSOURCEIP_/, SOURCEIP);        gsub(/^_TMPREVERSEDNS_/, REVERSEDNS);        print     }' /home/foo/footemplate      When I try this though and debug, I get this error:               + awk -v SOURCEIP=1.1.1.1 REVERSEDNS=nz32-cm1.foo.blah.example.com '{        gsub(/^_TMPSOURCEIP_/, SOURCEIP);        gsub(/^_TMPREVERSEDNS_/, REVERSEDNS);        print     }' /home/foo/footemplate     awk: REVERSEDNS=nz32-cm1.foo.blah.example.com     awk:                    ^ syntax error      I infer from the arrow that awk doesn't like the dot in the REVERSEDNS variable... but if that were the case, why would it be OK with dots in the IP address?


A command which returns either a process ID, if running, or some other output if not?

I'm looking for a command that will give me the PID, and it's not running it should give me some output other than blank. In my program, sometimes the library I'm using gives blank output even if that process is running and I'm not able to detect whether the blank output is due to the libray or due to the process having stopped! Changing the library call will take time, so I'm looking for suggestions of such a shell command as workaround?


File copied from Win7 to Linux ext4 are empty/corrupted

Problem: User on Win7 machine. Copy a simple text file from Win7 local drive, through samba, to Linux ext4 dir. The content of copied file on ext4 dir is empty when user open it. Only 1 user has such problem. Other user copying file to same ext4 dir has no issue. Tried so far:               1. Remove smb user, then readd user.     2. Copy to different ext4 dir, same problem.     3. Restart smb service, same problem.     4. Copy file from another Win7 and WinXP machine, same problem.     5. Tried copy file using WinSCP, to ext4 dir, the file doesn't get copied over and I got "Failure: Error code 4".  Ext4 dir is not full.      On Win7 machine, looking at file attribute: Other users' files have an attribute of 'A', but for this one particular user, her files have 'AP' attribute. The files with 'A' attribute open just fine. The files with 'AP' attribute can be opened, but there's no content. I'm not sure how to fix this and where else to check. Can anyone here help? Installed:               samba-3.0.33-0.34.el4     samba-common-3.0.33-0.34.el4     samba-client-3.0.33-0.34.el4


Cannot SSH to VM

I have a VM installed with some custom disk image (CentOS) from work, and I can't SSH into the VM. Here are some things I've tried:               [VM]$ ssh root@localhost     Password:      Great, ssh is working with the loopback. But when I try from the host machine:               ~/VirtualBox VMs% ssh -v -v -v root@192.168.56.1     OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 192.168.56.1 [192.168.56.1] port 22.     debug1: connect to address 192.168.56.1 port 22: Connection refused     ssh: connect to host 192.168.56.1 port 22: Connection refused      Nada. Ping works though. on the VM, /etc/hosts.allow:               ssh:ALL:allow     sshd:ALL:allow      nothing in hosts.deny EDIT:   I've also done:               service iptables save     service iptables stop     chkconfig iptables off      EDIT:   I'm also seeing this message on the VM in /var/log/secure   ![bind to port conflict](http://i.stack.imgur.com/Dsu2a.png)   But I can ssh just fine from the VM to the VM, so this isn't the issue, right? EDIT: `[VM]$ lsof -i :22` ![lsof -i :22 output](http://i.stack.imgur.com/hFLb0.png) And I have, in /etc/ssh/sshd_config               PermitRootLogin yes        And cannot login with a separate username. EDIT:   ` netstat -pant |grep :22` and ` netstat -ntp |grep :22` ![netstat -pant and netstat -ntp](http://i.stack.imgur.com/78ovI.png)   I think maybe this also points towards the IPv6 solution? EDIT:   Existing config for `vi /etc/sysctl.conf` ![/etc/sysctl.conf](http://i.stack.imgur.com/HSK6U.png) New config for `vi /etc/sysctl.conf` ![/etc/sysctl.conf after change](http://i.stack.imgur.com/H15JY.png) I then ran the commands:               sysctl -w net.ipv6.conf.default.disable_ipv6=1     sysctl -w net.ipv6.conf.all.disable_ipv6=1     chkconfig ip6tables off     service sshd restart     init 6      Aaaaaaand, still nothing. But after a restart, it looks like ipv6 isn't disabled. I'm getting the same error message. ![cannot bind port 22](http://i.stack.imgur.com/boU5v.png) And `lsof -i :22` is still saying type IPv6: ![lsof -i :22](http://i.stack.imgur.com/nnJUy.png) EDIT: Going further down the IPv6 rabbit hole.   http://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/   It says to remove the commented line with `#ListenAddress ::`, which seems fishy, cause it's already commented out. So I did, and nothing. However, the next section has a useful tidbit: `AddressFamily inet # IPv4 only` When I add this line to `/etc/ssh/sshd_config` and do a couple consecutive restarts, I now see that my address binding error has stopped appearing in `/var/log/secure` ![/var/log/secure](http://i.stack.imgur.com/55Lng.png)   and the output of `lsof -i :22` now shows a type of IPv4! ![yay, progress! lsof -i :22 shows IPv4](http://i.stack.imgur.com/B95yt.png) Progress!! But unfortunately I still cannot connect. I tried rebooting the VM, opening new shell windows just in case there was some state left hanging around. Still the same answer.               ~% ssh -vvv root@192.168.56.1     OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 192.168.56.1 [192.168.56.1] port 22.     debug1: connect to address 192.168.56.1 port 22: Connection refused     ssh: connect to host 192.168.56.1 port 22: Connection refused      EDIT:   ok, so i got arp-scan and am trying to find IP conflicts, but now i'm even more confused. ifconfig shows that vboxnet0, which is the host-only adapter, has an IP of 192.168.56.1. That's where I got that IP to begin with.               [local]~root# ifconfig       lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384         options=3<RXCSUM,TXCSUM>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1          inet 127.0.0.1 netmask 0xff000000          inet6 ::1 prefixlen 128      gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280     stf0: flags=0<> mtu 1280     en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500         ether 7c:d1:c3:e8:b0:e9          inet6 fe80::7ed1:c3ff:fee8:b0e9%en0 prefixlen 64 scopeid 0x4          inet 10.6.12.46 netmask 0xfffffe00 broadcast 10.6.13.255         media: autoselect         status: active     p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304         ether 0e:d1:c3:e8:b0:e9          media: autoselect         status: inactive     vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500         ether 0a:00:27:00:00:00          inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255     vboxnet1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500         ether 0a:00:27:00:00:01          inet 192.168.57.1 netmask 0xffffff00 broadcast 192.168.57.255      But `arp-scan -l` gives only domains starting with 10.6.*.*   So I guess it's looking at en0? So I tried   `arp-scan -I vboxnet0 -l`               mba-108-on-03:~ root# arp-scan -I vboxnet0 -l     Interface: vboxnet0, datalink type: EN10MB (Ethernet)     Starting arp-scan 1.8 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)     192.168.56.100  08:00:27:bc:ed:2f   CADMUS COMPUTER SYSTEMS          512 packets received by filter, 0 packets dropped by kernel     Ending arp-scan 1.8: 256 hosts scanned in 1.301 seconds (196.77 hosts/sec). 1 responded      Why is it now .100? #confused vboxnet1 has nothing               mba-108-on-03:~ root# arp-scan -I vboxnet1 -l     Interface: vboxnet1, datalink type: EN10MB (Ethernet)     Starting arp-scan 1.8 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)          512 packets received by filter, 0 packets dropped by kernel     Ending arp-scan 1.8: 256 hosts scanned in 1.302 seconds (196.62 hosts/sec). 0 responded      All of the other interfaces don't work with arp-scan. So let's show duplicates on the en0 interface:               mba-108-on-03:~ root# arp-scan -I en0 -l |grep DUP     10.6.12.68  84:8e:0c:75:5b:f4   (Unknown) (DUP: 2)     10.6.12.64  ac:cf:5c:42:24:47   (Unknown) (DUP: 2)     10.6.12.76  88:53:95:6e:6a:af   (Unknown) (DUP: 2)      These numbers don't correspond to anything meaningful for me. Going to try a reboot, then the IPv6 suggestion. EDIT:   The VM is a VirtualBox.   Adapter 1: NAT   Adapter 2: Host-only Adapter, 'vboxnet0' ![config of adapter1](http://i.stack.imgur.com/lzj4m.png) ![config of adapter2](http://i.stack.imgur.com/dRiHM.png)   Any ideas?


Problem with WPA connection on OpenBSD

I have an OpenBSD 5.3 amd64 installed and Intel WiFi Link 1000 card which works with WEP but I obtain a strange message with WPA keys:               # sh /etc/netstart iwn0      iwn0: no link ............. sleeping          # dhclient iwn0     iwn0: no link ............. sleeping      configuration :               # cat /etc/hostname.iwn0                                                 dhcp nwid Livebox-5dxx wpakey xxxxxxxxxxxxxxxxxxxxxxxxxx     # cat /etc/mygate     192.168.1.1 // Correct I check      Result with ifconfig :               # ifconfig iwn0     iwn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500     lladdr 74:e5:0b:c6:xx:xx     priority: 4     groups: wlan     media: IEEE802.11 autoselect (DS1 mode 11g)     status: no network     ieee80211: nwid Livebox-5dxx chan 6 bssid 00:19:70:a5:xx:xx 222dB wpakey 0x620f88c77fc3866ac2165966050980e5cc18f2a606c84b680c62xxxxxxxxxxxx wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip     inet6 fe80::76e5:bff:fec6:d914%iwn0 prefixlen 64 scopeid 0x2      I would like to know how to debug this configuration. Is it normal that my WPA key appear in hex with prefix `0x` in `ifconfig` output? How do I ensure that my WPA key settings are correct?


XDMX Setup Help

I have been searching for some time now, but apparently I am not using the proper words. I am trying to setup a cluster with xdmx to display all of the information from my head node, but I am only getting 16 monitors working with a few problems. I am running CentOS 6.2, but I am wondering if I need to switch distos, or if anyone has a nice guide to setting this up. I would appreciate any direction whatsoever as I am pretty knew to this proxy X server stuff.


Fedora-19 does not hibernate on Toshiba Satellite laptop

Fedora 19 no hibernation, black screen with some gibberish which I'll try to post ( a pic?).Also no shutdown by clicking on the menu. ACPI? Other Linux distros have no such problems. Tried the advice given here and others found elsewhere on the net, including the pm-hibernate - none help. One point, i dunno if it matters, the fedora19 is installed on a USB flash drive. The laptop is Toshiba Satellite L750-S5151. Output of `lshw`: http://pastebin.com/16izPA5y The 14GiB USB disk is the one with the fedora install. AFAIK the USB drive should be ID'd by UUID in /etc/fstab, I dunno why hostname is used in root and swap, :               /dev/mapper/HOSTNAME-root / ext4 defaults,x-systemd.device-timeout=0 1 1     UUID=UUID /boot ext4 defaults 1 2     /dev/mapper/HOSTNAME-swap swap swap defaults,x-systemd.device-timeout=0 0 0      HOSTNAME and UUID replace the actual ones. Also I'm not sure if swap should be in `/etc/mtab`, it is not in there.


listen to a conversation using port forwarding

I have been able to make a phone calls using the SIP client Pjsua from one Linux computer to another one. In case you have not heard of this user agent, explaining it's functionality is quite easy. It uses IP and port number of each linux to create a unique ID and then calling to this specific ID is possible. Now I have not studied port forwarding thoroughly but I suppose what it does is to forward whatever data that comes in, to another "port" or "IP and port". So I thought to myself, if my calling application is using ports and IPs to send and receive voice, I should be able to forward those specific ports to a second or third port (or IP and port) and listen to the conversation on a third computer. So here is what I did. Supposing that machine **Linux A** has the following identification info:               IP:192.168.1.11`  `UDP port# : 1111      The second machine **Linux B** has the following identification:               IP:192.168.1.22`  `UDP port# : 2222      If I do the following using `iptables` I should be able to hear that side of the conversation which is being received on **Linux B** on a 3rd system, **Linux C** . The third machine, **Linux C** has the following identification info:               IP:192.168.1.33`  `UDP port# : 3333      To achieve this, I tried running this command on **Linux B** :               $ iptables -t nat -A PREROUTING -p udp --dport 2222 -j DNAT     --to-destination 192.168.1.33:3333    //forward port 2222 to Linux C on port 3333      And ran this command on **Linux C** :               $ aplay | nc -l -u 3333     //listen on the specified UDP port       However I don't hear anything on **Linux C**. Can anyone tell me why this is not working? Other strategies to do something like this are also welcome.


How to disable DNS caching or override TTL for a certain hostname?

I've set up my own dynamic DNS service by using a script to automatically update the A record for a subdomain of one of my domains.   The host with the dynamic IP address runs, among other things, a Munin node which I'm reading remotely at five-minute intervals.   Unfortunately, my domain name registrar doesn't allow TTL values less than 3600, so the IP for the remote Munin node is cached for an hour and the connections fail for up to said hour whenever the node's dynamic IP changes. Is there a way to override the TTL reported by my registrar's DNS server, so the server will re-resolve the IP each time it connects to the Munin node?


processing command output line by line, without mixing standard input

So, I have a problem very similar to Bash: How to read one line at a time from output of a command?, I am doing:               while read path; do mplayer $path; done < <(find-me-random-mp3s)      or               find-me-random-mp3s | while read path; do mplayer $path; done      The command `find-me-random-mp3s` outputs file paths each on a new line. The problem starts when `mplayer` runs, it starts consuming lines from `find-me- random-mp3s` output, i.e. lines that were supposed to be filled inside the `path` variable on each iteration. I went on with this dirty fix:               find-me-random-mp3s | while read path; do cat /dev/null | mplayer $path; done      But I don't really like it, it blocks my terminal interaction with mplayer too. Is there any alternative method that I can use in such case?


catch http requests from another process

Suppose a process, among other things, is posting https requests, for example with curl. Assuming I have root privileges, is there a way to intercept such requests and respond with an http error or, even better with acknowledgment? I am using an embedded device, so I have limited access to software libraries.


Backup Ubuntu as an installer

I'm using ubuntu since 2007/8 and still I use the same system with upgrading it. I'm not a person who good in linux but developing under linux. Now I want to format the system and re install a new, but I need the previous (currently using) ubuntu system as a backup and, whenever I need that, I want to install it as a regular OS. how can I do it? Anything appreciate. Thank you!


How to increase the timer before drive spins-down?

I use Ubuntu 12 beta on a Lenovo Z575. I noticed that the disk spins down a few seconds after the last operation. When I am working, e.g. in the vim and write quite often, it spins-up and -down frequently. This causes vim to freeze for a second. I used `hdparm` but it didn't change anything:               hdparm -S 24 /dev/sda # 2 minutes standby time      and I see (and hear) that the disk is idle or working:               hdparm -C /dev/sda     drive state is: standby     # or...     drive state is: active/idle      I have `laptop-mode-tools` already installed.


zlib support for PIL won't work

I'm trying to install PIL as per its instruction on debian but can't figure how to fix this bit: I get --- ZLIB (PNG/ZIP) support available on build_ext and _*_ ZLIB (PNG/ZIP) support not installed on selftest what am I missing?               root@portman:~/dist/Imaging-1.1.7# python setup.py build_ext -i     running build_ext     --------------------------------------------------------------------     PIL 1.1.7 SETUP SUMMARY     --------------------------------------------------------------------     version       1.1.7     platform      linux2 2.7.2+ (default, Dec  1 2011, 01:55:02)                   [GCC 4.6.2]     --------------------------------------------------------------------     *** TKINTER support not available     --- JPEG support available     --- ZLIB (PNG/ZIP) support available     --- FREETYPE2 support available     --- LITTLECMS support available     --------------------------------------------------------------------     To add a missing option, make sure you have the required     library, and set the corresponding ROOT variable in the     setup.py script.          To check the build, run the selftest.py script.     root@portman:~/dist/Imaging-1.1.7# python selftest.py     --------------------------------------------------------------------     PIL 1.1.7 TEST SUMMARY     --------------------------------------------------------------------     Python modules loaded from ./PIL     Binary modules loaded from ./PIL     --------------------------------------------------------------------     --- PIL CORE support ok     *** TKINTER support not installed     --- JPEG support ok     *** ZLIB (PNG/ZIP) support not installed     --- FREETYPE2 support ok     --- LITTLECMS support ok     --------------------------------------------------------------------     Running selftest:     --- 57 tests passed.


kexec from within initramfs

Can `kexec` be used from within `initramfs` to load up a new image and kernel? It seems that `kexec` calls `shutdown` which then looks for `/dev/initctl`, which is missing from a `busybox` `initramfs` image. Any guidance would be appreciated!


How to make titlebars in XFCE bigger?

No matter how big font I set for titlebar, the height of the titlebar is not changed at all. I don't see any editbox where I could enter the desired height of titlebar. So far, I only found workaround, that you should edit window's button (close, maximize, and so on) from current theme. However this is tiresome, because if you decide, that the new height is not OK, and it should be 1 px bigger, you have to rescale the buttons (whole set) again. I am looking for something theme independent, and straightforward.


Strange behaviour of uninitialized arrays and unset arrays

I'm writing a script and I discovered some unexpected behaviour of uninitialized and unset array variables that I do not understand. First of all, the length:               giacomo@jack-laptop:~$ echo ${#notset[@]}     0     giacomo@jack-laptop:~$ uninitialized=     giacomo@jack-laptop:~$ echo ${#uninitialized[@]}     1      Why is the `uninitialized` length 1? Shouldn't it be zero? Is it because a null variable is considered an array of one null element? This fact leads to some problems. For example suppose I want to create an array, and insert a certain number of things based on the user command line arguments. I thought I could do something like(+):               myarray=          if [ some-condition ]     then         myarray[${#myarray[@]}]=some-value     fi          if [ some-condition2 ]     then         myarray[${#myarray[@]}]=some-value2     elif [ some-condition3 ]     then         myarray[${myarray[@]}]=some-value3         myarray[${myarray[@]}]=some-value4     fi      But this leaves the first slot to null, which I do not like and also breaks some code that I have written(*), and at this point suppose that I want to see if the array contains any element. How should I do it?               [ -z "${myarray[@]}" ]      Raises an error if the array contains more than an element.               [ -z "$myarray" ]      Fails because the first element is null, even if the array is not empty. So, how should I control that an array is uninitialized? And could someone explain what exactly happens when dealing with _arrays_ and unset - uninitialized variables? * * * (+) I know that I could avoid "declaring" the variable and it would work, but this script will be reviewed by a professor, and he does not like variables being defined at random places. (*) Before trying this thing I was keeping the length of the array in an other variable, and so I did not have problems. But I'd like to avoid defining this auxiliary variables since I know I can obtain the length without them.


How to create a new user without his own FS but with access to write to only one folder of user that creates him?

What are the command(s) to create a new user (not from `su`), give him the ability to write to only one folder which is some directory owned by an already existing user (the one that created him)? Meaning that the folder is already under some existing user's FS. How can I create another user and only let him write to that folder? I was told here: > Use useradd, adduser, or whatever utility your unix variant has to create a > user. The easiest way to control access to the directory is to make it and > its files (but nothing else) owned by a newly created group, and make the > new user a member of that group (and no other group). but I do not know which commands to use to do such thing. So how to do it?


Why does Firestarter say my firewall is active but ufw status shows it as inactive?

I am using Linux Mint and am having the following issue. Firestarter tells my that my firewall is active and it does indeed seem to be active. However when I type "sudo ufw status" into the terminal, I get the response "Status: inactive". It is my understanding that Firestarter is merely a way of controlling ufw. So, why the discrepancy?


Installing virtualbox on Debian: dependency problems

I'm currently running Debian Wheezy (Testing). I want to install `virtualbox` but when I run the following:               # aptitude install virtualbox      ...I get the following result:               The following packages have unmet dependencies:      libqt4-qt3support : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.                          Depends: libqtgui4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      qdbus : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-script : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-designer : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.                        Depends: libqtgui4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-network : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-dbus : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      qt4-qtconfig : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.                     Depends: libqtgui4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-sql : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-xml : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      libqt4-sql-mysql : Depends: libqtcore4 (= 4:4.8.2+dfsg-2) but 4:4.8.2+dfsg-6 is to be installed.      Aptitude then gives me a list of solutions, none of which seem very appealing. It seems to want to install packages from unstable rather than testing, but I don't really want to do this. **Why is this a problem if the packages have the correct version numbers?** This is the contents of my `/etc/apt/source.list`:               deb http://debian.man.ac.uk/debian/ wheezy main non-free contrib     deb-src http://debian.man.ac.uk/debian/ wheezy main non-free contrib          deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free          deb http://debian.man.ac.uk/debian/ wheezy-updates main contrib non-free     deb-src http://debian.man.ac.uk/debian/ wheezy-updates main contrib non-free          # The following line is required for iceweasel in wheezy     deb http://debian.man.ac.uk/debian experimental main          # The following line is required for icedove in wheezy     deb http://debian.man.ac.uk/debian unstable main


How to run chrome from terminal window after deb isntallation?

I have remote box accessed by VNC and `jwm` desktop. No menus, not desktop icons, only terminal window. I have downloaded `chrome` deb package and installed it. Now how can I run it from terminal window?


What is in the output of "getent ahosts"?

What are the fields printed by `getent ahosts DOMAIN`? The output for `getent hosts` is a simple combination of IP and hostname. The `getent ahosts` has an additional third field that is, in all my test, either `STREAM`, `DGRAM` or `RAW`. Output for `getent hosts example.net`               2001:500:88:200::10 example.net      and for `getent ahosts example.net`               2001:500:88:200::10 STREAM example.net     2001:500:88:200::10 DGRAM       2001:500:88:200::10 RAW         192.0.43.10     STREAM      192.0.43.10     DGRAM       192.0.43.10     RAW


Piped search queries in vim or less

I would like to be able to search a log file for lines that being with ^2014-02-18 15:30:[0-9:,]* and have UserName:someguy much later in the same line. I am sure I could do a regex to include any number of characters, digits and spaces before that point, but I would like to know if I could effectively do something like `/^2014-02-18 15:30:[0-9:,]* | /UserName:someguy` meaning pipe the results of the first search through the second search, while still in vim or less. Obviously I could do this with grep externally.


crossplatformui error in Mint 11

Whenever I try to install something in my system it generally installs but shows some error related to "crossplatformui". I don't know what it is and how to remove it. I am printing here a sample session:               Reading package lists... Done     Building dependency tree            Reading state information... Done     The following extra packages will be installed:       wordnet wordnet-base wordnet-sense-index     The following NEW packages will be installed:       artha wordnet wordnet-base wordnet-sense-index     0 upgraded, 4 newly installed, 0 to remove and 18 not upgraded.     1 not fully installed or removed.     Need to get 11.1 MB of archives.     After this operation, 38.1 MB of additional disk space will be used.     Do you want to continue [Y/n]? y     Get:1 http://archive.ubuntu.com/ubuntu/ natty/universe wordnet-base all 1:3.0-23ubuntu1 [8,761 kB]     Get:2 http://archive.ubuntu.com/ubuntu/ natty/universe wordnet i386 1:3.0-23ubuntu1 [57.8 kB]     Get:3 http://archive.ubuntu.com/ubuntu/ natty/universe artha i386 1.0.1-1ubuntu1 [65.3 kB]     Get:4 http://archive.ubuntu.com/ubuntu/ natty/universe wordnet-sense-index all 1:3.0-23ubuntu1 [2,243 kB]     Fetched 11.1 MB in 1min 12s (153 kB/s)                                              Selecting previously deselected package wordnet-base.     (Reading database ... 146247 files and directories currently installed.)     Unpacking wordnet-base (from .../wordnet-base_1%3a3.0-23ubuntu1_all.deb) ...     Selecting previously deselected package wordnet.     Unpacking wordnet (from .../wordnet_1%3a3.0-23ubuntu1_i386.deb) ...     Selecting previously deselected package artha.     Unpacking artha (from .../artha_1.0.1-1ubuntu1_i386.deb) ...     Selecting previously deselected package wordnet-sense-index.     Unpacking wordnet-sense-index (from .../wordnet-sense-index_1%3a3.0-23ubuntu1_all.deb) ...     Processing triggers for man-db ...     Processing triggers for menu ...     Processing triggers for bamfdaemon ...     Rebuilding /usr/share/applications/bamf.index...     Processing triggers for desktop-file-utils ...     Processing triggers for python-gmenu ...     Rebuilding /usr/share/applications/desktop.en_IN.utf8.cache...     Processing triggers for python-support ...     Setting up crossplatformui (2.1.1) ...     Rather than invoking init scripts through /etc/init.d, use the service(8)     utility, e.g. service acpid restart          Since the script you are attempting to invoke has been converted to an     Upstart job, you may also use the stop(8) and then start(8) utilities,     e.g. stop acpid ; start acpid. The restart(8) utility is also available.     acpid stop/waiting     acpid start/running, process 2658     package libqtgui4 exist     QT_VERSION = 4     Sorry! The usb-serial driver does not support your Linux version.     Sorry! Make usb-serial driver error.     But, it try to use the default driver module.     mv: cannot stat `/usr/local/bin/ztemtApp/ztemt.ko': No such file or directory     dpkg: error processing crossplatformui (--configure):      subprocess installed post-installation script returned error exit status 1     Setting up wordnet-base (1:3.0-23ubuntu1) ...     Setting up wordnet (1:3.0-23ubuntu1) ...     Setting up artha (1.0.1-1ubuntu1) ...     Setting up wordnet-sense-index (1:3.0-23ubuntu1) ...     Processing triggers for menu ...     Processing triggers for libc-bin ...     ldconfig deferred processing now taking place     Errors were encountered while processing:      crossplatformui     E: Sub-process /usr/bin/dpkg returned an error code (1)


Will the Firewall GUI in CentOS overwrite changes implemented by IPTABLES manual edits?

I would like to restrict access to the SSH port of a new CentOS 6.2 server to select IP addresses but the Firewall GUI utility seems to be an all-or-nothing scenario. Either the port is firewalled or it is opened. If I make changes using the IPTABLES commands and save them out, and then later someone uses the Firewall GUI to make other modifications such as opening up access to FTP or the like, will that remove the changes I made using the IPTABLES commands or manual edits to the tables?


Postfix: Forward/Reroute mails with unknown recipients

I'm running a postfix/dovecot mail server and everything works quite well.   What I want to do now is forward all mails with a recipient that does not have an entry in the local recipient table, to another, existing user. I've tried google'ing around, but I haven't found anything...it seems like this is an uncommon thing to do. Does anyone know how to do that, or can maybe point me to a lead? Thanks a lot in advance.


port opening in linux server

I need to open port 7001 in a linux server ( RHEL 6.3 ). Firewall is not running.               [root@hslsaoid2 ~]# service iptables status     iptables: Firewall is not running.      Please find the `netstat -ntpl` output               [root@hslsaoid2 ~]# netstat -ntpl     Active Internet connections (only servers)     Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name     tcp        0      0 0.0.0.0:57991               0.0.0.0:*                   LISTEN      15590/rpc.mountd     tcp        0      0 0.0.0.0:875                 0.0.0.0:*                   LISTEN      15586/rpc.rquotad     tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1299/rpcbind     tcp        0      0 0.0.0.0:55698               0.0.0.0:*                   LISTEN      -     tcp        0      0 0.0.0.0:51828               0.0.0.0:*                   LISTEN      -     tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1582/sshd     tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1474/cupsd     tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1674/master     tcp        0      0 0.0.0.0:47486               0.0.0.0:*                   LISTEN      1425/rpc.statd     tcp        0      0 0.0.0.0:2049                0.0.0.0:*                   LISTEN      -     tcp        0      0 0.0.0.0:34658               0.0.0.0:*                   LISTEN      15590/rpc.mountd     tcp        0      0 0.0.0.0:42820               0.0.0.0:*                   LISTEN      15590/rpc.mountd     tcp        0      0 :::5989                     :::*                        LISTEN      1767/cimservermain     tcp        0      0 :::34122                    :::*                        LISTEN      15590/rpc.mountd     tcp        0      0 :::111                      :::*                        LISTEN      1299/rpcbind     tcp        0      0 :::22                       :::*                        LISTEN      1582/sshd     tcp        0      0 :::46679                    :::*                        LISTEN      15590/rpc.mountd     tcp        0      0 ::1:631                     :::*                        LISTEN      1474/cupsd     tcp        0      0 ::1:25                      :::*                        LISTEN      1674/master     tcp        0      0 :::46521                    :::*                        LISTEN      1425/rpc.statd     tcp        0      0 :::36283                    :::*                        LISTEN      -     tcp        0      0 :::32896                    :::*                        LISTEN      -     tcp        0      0 :::8704                     :::*                        LISTEN      13631/java     tcp        0      0 :::2049                     :::*                        LISTEN      -     tcp        0      0 :::60929                    :::*                        LISTEN      15590/rpc.mountd      I tried to edit in `/etc/sysconfig/iptables` and restart the firewall but failed.. Kindly help to open port..


Monitoring the OpenSSH sFTP process?

Is there a way to monitor the current status of my sFTP process from my Debian server? I'm looking from something similar to `top` or `netstat` that will give me the status/progress of activities (uploads, downloads) to my OpenSSH-based sFTP server. Other bits that might be of use: I'll be looking at the results using a SSH session on the server. There is only one sFTP enabled user.


Need help processing a text file with awk to conform to CSV flat file format

I have the following problem. I collected data on reaction time from over 100 participants for an experiment I am running. Unfortunately, the separators between fields were not consistent, but after a lot of heartache with sed, I have managed to solve this problem. The experiment was divided into blocks (5 for each participant) and what I need is each block to be outputted on its own line, separated by commas. Here is a sample of my datafile:               Participant: 2456, Test: Optimism IAT. Format is stimulus ,  correct(1)/incorrect(0) ,  time(ms).  Writes 10 trials per line.     17/01/2011, 12:46:03 ,     Block 1: , Theirs   , 1        , 1921     , Myself   , 1        , 928      , Them     , 1        , 716      , Theirs   , 1        , 720      , Myself   , 1        , 533      , Me       , 1        , 596      , Themselves , 1        , 527      , Myself   , 1        , 656      , Mine     , 1        , 551      , Myself   , 1        , 624          , Themselves , 1        , 570      , Me       , 1        , 514          ,Block 1 Time,: 8856    ,     Block 2: , Failing  , 1        , 1835     , Happy    , 1        , 1118     , Sad      , 1        , 673      , Succeeding , 1        , 690      , Improving , 1        , 795      , Succeeding , 1        , 602      , Worse    , 1        , 586      , Succeeding , 1        , 553      , Improving , 1        , 619      , Disimproving , 1        , 659          , Succeeding , 1        , 596      , Failing  , 1        , 539          ,Block 2 Time,: 9265    ,     Block 3: , Succeeding , 1        , 2881     , Disimproving , 1        , 1072     , Mine     , 1        , 1120     , Me       , 1        , 627      , Happy    , 1        , 669      , Theirs   , 1        , 1539     , Worse    , 1        , 841      , Me       , 1        , 862      , Sad      , 1        , 1370     , Succeeding , 1        , 1115         , Worse    , 1        , 855      , Theirs   , 1        , 792      , Them     , 1        , 627      , Better   , 1        , 735      , Me       , 1        , 626      , Happy    , 1        , 622      , Succeeding , 1        , 616      , Mine     , 1        , 646      , Them     , 1        , 599      , Disimproving , 1        , 607          , Better   , 1        , 799      , Myself   , 1        , 1408     , Me       , 1        , 463      , Better   , 1        , 839      , Failing  , 1        , 602      , Mine     , 1        , 633      , Better   , 1        , 525      , Sad      , 1        , 573      , Worse    , 1        , 770      , Me       , 1        , 508          , Theirs   , 1        , 613      , Disimproving , 1        , 649      , Improving , 1        , 701      , Theirs   , 1        , 590      , Disimproving , 1        , 716      , Better   , 1        , 714          ,Block 3 Time,: 29924   ,     Block 4: , Them     , 1        , 1659     , Myself   , 1        , 1036     , Themselves , 1        , 595      , Me       , 1        , 509      , Myself   , 1        , 648      , Themselves , 1        , 542      , Myself   , 1        , 536      , Mine     , 1        , 537      , Theirs   , 1        , 615      , Mine     , 1        , 520          , Me       , 1        , 596      , Mine     , 1        , 471          ,Block 4 Time,: 8264    ,     Block 5: , Mine     , 1        , 1527     , Myself   , 1        , 1235     , Disimproving , 0        , 2001     , Theirs   , 1        , 981      , Succeeding , 1        , 1994     , Happy    , 1        , 1454     , Failing  , 1        , 1941     , Theirs   , 1        , 1151     , Failing  , 0        , 1358     , Me       , 1        , 790          , Failing  , 1        , 717      , Mine     , 1        , 585      , Myself   , 1        , 821      , Themselves , 1        , 793      , Disimproving , 1        , 965      , Succeeding , 1        , 727      , Worse    , 1        , 961      , Theirs   , 1        , 1259     , Mine     , 1        , 578      , Better   , 1        , 1112         , Mine     , 1        , 1207     , Happy    , 1        , 843      , Worse    , 1        , 1064     , Failing  , 1        , 699      , Happy    , 1        , 700      , Myself   , 1        , 516      , Them     , 1        , 794      , Me       , 1        , 526      , Sad      , 1        , 1118     , Improving , 1        , 826          , Mine     , 1        , 540      , Succeeding , 1        , 952      , Myself   , 1        , 536      , Themselves , 1        , 851      , Improving , 1        , 865      , Mine     , 1        , 582          ,Block 5 Time,: 35569        As you can see, each of the blocks take up multiple lines. I need them to take up one line in the following format               Participant Date Time   Block  Word1 Correct1 Time1.....Word36 Correct36  Time36     2456                    1      Happy   1      1200       sad    0         1500     .     .     .     1234                     5    sad       0     1100       happy   1       900      The issue is that blocks 3 &5 have 36 stimuli while blocks 1,2 &4 have 12. I need the participant, datetime and block time in each row also. Here is the script that got the data into the form you see here, but it doesn't give me each block on one line only which is what i need. Your help would be greatly appreciated.               BEGIN{         FS="\\";         RS="#";         OFS=",";         ORS="\n";     }{         for(i=1;i<=NF;i++) {printf "%-10s", $i; printf ",";}           }      I'm using gawk version 3.1.6 on Ubuntu 10.04.


Custom directory for cron commands

I'm using `vixie` cron on Debian/Ubuntu. How to set a custom directory to be read by cron? I want to lead crontab to run commands found in a series of files, e.g.               /home/cron/*.cron      or perfectly               /home/*/cron/*.*      In fact, instead of putting cron commands in `/var/spool/cron/crontab/root`, I want to spread commands in these folder. Is it possible and recommended to use `include` for calling other files within `root` file?


Ubuntu Qmake is not an executable

after installing new version of QtCreator in Ubuntu and               tux-world@alachiq:~ > sudo apt-get install qt5-qmake build-essential g++ gcc        Reading package lists... Done        Building dependency tree               Reading state information... Done        build-essential is already the newest version.        g++ is already the newest version.        g++ set to manually installed.        gcc is already the newest version.        qt5-qmake is already the newest version.        0 upgraded, 0 newly installed, 0 to remove and 247 not upgraded.      in option of `Build & Run` and choose qmake in `/usr/bin/qmake` i get this error :               The qmake executable /usr/lib/i386-linux-gnu/qt4/bin/qmake could not be added: qmake '/usr/lib/i386-linux-gnu/qt4/bin/qmake' is not an executable.      in Home system i don't have any problem after installing those packages and setting Qmake in option Other information:               tux-world@alachiq:~ > apt-cache search qt5-qmake     qt5-qmake - Qt 5 qmake Makefile generator tool          tux-world@alachiq:~ > ldd /opt/qtForArm/bin/qmake           ldd: /opt/qtForArm/bin/qmake: No such file or directory          tux-world@alachiq:~ > sudo chmod +x /usr/lib/i386-linux-gnu/qt4/bin/qmake     [sudo] password for tux-world:      chmod: cannot access ‘/usr/lib/i386-linux-gnu/qt4/bin/qmake’: No such file or directory      **UPDATE** :               tux-world@alachiq:~ > apt-cache policy qt5-qmake     qt5-qmake:       Installed: 5.2.1+dfsg-1ubuntu14.2       Candidate: 5.2.1+dfsg-1ubuntu14.2       Version table:      *** 5.2.1+dfsg-1ubuntu14.2 0             500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages             100 /var/lib/dpkg/status          5.2.1+dfsg-1ubuntu14 0             500 http://archive.ubuntu.com/ubuntu/ trusty/main i386 Packages                    tux-world@alachiq:~ > ls -a -l /usr/bin/qmake      lrwxrwxrwx 1 root root 9 فوریه 19 15:53 /usr/bin/qmake -> qtchooser                    tux-world@alachiq:~ > qtchooser      Usage:       qtchooser { -l | -list-versions | -print-env }       qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]       <executable name> [-qt=<Qt version>] [program arguments]          Environment variables accepted:      QTCHOOSER_RUNTOOL  name of the tool to be run (same as the -run-tool argument)      QT_SELECT          version of Qt to be run (same as the -qt argument)          tux-world@alachiq:~ >


Can I refresh my shell within a shell script?

Very new to Bash scripting... I am trying to setup a script that starts with a minimal CentOS 6 install and provisions it for Ruby development.               #!/bin/bash          # Add PostgreSQL Repo     rpm -i http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm          # Add NginX Repo     echo '[nginx]' > /etc/yum.repos.d/nginx.repo     echo 'name=nginx repo' >> /etc/yum.repos.d/nginx.repo     echo 'baseurl=http://nginx.org/packages/centos/6/$basearch/' >> /etc/yum.repos.d/nginx.repo     echo 'gpgcheck=0' >> /etc/yum.repos.d/nginx.repo     echo 'enabled=1' >> /etc/yum.repos.d/nginx.repo          # Update     yum update -y          # Install NginX, PostgreSQL, and Ruby Dependencies     yum install -y nginx postgresql91-server postgresql91-contrib gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison piconv-devel sqlite-devel git-core          # PostgreSQL Post Install     service postgresql-9.1 initdb     chkconfig postgresql-9.1 on          # Install rbenv system wide install     git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv          # Install ruby-build     git clone git://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build          # Add rbenv to the path     echo '# rbenv setup - only add RBENV PATH variables if no single user install found' > /etc/profile.d/rbenv.sh     echo 'if [[ ! -d "${HOME}/.rbenv" ]]; then' >> /etc/profile.d/rbenv.sh     echo '  export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh     echo '  export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh     echo '  eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh     echo 'fi'  >> /etc/profile.d/rbenv.sh     chmod +x /etc/profile.d/rbenv.sh          # SHELL NEEDS TO BE REFRESHED HERE          # Install latest Ruby     rbenv install 1.9.3-p286          # Set Global Ruby     rbenv global 1.9.3-p286      I am getting a rbenv: command not found error when it gets to the point where it uses rbenv because my shell needs refreshed/restarted for it to recognize the command. How can I accomplish this? Thanks.


dhcpd: any way to check dhcp pool status?

Once `dhcpd` (IPv4) is started, is there any way to check its internal pool status? e.g how many addresses are available? I checked `man(8) dhcpd`, there's no signals/files available for that info.


Why does Linux on sparc64 architecture use 32-bit pointers in user-space and 64-bit pointers in kernel-space?

What are the advantages of deviating from the norm; that is 64-bit pointers in both user and kernel space for a 64-bit architecture? Reference: http://lwn.net/images/pdf/LDD3/ch11.pdf (Page 2)


Mounting HTFS Disk on Linux

I got my hand on a harddrive that contains a SCO Openserver 5 and I need to access the data inside. Is there any way I can just mount and start copy- pasting the files? I've googled around and mostly get some instruction from 2000s that don't work. It looks like the Linux kernel needs to be compiled to support the filesystem. Are there any distros that supports this by default? If not, how could I access the drive without sharing it on the network?


ess has disappeared from emacs

I frequently use emacs ess functions. Specifically, I use r-mode and run R in emacs. However, quite suddenly, emacs is no longer offering ess options. r-mode is no longer an option in emacs nor is R. I tried purging ess and emacs (`aptitude --purge remove emacs ess`) and even removed my .emacs file and .emacs.d folder - to no avail. I'm using Debian (Jessie). emacs23 was installed. In trying to get this to work, I installed emacs24, and then even xemacs (on the off chance). Still no success. I was having a problem with el-get -- so I purged and reinstalled related packages. Oddly enough, reinstalling `dictionaries-common` was some help there (see http://askubuntu.com/questions/295234/broken-emacs- installation)- but still no luck with emacs and ess. There are no error messages installing, uninstalling, or reinstalling emacs, ess, or r. How can I amend this?


Why the code in a for loop is executed only in the first directory in a bash shell?

Under a directory called `a` there are many subfolders where I want to do something. The same for all. I do the following but it applies only to the first subdirectory:               for i in "a/*"         do                 #echo $i                 cd $i                 mkdir test                 mv *_no test                 touch aaa                 cd ..         done      The above code I want to be executed in every directory under `a`.


How do I get a list of all the available keyboard layouts in X.org?

I know these layouts have two-letter codes like 'us'for the US layout. I need a list of all the layouts available and also to pair the two-letter codes to the proper names of the layout to get the not so trivial ones.


Delete all but largest file of specific type

I am trying to organise the album art in my music collection so that only one image is assigned to each folder. My directory structure currently looks like:               /path/to/music/Album Name/     /path/to/music/Album Name/1 - Track one.flac     ...     /path/to/music/Album Name/cover.jpg (either this)     /path/to/music/Album Name/folder.jpg (or this)     /path/to/music/Album Name/Album Name.jpg (or this is the largest file)     /path/to/music/Album Name/AlbumArtSmall.jpg        (plus other low resolution images generated by Windows media player) I would like to scan through each folder and delete all but the largest jpg and rename it to `cover.jpg`. As the tags indicate, I have cygwin installed, but can also boot into Ubuntu where I have access to bash and zsh, if this makes the problem easier.


Use tabs for indentation in Python mode

I am using Emacs for Python developement. My team is using `Tab` indentation, so I must do the same. The problem is that I can't figure out how to make python-mode use tabs instead of spaces. I want Emacs to automatically indent my line to the correct level when I press `Ctrl`-`j`.


What is resolv.conf and why VPN client's hack it?

As stated in a previous question I want to connect to 2 VPN servers at the same time and for each connection specify the IPs of computers I want to reach with it. One of this VPN connection is done with `vpnc` and a `default.conf` file, and the other one is done with a Cisco client (I am not able, for now at least to connect with `vpnc` because I don't have the IPSecrete element required to connect). I am ok with the connection done through `vpnc`: I am able to connect configure the targeted IPs to use the created interface as following:               #!/bin/sh          #Get default gateway     DEFGW=`ip route list | grep default | awk -F' ' '{print $3 }'`     DEVICE=`ip route list | grep default | awk -F' ' '{print $5 }'`          echo "Default Gatway is: $DEFGW on device $DEVICE"          echo "Starting vpnc"     sudo vpnc          echo "Adding routes to known computers through VPN network interface"     sudo route add -net 132.181.11.0  netmask 255.255.255.0 dev tun0          echo "Adding all other routes through standard network interface"     sudo route del default     sudo route add default gw $DEFGW dev $DEVICE      Now, before running the two connections simultaneously, I am trying to do the same with the Cisco client but I am facing on problem with `resolv.conf`. This file is modified by the VPN client with a domain value and to DNS servers values. Running the following script result in DNS resolutions errors (reported by chrome)               #!/bin/sh          #Get default gateway     DEFGW=`ip route list | grep default | awk -F' ' '{print $3 }'`     DEVICE=`ip route list | grep default | awk -F' ' '{print $5 }'`          echo "Default Gatway is: $DEFGW on device $DEVICE"          echo "Starting cisco"     sudo /opt/cisco/vpn/bin/vpn connect 134.214.244.203          echo "Adding routes to computers through VPN network interface"     sudo route add -net 132.212.146.156  netmask 255.255.255.255 dev cscotun0          echo "Adding all other routes through standard network interface"     sudo route del default     sudo route add default gw $DEFGW dev $DEVICE      Any help and comments on this, and solve the issue are welcome. Thanks


SELinux preventing ssh via public key

I have user `$USER` which is a system user account with an authorized users file. When I have SELinux enabled I am unable to ssh into the server using the public key. If I `setenabled 0`, `$USER` can now log in. What SELinux bool/policy should I change to correct this behaviour without disabling SELinux entirely? It's worth noting that `$USER` can login with a password under this default SELinux configuration, I'd appreciate some insight as to what is happening here, and why SELinux isn't blocking that. (I will be disabling password authentication altogether after this is resolved so this question is more nice to know)


Is there some kind kind of hosts.additional file for Linux

If you have a list of servers all linking to each other by static addresses, is there some kind of hosts.additional you can use as some kind of file based DNS? ie The hosts file contains static information and the hosts.additional contains the address which change regularly.


scan and connect to wifi from linux terminal on virtual machine

I am trying to scan wifi networks via Linux terminal running on a virtual machine. I am running virtual machine on Mac OS. On MAC terminal, I can see all Wi-Fi networks using (airport) command and can connect to one network. The NetworkAdapter setting for Virtual machine is set to "Share with MAC". On Linux terminal, When I do `ifconfig -a`, I get `eth0` & `lo` However, when I type : `sudo iwlist eth0 scan` , I get error message:               sudo iwlist eth0 scan     eth0      Interface doesn't support scanning.      Can someone explain how I can do that with Linux running on virtual machine? What I am doing wrong?


Urxvt draws lines slowly

I'm using Arch Linux and Urxvt as terminal emulator. When I scroll up/down, text lines gets rendered so slow I can count by top to bottom ( _heh, 1st line get rendered... ohh, 2nd one! ..._ ). It takes like a full second to get new content rendered in terminal. The worst is reading man pages, looking at Git's log etc.. I have no conf for Urxvt, so it can't me misconfed. The strangest thing is that on both other computers that are also running Arch Linux and Urxvt with almost the same conf everything works. Also, it can't be performance problems — hardware is quite new. Any clue why's that? I even don't know where to start searching for problem!


What is symlinking and how can learn I how to to do this?

From the Django-Documentation: > The django-admin.py script should be on your system path if you installed > Django via its setup.py utility. If it’s not on your path, you can find it > in site-packages/django/bin within your Python installation. Consider > symlinking it from some place on your path, such as /usr/local/bin.' How do I 'symlink' and how do I know when I need to do it? OS Ubuntu 12.10 32 bit OEM2 GB RAM


Rotate console on startup (Debian)

I want to rotate my console (not X Server) by 90 degrees (clockwise). The following seems to work for me: `echo 1 > /sys/class/graphics/fbcon/rotate`; however, I'd prefer to use a kernel option in Grub, rather than including the above in the `/etc/rc.local` script. The fbcon documentation outlines the following option that can be passed to the kernel: `fbcon=rotate:<n>`. Unfortunately, when I modify `/etc/default/grub` and modify the `GRUB_CMDLINE_LINUX` line like this:               GRUB_CMDLINE_LINUX="fbcon=rotate_all:1"      ... it doesn't work. I also ran `update-grub` before rebooting. I've also tried this:               GRUB_CMDLINE_LINUX="fbconsole=rotate_all:1"      Still nothing. Any thoughts?


redirecting output of /dev/fb0 to /dev/fb2

I am using IMX6 Saberauto board on Linux OS. I have 2 displays primary is `HDMI` and secondary is `LVDS`. I want to run 2 applications. One QT on primary display, which I am able to do. Second application is airplay application I want this application to run on seondary display ie `/dev/fb2`. But I am not able to do that. It is coming on primary display only. Please let me know the command to direct airplay output to `/dev/fb2`.


How to configure buildroot to add a sound device?

I've used a given board configuration to reconfigure it for my individual board. My board has a CS4270 sound device of Cirrus Logic. My uImage is booting successfully on my target hardware, but an `alsactl init` always shows me `no sound card`. I loaded as many sound modules as I can, e.g. `modprobe snd-soc-cs4270`. But I have the feeling there is one module missing because the alsa-project website shows a specific module named `snd-cs4270`. Can I get this module installed by buildroot or do I have to download and integrate it into my target hardware on my own? I've followed this question and ended up with the question, if I must implement the sound device in the board file in `linux/linux- kernel/arch/<my_arch>/mach-<board_arch>/<board>.c`. But this can't give me a `snd-cs4270`module. Has anyone an idea which way I shall go to get this thing done?


How to install netbeans on Ubuntu

I'm trying to install Netbeans on Ubuntu. I downloaded `netbeans-7.3-javaee- linux.sh`, but when I opened it it didn't work. I tried opening it from a terminal, but it didn't help, and I ran:               # sudo chmod +x /home/amal/netbeans-7.3-javaee-linux.sh      What am I doing wrong?


Can I access Nautilus's bookmarks in terminal?

I have made a some bookmarks in Nautilus, i.e. shortcut links to some directories. I would like to `cd` to a directory which has been bookmarked in Nautilus. I was wondering if that is possible?


Is it possible to whitelist a specific program in iptables?

Is it possible to allow all traffic for a specific program in `iptables`? Otherwise using `nmap` and a strict `iptables` configuration at the same time seems impossible.


Get the maximum sum for a file on 2 keys

I have a file as below.               key1 key2  key3     a1    2    l1     a1    2.5  l2     a2    2    l2     a3    2.5  l3     a3    2.1  l4     a3    2.2  l5      I am trying to find the maximum possible sum of `key2` that satisfies the condition that `key1` and `key3` occur only once. For the above file, I expect the output as,               a1 2     l1     a2 2     l2     a3 2.5   l3      If I use the below command,               sort -nk2 file | perl -ane '$k{$F[$1]}=$_; END{print "$k{$_}" for keys(%k)}'      I get the output as,               a2 2   l2     a1 2.5 l2     a3 2.5 l3       However, I wish to get only one occurrence of `key1` and `key3` in the output as well as getting the maximum sum as I have described in the expected output. **EDIT** I have the input file as below.               a0 11.1    l6     a0 3       l1     a1 14.0    l6     a1 2.5     l2     a2 11.1    l2     a2 2       l2     a3 13.3    l8     a3 2.1     l4     a3 2.5     l7     a4 1.6     l6     a4 1.7     l1      As we can manually see, the maximum weighted output for the above file would be,               a0 11.1 l6     a2 11.1  l2     a3 13.3 l8     a4 1.7  l1      As per Gnouc's `awk` command, I get the output as,               a0 11.1  l6     a1 2.5   l2     a3 13.3  l8     a4 1.7   l1      As per terdon's `perl` command, I get the output as,               a2 2   l2     a4 1.7 l1     a3 13.3 l8      **EDIT 3**               a1 1 l1     a2 3 l2     a1 4 l3     a3 5 l2     a6 4 l5     a7 3 l2      I get the output as,               a3 5 l2     a6 4 l5     a7 3 l2      As we can see, `l2` is repeated twice.


Unreferenced inodes on EC2 linux instance

I have an Amazon EC2 instance which I am using as a NFS file server. It's using a 5x1TB volume RAID0 array. The system is very I/O intensive and files are being written/copied/deleted through the NFS share all the time. Quite often, I notice that there's a BIG discrepancy between the disk space used and the available free space. (I am checking while the system is idle and no files are being written to the file share/system). My only "Fix" for this is to shutdown the instance and restart it (reboot doesn't work and just hangs the machine). When it restarts, it runs `fsck` and I can see in the system log (many) "unreferenced " Inodes being cleaned up (this is not the entire log):                  25.110924] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291727     [   25.114687] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291723     [   25.118610] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291703     [   25.135184] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291722     [   25.140005] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291725     [   25.144013] EXT4-fs (dm-1): ext4_orphan_cleanup: deleting unreferenced inode 122291705     [   25.148008] EXT4-fs (dm-1): 735 orphan inodes deleted     [   25.150286] EXT4-fs (dm-1): recovery complete     [   26.126887] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: (null)     [  OK  ]      I can't find any solution for this anywhere online. Does anyone know what's causing this or how to prevent it? Or maybe fix it without unmounting the drive ? **Some more info:** Version information:               Linux version 3.10.42-52.145.amzn1.x86_64 (mockbuild@gobi-build-64003) (gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) ) #1 SMP Tue Jun 10 23:46:43 UTC 2014      RAID0 array mount on `/etc/fstab` as follows:               /dev/vg0/data /data ext4 defaults,auto,noatime,noexec 0 0      /etc/mdadm.conf:               DEVICE /dev/xvdk /dev/xvdj /dev/xvdi /dev/xvdh /dev/xvdg     ARRAY /dev/md0 metadata=1.2 name=ip-172-31-10-215:0 UUID=4c4fb472:e0540788:69a83d01:a75a8a3e      /etc/exports:               /data *(rw,sync)      Clients mount the NFS share as follows:               x.x.x.x:/data  /mnt/fileserver nfs defaults 0  0


How do I get NetworkManager to keep the same IP?

The DHCP-provided IP on my laptop changes periodically. It runs CentOS 6.5 and uses NetworkManager. My desktop, running Sabayon, on the same network, does not have this problem. How can I get NetworkManager to renew an existing DHCP lease instead of getting a new one?


problem with socks in proxychains

I'm trying to connect to a socks server using `proxychains`.   My `ProxyList` part of `proxychains.conf` is:               socks5   ip1.sockssrv.org      1080    MYUSER   MYPASS      When I try to use it; for example using this command:               proxychains wget -qO- ifconfig.me/ip      I'm getting this:               ProxyChains-3.1 (http://proxychains.sf.net)     |DNS-request| ifconfig.me      |DNS-response|: ifconfig.me is not exist      By disabling `proxy_dns`; it only prints version and doesn't connect at all:               ProxyChains-3.1 (http://proxychains.sf.net)        Note: The command works without `proxychains` and the socks server is up and works with `proxifier` (Windows application). What is the problem? Thanks


See server desktop in tightVNC

I installed _tightvncserver_ on one Linux machine and _xtightvncviewer_ on another Linux machine. I can connect from client computer to server computer without problems. There are two problems:   1. The screens are different. On the client computer I can see on desktop all the files from my _$HOME_ folder.   2. I can't see on server computer what is being done from client computer. Cursor movements, opening files, everything. I'm using _Ubuntu 11.04_ with _Xmonad_. Could the problems 1 and 2 be solved and _tightVNC_ will work as _teamviewer_?


How do I install hgview on Ubuntu?

I'm trying to install `hgview` on Ubuntu, but it's not working.               $ hg version     Mercurial Distributed SCM (version 2.1)     (see http://mercurial.selenic.com for more information)          Copyright (C) 2005-2012 Matt Mackall and others     This is free software; see the source for copying conditions. There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          $ sudo apt-get install hgview     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:       hgview: Depends: mercurial (>= 0.9.3)     E: Broken packages      Mercurial _is_ installed from the Ubuntu repository. As for `dpkg`, I get:               $ dpkg -l mercurial*     Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name                                           Version                                        Description     +++-==============================================-==============================================-============================================================================================================     ii  mercurial                                      2.1-0ppa1~lucid1                               easy-to-use, scalable distributed version control system     ii  mercurial-common                               2.1-0ppa1~lucid1                               easy-to-use, scalable distributed version control system (common files)     ii  mercurial-git                                  0.3.1-1~lucid1                                 Git plugin for Mercurial      What's going wrong?


No sound with fresh Kubuntu install

I've just taken the plunge and installed Kubuntu as my main desktop env but I can't get the sound to work, and was wondering if anyone would be so kind as to help me work out what the problem is. I don't even know where to start looking to be honest - I'm not a guru, so please be gentle. I saw somewhere that I should supply the below info to give you some idea of what's going on, please comment if you need any more info. Maybe worth noting that I've played about with all the settings in 'Playback Devices' and no combination produced any sound.               martyn@martyn-desktop-kubuntu:~$ cat /proc/asound/cards     0 [Intel          ]: HDA-Intel - HDA Intel                                                                                HDA Intel at 0xfb6f8000 irq 85                                                                                1 [Q9000          ]: USB-Audio - QuickCam Pro 9000                                                                                Logitech, Inc. QuickCam Pro 9000 at usb-0000:00:1a.7-6.1.2, high speed                                                                                2 [Generic        ]: HDA-Intel - HD-Audio Generic                                                                                HD-Audio Generic at 0xfb7fc000 irq 86       The actual devices I have are a 'Cypress HDMI Audio [Radeon HD 5800 Series] Digital Stereo (HDMI)' which I'm not using, and a 'Internal Audio Analogue Surround 5.1' which I do want to use. There's also a 'QuickCam Pro 9000' attached to the computer. also               martyn@martyn-desktop-kubuntu:~$ lspci                                                                                00:00.0 Host bridge: Intel Corporation 5520/5500/X58 I/O Hub to ESI Port (rev 13)                                                                                00:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 13)                                                                                00:03.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 3 (rev 13)                                                                                00:07.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 7 (rev 13)                                                                                00:09.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 9 (rev 13)                                                                                00:14.0 PIC: Intel Corporation 5520/5500/X58 I/O Hub System Management Registers (rev 13)                                                                                00:14.1 PIC: Intel Corporation 5520/5500/X58 I/O Hub GPIO and Scratch Pad Registers (rev 13)     00:14.2 PIC: Intel Corporation 5520/5500/X58 I/O Hub Control Status and RAS Registers (rev 13)                                                                                00:14.3 PIC: Intel Corporation 5520/5500/X58 I/O Hub Throttle Registers (rev 13)                                                                                00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4     00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5     00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6     00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2     00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller     00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 1     00:1c.2 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 3     00:1c.4 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 5     00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Root Port 6     00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1     00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2     00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3     00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1     00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90)     00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller     00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller #1     00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller     00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller #2     02:00.0 VGA compatible controller: ATI Technologies Inc Cypress [Radeon HD 5800 Series]     02:00.1 Audio device: ATI Technologies Inc Cypress HDMI Audio [Radeon HD 5800 Series]     04:00.0 PCI bridge: PLX Technology, Inc. PEX 8613 12-lane, 3-Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba)     05:01.0 PCI bridge: PLX Technology, Inc. PEX 8613 12-lane, 3-Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba)     05:02.0 PCI bridge: PLX Technology, Inc. PEX 8613 12-lane, 3-Port PCI Express Gen 2 (5.0 GT/s) Switch (rev ba)     06:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 03)     07:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9123 PCIe SATA 6.0 Gb/s controller (rev 10)     08:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)     09:00.0 SATA controller: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)     09:00.1 IDE interface: JMicron Technology Corp. JMB362/JMB363 Serial ATA Controller (rev 03)     0a:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 12)     0c:02.0 FireWire (IEEE 1394): VIA Technologies, Inc. VT6306/7/8 [Fire II(M)] IEEE 1394 OHCI Controller (rev c0)     ff:00.0 Host bridge: Intel Corporation Xeon 5500/Core i7 QuickPath Architecture Generic Non-Core Registers (rev 05)     ff:00.1 Host bridge: Intel Corporation Xeon 5500/Core i7 QuickPath Architecture System Address Decoder (rev 05)     ff:02.0 Host bridge: Intel Corporation Xeon 5500/Core i7 QPI Link 0 (rev 05)     ff:02.1 Host bridge: Intel Corporation Xeon 5500/Core i7 QPI Physical 0 (rev 05)     ff:03.0 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller (rev 05)     ff:03.1 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Target Address Decoder (rev 05)     ff:03.4 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Test Registers (rev 05)     ff:04.0 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 0 Control Registers (rev 05)     ff:04.1 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 0 Address Registers (rev 05)     ff:04.2 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 0 Rank Registers (rev 05)     ff:04.3 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 0 Thermal Control Registers (rev 05)     ff:05.0 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 1 Control Registers (rev 05)     ff:05.1 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 1 Address Registers (rev 05)     ff:05.2 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 1 Rank Registers (rev 05)     ff:05.3 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 1 Thermal Control Registers (rev 05)     ff:06.0 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 2 Control Registers (rev 05)     ff:06.1 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 2 Address Registers (rev 05)     ff:06.2 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 2 Rank Registers (rev 05)     ff:06.3 Host bridge: Intel Corporation Xeon 5500/Core i7 Integrated Memory Controller Channel 2 Thermal Control Registers (rev 05)


Creating a virtual interface to always access a DHCPed interface with the same ip

I have an interface that on connect always gets a new IP. So I want to create a virtual interface with a static IP that "relays" everything over the physical interface.   This would be useful to bind applications to the virtual interface that do not support binding to an interface name.   I imagine this being possible with ethernet bridges and/or iptables but I do not really have a clue.      _edit:_ A network alias is not an option because I can only use the provided IP.


Awesome: keyboard layout switch

I use awesome as a window manager under gnome (debian system) and I made a widget to switch keyboard layout by this code:               -- Keyboard map indicator and changer         kbdcfg = {}         kbdcfg.cmd = "setxkbmap"         kbdcfg.layout = { { "us", "" }, { "ru", "phonetic" } }         kbdcfg.current = 1  -- us is our default layout         kbdcfg.widget = widget({ type = "textbox", align = "right" })         kbdcfg.widget.text = " " .. kbdcfg.layout[kbdcfg.current][1] .. " "         kbdcfg.switch = function ()            kbdcfg.current = kbdcfg.current % #(kbdcfg.layout) + 1            local t = kbdcfg.layout[kbdcfg.current]            kbdcfg.widget.text = " " .. t[1] .. " "            os.execute( kbdcfg.cmd .. " " .. t[1] .. " " .. t[2] )         end              -- Mouse bindings         kbdcfg.widget:buttons(awful.util.table.join(             awful.button({ }, 1, function () kbdcfg.switch() end)         ))     -- Alt + Right Shift switches the current keyboard layout         awful.key({ "Mod1" }, "Shift_R", function () kbdcfg.switch() end),      It works, however there is a serious problem with keyboard behavior. When I switch to ru layout non of my keyboard bindings works. Awesome bindings don't work. For example vim shortcuts don't also work and etc. How I can solve this problem?


Ffmpeg problems on centOS 5.8 64 bit

I did install ffmpeg with winff, unsuccessfully when I try converting avi to x264, it says I don't have it. When I try to convert mp4 to Xvid I get unknown encoder 'libxvid'. It's like nothing really works except avi Msi compatible using winff, anybody help?


"TouchPad lost synchronization" errors in dmesg

My openSUSE 11.3 laptop is running slow. `dmesg` shows the following errors:               [  733.162161] psmouse.c: TouchPad at isa0060/serio4/input0 lost synchronization, throwing 5 bytes away.     [  774.230841] psmouse.c: TouchPad at isa0060/serio4/input0 lost synchronization, throwing 2 bytes away.     [  856.344570] psmouse.c: TouchPad at isa0060/serio4/input0 lost synchronization, throwing 1 bytes away.     [  898.451626] psmouse.c: TouchPad at isa0060/serio4/input0 lost synchronization, throwing 1 bytes away.      Is that causing the slowdown? How do I fix it?


rsync'ing multiple {src,dest} pairs

I have a remote server on which I am deploying code. I am currently using `scp` to upload code, but `scp` is very slow and I'd like to switch to `rsync` (or something else which is more efficient). The bottleneck is in making the `ssh` connection, so I'd like to minimize the number of connections I make to the server. Locally, my build process outputs a directory `out` containing `bin`, `lib` and `etc` subdirectories. I am pushing a subset of the output files to matching positions on the remote server. My `scp` commands look like this:               scp out/bin/$BINFILES remote:/usr/bin     scp out/lib/$LIBFILES remote:/usr/lib     scp out/etc/$ETCFILES remote:/etc      This makes three connections to the remote server, and copies the files in full even if they haven't been modified. This is what I did with `rsync`:               rsync -e ssh -avz out/bin/$BINFILES remote:/usr/bin     rsync -e ssh -avz out/lib/$LIBFILES remote:/usr/lib     rsync -e ssh -avz out/etc/$ETCFILES remote:/etc      which is faster (compression and elimination of duplicates), but still makes three connections to the remote server. Is there a way to achieve these three copies using a single `rsync` command? I'm open to e.g. putting all {src,dest} pairs in a temporary file before copying, if that will work. I'm also open to trying a different tool, but it should be available for OS X (my current development platform), and it should preferably support transfer optimizations like `rsync` does.


sudoers conditional/combo command is possible?

I want to allow sudo this way:               myuser ALL=NOPASSWD:/usr/bin/pkill -fx "/usr/sbin/nethogs -v 3 -s" || /usr/sbin/nethogs -v 3 -s      so I get only a single running instance of nethogs. visudo accepts it, but I am unable to run these commands without a password... Failed attempts:               sudo '/usr/bin/pkill -fx "/usr/sbin/nethogs -v 3 -s" || /usr/sbin/nethogs -v 3 -s'     sudo /usr/bin/pkill -fx "/usr/sbin/nethogs -v 3 -s" || sudo /usr/sbin/nethogs -v 3 -s      PS.: this version of nethogs is compiled from its cvs on sf.net


Out of range error on monitor after installing video card drivers

I have a dual boot system with windows xp and a fresh install of linux mint 12 lxde. I installed the video card drivers for my ati radeon (hd5570). After this I get an out of range error on my monitor every time I reboot. The grub menu is still visible though. I don't know if it is related but before installing the drivers I also used xrandr to add the native resolution of my monitor 1280x1024 and saved that in my xprofile. I used the guide from here https://wiki.ubuntu.com/X/Config/Resolution#Adding_undetected_resolutions. I added something similar:               xrandr --newmode "1280x1024_60.00"   38.25  800 832 912 1024  600 603 607 624 -hsync +vsync     xrandr --addmode VGA-0 1280x1024     xrandr --output VGA-0 --mode 1280x1024      BTW: I commented out these lines before installing the video card drivers. I'm just not exactly sure what is the cause of the error. Setting the resolution to 1280x1024 or installing the drivers. How can I solve this problem? How can I uninstall the video card driver from command line? I don't really care about having these drivers or not, there was a popup saying that there are proprietary drivers available and I installed it. I probably won't use this for gaming. Any help is appreciated.


Low brightness in a Intel Mobile GM956/GL960

I'm installing Debian stable (7.0) on a old Dell Vostro 1500 and I noticed that the brightness is always low. I've searched around and the only thing I've found is adding `nomodeset acpi_backlight=vendor` to the kernel init commands, that only mess up with the graphic card and reduces the maximum resolution. How can I really showoff the real brightness of the screen?


How exactly does `if $cmd ; then $cmd ; fi` differ from `$cmd && $cmd`?

In an answer to another _very good_ question I made the following assertion: According to my reading of the POSIX specs, the use of one or the other makes no difference from a parsing standpoint. POSIX specifies that `&&||` lists are _compound commands_ which means that the entire list must be read in and parsed before execution of the constituent simple commands. POSIX also specifies a command _shall not be expanded_ if it follows an `||OR` and another command with a 0-exit status. When you consider that a command following an `&&||` reserved word can easily be another grouped `{ command || ( command ; list) ; }` makes each branch of the `&&||` or list its own _compound command_. But POSIX also specifies that each branch of the `if...;then...;else...fi` construct be its own _compound command_ in this way:               if compound-list     then         compound-list     [elif compound-list     then         compound-list] ...     [else         compound-list]     fi      > The `if` _compound-list_ shall be executed; if its `exit` status is zero, > the `then` _compound-list_ shall be executed and the command shall > complete... It is this specification that the string following a `then...` or `else...` reserved words are _compound commands_ in their own right and not merely _simple commands_ that means the shell's parser must denote them with a command and a delimiter in order to operate correctly. So basically, `then ' '` doesn't work for the same reason:               function()     sh: line 2: syntax error: unexpected end of file       ...doesn't - it doesn't make any sense. I know that...               [ -e doesntexist ] && $((i=1)) ; echo $i      ...will short-circuit any side-effects and result in only a `\n`ewline as a result of the spec I noted in my answer. The result of...               if [ -e doesntexist ]          then $((i=1))     fi     echo $i      ...is identical. But I honestly use `if...fi` so seldom that I'm unsure if I've misread something and so when I received a comment indicating my interpretation was incorrect and that if I had further questions on the matter I need only ask I deleted the answer in lieu of this question: how have I got it wrong - how do they differ?


Instantaneous Puppet Deployments with MCollective

Note: I'm not sure where this question belongs. Perhaps it would belong better on Server Fault, but as I'm primarily asking for hacking and home-networking purposes, I'm asking here. Plus it'd probably get flame-trolled off the site in less than 10-100 seconds, which is why I avoid using Server Fault. I'm looking to setup and start messing around with having a Puppet Master and several Puppet clients to get the feel for working with Puppet with an actual master. By default, Puppet client instances update (as far as I know) every 30 minutes, asking the master for their latest configuration and applying it as it comes down. I've heard that MCollective can make these changes essentially instantly as it uses a message queue and parallelism to push commands in real time to clients. I've been trying to find out how to do this with a Puppet Master and Puppet Clients, but it seems that MCollective is much bigger of a project than just a real-time plugin for a Puppet Master. How do I setup a simple Puppet Master, an MCollective Server (and message queue), and my Puppet Clients to get changes to Puppet configuration in real time? (I understand generally how to `apt-get install redis-server puppetmaster mcollective`, but I'm looking to understand how integrating MCollective with the Puppet Master actually works.)


Error while installing wireless-bcm43142-dkms-6.20.55.19: dependency linux-headers is not satisfiable

I have to install a .deb file with the firmware for the wifi card (This is the name of the file: wireless-bcm43142-dkms-6.20.55.19_amd64.deb; I've downloaded the file from here: http://www.filewatcher.com/m/wireless- bcm43142-dkms_6.20.55.19-1_amd64.deb.1337086-0.html ). When I try to install the .deb file, I double click on the file but it gives to me this error:               "Failed to install file. Unknown error. Please refer to detailed report and report in your distribution bug tracker.          More details:  This package is uninstallable. Dependency is not satisfiable: linux-headers-generic|linux-headers".      How can I fix it, so that i will be able to install the .deb file? I've already update the system, through the commands `apt-get update` and `apt-get upgrade` and `apt-get dist-upgrade`. Moreover I've also tried to install linux-headers-generic (Don't know if this could be the solution) with the command: apt-get install linux-headers- generic. But it gives this error:               Package linux-headers-generic is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source.     E: Package "linux-headers-generic" has no installation candidate."      This is the output of `dpkg -i wireless-bcm43142-dkms-6.20.55.19_amd64.deb`:                   Selecting previously unselected package wireless-bcm43142-dkms-6.20.55.19_amd64-deb          (Reading database… 347343 files and directories currently installed.)          Unpacking wireless-bcm43142-oneiric-dkms (from wireless-bcm43142-dkms-6.20.55.19_amd64.deb) …          dpkg: dependency problems prevent configuration of wireless-bcm43142-oneiric-dkms:         wireless-bcm43142-oneiric-dkms depends on linux-headers-generic | linux-headers; however:          Package linux-headers-generic is not installed.          Package linux-headers is not installed.          dpkg: error processing wireless-bcm43142-oneiric-dkms (--install):      dependency problems - leaving unconfigured      Errors were encountered while processing:       wireless-bcm43142-oneiric-dkms      Whereas the output of apt-get -f install :               Reading package lists… Done     Building dependency tree     Reading state information… Done     Correcting dependencies… Done     The following extra packages will be installed:      linux-headers-3.2.0-4-common-rt linux-headers-3.2.0.4-rt-amd64 linux-kbuild-3.2     The following NEW packages will be installed:      linux-headers-3.2.0-4-common-rt linux-headers-3.2.0.4-rt-amd64 linux-kbuild-3.2     0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.     1 not fully installed or removed.     Need to get 4,433 kB of archives.     After this operation, 27.9 MB of additional disk space will be used.     Do you want to continue [Y/n]? Y     Get:1 http://security.debian.org/ wheezy/updates/main linux-headers-3.2.0-4-common-rt amd64 3.2.57-3+deb7u1 [3576 kB]     Get:2 http://debian.net/debian/ wheezy/ main linux-kbuild-3.2 amd64 3.2.17-1 [238 kB]     Get:3 http://security.debian.org/ wheezy/ updates/main linux-headers-3.2.0-4-rt-amd64 amd64 3.2.57-3+deb7u1 [618 kB]     Fetched 4,433 kB in 13s (325 kB/s)     Selecting previously unselected package linux-headers-3.2.0-4-common-rt.     (Reading database… 347406 files and directories currently installed.)     Unpacking linux-headers-3.2.0-4-common-rt (from .../linux-headers-3.2.0-4-common-rt_3.2.57-3+deb7u1_amd64.deb) …     Selecting previously unselected package linux-kbuild-3.2.     Unpacking linux-kbuild-3.2 (from .../linux-kbuild-3.2_3.2.17-1_amd64.deb) …     Selecting previously unselected package linux-headers-3.2.0-4-rt-amd64.     Unpacking linux-headers-3.2.0-4-rt-amd64 (from .../linux-headers-3.2.0-4-rt-amd64_3.2.57-3+deb7u1_amd64.deb) …     Setting up linux-headers-3.2.0-4common-rt (3.2.57-3+deb7u1) …     Setting up linux-kbuild-3.2 (3.2.17-1) …     Setting up linux-headers-3.2.0-4-rt-amd64 (3.2.57-3+deb7u1) …     Examining /etc/kernel/header_postinst.d.     run-parts: executing /etc/kernel/header_postinst.d/dkms 3.2.0-4-rt-amd64     Setting up wireless-bcm43142-oneiric-dkms (6.20.55.19~bdcom0602.0400.1000.0400-0somerville1) …     Loading new wireless-bcm43142-oneiric-dkms-6.20.55.19~bdcom0602.0400.1000.0400 DKMS files …     First Installation: checking all kernels…     Building only for 3.12-kalil-amd64     Building for architecture x86_64     Building initial module for 3.12-kalil-amd64     Error! Bad return status for module build on kernel: 3.12-kalil-amd64 (x86_64)     Consult /var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/make.log for more information.     update-initramfs: deferring update (trigger activated)     Processing triggers for initramfs-tools…     update-initramfs: Generating /boot/initrd.img-3.12-kalil-amd64      Here's the make.log :               DKMS make.log for wireless-bcm43142-oneiric-dkms-6.20.55.19~bdcom0602.0400.1000.0400 for kernel 3.12-kali1-amd64 (x86_64)     Wed May 14 10:44:27 PDT 2014     make: Entering directory `/usr/src/linux-headers-3.12-kali1-amd64'     CFG80211 API is prefered for this kernel version     Using CFG80211 API       LD      /var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/built-in.o       CC [M]  /var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/src/shared/linux_osl.o       CC [M]  /var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/src/wl/sys/wl_linux.o     /var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/src/wl/sys/wl_linux.c:50:24: fatal error: asm/system.h: No such file or directory     compilation terminated.     make[3]: *** [/var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build/src/wl/sys/wl_linux.o] Error 1     make[2]: *** [_module_/var/lib/dkms/wireless-bcm43142-oneiric-dkms/6.20.55.19~bdcom0602.0400.1000.0400/build] Error 2     make[1]: *** [sub-make] Error 2     make: *** [all] Error 2     make: Leaving directory `/usr/src/linux-headers-3.12-kali1-amd64'


Installing Ubuntu-13.0 Desktop in Qemu

Following are the details of my system: Fedora Core-18, i686. I am trying to install ubuntu in the qemu. Following are the commands I executed:               qemu-img create ubuntu.img 8G     qemu-system-i386 -hda ubuntu.img -boot d -cdrom ./ubuntu-13.10-desktop-i386.iso -m 512      After executing the second command the window pops up and it shows UBUNTU getting started but after that the window just becomes black with no activity. Not sure how to proceed on the same. Any tips/hints where I am going wrong.


qemu emulator for raspberry

I am trying to emulate a raspberry pi on ubuntu. I have tried several ways using several tutorials but every time, the emulator logs this:                   scsi: 0:0:0:0 ABORT operation started         scsi: 0:0:0:0 ABORT operation timed-out.         scsi: 0:0:0:0 DEVICE RESET operation started         scsi: 0:0:0:0 DEVICE RESET operation timed-out.         scsi: 0:0:0:0 BUS RESET operation started         scsi: 0:0:0:0 BUS RESET operation timed-out.         scsi: 0:0:0:0 HOST RESET operation started         sym0: SCSI BUS has been reset.         scsi: 0:0:0:0 HOST RESET operation timed-out.         scsi: 0:0:0:0 Device offlined - not ready after error recovery      This list is repeated over and over again.


Strange screen ghosting issue with GNOME 3.8.4 on Fedora 19

Since migrating to Fedora 19 and GNOME 3.8.4 I've been noticing a strange ghosting of images on my screen, where pieces of popups and parts of GUIs will sometime remain around. Running `xwininfo` doesn't report them as actually there so I'm kind of at a loss as to:   1. what is causing these   2. how to get rid of them   3. curious if anyone else has been experiencing them as well ### Examples Here are 2 screenshots that show these mysterious popup ghosts. _**#1_**                             ![ss of ghost image #1](http://i.stack.imgur.com/Bx10U.png) _**#2_**                              ![ss of ghost image #2](http://i.stack.imgur.com/GieHq.png) ### EDIT #1 _lspci -vv output_               $ sudo lspci -vvv -s 00:02.0     00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller])         Subsystem: Lenovo Device 215a         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-         Latency: 0         Interrupt: pin A routed to IRQ 41         Region 0: Memory at f2000000 (64-bit, non-prefetchable) [size=4M]         Region 2: Memory at d0000000 (64-bit, prefetchable) [size=256M]         Region 4: I/O ports at 1800 [size=8]         Expansion ROM at <unassigned> [disabled]         Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-             Address: fee0f00c  Data: 41a1         Capabilities: [d0] Power Management version 2             Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)             Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-         Capabilities: [a4] PCI Advanced Features             AFCap: TP+ FLR+             AFCtrl: FLR-             AFStatus: TP-         Kernel driver in use: i915        * **Video hardware:** Appears to be Intel card, not sure of specific model, I have a ThinkPad T410, Type #: 2516-CTO.   * **Driver:** Appears to be using the i915 Kernel module as a driver.


How can I view packages from a specific repository?

In my `/etc/apt/sources.list` if I add the path:               deb http://debian.meebey.net/pkg-mono ./      Can I view packages from this specific repository alone?


How do I use cut to separate by multiple whitespace?

I would like to get the last column of this sample:               [  3]  1.0- 2.0 sec  1.00 MBytes  8.39 Mbits/sec     [  3]  2.0- 3.0 sec   768 KBytes  6.29 Mbits/sec     [  3]  3.0- 4.0 sec   512 KBytes  4.19 Mbits/sec     [  3]  4.0- 5.0 sec   256 KBytes  2.10 Mbits/sec     ...      If I use               cut -d\  -f 13      I get               Mbits/sec     6.29     4.19     2.10      because sometimes there are additional spaces in between.