title: Auto connect to a wireless network (Ångström Linux)

text: I am using Ångström Linux on BeagleBoard-xM. I have installed a RTL8188SU USB Wi-Fi adapter and configured it properly. But it doesn't connect automatically even though I have marked the interface as `auto` in `/etc/network/interfaces` file. My `/etc/network/interfaces` file is seen below (only `wlan0` settings pasted):               auto wlan0     iface wlan0 inet static         address 192.168.2.50         netmask 255.255.255.0         gateway 192.168.2.1         wireless_mode managed         wireless_essid MY NETWORK ESSID         wireless_key   MY_PASS      And here is the output of `ifconfig` command after system boot:               root@beagleboard:~# ifconfig     lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:24 errors:0 dropped:0 overruns:0 frame:0               TX packets:24 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:1632 (1.5 KiB)  TX bytes:1632 (1.5 KiB)          wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX               inet6 addr: fe80::2e0:4cff:fe03:cbb1/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:241 errors:0 dropped:0 overruns:0 frame:0               TX packets:6 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      As you can see, there is no `inet` connection on interface `wlan0`. When I type `ifdown wlan0` and `ifup wlan0` consecutively, the wireless connection can be established successfully according to interface settings. The output of `ifconfig` after restarting `wlan0` is shown below:               wlan0     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX               inet addr:192.168.2.50  Bcast:192.168.2.255  Mask:255.255.255.0               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:974 errors:0 dropped:0 overruns:0 frame:0               TX packets:22 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      I want my wireless connection to be established automatically on system boot (and preferably after replugging Wi-Fi adapter). Is there anything that I am missing to do so? **EDIT:** I have traced boot log and seen a message that is complaining about setting ESSID:               Error for wireless request "Set ESSID" (8B1A) :         SET failed on device wlan0 ; Operation not permitted.      However, I haven't realized the source of the problem. After the system boot I can establish connection by restarting networking.


title: Why can't I change permission on a symlink on Mac?

text: Simple question and there is perhaps a simple answer. I have several directories in my home folder that I would like to make available as a directory on my webserver. So, what I did was to create a symlink:               iMac:/Library/WebServer/Documents/ ls -ltr     -rw-rw-r--  1 root      admin     44 Nov 20  2004 index.html.en     -rw-rw-r--  1 root      admin  31958 May 18  2009 PoweredByMacOSXLarge.gif     -rw-rw-r--  1 root      admin   3726 May 18  2009 PoweredByMacOSX.gif     -rwxr-xr-x  1 mego  admin      0 Jan  6  2011 favicon.ico     lrwxrwxr-x  1 mego  admin     52 Jul 26 13:45 myadmin -> /Users/mego/Downloads/phpMyAdmin-3.4.3.2-english     iMac:/Library/WebServer/Documents/ ln -s /Users/mego/opt/rel/src/main/web/ rel     iMac:/Library/WebServer/Documents/ ls -ltr     -rw-rw-r--  1 root      admin     44 Nov 20  2004 index.html.en     -rw-rw-r--  1 root      admin  31958 May 18  2009 PoweredByMacOSXLarge.gif     -rw-rw-r--  1 root      admin   3726 May 18  2009 PoweredByMacOSX.gif     -rwxr-xr-x  1 mego  admin      0 Jan  6  2011 favicon.ico     lrwxrwxr-x  1 mego  admin     52 Jul 26 13:45 myadmin -> /Users/mego/Downloads/phpMyAdmin-3.4.3.2-english     lrwxrwx---  1 mego  admin     47 Oct 12 09:58 rel -> /Users/mego/opt/rel/src/main/web/      Permissions on /Users/mego/opt/rel are recursively set to a+rx so everybody can read and execute. When I try to change the permission, i.e. " **chmod a+rx rel** " and " **chmod -R a+rx /Users/mego/opt/rel** ", zero effect. The output of               ls -ld / /Users /Users/mego /Users/mego/opt /Users/mego/opt/rel /Users/mego/opt/rel/src /Users/mego/opt/rel/src/main /Users/mego/opt/rel/src/main/web          iMac:~/ ls -ld / /Users /Users/mego /Users/mego/opt /Users/mego/opt/rel /Users/mego/opt/rel/src /Users/mego/opt/rel/src/main /Users/mego/opt/rel/src/main/web     drwxrwxr-t@ 39 root      admin  1394 Sep 14 15:30 /     drwxr-xr-x   7 root      admin   238 Aug 29 10:04 /Users     drwxr-xr-x+ 98 mego  staff  3332 Oct 15 10:59 /Users/mego     drwxrwxr-x  19 mego  staff   646 Oct 14 20:47 /Users/mego/opt/rel     drwxrwxr-x   5 mego  staff   170 May 31 08:01 /Users/mego/opt/rel/src     drwxrwxr-x   6 mego  staff   204 Oct 12 08:42 /Users/mego/opt/rel/src/main     drwxrwxr-x   5 mego  staff   170 Oct 12 08:42 /Users/mego/opt/rel/src/main/web     iMac:~/       Must be something related to users home folder. But strangely enough, another folder " **myadmin** " has correct permissions and it works. What am I doing wrong? Thank you in advance.


title: Script to check for read only filesystem

text: How can I check a bunch of systems to find any filesystem that are mounted read-only? Possibly via a script?


title: cURL on Linux not compiled, although installed

text: cURL is not compiled into PHP. I'm running:               [root@vps ~]# cat /etc/issue     CentOS release 5.7 (Final)     Kernel \r on an \m      Then I execute `yum install curl` and `yum install php-curl`. Then:                  [root@vps ~]# which curl         /usr/bin/curl        [root@vps ~]# /usr/bin/curl -v     curl: no URL specified!     curl: try 'curl --help' for more information      My environment still shows that I haven't compile curl into php. Why? I used `phpinfo()`, which shows: ![cURL support: enabled](http://i.stack.imgur.com/XsjWO.jpg) but when I install `zencart` on my vps hosting, it shows: ![CURL not compiled into PHP - notify server administrator](http://i.stack.imgur.com/8PHnY.jpg) How can I fix this?


title: Program to filter lines by passing them to an external program?

text: I'm looking for a program to use an external program to filter the lines of a stream - pretty much a version of `grep` that, for each line, prints or suppresses it based on whether the specified program exits with a zero exit code (like `find`'s `-exec` option). I know that I can do this in shell by using a loop and a subshell:               some-program |(while read line; do         if predicate "$line"; then             echo "$line"         fi     done)      What I'm wondering is if there's a program floating around that will let me make this simpler:               some-program |filter predicate     # want negation as well     some-program |filter ! predicate      One would think that an enhanced Sed might support this, asking "does it pass on the pattern space?", but GNU Sed does not seem to have such a facility. Is there such a program somewhere that I haven't found, or do I just need to do it in shell (or perl)?


title: Issues Splitting CSV files

text: Im trying to split a csv file into multiple files using the below command..This command splits into 5 files but the data is truncated in one of the file? How do I fix this issue?               >>split -n 5 -d -a 2  testfile      I have 5001 lines in my input but the split splits into               file1 - 932     file2 - 910     file3 - 1149     file4 - 1044     file5 - 966      Shouldn't it be 1000 lines per file?


title: "supervisory" software for school rooms

text: In a schoolroom there are 15 machines + 1 the teacher's PC. All have ex.: Ubuntu 10.04 LTS.      Are there any softwares that can be used on the teachers machine that can "audit" the students 15 PC? Things needed:      - teacher must see the students "display" from his PC.   - teacher could show 1 students "display" to all of the other students or his own monitor.   - extra: teacher could "control" the students machine remotely (ex.: to show the student the good solution for a given exercise)


title: Where is Netbeans installed on Ubuntu?

text: I installed Netbeans on my Ubuntu 11.10 machine. I used the combined method, so Netbeans and JDK are installed from a single file. However, now that it's installed I can't figure out how to start Netbeans. If I try to reinstall it says that Netbeans is already installed, but if I look in `/usr/share/netbeans` there are the installation files but nothing else. How do I run Netbeans?


title: Cross mounting nfs shares on linux servers

text: We have a few linux file servers, our sysadmin refuses to do any NFS cross mounting, by cross mounting I mean mounting an nfs share from server A on server B and a share from server B on A .   Anybody knows if there are any problems with this cross mounting?


title: ssh prompts for password despite .ssh/authorized_keys

text: I issued `ssh username@db2workgoup -n "echo`cat ~/.ssh/id_dsa.pub`>> ~/.ssh/authorized_keys"` and then checked that the key was stored in authorized_keys file. But ssh is still asking for the password. I used the same for other servers within our company without any troubles. Someone can help me to ssh without password prompt?   * ssh from OSX   * ssh to openSUSE 11.2 (x86_64)   * permissions are for home dir, .ssh dir and authorised_keys file 700 or less `/var/log/messages` has entry `ec 9 11:09:53 db2workgroup automount[3506]: update_negative_cache: key ".user.ini" not found in map.` from the time I tried to log in . output from ssh -vvv               radek:~ radek$ ssh -vvv root@db2workgroup     OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009     debug1: Reading configuration data /etc/ssh_config     debug2: ssh_connect: needpriv 0     debug1: Connecting to db2workgroup [10.0.0.22] port 22.     debug1: Connection established.     debug1: identity file /Users/radek/.ssh/identity type -1     debug1: identity file /Users/radek/.ssh/id_rsa type -1     debug3: Not a RSA1 key file /Users/radek/.ssh/id_dsa.     debug2: key_type_from_name: unknown key type '-----BEGIN'     debug3: key_read: missing keytype     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug3: key_read: missing whitespace     debug2: key_type_from_name: unknown key type '-----END'     debug3: key_read: missing keytype     debug1: identity file /Users/radek/.ssh/id_dsa type 2     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2     debug1: match: OpenSSH_5.2 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.2     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1     debug2: kex_parse_kexinit: ssh-rsa,ssh-dss     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit: none,zlib@openssh.com     debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit:      debug2: kex_parse_kexinit: first_kex_follows 0      debug2: kex_parse_kexinit: reserved 0      debug2: mac_setup: found hmac-md5     debug1: kex: server->client aes128-ctr hmac-md5 none     debug2: mac_setup: found hmac-md5     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug2: dh_gen_key: priv key bits set: 133/256     debug2: bits set: 518/1024     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug3: check_host_in_hostfile: filename /Users/radek/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 12     debug3: check_host_in_hostfile: filename /Users/radek/.ssh/known_hosts     debug3: check_host_in_hostfile: match line 12     debug1: Host 'db2workgroup' is known and matches the RSA host key.     debug1: Found key in /Users/radek/.ssh/known_hosts:12     debug2: bits set: 509/1024     debug1: ssh_rsa_verify: signature correct     debug2: kex_derive_keys     debug2: set_newkeys: mode 1     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug2: set_newkeys: mode 0     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug2: service_accept: ssh-userauth     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug2: key: /Users/radek/.ssh/identity (0x0)     debug2: key: /Users/radek/.ssh/id_rsa (0x0)     debug2: key: /Users/radek/.ssh/id_dsa (0x100123c50)     debug1: Authentications that can continue: publickey,keyboard-interactive     debug3: start over, passed a different list publickey,keyboard-interactive     debug3: preferred publickey,keyboard-interactive,password     debug3: authmethod_lookup publickey     debug3: remaining preferred: keyboard-interactive,password     debug3: authmethod_is_enabled publickey     debug1: Next authentication method: publickey     debug1: Trying private key: /Users/radek/.ssh/identity     debug3: no such identity: /Users/radek/.ssh/identity     debug1: Trying private key: /Users/radek/.ssh/id_rsa     debug3: no such identity: /Users/radek/.ssh/id_rsa     debug1: Offering public key: /Users/radek/.ssh/id_dsa     debug3: send_pubkey_test     debug2: we sent a publickey packet, wait for reply     debug1: Authentications that can continue: publickey,keyboard-interactive     debug2: we did not send a packet, disable method     debug3: authmethod_lookup keyboard-interactive     debug3: remaining preferred: password     debug3: authmethod_is_enabled keyboard-interactive     debug1: Next authentication method: keyboard-interactive     debug2: userauth_kbdint     debug2: we sent a keyboard-interactive packet, wait for reply     debug2: input_userauth_info_req     debug2: input_userauth_info_req: num_prompts 1     Password:


title: Why does scp say "No such file"?

text: I have a bash script that uses `scp` to copy a file from my machine to another. The script keeps on exiting after I enter the SSH password with the error:               <filename>: No such file or directory      Yet, in the script, I check the file, and it is just fine. I did `set -o verbose ` at the beginning and here's what I get at the end of the script:               scp /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4 root@rpi.local:"/media/3TB/TV\ Shows/NCIS"     root@rpi.local's password:     /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4: No such file or directory      So, I tried executing the `scp` command as outputted and it was fine; it copied. What's going wrong???


title: Do all Debian-based distributions come with the same default .bashrc?

text: I ask this out of curiosity because while I have kept my system configuration files under version control for some time now, they've only ever been for OS X. Recently, though, I've been developing more and more in Ubuntu and other Linux machines--mostly Ubuntu and other Debian-biased ones--so I've begun adding Linux-specific config files to version control too. I know about the differences in the behaviour of `.bash_profile` and `.bashrc` between OS X and Linux, so it makes sense that the default OS X .bashrc would differ from that of Linux. I've only used Ubuntu Server 12.04 and the latest version of Raspbian and I've noticed that the .bashrc for both are the same, but I'm wondering - between the Debian distributions, do they all have the same .bashrc?


title: Cut command not extracting fields properly in aligned columns

text: I have a text file in which I must cut the fields 3,4,5 and 8:               219 432 4567 Harrison     Joel     M 4540 Accountant      09-12-1985     219 433 4587 Mitchell     Barbara  C 4541 Admin Asst      12-14-1995     219 433 3589 Olson        Timothy  H 4544 Supervisor      06-30-1983     219 433 4591 Moore        Sarah    H 4500 Dept Manager    08-01-1978     219 431 4527 Polk         John     S 4520 Accountant      09-22-1998     219 432 4567 Harrison     Joel     M 4540 Accountant      09-12-1985     219 432 1557 Harrison     James    M 4544 Supervisor      01-07-2000      Since the delimiter by default is tab the command to extract the fields would be:               cut -f 3,4,5,8 filename      The thing is that the output is the same as the original file content. What is happening here? Why doesn't this work?


title: How do I interpret this IFTOP result

text: I used iftop and got strange result It looks like I am heavily visited by ztomy and zerolimites.com. What the hell is that? Also I saw msnbot-157-55-39-140.search.msn.com . Is that a host or user agent? WHat sort of thing shows up on the left and what sort of thing show up on the right?               ns1626.ztomy.com                                                                                => text-lb.eqiad.wikimedia.org                                                                               76.5Kb  83.5Kb  63.3Kb                                                                                <=                                                                                2.13Mb  2.36Mb  2.00Mb     204.45.139.46                                                                                => text-lb.eqiad.wikimedia.org                                                                               41.2Kb  62.1Kb  59.7Kb                                                                                <=                                                                                1.74Mb  2.28Mb  1.90Mb     ns1.zerolimites.com                                                                                => text-lb.eqiad.wikimedia.org                                                                               36.7Kb  61.5Kb  64.0Kb                                                                                <=                                                                                784Kb  2.06Mb  2.10Mb     204.45.139.43                                                                                => text-lb.eqiad.wikimedia.org                                                                               60.8Kb  48.9Kb  44.2Kb                                                                                <=                                                                                2.52Mb  1.55Mb  1.42Mb     zerolimites.com                                                                                => text-lb.eqiad.wikimedia.org                                                                               55.0Kb  34.5Kb  39.8Kb                                                                                <=                                                                                1.51Mb   979Kb  1.25Mb     ns2.zerolimites.com                                                                                => 211.147.4.31                                                                                0b   9.76Kb  2.44Kb                                                                                <=                                                                                0b    547Kb   137Kb     ns2.zerolimites.com                                                                                => 123.58.180.119                                                                                17.0Kb  10.5Kb  4.35Kb                                                                                <=                                                                                809Kb   429Kb   187Kb     ns1.zerolimites.com                                                                                => 64.237.45.114                                                                                322Kb   382Kb   663Kb                                                                                <=                                                                                9.24Kb  11.0Kb  17.9Kb     ns2.zerolimites.com                                                                                => text-lb.eqiad.wikimedia.org                                                                               17.8Kb  13.8Kb  20.0Kb                                                                                <=                                                                                485Kb   377Kb   655Kb     ns1626.ztomy.com                                                                                => 157.55.39.108                                                                                352b    310Kb  77.5Kb                                                                                <=                                                                                5.02Kb  6.79Kb  1.99Kb     ns1626.ztomy.com                                                                                => 64.237.45.114                                                                                448b    248Kb   233Kb                                                                                <=                                                                                2.66Kb  7.13Kb  6.77Kb     204.45.139.43                                                                                => 64.237.45.114                                                                                796Kb   225Kb   138Kb                                                                                <=                                                                                14.6Kb  5.98Kb  3.81Kb     204.45.139.46                                                                                => msnbot-207-46-13-121.search.msn.com                                                                          0b    195Kb  65.2Kb                                                                                <=                                                                                0b   3.99Kb  1.42Kb     ns1626.ztomy.com                                                                                => msnbot-207-46-13-121.search.msn.com                                                                        616Kb   186Kb  46.5Kb                                                                                <=                                                                                9.06Kb  3.88Kb   994b     ns1626.ztomy.com                                                                                => 157.55.39.207                                                                                0b    185Kb  46.3Kb                                                                                <=                                                                                0b   4.23Kb  1.06Kb     ns2.zerolimites.com                                                                                => 122.112.13.58                                                                                0b   4.87Kb  1.22Kb                                                                                <=                                                                                0b    171Kb  42.8Kb     host.superhostsite.com                                                                                => 139.195.53.172                                                                                23.0Kb  21.9Kb  17.2Kb                                                                                <=                                                                                9.65Kb   150Kb   107Kb     204.45.139.46                                                                                => 185.10.104.194                                                                                160b    148Kb  50.5Kb                                                                                <=                                                                                1.72Kb  5.10Kb  2.09Kb     ns1.zerolimites.com                                                                                => 62-210-129-133.cheapseovps.com                                                                             315Kb   144Kb  84.5Kb                                                                                <=                                                                                4.38Kb  2.78Kb  2.73Kb     ns2.zerolimites.com                                                                                => 211.147.4.32                                                                                0b   2.63Kb   686b                                                                                <=                                                                                0b    143Kb  35.7Kb     204.45.139.43                                                                                => msnbot-157-55-39-140.search.msn.com                                                                          0b    131Kb  32.8Kb                                                                                <=                                                                                0b   2.67Kb   684b     ns1626.ztomy.com                                                                                => 157.55.39.223                                                                                311Kb   127Kb  31.8Kb                                                                                <=                                                                                4.69Kb  2.96Kb   757b     ns1.zerolimites.com                                                                                => msnbot-157-55-39-191.search.msn.com                                                                          0b    126Kb  31.7Kb                                                                                <=                                                                                0b   2.50Kb   826b     ns1626.ztomy.com                                                                                => 207.46.13.17                                                                                0b    125Kb  31.3Kb                                                                                <=                                                                                0b   2.25Kb   677b     ns1626.ztomy.com                                                                                => 207.46.13.68                                                                                0b    124Kb  30.9Kb                                                                                <=                                                                                0b   1.84Kb   659b     ns2.zerolimites.com                                                                                => 119.254.4.247                                                                                0b   2.98Kb  1.23Kb                                                                                <=                                                                                0b    117Kb  48.5Kb     204.45.139.46                                                                                => 66.249.74.108                                                                                136Kb   109Kb   128Kb                                                                                <=                                                                                12.0Kb  8.28Kb  7.98Kb     ns1.zerolimites.com                                                                                => 61.135.185.17


title: SSH tunnel to MySQL for PHP scripts

text: I need to establish an SSH tunnel so that my local PHP script can connect to a MySQL server on a remote server.               Remote machine: MySQL (127.0.0.1:3306) on Linux (SSH port 44422)     Local machine: Linux (Debian Squeeze)      The problem is that it doesn't allow me to connect with this command:               ssh -oPort=44422 user@ip_address      How do I establish an SSH tunnel so that my PHP script can connect to the remote MySQL? (If you believe that an alternative connection method, such as establishing SSH tunnel via PHP script is better, please let me know.) Thanks in advance! * * * EDIT: I forgot to mention that the SSH has a separate username/password and MySQL has another username/password.


title: How do you write specific bytes to a file?

text: Given a file `myfile` with the following contents:               $ cat myfile     foos      A hexdump of the file gives us the contents:               $ hexdump myfile     6f66 736f 000a      Currently, I can create the file by specifying the contents in ascii like this:               $ echo foo > myfile      Is it possible to create the file by giving it the exact bytes in hexadecimal rather than ascii?               $ # How can I make this work?     $ echo --fake-hex-option "6f66 736f 000a" > myfile     $ cat myfile     foos      Update: For clarity's sake, I worded the question to ask how to write a small number of bytes to a file. In reality, I need a way to pipe a large amount of hexadecimal numbers directly into a file rather than just 3 bytes:               $ cat hexfile     6f66 736f 6f66 736f ...     $ some_utility hexfile > myfile     $ cat myfile     foosfoosfoosfoos...


title: Is there a tool to map ecryptfs plaintext and encrypted filenames?

text: Ecryptfs encrypts filenames and sometimes I need to find particular file, so I would like a tool to map the encrypted filenames back to their plaintext file name.


title: Is it possible to get specific information about how a file is compressed?

text: File compression works on the basic idea of assigning commonly recurring chains of strings to a common index of a table where the full string is stored. For example:               Input file: foo bar bash baz foo foo bash foo baz baz foo baz foo bar     Output file: foo ,bar ,bash ,baz |01230020330301      I understand that this is a trivial example and actual file structures and algorithms are much more complex, but my question is, are there any existing compression utilities that provide options for viewing this sort meta-data in some way given a specific archive? Possibly for educational purposes?


title: What features does Darwin have that other Unixes don't, or vice versa?

text: Does Darwin have any features that are specific to it? Do other Unixe(s) have features that Darwin lacks?


title: Terminal and Vim

text: I open a terminal then I open Vim. Then I work on my source code, but unfortunately I click on the close button of the terminal title bar and my work is lost. Is it possible to configure Vim such that it will tell me when I am trying to close the terminal without saving my work? Thanks!


title: What does this python2 error mean, and what should I do about it?

text: Whenever I attempt to use an application relating to python2(gnome-tweak-tool, bzr, etc.) it fails to start and, when run from command-line, I get this error:                   [username@host ~]$ gnome-tweak-tool     Traceback (most recent call last):       File "/usr/lib/python2.7/site.py", line 563, in <module>         main()       File "/usr/lib/python2.7/site.py", line 545, in main         known_paths = addusersitepackages(known_paths)       File "/usr/lib/python2.7/site.py", line 278, in addusersitepackages         user_site = getusersitepackages()       File "/usr/lib/python2.7/site.py", line 253, in getusersitepackages         user_base = getuserbase() # this will also set USER_BASE       File "/usr/lib/python2.7/site.py", line 243, in getuserbase         USER_BASE = get_config_var('userbase')       File "/usr/lib/python2.7/sysconfig.py", line 520, in get_config_var         return get_config_vars().get(name)       File "/usr/lib/python2.7/sysconfig.py", line 419, in get_config_vars         _init_posix(_CONFIG_VARS)       File "/usr/lib/python2.7/sysconfig.py", line 287, in _init_posix         raise IOError(msg)     IOError: invalid Python installation: unable to open /usr/bin/lib/python2.7/config/Makefile (No such file or directory)      I had posted this on askubuntu, but was told it belonged here, since I use Arch Linux. Output for python2:                   [username@host ~]$ python2     Traceback (most recent call last):       File "/usr/lib/python2.7/site.py", line 563, in <module>         main()       File "/usr/lib/python2.7/site.py", line 545, in main         known_paths = addusersitepackages(known_paths)       File "/usr/lib/python2.7/site.py", line 278, in addusersitepackages         user_site = getusersitepackages()       File "/usr/lib/python2.7/site.py", line 253, in getusersitepackages         user_base = getuserbase() # this will also set USER_BASE       File "/usr/lib/python2.7/site.py", line 243, in getuserbase         USER_BASE = get_config_var('userbase')       File "/usr/lib/python2.7/sysconfig.py", line 520, in get_config_var         return get_config_vars().get(name)       File "/usr/lib/python2.7/sysconfig.py", line 419, in get_config_vars         _init_posix(_CONFIG_VARS)       File "/usr/lib/python2.7/sysconfig.py", line 287, in _init_posix         raise IOError(msg)     IOError: invalid Python installation: unable to open /usr/bin/lib/python2.7/config/Makefile (No such file or directory)


title: NFS keeps randomly crashing, breaks mount on other clients

text: I interconnect several of my Linux servers with NFS. For a while its been going fine but for some reason keeps getting more and more unstable Example: Copy a 4 GB file from client to NFS server, fails before finishing with an IO error. `dmesg` is filled with               [1525450.884071] nfs: server quackron not responding, timed out     [1525451.384072] nfs: server quackron not responding, timed out     [1525451.884072] nfs: server quackron not responding, timed out     [1525452.384086] nfs: server quackron not responding, timed out     [1525452.884065] nfs: server quackron not responding, timed out     [1525584.112127] nfs: server quackron not responding, timed out     [1525669.492066] nfs: server quackron not responding, timed out     [1525930.544062] nfs: server quackron not responding, timed out      Mount options (the many extra options are to prevent a disappearing NFS server from locking the whole directory until a restart or umount trickery)               rw,intr,soft,timeo=5,retrans=5,actimeo=10,retry=5,vers=4,addr=10.0.0.20,clientaddr=10.0.0.1      Going to the server, I get this in dmesg               [1384141.237197] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory     [1384141.237237] NFSD: starting 90-second grace period     [1439491.137710] nfsd: last server has exited, flushing export cache     [1439492.461197] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory     [1439492.461236] NFSD: starting 90-second grace period      I can't find it in this dmesg or the log, but I do know I've seen "nfsd last server has exited signal 15" errors. Googling can't seem to find any useful information Any idea's what would cause nfs to constantly crash? Note: This server is running Ubuntu Server 11.10 and is fully up to date


title: Running shell script inside with vagrant provision

text: I have setup a vagrant box using precise64 (ubuntu 14.04) and installed packages needed for octopress. I can ssh into the vagrant box and generate posts and run preview for my octopress site. Now I want to create a provision script to automatically run following commands once machine is up.               gem install bundler     rbenv rehash     bundle install     rake install     rake generate     rake preview      so I created a shell script using above commands. But when I try to run vagrant up or vagrant provision it's giving me following error.               ==> default: ERROR:  While executing gem ... (Gem::FilePermissionError)     ==> default:     You don't have write permissions into the /opt/vagrant_ruby/lib/ruby/gems/1.8 directory.     ==> default: bash: rbenv: command not found      My Vagrantfile's provision configuration is like this. I tried privileged option making true too.               config.vm.provision :shell, :privileged => false, :upload_path => "/home/vagrant/octopress/start.sh", :path => "start.sh"      What am I doing wrong here? As you can see in above logs, provision script is trying to use gem from /opt/vagrant_ruby/lib/ruby/gems directory. But when I ssh into vagrant box and check the location of gem and rbenv, those packages are located inside users home directory (/home/vagrant). The problem seems to provision script is not using 'vagrant' user's environment variables. But when I check whoami inside the script, I am getting vagrant as output. Is there any way to run provision script with vagrant user's variable?


title: Does Gnome Shell use Mutter?

text: In Wikipedia is written that Gnome Shell in Gnome 3 uses Mutter window manager. But `ps x | grep mutter` shows that Mutter is not running. Moreover I had experience with working Gnome Shell _before_ I installed Mutter. Does Gnome Shell really use Mutter? Which WM are used and which can be used with Gnome Shell?


title: Can I make low-level changes on a root fs mounted RO?

text: Related to this question: having a root file system that had to be mounted read-only (say it's completely broken), can I reformat the partition or `dd` a older backup image on top of it (and then reboot)? I guess the file system won't like those radical changes while mounted (even if readonly). Or, as a similar question: does one have other possibilities to fix a bad root fs other than running fsck interactively (i.e. perform permanent changes on the partition data with other tools)?


title: Bash prompt that won't clobber long commands

text: I'm trying to set up a bash prompt for `\- hostname(screen#):directory$` which is coloured green if the last command completed successfully, red if not. This is what I have so far, which actually does the job but seems to cause display problems if the command wraps a line:                PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m'; else echo '\e[31m' ; fi\` - \h(${WINDOW}):\W$\e[00m "      Googling the issue I found this helpful SO post with a comment that mentions wrapping nonprinting characters in `\\\\[` and `\\\\]` to avoid this issue. Therefore I tried the following, but it did not solve the issue, and furthermore breaks the colour change:               PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m'; else echo '\e[31m' ; fi\`\] - \h(${WINDOW}):\W$\[\e[00m\] "      How can I keep the structure of this prompt, with colours, but fix it so that long commands are displayed properly?


title: Sound events in Gnome 3

text: I've installed Gnome 3 yesterday. I use Gnome Shell. There are no any sound when a window closes and no any sound when I switch windows. Can sound be added (at least when I close a window)?


title: Will vmstat bi/bo display statistics infor for raw device

text: I don't have the required setup to try this so I'll just ask. `vmstat` will show `bi/bo` for a block device, but will it also be able to show that info for a raw device like some DB partition?


title: Getting message "Error trying to open /dev/dvd exclusively" at the end of a DVD burning process when using growisofs

text: I am using Linux Fedora Core 4 (have to work with a legacy system) and trying to burn DVDs as a non-root user using the `growisofs` utility. I seem to be getting this error message at the end of the burn process every time: `Error trying to open /dev/dvd exclusively ... retrying in 1 second.` The output is here:                99.18% done, estimate finish Wed Jan 22 11:02:27 2014      99.44% done, estimate finish Wed Jan 22 11:02:27 2014      99.71% done, estimate finish Wed Jan 22 11:02:27 2014      99.97% done, estimate finish Wed Jan 22 11:02:28 2014     Total translation table size: 973     Total rockridge attributes bytes: 663     Total directory bytes: 0     Path table size(bytes): 10     Max brk space used 0     1900572 extents written (3712 MB)     builtin_dd: 1900576*2KB out @ average 8.2x1385KBps     /dev/dvd: flushing cache     /dev/dvd: closing track     /dev/dvd: closing disc     Error trying to open /dev/dvd exclusively ... retrying in 1 second.     /dev/dvd: reloading tray      It seems like it completed the writing process, complains about not being able to open the device exclusively, then reloads the DVD drive's tray and things are fine after that. Furthermore, on examining the DVD, the burnt contents are there. The burn command is run inside a bash script and I prefer it if the error message is not there as it is used by other people and can cause confusion. An excerpt of the script is here:               #     # Burn to DVD     #     growisofs -dvd-compat -Z /dev/dvd -r -f -J -T /BACKUPS/DVD_backups/*          if [[ $? != 0 ]]; then       echo "Burn to DVD failed."       exit 1     fi     echo "============================================="     echo "    DVD Burn Finished."     echo "============================================="     echo     echo      `/dev/dvd` is a soft link that points to `/dev/scd0`. An `ls` output of `/dev/scd0` is:               brw-rw----  1 root disk 11, 0 Jan 22 09:47 /dev/scd0      The user I am running the bash script under is a member of the `disk` group. Here is the content of the `/etc/fstab` file:               /dev/scd0               /media/cdrecorder       auto    pamconsole,exec,noauto,user,managed 0 0      I have tried `lsof | grep /media/cdrecorder` and `fuser -a /media/cdrecorder` but that does not show up with anything.


title: CentOS yum install gcc error: glibc-common conflicts with glibc

text: I met a problem with installing gcc on my CentOS. Outputs of my command sudo yum install gcc:               Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * addons: centos.ustc.edu.cn      * base: centos.ustc.edu.cn      * extras: mirror.bit.edu.cn      * updates: centos.ustc.edu.cn     Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package gcc.x86_64 0:4.1.2-54.el5 set to be updated     --> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc     --> Processing Dependency: libgomp >= 4.1.2-54.el5 for package: gcc     --> Processing Dependency: libgcc >= 4.1.2-54.el5 for package: gcc     --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc     --> Running transaction check     ---> Package cpp.x86_64 0:4.1.2-54.el5 set to be updated     ---> Package glibc-devel.x86_64 0:2.5-118.el5_10.2 set to be updated     --> Processing Dependency: glibc-headers = 2.5-118.el5_10.2 for package: glibc-devel     --> Processing Dependency: glibc = 2.5-118.el5_10.2 for package: glibc-devel     --> Processing Dependency: glibc-headers for package: glibc-devel     ---> Package libgcc.i386 0:4.1.2-54.el5 set to be updated     ---> Package libgcc.x86_64 0:4.1.2-54.el5 set to be updated     ---> Package libgomp.x86_64 0:4.4.7-1.el5 set to be updated     --> Running transaction check     --> Processing Dependency: glibc = 2.5-49 for package: nscd     ---> Package glibc.x86_64 0:2.5-118.el5_10.2 set to be updated     --> Processing Dependency: glibc-common = 2.5-118.el5_10.2 for package: glibc     ---> Package glibc-headers.x86_64 0:2.5-118.el5_10.2 set to be updated     --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers     --> Processing Dependency: kernel-headers for package: glibc-headers     --> Running transaction check     ---> Package glibc-common.x86_64 0:2.5-118.el5_10.2 set to be updated     ---> Package kernel-headers.x86_64 0:2.6.18-371.4.1.el5 set to be updated     ---> Package nscd.x86_64 0:2.5-118.el5_10.2 set to be updated     --> Processing Conflict: glibc-common conflicts glibc > 2.5     --> Finished Dependency Resolution     glibc-common-2.5-118.el5_10.2.x86_64 from updates has depsolving problems       --> glibc-common conflicts with glibc     Error: glibc-common conflicts with glibc      You could try using --skip-broken to work around the problem      You could try running: package-cleanup --problems                             package-cleanup --dupes                             rpm -Va --nofiles --nodigest      I can not figure out what the "conflict" means, and I found nothing after a Google search. How can I get gcc working?


title: Which Linux can I install from Windows? (but not Ubuntu)

text: I have an old laptop, currently running Windows, but extremely slowly. I want to install Linux on it, probably a distro like Puppy, which plays well with low resources. But just about any distro will do as I will give the laptop to someone who only ever uses the browser (Chrome), no other apps. The problem is that while the laptop BIOS recognizes the internal CD, an external USB CD and a USB thumb drive and allows me to set them high in the boot order and also to select them from the one time boot menu, it will not actually boot from any of them. The only solution that I can see is to install Linux from Windows (and then, probably, remove Windows). I tried Wubi, which only installs Ubuntu, but that Ubuntu (12.04) would not recognize my Gigabit Ethernet card. I am drowning in other projects & just don't have time to sort that out, so am looking for another Linux which can be installed from Windows. I also found wubiX, a fork of Wubi, which says that it will allow to install any distro, but that has no download & the project was started in 2008. While I am aware that there are things that I could do (get the machine to boot from other than its hardrive, or sort out the Ubuntu networking (which I had expected to work out of the box), but I just don't have time, alas. I want to give this laptop to a friend who needs it and can't afford one otherwise. Does anyone know of a Linux distro, other than Ubuntu, which I can install from Windows? (Obviously, no virtual machines, as Windows has slowed to a crawl and a VM on top of that would not help)


title: Why do you need screen/tmux to keep a remote program running

text: When I ssh to a server and start a script that is supposed to run for several days, it stops executing some time after I log off. Why? I suppose the server runs 24/7. And what does screen/tmux do to prevent this from happening?


title: Can I install other distro and use /home from previous one?

text: Pretty much it. I want to install CrunchBang, and I have been using Ubuntu 12.10. Should I format `/home`, or do I need to only format `/` and install #! there?


title: Ubuntu Server - OS on single HDD, file server on software RAID 1

text: I run a Windows Server 2008 machine. It is used as a file server (File Services feature), in addition to local shares I use CrushFTP for SFTP and HTTP access to my files. I would like to convert to Linux (Ubuntu at first). What I want is to install the OS on a single HDD (500 GB) and then have a software RAID 1 with two 2 TB HDDs. The RAID 1 volume will be used only for storing, and all programs will be installed on the OS HDD. In what stage of this setup should I make the RAID 1 volume? I have been searching around and it seems like most guides suggests making it during the installation of the OS. Is this the best way to do it, and when I upgrade with more HDDs, will I be able to extend the volume?


title: How to find a symlink when the location in which it was created is unknown?

text: I followed some slightly incorrect instructions to install my video driver. I executed this command blindly and don't know what directory I did it:               sudo ln -s lib /usr/lib64      How can I find that incorrect symlink and delete it?


title: Kernel IPsec SA database: FIFO instead of LIFO

text: When processing an IP packet, the kernel looks into the security policy (SP) database to determine whether it is to be protected with IPsec. If the identifiers of the packet (e.g. IP addresses, etc.) match an SP entry, the kernel searches for an appropriate Security Association (SA) in the corresponding database, containing the algorithms, keys and so on. Now, the Linux kernel apparently takes always the most recently estblished matching SA (i.e. using LIFO). Is there a way (config file, command, etc.) to change this to FIFO? I am working on a solution, where I really want to "use up old SAs" before generating new ones.


Every minute these three lines are added to /var/log/syslog:               Dec  6 06:04:01 machine1234 kernel: last message repeated 3 times     Dec  6 06:04:01 machine1234 CRON[28959]: (root) CMD (/usr/local/rtm/bin/rtm 58 > /dev/null 2> /dev/null)     Dec  6 06:04:01 machine1234 kernel: mdadm: sending ioctl 1261 to a partition!      What's going on? I'm on Ubuntu 12.04 server edition.


title: How to forward a port from one machine to another?

text: Consider the following situation: At my home, I have a router (which is connected to internet), server (S) and my main machine (M). S is reachable from the internet (it has static IP), and it is up 24/7, while M is not. Sometimes, I want to make some app (which listens on some port on M, for example 8888) accessible from outer internet. For that, I wanted to set up some port on S (2222) to forward to M's port 8888, so that anybody accessing S:2222 would feel like he was accessing M:8888. I tried to use ssh port forwarding, my best attempt was as follows:               ssh -L 2222:M:8888 -N M      But that only allows me to access 2222 port from server itself, not from other machines. Is there some way to do it properly? Preferably, I'd like it to be a simple command, which I would be able to start and shut down with ^C when I don't need that forwarding anymore.


title: dbus problem with caja when using chocolate-doom on Linux Mint 14

text: I'm running Linux Mint 14 (Nadia) and I'm having a problem with chocolate- doom. When I run it, it changes the screen resolution but for some reason upsets caja (the file manager) like so (from /var/log/auth.log). The effects of the error include include chocolate-doom crashing to the desktop, changes to resolution that can only be reversed using monitor preferences and errors about caja trying to remount drives that are already mounted.               Aug  4 13:20:01 bart-laptop dbus[794]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.79" (uid=1000 pid=27478 comm="caja ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=1539 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Aug  4 13:23:15 bart-laptop dbus[794]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.83" (uid=1000 pid=27571 comm="caja ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=1539 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Aug  4 13:30:42 bart-laptop dbus[794]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.87" (uid=1000 pid=27933 comm="caja ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=1539 comm="/usr/sbin/console-kit-daemon --no-daemon ")     Aug  4 13:54:39 bart-laptop dbus[794]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.91" (uid=1000 pid=28306 comm="caja ") interface="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply="0" destination=":1.11" (uid=0 pid=1539 comm="/usr/sbin/console-kit-daemon --no-daemon ")      It's very difficult to find information on what this error message means. A couple of interesting observations: the PID of the caja process changes most times (i.e. it spawns a new process) and it also comes up with warnings about being unable to remount already mounted drives. Needless to say this problem is frustrating, as it renders chocolate-doom unplayable, makes caja very unreliable and also permanently (can only be reset using monitor settings) changes the screen resolution. For the record chocolate-doom works flawlessly on Windows XP, including when it changes the screen resolution. But that means I can only play chocolate-doom at work!


title: Keep all commands in bash history?

text: I have the opposite question to this. How do I keep all commands in bash history? In Ubuntu since quite some time now, the default for bash is to forget commands with non success exit code. This is incredibly stupid and I would go with the accepted answer to linked question. Unix user @goldilocks pointed out that maybe I am just confused by the ignoreboth directive. set pastie


title: Remmina doesn't eat keys

text: Unlike rdesktop, when I press `ALT` + `F4` in remmina, it doesn't react in the Windows system, but instead closes the remmina window. Any thoughts?


title: Program a file to self-destruct at a given time

text: Does anyone know whether there is a command in linux that can set attributes to file so that the file can disappear after certain time. For example, if I set one attribute to file as "1/1/2015", so the file will delete itself at that time. Or is there any other ways to make this file become an accessible after some time? For example, I can set password to the file and after some time, the password will get expired and be a new password and the file will not be read any more. I know in my own computer, I can set like `cron` tasks. But I just want to know if I send this file to others, the file can delete itself or make itself unreadable automatically.


title: Module marked (F) in /proc/modules

text: On my 3.10 system some of modules listed in /proc/modules are marked (F). I'd like to find the cause of this (F). I am sure modules were not forcefully loaded and were built with the Kernel. Could you, please point what kernel code creates the /proc/modules?               usb_storage 56610 0 - Live 0xffffffffa005d000 (F)      If I unload and reload back this module the (F) goes away.


title: lsyncd and additional parameters for rsync

text: Currently Im using lsyncd to monitor data and sync them (same machine)                settings{         logfile      = "/var/log/lsyncd/lsyncd.log",         statusFile   = "/var/log/lsyncd/lsyncd_status.log",         maxDelays    = 10,         maxProcesses = 15,      }          sync{     default.rsync,     source="/home/user/data/source_data/",     target="/home/user/data/synced_data/",     delete=false,     rsyncOpts={     "--remove-source-files",     "--delay-updates",     "--checksum"     }     }      The problem is I can't pass these parameters for rsync (remove-source-files, delay-updates and checksum) Im using lsyncd 2.1.4 Here is the error:               Starting lsyncd: Error: error preparing /etc/lsyncd.conf: Parameter "rsyncOpts" unknown. (if this is not a typo add it to checkgauge)


title: Linux makes my audio speaker make a “poping sound” back to Windows in dualboot

text: I have a very strange problem that other people with the same hardware than me already had, but I didn't see any solutions on the internet. That's why I'm posting here, I'm a bit desperate and if I don't fix that problem I will certainly uninstall Linux... I have a Dell Inspiron 17R Special Edition with advanced audio Skullcandy (a thrid special speaker). Everything worked fine, until I decided to install Ubuntu in dual boot. When I first boot on Windows everything is fine, but when I boot on Linux and get back to windows, my third speaker starts to make a very strange and loud poping sound, a broken-like awful sound... First I thought it was a hardware problem, but to make it work again, I have to totally shutdown the computer and then boot on Windows... And it works ! oO I did the test many times and I always have the same result. I fear that this speaker problem may really damage my hardware... Has someone already seen something like that ? It's very strange that a Linux installed apart creates a bug on Windows... Thank you for your help, but as I said, If I don't solve the problem, I'll have to do a heart-breaking uninstallation of Ubuntu :(


title: snd_rawmidi_open() waits forever - no error message

text: I am trying to use ALSA for MIDI purposes in C. My problem is, snd_rawmidi_open() sort of "crashes" (waits forever like a while loop) when using valuable arguments :               #include <stdio.h>     #include <stdlib.h>     #include <alsa/asoundlib.h>          int main(int argc,char** argv)     {         snd_rawmidi_t *handle_in = 0;         int err;         fprintf(stderr, "TEST 1\n");         err = snd_rawmidi_open(&handle_in,NULL,"hw:1,0,0",0);         fprintf(stderr,"TEST 2\n");         if (err) {             fprintf(stderr,"snd_rawmidi_open failed: %d\n",err);         }         fprintf(stderr, "TEST 3\n");         exit(0);         }      "hw:1,0,0" is a MIDI keyboard. When I use an invalid value like "foo", it gives an error. With a valid one, the program displays "TEST 1" and pauses. Any idea? Many thanks!


title: to print address space of a process in ubuntu 12.04

text: How do I print an address space of a process by taking the process' PID?


title: How do I get the character count of words in a particular column?

text: I have a CSV file like this:               abd,123,egypt,78     cde,456,england,45      How can I get the character count of only the 3rd column words? I can't figure out how to get `wc` to do this.


title: 'Refresh-save' a file, dock problem?

text: A bit of context: I followed the bug reports on Docky (link1, link2, and all the other links in these links...) and managed to make Plank recognize IntelliJ IDEA using the right StartupWMClass on the .desktop file, it even works in the terminal; typing idea, launches IDEA, with the right icon in the dock, but after I reboot, it doesn't work anymore. What's weirder, if I open idea.desktop with any text editor, and save it, it starts working again until the next reboot, what could be happening? This is my bash for IDEA, located at /usr/bin/idea:               #!/bin/sh     export IDEA_HOME="/opt/idea-IU-135.909/bin"          $IDEA_HOME/idea.sh $*      My idea.desktop file at `/usr/share/applications/idea.desktop`:               [Desktop Entry]     Encoding=UTF-8     Name=IntellJ IDEA     Comment=The Best Java and Polyglot IDE     StartupWMClass=jetbrains-idea     Exec=idea     Icon=intellij-idea-ultimate-edition     Terminal=false     Type=Application     Categories=GNOME;Application;Development;     StartupNotify=true      At the moment I've solved this issue by forcing an open & save on my `/etc/rc.local` like this:               sudo vim /usr/share/applications/idea.desktop     :wq     exit 0      What other options do I have? what could be happening here? is there -at least- a better way to open and save a file in the terminal? mine is imho, horrifying.


title: High-latency VM-centric workstation, vs. low-latency, (but, hack-ish) configuration for Oracle 11g

text: **tl;dr Low-latency native (i.e. VM-less) development workstation vs. higher latency VM-centric workstation?** Hey StackExchange, I'm unsure of whether or not I should be using a VM for development, as opposed to running a native configuration on a distribution certified for use with Oracle 11g (as opposed to Debian). As it stands, my options are as follows:   * Current development system (see below) + Oracle Virtualbox + prebuilt Oracle VM   * New development system (OS + software) certified for use with Oracle 11g   * Current development system + haphazard compatibility hacks to remedy Oracle 11g's cantankerous disposition towards Debian-based distributions **Motivation:**   * Difficulty of Oracle 11g on Debian-based systems   * Expected difficulty of subsequent Oracle installations   * University studies are Java + PL/SQL centric * * * **Current development system (laptop):**   * OS: Linux Mint 14    * CPU: i3-2310M @ 2.1GHz   * RAM: 6GB   * Development languages:     * PL/SQL (11g R2)     * MySQL     * Java     * C++     * R * * * **Any thoughts on whether or not I should vie for a higher latency VM-centric deployment as opposed to a low-latency, native workstation?** **VM-centric pros:**   * I don't have to install Oracle 11g.    * Separation-of-duty (VMs for: pentesting, Oracle development, Windows applications)   * Portability of development system **VM-centric cons:**   * Higher latency   * Narrow application base (as opposed to [Debian|Ubuntu]) for non-Oracle software   * Lack of install candidates for Debian-based development software in OEL5/RHEL5 * * * **Main concerns:**   1. Lack of install candidates for software    2. Inability to efficiently install complicated Oracle software    3. Lack of accessibility to applications in other VMs   4. High latency   5. Lack of bleeding edge software for OEL/RHEL * * * **Oracle Database 11g certified distributions (if going native):**   * Oracle Linux 5   * RHEL 5   * SUSE Linux Enterprise Server 10 * * * **So, realistically my options (if taking the native, certified distribution route) are:**   * CentOS {5,6}   * Oracle Linux 5   * OpenSUSE **Otherwise:**   * Fedora 17 + hacks   * Linux Mint 14 + m0ar hacks * * * **Should I go with a low-latency, Oracle-based development system (thus starting over), or go with multiple, higher-latency Oracle VMs?** * * * # _**Thank you._** PS: Note that this is **not** intended as a shopping question.


title: Can Firefox browser plugin/addon do bad things to your files?

text: Firefox is open source software and can't be intended to do bad things, but the plugins, as I know, aren't open source. Can they be intended to do bad things? Is there any good idea to supervise them or to control their behavior?


title: Bash shells with different environment variables

text: I want to somehow enter a different bash shell with some altered environment variables. For example, if I run script `bfin.sh` and it contains something like               export PATH=/home/me/bfin2012:$PATH I want it to create a bash shell with this changed variable. How to do this?


title: setup filename encryption for encrypted home folder in eCryptfs

text: I used `ecryptfs-migrate-home` to encrypt my home folder on my Debian (Testing) system. As I am a complete encryption-greenhorn, I don't know yet how to check, if the encryption succeeded. However, I suppose encryption works but filenames are not encrypted. I want to have encrypted filenames as well. How can I get encrypted filenames for my (already encrypted) `/home`-folder?


title: tcp6 in the output netstat

text: What does column 'tcp6' mean on output netstat? Please anyone explain the follow output of netstat: `tcp6 0 0 dmz.local.net:www 5.140.235.6%14631:49964 ESTABLISHED 21393/apache2` What does **tcp6** mean?


title: How to get ntp to use gpsd to update system date/time with a large offset

text: I have a GPS connected to my system, and if I change system time to be ahead/behind GPS time by less than 4 hours, **`ntpd`** ensures that the system time is updated to match that of the GPS. If, however, that offset is beyond 4 hours, no update takes place. I have ensured to run **`ntpd`** with the `-g` option, but it still doesn't work, unless I use normal ntp servers, for example having `server 0.debian.pool.ntp.org iburst` in **/etc/ntp.conf**. Let us, however, assume that the system in question will not have internet access during normal operation. The other relevant settings in that file are:               server 127.127.28.0 minpoll 4 maxpoll 4     fudge 127.127.28.0 time1 0.420 refid GPS          server 127.127.28.1 minpoll 4 maxpoll 4 prefer     fudge 127.127.28.1 refid GPS1      (source: **`gpsd`** manpage) I even added `tinker panic 0` to that config, just to make sure, but still no luck.


title: How come I can append to files to a directory without write permissions?

text: I understand this first example:               > mkdir foo     > chmod u-w foo     > touch foo/test     touch: cannot touch `foo/test': Permission denied     > echo "BAD" >> foo/test     bash: foo/test: Permission denied      This makes sense: I don't have write permission on the directory so I shouldn't be able to write any changes. I can not touch nor create a file that can be appended to. Why does this work however?               > mkdir bar     > touch bar/test     > chmod u-w bar     > echo "BAD" >> bar/test      > cat bar/test      BAD


title: Gnome Shell - Disabling live window thumbnails in activities

text: I have noticed it slows down the system when a browser game or real game is open because it renders them all in the activities menu. Is there a way to disable them, or make them static?


title: App consumes diferent %CPU if started at start-up or from prompt

text: I run an application in embedded system, and it needs to start at boot. However, I have a problem with it: when I execute it at boot (from rc.local script), it consumes nearly all the CPU, making the system slow. When I kill and execute it from the system prompt, it only consumes 4~6% cpu, and the whole system works correctly (and this application too). Any ideas to solve this mystery?


Delete files with same name at the end of the file i have a lot of files in my folder and sub directories like               ajax_hostel_room_master.php.php          class_hostel_registration.php.php     ajax_hostel_room_master.php.php.php      class_hostel_registration.php.php.php     ajax_hostel_room_shifting.php            class_hostel_room_allocation.php     ajax_hostel_room_shifting.php.php        class_hostel_room_allocation.php.php     ajax_hostel_room_shifting.php.php.php    class_hostel_room_allocation.php.php.php      I want to keep the filename.php and delete the other files like filename.php.php


title: EXT3: If block size is 4K, why does ls -l show file sizes below that?

text: If you run ls -l on a file that contains one letter, it will list as 2B in size. If your file system is in 4k blocks, I thought it rounded files up to the block size? Is it because ls -l actually reads the byte count from the inode? In what circumstances do you get rounded up to block answers vs actual byte count answers in Linux 2.6 Kernel GNU utils?


title: Debian 7 - Startx fails to start system

text: When I boot into the second primary boot loader, I get to the text based console to boot when I type 'startx'. The screen loads, and goes black for 10 seconds. Then when it loads a white screen appears with a computer monitor an sad face on it. Under it, it says               "Oh no! Something has gone wrong"     A problem has occurred and the system can't recover. Please log out and try again      When I click the logout button in the console it reports the errors as follows:               X.Org X Server 1.12.4     Release Date: 2012-08-27     X Protocol Version 11, revision 0     build operating system: Linux 3.2.0-4-amd64 x86_64 Debian     ....     The XKEYBOARD Keypmap compiler (xkbcomp) reports:     > warning:  compat map for group 2 redefined     > using new definition     > warning:  compat map for group 3 redefined     > using new definition     > warning:  compat map for group 4 redefined     > using new definition     Errors from xkbcomp are not fatal to the X server     xinit: connection to X server lost          Waiting for X server to shut down server terminated successfully (0). closing the file      Does anyone know how I can successfully boot into my operating system with startx and avoid getting these errors?


title: How does the OS know that a command needs sudo?

text: 1. When you run an executable, sometimes the OS will deny your permission to. For example running `make install` with the prefix being a system path will need `sudo`, while with the prefix being a non-system path will not be asked for `sudo`. How does the OS decide that running an executable would require more privilege than a user has, even before the program does something?   2. Sometimes, running a program will not be denied permission, but the program will be able to do more things if it is run with `sudo`. For example, when running `du` on some system directory, only with `sudo` it will be able to access some directory. Why does the OS not deny permission of running such a program, or friendly notify more privilege is preferred, before the program can run?   3. Is it true that whenever `sudo` works, `su` will also work, and whenever `su` works, `sudo` will also work? or with `su`, a user can do more than with `sudo`? How does the OS decide when `sudo` works, and when `su` is needed?


title: Why do slackware packages recreate symlinks after installation?

text: Reading through slackware's makepkg script, I saw that rather than putting symlinks directly into the package, it deletes them and generates a script called doinst.sh that recreates them after installing the package. Is there any reason why the links have to be recreated post-install? It seems like an unnecessary step to me.


title: mount: fmask options is not working

text: Few days ago I did this question. But now I have another problem, related, but new. Scenario: I have a flash drive (vfat) mounted in `/media/flash` the filesystem node is `/dev/sdb1`. according to linux manuals mount(8) under the section **Mount options for fat** : > _fmask: Set the umask applied to regular files only. The default is the > umask of the current process. The value is given in octal._ So since I'm trying nobody be able to read anything from this flash drive I did:               mount /dev/sdb1 /media/flash -o remount,fmask=444      but I'm still able to read the content of a *.txt file stored in the mentioned device. What I'm doing wrong?


title: Arch Linux makepkg for AUR now always fails on finding dependencies

text: When trying to install something from AUR like I have done successful before with no issues, it now always fails.               [seth@archbang google-talkplugin-amd64]$ makepkg -si     ==> Making package: google-talkplugin-amd64 2.5.6.0-1 (Mon Nov 21 19:26:58 MST 2011)     ==> Checking runtime dependencies...     ==> Installing missing dependencies...     error: target not found: error:     ==> ERROR: 'pacman' failed to install missing dependencies.      I don't understand how to fix this error. It does this on others also when it was working. ADDED: pacman.conf               #     # /etc/pacman.conf     #     # See the pacman.conf(5) manpage for option and repository directives          #     # GENERAL OPTIONS     #     [options]     # The following paths are commented out with their default values listed.     # If you wish to use different paths, uncomment and update the paths.     #RootDir     = /     #DBPath      = /var/lib/pacman/     #CacheDir    = /var/cache/pacman/pkg/     #LogFile     = /var/log/pacman.log     HoldPkg     = pacman glibc     # If upgrades are available for these packages they will be asked for first     SyncFirst   = pacman     #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u     #XferCommand = /usr/bin/curl -C - %u > %o     #CleanMethod = KeepInstalled     Architecture = auto          # Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup     #IgnorePkg   =     #IgnoreGroup =          #NoUpgrade   =     #NoExtract   =          # Misc options (all disabled by default)     #UseSyslog     ShowSize     #UseDelta     TotalDownload     ILoveCandy          #     # REPOSITORIES     #   - can be defined here or included from another file     #   - pacman will search repositories in the order defined here     #   - local/custom mirrors can be added here or in separate files     #   - repositories listed first will take precedence when packages     #     have identical names, regardless of version number     #   - URLs will have $repo replaced by the name of the current repo     #   - URLs will have $arch replaced by the name of the architecture     #     # Repository entries are of the format:     #       [repo-name]     #       Server = ServerName     #       Include = IncludePath     #     # The header [repo-name] is crucial - it must be present and     # uncommented to enable the repo.     #          # The testing repositories are disabled by default. To enable, uncomment the     # repo name header and Include lines. You can add preferred servers immediately     # after the header, and they will be used before the default mirrors.          #[testing]     ## Add your preferred servers here, they will be used first     #Include = /etc/pacman.d/mirrorlist          [core]     # Add your preferred servers here, they will be used first     Include = /etc/pacman.d/mirrorlist          [extra]     # Add your preferred servers here, they will be used first     Include = /etc/pacman.d/mirrorlist          #[community-testing]     ## Add your preferred servers here, they will be used first     #Include = /etc/pacman.d/mirrorlist          [multilib]     ## Add your preferred servers here, they will be used first     Include = /etc/pacman.d/mirrorlist          [community]     # Add your preferred servers here, they will be used first     Include = /etc/pacman.d/mirrorlist          # An example of a custom package repository.  See the pacman manpage for     # tips on creating your own repositories.     #[custom]     #Server = file:///home/custompkgs      MORE INFO:               [seth@archbang google-talkplugin-amd64]$ sudo makepkg --check --asroot     ==> Making package: google-talkplugin-amd64 2.5.6.0-1 (Mon Nov 21 21:31:50 MST 2011)     ==> Checking runtime dependencies...     ==> Missing Dependencies:       -> lib32-alsa-lib       -> libstdc++5       -> glew       -> lib32-libxt       -> lib32-openssl       -> lib32-libxfixes       -> lib32-gtk2       -> lib32-gdk-pixbuf2     ==> Checking buildtime dependencies...     ==> ERROR: Could not resolve all dependencies.      MAKEPGK.conf               #     # /etc/makepkg.conf     #          #########################################################################     # SOURCE ACQUISITION     #########################################################################     #     #-- The download utilities that makepkg should use to acquire sources     #  Format: 'protocol::agent'     DLAGENTS=('ftp::/usr/bin/wget -c --passive-ftp -t 3 --waitretry=3 -O %o %u'               'http::/usr/bin/wget -c -t 3 --waitretry=3 -O %o %u'               'https::/usr/bin/wget -c -t 3 --waitretry=3 --no-check-certificate -O %o %u'               'rsync::/usr/bin/rsync -z %u %o'               'scp::/usr/bin/scp -C %u %o')          # Other common tools:     # /usr/bin/snarf     # /usr/bin/lftpget -c     # /usr/bin/curl          #########################################################################     # ARCHITECTURE, COMPILE FLAGS     #########################################################################     #     CARCH="x86_64"     CHOST="x86_64-unknown-linux-gnu"          #-- Exclusive: will only run on x86_64     # -march (or -mcpu) builds exclusively for an architecture     # -mtune optimizes for an architecture, but builds for whole processor family     CFLAGS="-march=amdfam10 -mtune=amdfam10 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"     CXXFLAGS="-march=amdfam10 -mtune=amdfam10 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"     LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"     #-- Make Flags: change this for DistCC/SMP systems     #MAKEFLAGS="-j5"          #########################################################################     # BUILD ENVIRONMENT     #########################################################################     #     # Defaults: BUILDENV=(fakeroot !distcc color !ccache check)     #  A negated environment option will do the opposite of the comments below.     #     #-- fakeroot: Allow building packages as a non-root user     #-- distcc:   Use the Distributed C/C++/ObjC compiler     #-- color:    Colorize output messages     #-- ccache:   Use ccache to cache compilation     #-- check:    Run the check() function if present in the PKGBUILD     #     BUILDENV=(fakeroot !distcc color !ccache check)     #     #-- If using DistCC, your MAKEFLAGS will also need modification. In addition,     #-- specify a space-delimited list of hosts running in the DistCC cluster.     #DISTCC_HOSTS=""          #########################################################################     # GLOBAL PACKAGE OPTIONS     #   These are default values for the options=() settings     #########################################################################     #     # Default: OPTIONS=(strip docs libtool emptydirs zipman purge)     #  A negated option will do the opposite of the comments below.     #     #-- strip:     Strip symbols from binaries/libraries     #-- docs:      Save doc directories specified by DOC_DIRS     #-- libtool:   Leave libtool (.la) files in packages     #-- emptydirs: Leave empty directories in packages     #-- zipman:    Compress manual (man and info) pages in MAN_DIRS with gzip     #-- purge:     Remove files specified by PURGE_TARGETS     #     OPTIONS=(strip docs libtool emptydirs zipman purge)          #-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512     INTEGRITY_CHECK=(md5)     #-- Options to be used when stripping binaries. See `man strip' for details.     STRIP_BINARIES="--strip-all"     #-- Options to be used when stripping shared libraries. See `man strip' for details.     STRIP_SHARED="--strip-unneeded"     #-- Options to be used when stripping static libraries. See `man strip' for details.     STRIP_STATIC="--strip-debug"     #-- Manual (man and info) directories to compress (if zipman is specified)     MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})     #-- Doc directories to remove (if !docs is specified)     DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})     #-- Files to be removed from all packages (if purge is specified)     PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)          #########################################################################     # PACKAGE OUTPUT     #########################################################################     #     # Default: put built package and cached source in build directory     #     #-- Destination: specify a fixed directory where all packages will be placed     #PKGDEST=/home/packages     #-- Source cache: specify a fixed directory where source files will be cached     #SRCDEST=/home/sources     #-- Source packages: specify a fixed directory where all src packages will be placed     #SRCPKGDEST=/home/srcpackages     #-- Packager: name/email of the person or organization building packages     #PACKAGER="John Doe <john@doe.com>"          #########################################################################     # EXTENSION DEFAULTS     #########################################################################     #     # WARNING: Do NOT modify these variables unless you know what you are     #          doing.     #     PKGEXT='.pkg.tar.xz'     SRCEXT='.src.tar.gz'          # vim: set ft=sh ts=2 sw=2 et:      RESULTS               [seth@archbang ~]$ sudo pacman -Syu && sudo pacman -S base-devel     :: Synchronizing package databases...      core is up to date      extra is up to date      multilib is up to date      community is up to date     :: Starting full system upgrade...      there is nothing to do     :: There are 11 members in group base-devel:     :: Repository core        1) autoconf  2) automake  3) bison  4) fakeroot  5) flex  6) gcc  7) libtool        8) m4  9) make  10) patch  11) pkg-config          Enter a selection (default=all):      warning: autoconf-2.68-2 is up to date -- reinstalling     warning: automake-1.11.1-3 is up to date -- reinstalling     warning: bison-2.5-2 is up to date -- reinstalling     warning: fakeroot-1.18.1-1 is up to date -- reinstalling     warning: flex-2.5.35-5 is up to date -- reinstalling     warning: gcc-4.6.2-1 is up to date -- reinstalling     warning: libtool-2.4.2-2 is up to date -- reinstalling     warning: m4-1.4.16-2 is up to date -- reinstalling     warning: make-3.82-4 is up to date -- reinstalling     warning: patch-2.6.1-3 is up to date -- reinstalling     warning: pkg-config-0.26-2 is up to date -- reinstalling     resolving dependencies...     looking for inter-conflicts...          Targets (11): m4-1.4.16-2 [0.16 MB]  autoconf-2.68-2 [0.56 MB]                   automake-1.11.1-3 [0.51 MB]  bison-2.5-2 [0.42 MB]                   fakeroot-1.18.1-1 [0.05 MB]  flex-2.5.35-5 [0.24 MB]                   gcc-4.6.2-1 [17.03 MB]  libtool-2.4.2-2 [0.26 MB]                   make-3.82-4 [0.34 MB]  patch-2.6.1-3 [0.06 MB]                   pkg-config-0.26-2 [0.03 MB]          Total Download Size:    0.00 MB     Total Installed Size:   77.21 MB          Proceed with installation? [Y/n] y     (11/11) checking package integrity                 [----------------------] 100%     (11/11) checking for file conflicts                [----------------------] 100%     ( 1/11) upgrading m4                               [----------------------] 100%     ( 2/11) upgrading autoconf                         [----------------------] 100%     ( 3/11) upgrading automake                         [----------------------] 100%     ( 4/11) upgrading bison                            [----------------------] 100%     ( 5/11) upgrading fakeroot                         [----------------------] 100%     ( 6/11) upgrading flex                             [----------------------] 100%     ( 7/11) upgrading gcc                              [----------------------] 100%     ( 8/11) upgrading libtool                          [----------------------] 100%     ( 9/11) upgrading make                             [----------------------] 100%     (10/11) upgrading patch                            [----------------------] 100%     (11/11) upgrading pkg-config                       [----------------------] 100%     [seth@archbang ~]$ sudo pacman -Qi base-devel     error: package "base-devel" not found


title: Submitting bug reports for Arch Linux

text: I come from Ubuntu and when things crashed I could collect the relevant information and submit a bug report. Is there an easy or preferred way to do this in Arch Linux after an application crashes?


title: Migrate /home to another physical drive

text: I recently cleared about 500GB of junk from my HDD. Since I'm pretty low on space on my Arch install, I figured I'd dedicate 200GB of that to /home. Problem is that my /home partition is located on my SSD, not the HDD. I'm not sure how I'm supposed to migrate /home to another drive. The partitions ![Partitions](http://i.cubeupload.com/gNPBNs.png) Recovery, EFI, Windows Boot, Arch Root Partition, Arch /home Partition and 20GB overhead for the SSD. The HDD is just a big dumping ground. What I want is to move the /home partition safely over to the HDD (new 200GB partition), then merge the old /home with the root partition to create a bigger root partition.


title: How do I patch an rpm in SLES and automatically rebuild it when updates are available?

text: I applied a patch to a source RPM, built it and installed the resulting package. All good. But now every time the package gets updated, it gets overwritten with the unpatched version from the official repository. I could of course just lock the package to its current version, but I don't want to miss security related updates. I'd like to patch and compile the source RPM every time an update is available, kind of similar in concept to dkms. Is there maybe some place I could hook a script into? I looked into (lib)zypp plugins but am not yet sure if the task can be accomplished with those. Any pointers to documentation or similar implementations in that direction are much appreciated.


title: How can I make stdin always get consumed?

text: Some programs do not read from stdin (such as `dmesg` or `adb logcat`). I usually press `Return` a few times to provide a separation between log lines. When I interrupt the command directly in the shell, everything works satisfactory. However, when the programs terminate themselves (because the connection for `adb logcat` gets lost for example), the shell starts processing all lines I have entered. This usually looks like this:               user@host$      user@host$      user@host$      user@host$      user@host$ # I broke something here     user@host$      user@host$      user@host$      user@host$ TODO LOOK AT THIS     bash: TODO: command not found     user@host$      user@host$      user@host$      user@host$      user@host$      user@host$ # adb is about to get killed...     user@host$      As you can understand, having Bash execute all these lines is quite useless and shifts the last remaining output. Is there a way to consume stdin even when the process terminates?


title: Find where inodes are being used

text: So I received a warning from our monitoring system on one of our boxes that the number of free inodes on a filesystem was getting low. `df -i` output shows this:               Filesystem       Inodes  IUsed    IFree IUse% Mounted on     /dev/xvda1       524288 422613   101675   81% /      As you can see, the root partition has 81% of its inodes used.   I suspect they're all being used in a single directory. But how can I find where that is at?


title: Is VNC traffic bypassing IPSec and L2TP tunnel?

text: I have a CentOS 6.5 server running:   * a tightvnc server   * a StrongSwan to provide IPSec VPN   * xl2tpd to provide L2TP/IPSec VPN The VNC clients are:   * RealVNC Viewer on OSX   * Android-vnc-viewer on Android 4.3 I intend to use the two VPN connections to secure the communication between VPN clients and the VPN server, however there is a strange behaviour:   * First, I connect to IPSec (or the l2tp) VPN.   * To verify that the VPN connection is active, I go to an IP lookup website, and confirm that my IP belongs to the VPN server.   * Using the VNC client I establish a VNC connection to the VPN server using the server's public IP address (instead of VPN tunnel address)   * Disconnect VPN. Upon VPN disconnection, all other applications (Skype for example) momentarily lose Internet connectivity, however the VNC connection is not interrupted no matter the client is OSX or Android. How is this possible? Are both VNC clients bypassing IPSec And L2TP VPN?


title: Where do I find ioctl EVIOCGRAB documented?

text: I want to use the `ioctl` `EVIOCGRAB` function in a C based program, and from googling around I have found various bits of example source code that use the function, but I am struggling to find explicit documentation that correctly describes how to correctly use it. I see that from ioctl(2), `ioctl` function is defined as               int ioctl(int d, unsigned long request, …);      And that:                  The third argument is an untyped pointer to memory.  It's traditionally char        *argp (from the days before void * was valid C), and will be so named        for this discussion.      And I hoped to find `EVIOCGRAB` listed in ioctl_list(2), but it wasn't. So I don't _know_ what the third argument should be for the `EVIOCGRAB` function. After seeing various bits of example code all I can do is _assume_ that a non-zero value grabs the device and that a zero value releases it. Which I got from random code examples like               int grab = 1;     ioctl(fd, EVIOCGRAB, &grab);     ..     ioctl(fd, EVIOCGRAB, NULL);       or               ioctl(fd, EVIOCGRAB, (void*)1);     ..     ioctl(fd, EVIOCGRAB, (void*)0);       or               ioctl(fd, EVIOCGRAB, 1);     ..     ioctl(fd, EVIOCGRAB, 0);       (Which seems to smell a bit of cargo cult programming.) So where can I find a definitive explanation of the `EVIOCGRAB` control parameter?


title: Installing KVM on CentOS 6.4 without GUI (yet)

text: I've installed CentOS 6.4 from the 'minimal' iso, so it doesn't come with a GUI. Will this question's answer allow me to install KVM, or do I need to install KDE or X-server or something first?


title: Corrupted PDF: Opens fine, but pyPdf bails with AssertionError

text: I received a PDF in an email and I want to crop and rotate it because it has two pages per sheet. Trying the solutions in Split pages in pdf I had problems with "AssertionError" in `pyPDF` and "Warning: stream operator not terminated by valid EOL." in ImageMagick. `pdftk` seems to be stuck in an endless loop and never finishes processing the file. Here's the `pyPDF` error:               Traceback (most recent call last):       File "./un2up.py", line 48, in <module>         split_pages(sys.argv[1],sys.argv[2])       File "./un2up.py", line 14, in split_pages         for i in range(input.getNumPages()):       File "/usr/lib64/python2.7/site-packages/pyPdf/pdf.py", line 431, in getNumPages         self._flatten()       File "/usr/lib64/python2.7/site-packages/pyPdf/pdf.py", line 596, in _flatten         catalog = self.trailer["/Root"].getObject()       File "/usr/lib64/python2.7/site-packages/pyPdf/generic.py", line 480, in __getitem__         return dict.__getitem__(self, key).getObject()       File "/usr/lib64/python2.7/site-packages/pyPdf/generic.py", line 165, in getObject         return self.pdf.getObject(self).getObject()       File "/usr/lib64/python2.7/site-packages/pyPdf/pdf.py", line 647, in getObject         assert idnum == indirectReference.idnum     AssertionError      I tried opening it in Adobe Reader and saving a copy, but the file ended up the same. The file opens fine for visualization on `evince`, Adobe Reader and Google Drive. Any idea how to fix the file so it can be read by `pyPdf`?


title: Linux signals logger

text: I'm looking for a signals logger for the Linux kernel, without patching of kernel. I found many articles with patching, but I am not interested in that. I'm running default Ubuntu 13.04.               # uname -a     Linux bt 3.8.0-26-lowlatency #18-Ubuntu SMP PREEMPT Tue Jun 25 22:36:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      I need: pid, comm (sender) -> SIGNAL (number 0-31) -> pid, comm (catcher) Would be great too:                 pidtree of sender ----- - - - - - receiver(cmd) ---- child1 of receiver, etc                   /                     \----child2---child1 of child2(cmd)                  ppid(+cmd)               ----child3(+cmd)                 /                          \__child4(+cmd)                ppid of ppid(cmd)               ....              /             init      And the same for catcher. + timestamps. What I have already found: superfrink.net: patch Linux UserSpace Signal Logging (Logs signals sent from userspace programs.) by Chad Clark (Version 10 March 2003) grsecurity patch has similar realization. I need light and easy way to achieve this on Ubuntu.


title: How do I set permissions recursively on a dir (with ACL enabled)?

text: For example, I want to give my colleagues write access to certain directory. Let's assume that subdirectories in it had access rights 775, files 664, and also there were some executable files in the dir - 775. Now I want to add write permissions. With chmod, I could try something like               chmod o+w -R mydir/      But that's not cool, since I don't want to make the dir world-writable - I want give access only to certain users, so I want to use ACL. But is there an easy way to set those permissions? As I see it, I need to tackle at least three cases (dirs, files, executable files) separately:               find -type d -exec setfacl -m u:colleague:rwx {} \;     find -type f -executable -exec setfacl -m u:colleague:rwx {} \;     find -type f \! -executable -exec setfacl -m u:colleague:rw {} \;      It seems quite a lot of code lines for such a simple task. Is there a better way?


title: Showing type of newline character in Emacs

text: How can I have Emacs display the type of new character? I am looking for something similar to what Notepadd does (see below). I read that Emacs comes with `M-x whitespace-mode` but this doesn't seem to show the type of ASCII control character the file uses to represent linebreaks. Am I missing anything? ![enter image description here](http://i.stack.imgur.com/5PCkO.png) Note: I asked this question in SuperUser but did not get an answer in 3+ months so I am hoping to try here now.


title: nmap failed to determine route

text: I have set about trying to learn nmap, though for some reason it does not work I keep getting the same error, the only time it works is when I specify loopback address, this is the error I get otherwise: `Premature EOF in /proc/net/route nexthost: failed to determine route to 192.168.1.1 QUITTING!` I have checked the file /proc/net/route and found that it is empty. What should I do? I have searched the web and can't find a solution. Since I'm stuck at this hurdle I can't progress in any way learning nmap unfortunately. EDIT: This what ifconfig brings up:               lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128      Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1      RX packets:521137 errors:0 dropped:0 overruns:0 frame:0      TX packets:521137 errors:0 dropped:0 overruns:0 carrier:0 collisions:0      Txqueuelen:0 RX bytes:22075684 (22.0 MB) TX bytes:22075684 (22.0 MB)


title: Can one scan with fsck a read-only partition?

text: I have a file system that has some "unlinked inodes" and for this reason it was mounted as read-only. As I understood, to get this device into rw-mode, I need to perform partition check with fsck. All the advices I found state, that I should first unmount the device. Is it necessary? Can one scan (and repair) with fsck a read-only partition? The server is used for smb-exports, and most of the users would be much happier if they, at least, would have a read-access.


title: How does strace know to use /bin/echo instead of failing on a built-in

text: When I do `strace echo hello`, I see it is using `/bin/echo`, but built-in `echo` should be found first. Is it a functionality of strace to skip built-in commands? strace -- version 4.5.19 I understand that strace won't work on built-in commands the way it works on system executables.


title: Is there a distribution-independent tool to autocompile+install dependencies?

text: I like the way e.g. ArchLinux' `yaourt` (or if you're not that lazy, `abs`+`makepkg`; and from what I read so far, Gentoo's `ebuild` as well) automatically take care of obtaining, compiling and installing dependencies (and _their_ dependencies etc.) before compiling a desired package. Currently I'm working with a system that does not natively provide such a mechanism (a Buffalo LinkStation Pro Duo with root access via ssh) and need to compile some programs with horribly complex dependency chains, crawling through which manually is really tedious, so I'm wondering if there either is   * a tool similar to the aforementioned ones, which basically takes a sourcecode directory (or `.tar.gz` or git-repo or ...) and before compiling checks for missing dependencies, more or less automatically obtains their sourecode (recursing until all dependencies are resolved)   * a way to configure one of these tools such that they respect deviations from their own distribution, e.g. installing everything under `/opt` and not attempting to upgrade the (firmware-specific) kernel? Sure enough there are many peculiarities in the general case, but for the sake of it assume 90% of all dependencies merely require a `./configure --prefix=/opt && make && make install` run.


title: Get report of the gui application processes

text: I want to list main applications processes report in this format               ps -e -o pid,comm,pmem,pcpu,uname      To filter main GUI applications `wmctrl -pl` is the only way I can get processes ids.its great if `xlsclients` can be used. It contains the real list with names I want. How can I combine them as single commands to get report as I want. (ps -p = xlsclients -p)


title: How to rip scratched audio cds?

text: What is currently the best way to rip scratched audio cds under Linux? What I find complicated, is that there are several tools available but it is not clear if one tool has better error correction features than the other. I mean, there are at least:   * cdparanoia   * cdda2waw   * cdrdao


title: how to view a directory's permission

text: What is the command with which you can directly view the permission bits of a directory?


title: Names for ATA and SATA disks in Linux

text: Assume that we have two disks, one master SATA and one master ATA. How will they show up in /dev?