title: why do I need to patch linux kernel to use pandaboard's spi?

text: I believe this question is a bit more general but here is how it goes : I have read this article about using pandaboard's SPI, especially the part "Configuring and patching the kernel". It says that you have to edit the driver to use the SPI, by telling the driver what bus you want to use, and I don't really understand why we would need to do so. If we are compiling the kernel, we specify the `arch` (`omap...`) and so I guess that since the toolchain knows what is the target processor, it knows what are the pin numbers of the SPI (clock, miso, mosi, ...). So what am I missing here ? Why do we need extra configuration ?


title: How do I set dhclient debug info on?

text: On a FreeBSD computer Is there a DHCP client log that I could use to debug a DHCP issue? Can I set a debug param to get more information from the dhclient? UPDATE 1: I found a lead on this article handy tools for debugging DHCP on linux but that's on Linux (dhcping, dhcpdump), and I don't have these on my FreeBSD, I won't be able to install them. UPDATE 2: tcpdump -lenx -i eth0 -s 1500 port bootps


title: Need to remove lines till a pattern is matched

text: My C code needs to decode some application data that were received over a socket by another application. I used the Wireshark to export the packets(many) into a C array. But the array carries all bytes comprising IP address/Port. I just need the application data. The C array is:               static const unsigned char pkt64[393] = {     0x00, 0x04, 0x00, 0x01, 0x00, 0x06, 0xd8, 0x9d, /* ........ */     0x67, 0x16, 0x55, 0xc0, 0x00, 0x00, 0x08, 0x00, /* g.U..... */     0x45, 0x00, 0x01, 0x79, 0xf1, 0x09, 0x40, 0x00, /* E..y..@. */     0x40, 0x06, 0xc1, 0xee, 0x0a, 0x17, 0x6f, 0x35, /* @.....o5 */     0x0a, 0xd7, 0x02, 0x64, 0xe3, 0xa4, 0x18, 0x54, /* ...d...T */     0x8c, 0xa2, 0xd6, 0xb1, 0xe9, 0xa5, 0x0c, 0xd2, /* ........ */     0x80, 0x18, 0x14, 0x12, 0x87, 0xf2, 0x00, 0x00, /* ........ */     0x01, 0x01, 0x08, 0x0a, 0x4a, 0x0c, 0x9a, 0x21, /* ....J..! */     0x94, 0x8d, 0xb2, 0x23, 0x01, 0x43, **0x60, 0x00,** /* ...#.C`. */     **0x06, 0x00** , 0x58, 0x6f, 0x12, 0x00, 0x30, 0x30, /* ..Xo..00 */     0x47, 0x00, 0x20, 0xe2, 0x82, 0x19, 0x00, 0x10, /* G. ..... */     0x10, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x95, /* ........ */     0x42, 0x38, 0x14, 0x04, 0x24, 0x11, 0x57, 0x14, /* B8..$.W. */     0x58, 0x12, 0x30, 0x30, 0x11, 0x00, 0x40, 0x00, /* X.00..@. */     [...]     0x39, 0x38, 0x35, 0x2d, 0x31, 0x31, 0x37, 0x00, /* 985-117. */     0x03, 0x14, 0x10, 0x00, 0x00, 0x03, 0x28, 0x00, /* ......(. */     0x01, 0x19, 0x95, 0xe2, 0xcf, 0x53, 0x13, 0xa2, /* .....S.. */     0xd5                                            /* . */     };      My application data starts with the bytes `0x60, 0x00, 0x06, 0x00`. So I need to delete all lines and bytes up to the the application data of interest. Since I have many packets to be decoded, how do I use grep/sed to achieve my requirement?


title: Job started by procmail does not appear in ps-output and cannot be stopped, even not after reboot

text: For testing purposes I called procmail by my .forward file `|/usr/bin/procmail` and by the rules in .procmailrc it started a job named "start", which was simply an infinite loop               while true     do      date>>logfile      sleep 300     done      To my surprise this job (or anything else related to procmail or .forward) does not appear as a separate process in the output of ps -ef (not as my own process and not as that of anybody else), so I cannot kill it and it writes one timestamp each 5 minutes into the log. Even deleting the shell script does not work, obviously it is already in memory and does not need to be read again. Now I thought, at least the job will terminate after a reboot, but it didn't. The only thing I can do for stopping the output is making the logfile unwritable to all, but even then the job continues to run (I see it when I make the file readable again). Now my question is: How can I kill this script as non-root user? Or if not at all: What did I do wrong? How do I have to call a script by procmail to show up in the ps-output and (more important) to make it killable for me? I have no root access to the machine, but I have physical access, so I can restart it. The OS seems to be x86_64-suse-linux, uname -a shows Linux 3.11.10-7-default #1 SMP. My shell is bash. @Anthon: mailq shows an empty mail queue. Renaming start, .procmailrc and .forward does not change anything. @EightBitTony:               nameofpc:~ > ps -ef     UID        PID  PPID  C STIME TTY          TIME CMD     root         1     0  0 Apr24 ?        00:00:13 /sbin/init showopts     root         2     0  0 Apr24 ?        00:00:00 [kthreadd]     root         3     2  0 Apr24 ?        00:00:00 [ksoftirqd/0]     root         5     2  0 Apr24 ?        00:00:00 [kworker/0:0H]     root         7     2  0 Apr24 ?        00:00:00 [migration/0]     root         8     2  0 Apr24 ?        00:00:00 [rcu_bh]     root         9     2  0 Apr24 ?        00:00:00 [rcuob/0]     root        10     2  0 Apr24 ?        00:00:00 [rcuob/1]     root        11     2  0 Apr24 ?        00:00:00 [rcuob/2]     root        12     2  0 Apr24 ?        00:00:00 [rcuob/3]     root        13     2  0 Apr24 ?        00:00:11 [rcu_sched]     root        14     2  0 Apr24 ?        00:00:07 [rcuos/0]     root        15     2  0 Apr24 ?        00:00:04 [rcuos/1]     root        16     2  0 Apr24 ?        00:00:04 [rcuos/2]     root        17     2  0 Apr24 ?        00:00:03 [rcuos/3]     root        18     2  0 Apr24 ?        00:00:01 [watchdog/0]     root        19     2  0 Apr24 ?        00:00:01 [watchdog/1]     root        20     2  0 Apr24 ?        00:00:00 [migration/1]     root        21     2  0 Apr24 ?        00:00:00 [ksoftirqd/1]     root        23     2  0 Apr24 ?        00:00:00 [kworker/1:0H]     root        24     2  0 Apr24 ?        00:00:01 [watchdog/2]     root        25     2  0 Apr24 ?        00:00:00 [migration/2]     root        26     2  0 Apr24 ?        00:00:00 [ksoftirqd/2]     root        28     2  0 Apr24 ?        00:00:00 [kworker/2:0H]     root        29     2  0 Apr24 ?        00:00:01 [watchdog/3]     root        30     2  0 Apr24 ?        00:00:00 [migration/3]     root        31     2  0 Apr24 ?        00:00:00 [ksoftirqd/3]     root        33     2  0 Apr24 ?        00:00:00 [kworker/3:0H]     root        34     2  0 Apr24 ?        00:00:00 [khelper]     root        35     2  0 Apr24 ?        00:00:00 [kdevtmpfs]     root        36     2  0 Apr24 ?        00:00:00 [netns]     root        37     2  0 Apr24 ?        00:00:00 [writeback]     root        38     2  0 Apr24 ?        00:00:00 [kintegrityd]     root        39     2  0 Apr24 ?        00:00:00 [bioset]     root        40     2  0 Apr24 ?        00:00:00 [kblockd]     root        41     2  0 Apr24 ?        00:00:00 [ata_sff]     root        42     2  0 Apr24 ?        00:00:00 [md]     root        44     2  0 Apr24 ?        00:00:00 [khungtaskd]     root        45     2  0 Apr24 ?        00:00:00 [kswapd0]     root        46     2  0 Apr24 ?        00:00:00 [ksmd]     root        47     2  0 Apr24 ?        00:00:01 [khugepaged]     root        48     2  0 Apr24 ?        00:00:00 [fsnotify_mark]     root        49     2  0 Apr24 ?        00:00:00 [crypto]     root        54     2  0 Apr24 ?        00:00:00 [kthrotld]     root        55     2  0 Apr24 ?        00:00:00 [scsi_eh_0]     root        56     2  0 Apr24 ?        00:00:00 [scsi_eh_1]     root        57     2  0 Apr24 ?        00:00:00 [scsi_eh_2]     root        58     2  0 Apr24 ?        00:00:00 [scsi_eh_3]     root        59     2  0 Apr24 ?        00:00:00 [scsi_eh_4]     root        60     2  0 Apr24 ?        00:00:00 [scsi_eh_5]     root        68     2  0 Apr24 ?        00:00:00 [kpsmoused]     root        72     2  0 Apr24 ?        00:00:01 [kworker/0:1H]     root        73     2  0 Apr24 ?        00:00:00 [deferwq]     root       114     2  0 Apr24 ?        00:00:00 [kmpath_rdacd]     root       141     2  0 Apr24 ?        00:00:00 [khubd]     root       151     2  0 Apr24 ?        00:00:00 [kworker/1:1H]     root       152     2  0 Apr24 ?        00:00:00 [kworker/2:1H]     root       154     2  0 Apr24 ?        00:00:00 [kworker/3:1H]     root       220     2  0 Apr24 ?        00:00:00 [jbd2/sda5-8]     root       221     2  0 Apr24 ?        00:00:00 [ext4-rsv-conver]     root       222     2  0 Apr24 ?        00:00:00 [ext4-unrsv-conv]     root       260     1  0 Apr24 ?        00:00:11 /usr/lib/systemd/systemd-journald     root       261     2  0 Apr24 ?        00:00:00 [kauditd]     root       296     1  0 Apr24 ?        00:00:00 /usr/lib/systemd/systemd-udevd     root       381     2  0 Apr24 ?        00:00:00 [irq/46-mei_me]     root       382     2  0 Apr24 ?        00:00:00 [hd-audio0]     root       387     2  0 Apr24 ?        00:00:00 [kvm-irqfd-clean]     root       426     2  0 Apr24 ?        00:00:00 [jbd2/sda7-8]     root       427     2  0 Apr24 ?        00:00:00 [ext4-rsv-conver]     root       428     2  0 Apr24 ?        00:00:00 [ext4-unrsv-conv]     root       430     2  0 Apr24 ?        00:00:00 [jbd2/sda9-8]     root       431     2  0 Apr24 ?        00:00:00 [ext4-rsv-conver]     root       432     2  0 Apr24 ?        00:00:00 [ext4-unrsv-conv]     root       438     2  0 Apr24 ?        00:00:01 [jbd2/sda6-8]     root       439     2  0 Apr24 ?        00:00:00 [ext4-rsv-conver]     root       440     2  0 Apr24 ?        00:00:00 [ext4-unrsv-conv]     avahi      624     1  0 Apr24 ?        00:01:38 avahi-daemon: running [fphct03.local]     root       625     1  0 Apr24 ?        00:00:00 /sbin/rpcbind -w -f     nscd       628     1  0 Apr24 ?        00:00:07 /usr/sbin/nscd --foreground     message+   631     1  0 Apr24 ?        00:00:10 /bin/dbus-daemon --system --address=systemd: --     root       642     1  0 Apr24 ?        00:00:04 /usr/lib/systemd/systemd-logind     root       644     1  0 Apr24 ?        00:00:07 /usr/local/natinst/nisvcloc/bin/nisvcloc -D     root       647     1  0 Apr24 ?        00:00:03 /usr/sbin/rsyslogd -n     root      1233     1  0 Apr24 ?        00:00:00 /usr/sbin/sshd -D     root      1241     1  0 Apr24 ?        00:00:01 /usr/sbin/ypbind -n -no-dbus     root      1246     2  0 Apr24 ?        00:00:00 [rpciod]     root      1247     2  0 Apr24 ?        00:00:00 [nfsiod]     root      1255     1  0 Apr24 ?        00:00:00 /usr/sbin/rpc.gssd -D -p /var/lib/nfs/rpc_pipef     root      1261     1  0 Apr24 ?        00:00:00 /usr/sbin/rpc.idmapd -p /var/lib/nfs/rpc_pipefs     root      1264     2  0 Apr25 ?        00:00:00 [kworker/u8:2]     root      1276     2  0 Apr24 ?        00:00:00 [nfsv4.0-svc]     root      1298     1  0 Apr24 tty1     00:00:00 /sbin/agetty --noclear tty1 linux     ntp       1319     1  0 Apr24 ?        00:00:11 /usr/sbin/ntpd -p /var/run/ntp/ntpd.pid -g -u n     root      1351     1  0 Apr24 ?        00:00:00 /usr/bin/kdm     root      1395     1  0 Apr24 ?        00:00:29 /usr/bin/python /usr/sbin/denyhosts --daemon --     root      1437     1  0 Apr24 ?        00:00:00 /usr/lib/postfix/master     root      1450     1  0 Apr24 ?        00:00:00 /usr/sbin/cron -n     postfix   1460  1437  0 Apr24 ?        00:00:00 qmgr -l -t fifo -u     root      1633     1  0 Apr24 ?        00:00:02 /usr/lib/upower/upowerd     polkitd   1638     1  0 Apr24 ?        00:00:09 /usr/lib/polkit-1/polkitd --no-debug     root      1678     1  0 Apr24 ?        00:00:41 /usr/lib/udisks2/udisksd --no-debug     rtkit     1748     1  0 Apr24 ?        00:00:02 /usr/lib/rtkit/rtkit-daemon     root      1777     1  0 Apr24 ?        00:00:00 /usr/lib/bluetooth/bluetoothd     root      1789     1  0 Apr24 ?        00:00:00 /usr/lib/systemd/systemd-hostnamed     root      1979  1351  0 Apr25 tty7     00:00:48 /usr/bin/Xorg -br :0 vt7 -nolisten tcp -auth /v     root      1987  1351  0 Apr25 ?        00:00:00 -:0     kdm       1988  1987  0 Apr25 ?        00:02:09 /usr/lib64/kde4/libexec/kdm_greet     root     17533     2  0 Apr26 ?        00:00:00 [kworker/u8:1]     root     21461     2  0 08:20 ?        00:00:00 [kworker/2:1]     root     22873     2  0 12:10 ?        00:00:00 [kworker/1:1]     postfix  23129  1437  0 12:47 ?        00:00:00 pickup -l -t fifo -u     root     23171     2  0 12:50 ?        00:00:00 [kworker/2:2]     root     23266     2  0 13:05 ?        00:00:00 [kworker/3:1]     root     23300     2  0 13:11 ?        00:00:00 [kworker/0:2]     root     23393     2  0 13:20 ?        00:00:00 [kworker/3:2]     root     23407     2  0 13:22 ?        00:00:00 [kworker/0:0]     root     23428     2  0 13:26 ?        00:00:00 [kworker/1:0]     root     23481  1233  0 13:34 ?        00:00:00 sshd: myuserid [priv]     myuserid    23484     1  0 13:34 ?        00:00:00 /usr/lib/systemd/systemd --user     myuserid    23485 23484  0 13:34 ?        00:00:00 (sd-pam)     myuserid    23486 23481  0 13:34 ?        00:00:00 sshd: myuserid@pts/2     myuserid    23487 23486  0 13:34 pts/2    00:00:00 -bash     root     23547     2  0 13:35 ?        00:00:00 [kworker/2:0]     root     23561     2  0 13:35 ?        00:00:00 [kworker/0:1]     myuserid    23595 23487  0 13:37 pts/2    00:00:00 ps -ef     nameofpc:~ >      @tripleee: .procmailrc (yes, I know that there is some garbage in) was something like               # .procmailrc     # routes incoming mail to appropriate mailboxes     PATH=/usr/local/bin:/usr/bin:/bin     MAILDIR=$HOME/.mailspool   # all mailboxes are in .mailspool/     #DEFAULT=$HOME/.mailspool/mbox     DEFAULT=/var/spool/mail/myuserid     LOGFILE=/dev/null     SHELL=/bin/bash     {     :0     * ^From myemail@myexternalfreemailprovider\.com     {      :0      | /home/myuserid/start >/dev/null     }     }      If you ask why I need this: I want to make sure each time I get mail at my external freemail account, that a job (let's call it payload.sh) on the host (which has no `cron` and no `at`) is run once every 6 hours. So I forward the mail from my external mail account to the host, where procmail starts my script "start" each time a new mail arrives. And in "start" I would check if an earlier "start" script is still running. If yes, then exit the new, second "start", if not (probably due to a shut down of the host), then "start" will call payload.sh every 6 hours. If you know a simpler solution for this problem then feel free to write it here.


title: Automatically run rfkill unblock on startup

text: I'm running Elementary OS on an old(er) HP Pavilion dm1. Unfortunately, on startup my wireless is hard disabled, and I need to run `sudo rfkill unblock all` to get it up and running. Works fine once I do though. Is there any way to either: 1) Automatically run this line with startup 2) Not need to do this anymore? When I use rfkill to view any blocks, there's a hard block on the wireless, and the wireless button's light is orange. Pressing the button does nothing. After running the line, I can switch wireless on and off at will. Please help!


title: SSH to machines in new subnet - connection timeout

text: I'm using RHEL4 and RHEL5. A new group of Linux machines are setup recently using 172.16.32.0/24. The existing RHEL machines are running on 172.16.1.0/22 and 172.16.4.0/22. When I try to ssh from 172.16.4.39 to 172.16.1.1, there's no problem.               > traceroute 172.16.1.156     traceroute to 172.16.1.156 (172.16.1.156), 30 hops max, 46 byte packets      1  swt0 (172.16.4.240)  1.396 ms  1.380 ms  1.758 ms      2  172.16.1.156 (172.16.1.156)  579.076 ms  573.315 ms  574.878 ms      If I ssh to any one of the new machine, I get ssh timeout, although I can traceroute to it.               > traceroute 172.16.32.11     traceroute to 172.16.32.11 (172.16.32.11), 30 hops max, 46 byte packets      1  swt0 (172.16.4.240)  5.968 ms  1.641 ms  1.476 ms      2  * * *     <----- could be misconfiguration, not sure how to troubleshoot this.      3  172.16.32.11 (172.16.32.11)  273.330 ms  271.820 ms  274.223 ms          > ssh -v -v -v 172.16.32.11     OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 172.16.32.11 [172.16.32.11] port 22.     debug1: connect to address 172.16.32.11 port 22: Connection timed out     ssh: connect to host 172.16.32.11 port 22: Connection timed out      I added a similar route on both the switch (swt0) and firewall to point 172.16.32.0/24 to the same gateway 172.16.5.253. Also added a new line in hosts.allow file on 172.16.4.39 (the machine where I try to ssh from).               > cat /etc/hosts.allow     ALL: 127.0.     ALL: 172.16.0.0/255.255.252.0     ALL: 172.16.4.0/255.255.252.0     ALL: 172.16.24.0/255.255.252.0     ALL: 172.16.32.0/255.255.255.0      Any advice what other files I should check/change to make ssh work between 172.16.4.0/22 172.16.32.0/24? Output of ping and `route -n`:               > route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     172.16.4.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0     0.0.0.0         172.16.4.240    0.0.0.0         UG    0      0        0 eth0          > ping 172.16.32.11     PING 172.16.32.11 (172.16.32.11) 56(84) bytes of data.     64 bytes from 172.16.32.11: icmp_seq=0 ttl=62 time=269 ms     64 bytes from 172.16.32.11: icmp_seq=1 ttl=62 time=259 ms     64 bytes from 172.16.32.11: icmp_seq=2 ttl=62 time=269 ms     64 bytes from 172.16.32.11: icmp_seq=3 ttl=62 time=268 ms          --- 172.16.32.11 ping statistics ---     4 packets transmitted, 4 received, 0% packet loss, time 3005ms     rtt min/avg/max/mdev = 259.331/266.884/269.777/4.408 ms, pipe 2


title: How to get proccesses currently running semaphores by /proc?

text: I wonder how to get processes currently running semaphores by `/proc` ? I guess it's possible by SysVIPC subdirectory.But I don't know how to use this commands. Ubuntu 12.10


title: CPU usage of KVM

text: I have a linux host with 4 KVM linux guests. All the guest are pretty much idle, having a load of <0.1 inside the guest. Now, if I do a `top` on the host, each KVM process is using something about 30% of the CPU. Is this a normal behavior? I would expect the host to need much less CPU just to host a idle guest. If it is normal, what is the reason for this? If it is not normal, what might be the problem?


title: apply bash function to parent scope

text: I can to define function in bash and use it:               foo() { echo $1; }     foo test      But if I want to collect my functions in one bash script all its unavailable: init.bash               #!/bin/bash     foo() { echo $1; }       export -f foo # This not helps      Using:               ./init.bash && foo test # error here      Is there any way to export script's functions to parent scope?   Without writing to `.bashrc`, it's too global   Same as `.bashrc` but for current bash instance only...


title: How to enable passwordless auth to remote server as a different user?

text: This may seem quite trivial but what I've done doesn't seem to solve the problem. I'm connecting to a remote server as `tom` who (obviously) exists on the remote server but not the local server. I copied the `id_rsa.pub` key generated for local user `bob` onto tom's `authorized_keys` file on the remote server. However, I'm still being prompted for the password.               [bob@localserver ~]$ ssh tom@remoteserver      I suspect I'm doing something wrong. Can someone assist? Thanks. **EDIT 1** Just for completeness I also regenerated the the key and copying it to the remote server.               ssh-keygen -t rsa     ssh-copy-id -i tom@REMOTESERVER      See debug output here: ssh debug details I noticed the following in the debug output. This is present for every line (base64 block?) in my `id_rsa` private key file:               debug3: key_read: missing whitespace      **EDIT 2:** Remote server's permissions:               drwx------ 2 tom tom 4096 Aug 15 10:59 .     drwx------ 5 tom tom 4096 Aug 15 11:54 ..     -rw-rw-r-- 1 tom tom  810 Aug 15 10:59 authorized_keys     -rwx------ 1 tom tom  109 Aug 14 09:43 config     -rw------- 1 tom tom 1675 Aug  8 14:58 id_rsa     -rw-r--r-- 1 tom tom  404 Aug  8 14:58 id_rsa.pub     -rw-r--r-- 1 tom tom 1217 Aug 10 09:32 known_hosts      Local server's permissions:               drwx------ 2 bob bob 4096 Aug 15 11:32 .     drwx------ 7 bob bob 4096 Aug 15 11:32 ..     -rw------- 1 bob bob 1613 Aug 15 11:09 id_rsa     -rw------- 1 bob bob 1675 Aug 15 11:08 id_rsa.bkp     -rw-r--r-- 1 bob bob  405 Aug 15 10:58 id_rsa.pub     -rw-r--r-- 1 bob bob  410 Aug 15 10:59 known_hosts


title: Why doesn't "ping -vrf" works when ping works?

text: 0:root@SERVER:/root # ping IPADDRESS     PING IPADDRESS (IPADDRESS): 56 data bytes     64 bytes from IPADDRESS: icmp_seq=0 ttl=254 time=0 ms     64 bytes from IPADDRESS: icmp_seq=1 ttl=254 time=0 ms     64 bytes from IPADDRESS: icmp_seq=2 ttl=254 time=0 ms     ^C     --- IPADDRESS ping statistics ---     3 packets transmitted, 3 packets received, 0% packet loss     round-trip min/avg/max = 0/0/0 ms     0:root@SERVER:/root # ping -vrf IPADDRESS     PING IPADDRESS (IPADDRESS): 56 data bytes     ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable     ping: wrote IPADDRESS 64 chars, ret=-1     .ping: sendto: Network is unreachable      **QUESTION** : If I can ping the IPADDRESS then why can't I "ping -vrf" the IPADDRESS?


title: Gnome: Make system text copyable

text: Here I use "system text" to refer to the text displayed in the GTK widgets (labels, menus, dialogs etc.) I would like to be able to highlight and copy any system text. I am using a locale with a non-roman script that I am not fluent in, and I would like to be able to copy menu items, and paste them into a dictionary. Has anyone ever heard of something that can add that functionality to the GTK libs?


title: Httpd : no space left on device

text: I am using Fedora 17 and over the last few days I am having an issue with my system. Whenever I try to start `httpd` it shows me: `Error: No space left on device` When I execute `systemctl status httpd.service`, I receive the following output:               httpd.service - The Apache HTTP Server (prefork MPM)               Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)               Active: inactive (dead) since Tue, 19 Feb 2013 11:18:57 +0530; 2s ago              Process: 4563 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=0/SUCCESS)               CGroup: name=systemd:/system/httpd.service      I tried to Google this error and all links point to clearing the semaphores. I don't think this is the issue as I tried to clear the semaphores but that didn't work. **Edit 1** here is the output of `df -g`               [root@localhost ~]# df -h     Filesystem              Size  Used Avail Use% Mounted on     rootfs                   50G   16G   32G  34% /     devtmpfs                910M     0  910M   0% /dev     tmpfs                   920M  136K  920M   1% /dev/shm     tmpfs                   920M  1.2M  919M   1% /run     /dev/mapper/vg-lv_root   50G   16G   32G  34% /     tmpfs                   920M     0  920M   0% /sys/fs/cgroup     tmpfs                   920M     0  920M   0% /media     /dev/sda1               497M   59M  424M  13% /boot     /dev/mapper/vg-lv_home  412G  6.3G  385G   2% /home      Here is the deatail of httpd error log               [root@localhost ~]# tail -f /var/log/httpd/error_log     [Tue Feb 19 11:45:53 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Tue Feb 19 11:45:53 2013] [notice] Digest: generating secret for digest authentication ...     [Tue Feb 19 11:45:53 2013] [notice] Digest: done     [Tue Feb 19 11:45:54 2013] [notice] Apache/2.2.23 (Unix) DAV/2 PHP/5.4.11 configured -- resuming normal operations     [Tue Feb 19 11:47:23 2013] [notice] caught SIGTERM, shutting down     [Tue Feb 19 11:48:00 2013] [notice] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0     [Tue Feb 19 11:48:00 2013] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Tue Feb 19 11:48:00 2013] [notice] Digest: generating secret for digest authentication ...     [Tue Feb 19 11:48:00 2013] [notice] Digest: done     [Tue Feb 19 11:48:00 2013] [notice] Apache/2.2.23 (Unix) DAV/2 PHP/5.4.11 configured -- resuming normal operations     tail: inotify resources exhausted     tail: inotify cannot be used, reverting to polling      **Edit 2** here is the output of `df-i`               [root@localhost ~]# df -i     Filesystem               Inodes  IUsed    IFree IUse% Mounted on     rootfs                  3276800 337174  2939626   11% /     devtmpfs                 232864    406   232458    1% /dev     tmpfs                    235306      3   235303    1% /dev/shm     tmpfs                    235306    438   234868    1% /run     /dev/mapper/vg-lv_root  3276800 337174  2939626   11% /     tmpfs                    235306     12   235294    1% /sys/fs/cgroup     tmpfs                    235306      1   235305    1% /media     /dev/sda1                128016    339   127677    1% /boot     /dev/mapper/vg-lv_home 26984448    216 26984232    1% /home      Thanks


title: Window contents disappear after maximizing

text: Window contents usually disappear after Maximizing them! Especially Firefox. I'm running Ubuntu 12.10 on a Vaio Z56 laptop (graphics card: nVidia GeForce 9300M GS). I've read this question before and do everything that was said in the answer but they didn't work for me. (Something worse happen!!!My toolbar is disappeared!I have a terminal on Desktop and it's the only thing I can use.I can't access administration panel!)


title: OpenBSD AnonCVS find out which "tree" I am using

text: I am pretty much of a newb when it comes to OpenBSD. And I know the FAQ suggests to prefer the pkg_tools over using the ports tree if you are not so experienced with the package system. But anyhow, I just wanted to know if there is a way to find out which source tree I have cloned over AnonCVS, because its been a while since I have installed my ports tree and I read that it is important to know before you upgrade them sources.


title: How to achieve portability with sed -i (in-place editing)?

text: I'm writing shell scripts for my server, which is a shared hosting running FreeBSD. I also want to be able to test them locally, on my PC running Linux. Hence, I'm trying to write them in a portable way, but with `sed` I see no way to do that. Part of my website uses generated static html files, and this sed line inserts correct DOCTYPE after each regeneration:               sed -i '1s/^/<!DOCTYPE html> \n/' ${file_name.html}      It works with `GNU sed` on Linux, but FreeBSD `sed` expects the first argument after -i flag to be extension for backup copy. This is how it would look like:               sed -i '' '1s/^/<!DOCTYPE html> \n/' ${file_name.html}      However, `GNU sed` in turn expects the expression to follow immediately after -i. (It also reqires fixes with newline handling, but that's already answered in here) Of course I can include this change in my server copy of the script, but that would mess i.e. my use of VCS for versioning. Is there a way to achieve this with sed in a fully portable way?


title: What mount option to use for ext3 file system to minimise data loss or corruption?

text: I have an embedded setup using an initramfs for the root file system but using a custom ext3 partition mounted on a compact flash IDE drive. Because data integrity in the face of power loss is the most important factor in the entire setup, I have used the following options to mount (below is the entry from my `/etc/fstab` file               <file system> <mount pt> <type> <options>                         <dump><pass>     /dev/sda2     /data      ext3   auto,exec,relatime,sync,barrier=1 0     2      I came by these options from reading around on the internet. What I am worried about is that the content of `/proc/mounts` give the following:               /dev/sda2 /data ext3 rw,sync,relatime,errors=continue,user_xattr,acl,     barrier=1,data=writeback 0 0      From what I understand from reading around is that I want to use `data=journal` option for my mount as this offers the best protection against data corruption. However, from the man page for specific ext3 options for `mount` it says the following about the writeback option: > Data ordering is not preserved - data may be written into the main > filesystem after its metadata has been committed to the journal.   >  This is rumoured to be the highest-throughput option. **It guarantees > internal filesystem integrity** , however it can allow old data to appear in > files after a crash and journal recovery. I am very confused about this - the man page seems to suggest that for file system integrity I want to specify `data=writeback` option to `mount` but most other references I have found (including some published books on embedded linux) suggest that I should be using `data=journal`. What would be the best approach for me to use? Write speed is not an issue at all - data integrity is though.


title: Reading amount of tracks from an audio CD?

text: I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this? On an Ubuntu 12.04 derivative.


title: No internet access for system services; however, browser access works

text: Unable to reload repos via apt-get, aptitude, or synaptic. Dropbox does not connect or sync. Pithos does not connect to pandora.com. Chrome and Firefox browsers do work fine. I have been unable to find why my browsers can touch the internet and not any other apps can.


title: Init script header not resolving dependency

text: I need to run a `/usr/sbin` command in my init script, so there is a dependency for the `/usr` filesytem to be mounted. To resolve the dependency, I put `$local_fs` or `boot.localfs` (I also tried `$remote_fs` and `$all`) in the required-start field of init script header, but it does still mount the `/usr` filesystem and my command in the initscript still fails with "command not found" error. I could resolve the issue by adding `boot.localfs` in the `.depend.boot` file, but why could not I resolve from the required-start init script header? Edit: I'm using the SUSE Linux 10.


title: What sets systemd apart from other init systems?

text: It is not quite official but it looks like systemd is coming to Debian and after reading some of the heated mailing list discussion on that decision, I am curious about the polarizing nature of systemd among linux users. I run Debian (sysvinit) and Gentoo (OpenRC) systems and know nothing concrete about systemd, though it looks like it is coming my way. I have seen this related question asking the pros and cons of systemd vs upstart, but it has been 3 years since that question was posted and I'm sure things have changed in that time. My question is: How does systemd compare to other init systems?   * What sets it apart -- what can it do that the other init systems cannot?    * Is there anything to lose in switching to it from another init system?    * How does administering systemd compare to the others?


title: How can I automatically interrupt what I'm doing to input something?

text: As per Nick Winter's _The Motivation Hacker_ , I want to measure my happiness. I know that I'm bad at remembering things or responding to reminders, so I'd like to set up a daemon that, at random intervals would:   * Check if I'm in a tty and if I am, output a message to that tty/pts, then capture input until newline   * Check if I'm in (currently using) the graphical interface, and if I am, launch a dialog to capture input. How can I do this?


title: Parse JSON or XML on bootup

text: I'm compiling my own version of the linux kernel and I was wondering if there is any way to do parse a local XML or JSON file.


title: Disabling email for an account

text: I have an amazon ec2 instance running ubuntu. There are only a couple of user accounts and the server is used to host a small web app. Apparently, by default, each user account has an email account. We do not use these accounts. Recently I discovered that one of the accounts is receiving "undeliverable message" emails from spam being sent in its name. We're receiving hundreds per hour and we didn't notice until the disk filled up. Of course we deleted all the emails and in the time it took for the delete to complete we had received 30 more. The best solution is to disable the email for this account. We want to keep the account though. Is there a way to just remove the email account for a user without affecting the account itself. Googling didn't help me. I only found directions for deleting individual emails or deleting the entire user account.


title: Send keystrokes to a process on Console

text: If I have a terminal with a shell open, how can I write a shell script (any scripting language is ok with me!) that will send a keystroke to any one of the running processes? As an example, how could I call a function that sends `Esc`,`:`,`wq`,`enter` to the Vim process, assuming I know its PID? Is there an executable that could provide this API? Alternatively, could I do this with something like Tmux?


title: How do I navigate to a CD drive?

text: I'm trying to install Virtualbox Guest Additions in Elementary OS. `cd` doesn't seem to work with `cd VBOXADDITIONS_4.2.6_82870`. **Update:** I did what @ivica recommended, and here's what I'm getting: ![enter image description here](http://i.stack.imgur.com/pqMgD.png) I see that I'm supposed to run either `autorun.sh` or `runasrood.sh` or `VBoxLinuxAdditions.run`, but what program am I supposed to run it with?


title: Missing Python.h in Arch

text: I use Arch Linux. I want to compile a C++ file that includes `<Python.h>`. But I can't do it. In Debian based systems this problem is resolved with `sudo apt-get install python-dev`. How I can install this package with pacman? *** EDIT *** I wan't to compile this file C.c               #include "Python.h"     int main(int argc, char *argv[])     {       Py_SetProgramName(argv[0]);  /* optional but recommended */       Py_Initialize();       PyRun_SimpleString("from time import time,ctime\n"                          "print 'Today is',ctime(time())\n");       Py_Finalize();       return 0;     }      run this command:               g++ C.c      and i have this error:               call_function.c:1:20: fatal error: Python.h: No such file or directory      #include "Python.h"                         ^     compilation terminated.


title: Not able to copy original top command executable over a malicious one

text: Somebody hacked my system and replaced some of the system commands like top, ps, find etc with malicious ones. Now, I am trying to copy the original ones, but the copy or move commands fail, even though I am logged in as root user. I get the following error:               cp /root/top /usr/bin/     cp: overwrite `/usr/bin/top', overriding mode 0755? y     cp: cannot create regular file `/usr/bin/top': Permission denied Can somebody please tell me a way by which I can copy my original files.


title: What repositories do I need to install heartbeat and haproxy on RHEL?

text: So I am now managing two RHEL machines that I need to install `haproxy` and `heartbeat` on. When I follow instructions to do so I get the following:               [admin@p2378442 ~]$ sudo yum -y install heartbeat haproxy     Loaded plugins: fastestmirror, security     Loading mirror speeds from cached hostfile      * main-base: yum01tor.peer1.com      * main-extras: yum01tor.peer1.com      * main-updates: yum01tor.peer1.com     Setting up Install Process     No package heartbeat available.     No package haproxy available.     Nothing to do     [admin@p2378442 ~]$      I imagine I just need to add some repository or other to some yum configuration file or other. What is my best bet? I've tried a few things I've found in Google so far; but they don't seem to help. I'm new to RHEL I don't want to just spray packages in to my system on accident! I miss Ubuntu server already...


title: How to merge all (text) files in a directory into one?

text: I've got 14 files all being parts of one text. I'd like to merge them into one. How to do that?


title: When I schedule a command with 'at', can I change where the output is mailed to?

text: When I schedule a job/command with `at` to be executed in the future, the standard output and error of the command is "mailed" to the user that did the scheduling. So after my job runs, I get a message in the command prompt > You have mail in /var/spool/mail/mattb which I can then read with `mail`. Is it possible to have the output instead sent to my corporate mailbox (i.e. `mattb@company.com`), rather than the local user's `/var/spool/mail`? How does `at` know which address to email the output of the command, or does it only know how to place a message in the user's `/var/spool/mail`? (I would tag this question `at` but I don't have enough rep on this SE site for that yet)


title: Problem Aliasing a Command With a Pipeline and an Argument

text: Note: I use tcsh. I am trying make an alias that will use the mutt command to send an email with a pre-written body and subject line but that will take the alias argument and attach it to the email. The best I currently have is:               alias emailattach 'echo "Message Body" | mutt -a \!:1 -s "Subject" email@somewhere.com'      This alias sets just fine, without any whining, but when I try to run it I get the following message:               Can't stat email@somewhere.com: No such file or directory     email@somewhere.com: unable to attach file.      When I remove `-a \\!:1` I no longer get the error message, so I believe the problem could be focused on this portion of the alias. The files I've told `emailattach` to attach are real, attachable files (a PDF specifically), so that's not the issue. I also tried the same alias but without the single quotes and I only got this error:               email@somewhere.com: unable to attach file.      To see if the pipeline was the crux of the problem I tried the following:               alias emailattach mutt -a \!:1 -s "Subject" email@somewhere.com      and then tried just running:               echo "Message Body" | emailattach /path/to/attachment      which gave the same error message as I first listed(`can't stat`...`unable to attach file.`). However, when I just ran:               echo "Message Body" | emailattach       I got this error:               Bad ! arg selector.      Which I assume is just an error saying that I forgot to put in the required argument. What have I written wrong in my alias that makes it not work?


title: What is this construct in bash? mycommand(){dosomething;}

text: I actually found following one-liner on commandfu.com: `cmdfu(){ curl "http://www.commandlinefu.com/commands/matching/$@/$(echo -n $@ | openssl base64)/plaintext"; }` I have not come across a similar use of the `()` in bash before. It seems that it creates the command `cmdfu` temporarily within the bash environment. Am I correct here? Or is it actually stored somewhere? Is there a name for this construct so I can read up on it?


title: X Windows Terminates when I type {+<ENTER>

text: In particular when I type the following keyboard combo: `<hold shift> [ <release shift> <enter>` I get dumped out of KDE and see a flash of some console output but I can't find it in any log. I'm running Fedora 15 (upgrading is hard). Does anyone have any ideas? **update:** This occurs across applications. In Intellij IDE, in the terminal. **update:** It also happens when I type `= <hold shift> 2 <release shift>` **update:** After a bit of digging I can see in /var/log/messages that it's dumped some info to /var/spool/abrt/ccpp-2012-07-20-10:50:21-1395 and within that it tells me that /usr/bin/Xorg was sent a SIGABRT.


title: Gnome screensaver floating feet shows only one (left) foot any alternative screensaver with both?

text: I like gnome screensaver floating feet and looking for version that displays both right, left heels of gnome or at least with choice option for the right. this is just for fun design related question.


title: run-parts ignores jobs.deny

text: I use run-parts to run all scripts under a directory,the same way crontab does. But the jobs deny and jobs allow don't block any of the scripts in the directory.               rajeevs@rajeev:/home/rajeevs/test$: ls     a     b     jobs.deny          $:cat jobs.deny     a     b          $:run-parts .     hello a     hello b      Any idea about this strange behavior?


title: Performance virtualbox diskfiles vs rawdisk

text: Pros and cons with this two ways to make disk for virtual machines on virtualbox               $ vboxmanage createhd --format VDI --size ${SIZE} --filename /path/to/disk.vdi      and               # vboxmanage createrawvmdk -filename /path/to/disk.vmdk -rawdisk /dev/sdX


title: Disable SELinux in apache to stop warning

text: I keep getting this error when I restart `httpd`: > DocumentRoot does not exist What else can I do besides disable editing `/etc/sysconfig/selinux` to fix it?


title: Is there any difference between mode value 0777 and 777

text: I saw a code change at work, where the mode values were changed from 777 to 0777 to make nfs setattr work. What is the difference in the 2 values?


title: How to create a folder which will change its contents’ ownership to what the folder has?

text: In a GNU/Linux OS there is no way to change ownership of a file until you are root. But what if I want to hide my system’s username e.g. before sending a file to someone, because some things like tar will try to keep it? What I think about is something like               # mkdir --mode=????? /tmp/nobodysfiles     # chown nobody:nobody /tmp/nobodysfiles          $ whoami     popcorneater     $ ls -l ~/file     -rw-r--r-- 1  popcorneater popcorneater 12345 oct.  18 11:10     $ cp ~/file /tmp/nobodysfiles/     $ ls -l /tmp/nobodysfiles/file     -rw-r--r-- 1 nobody nobody 12345 oct.  18 11:11


title: Custom bash autocomplete for git breaks other git autocomplete features

text: I am trying to add autocompletion to `git commit` upon hitting `Tab``Tab`. The autocomplete feature I am working on is based on a branch-naming convention. The convention is to append the PivotalTracker Id number to the end of the branch name, so a typical branch would look like `foo-bar- baz-1449242`. We can associate the commits with the PivotalTracker card by prepending `[#1449242]` to the beginning of the commit message. I would like this to be auto-inserted if `git commit` is typed in and the user hits `Tab``Tab`. I have already done this here: https://github.com/tlehman/dotfiles/blob/master/ptid_git_complete (and for convenience, here is the source code):                 function _ptid_git_complete_()       {         local line="${COMP_LINE}"                   # the entire line that is being completed              # check that the commit option was passed to git          if [[ "$line" == "git commit" ]]; then            # get the PivotalTracker Id from the branch name           ptid=`git branch | grep -e "^\*" | sed 's/^\* //g' | sed 's/\-/ /g' | awk '{ print $(NF) }'`           nodigits=$(echo $ptid | sed 's/[[:digit:]]//g')                if [ ! -z $nodigits ]; then             : # do nothing           else             COMPREPLY=("commit -m \"[#$ptid]")           fi         else           reply=()         fi       }            complete -F _ptid_git_complete_ git      The problem is that this breaks the git autocompletion features defined in git-autocompletion.bash How can I make this function compatible with git-autocompletion.bash?


title: sed on OSX insert at a certain line

text: So I've been using 'sed' on linux for a while, but have had a bit of difficulty trying to use it on OSX since 'POSIX sed' and 'GNU sed' have so many little differences. Currently I'm struggling with how to insert a line of text after a certain line number. (in this case, line 4) On linux I would do something like this:               sed --in-place "4 a\  mode '0755'" file.txt      So on OSX I tried this:               sed -i "" "4 a\ mode '0755'" file.txt      However this keeps giving me a 'extra characters after \ at the end of a command' error. Any ideas what's wrong here? Do I have a typo? Or am I not understanding another difference between versions of sed?


title: How to give permissions to other user after logging as root in Linux?

text: I am a Linux newbie and I have a very basic question. I have one machine which is `machineA` and I have a `root` access to that machine. Now I need to create these below two directories and give permissions to `app` user.               Create ZooKeeper Data directory and give permissions to app : /opt/zookeeper/data     Create ZooKeeper Log directory and give permissions to app : /opt/zookeeper/log      I have already created those directories in `/opt` folder by logging as `root` -               root@machineA:/opt# ls -lt     drwxr-xr-x 4 root root 4096 Dec 17 13:46 zookeeper          root@machineA:/opt/zookeeper# ls -lt     drwxr-xr-x 2 root root 4096 Dec 17 13:46 log     drwxr-xr-x 2 root root 4096 Dec 17 13:45 data      Now I am not sure how to give permissions to `app` user as mentioned above? I believe this is pretty easy question but I am not sure how to do that?


title: How to boot a system in a second HD but runing the system in another one?

text: I have two computers, but the old one is not working well. So I'd like to install the old hard disk on the new computer. I know how to do this and I know how to access the data from `sdb`. But I have some old programs installed on `sdb` which I'm not able to install them again on `sda`. So, I'd like to know if it is possible to use some virtual machine (I have installed VM on `sda`) to boot from `sdb` so that I'd be able to use my old programs whenever I need. I'm using Ubuntu 10.04 on both disks. Thanks.


title: Connected Android device - brings the network down?

text: I have dealt with sensitive development under Android, and have recently decided to switch to Linux now sit under (Mint 13 - KDE). But strangely, when the Android device is connected, my network goes down and only reboot works. I tried               sudo service network-manager stop     sudo service network-manager start      And this udev rule for the Android device.               vim /etc/udev/rules.d/51-android.rules     SUBSYSTEM == "usb", ATTR {idVendor} == "04e8", MODE = "0666", GROUP = "plugdev"     chmod a + r /etc/udev/rules.d/51-android.rules      Here is an article http://developer.android.com/tools/device.html But with this article, when I try to connect as a drive, I don't know how to mount it. I did this: http://blog.mpshouse.com/?p=609 Basically, **I want the device to work without bringing down my network** What is the cause, what is the problem, what's wrong?


title: Accessing other folder

text: I'm having difficulty with groups and permissions.   * I have user `A` part of group `A` that manages a folder `F`.    * A second user `B` part of group `B` must access folder `F` and its content.   * I added user `B` to group `A` but every time `B` tries to access folder `F` gets the message saying:              'Permission Denied'.       Is this the correct way to achieve that or do I need to do something more? I'm using CentOS 6.4.


title: How to force release of a keyboard modifiers

text: Sometimes, when I use synergy between my machines when one is using full- screen VirtualBox guest I get stuck with some weird key modifiers turned on. If they exist on my keyboard (like Shift_L) I can just tap it and their status is reset and I can continue typing in small letters. But some of them are not mapped to my keyboard at all (like ISO_Level3_Shift), so I have no means of turning them off at all! How to reset them? Right now, all I can do is to reboot the computer, but it's rather embarrassing solution. All I want is some program that can artificially "tap" all possible keyboard modifiers, so their status would be reset. Can it be done? I use Mint 14 (a clone of Ubuntu 12.10 Quantal).


title: Test what cd has done ksh

text: I'm facing a small issue here. I'm doing :               cd $(find . -type d | grep "${4:0:4}.*${4:4:2}.*${4:6:2}")      $4 is a data entered from the user. However, if the user doesn't respect the format to enter, it will do : `cd` Then, my `$?` will be 0 and not 1, and it will `cd` to my home. I'd like to introduce this in my error case to (by error case, I mean : `if $? = 1`). How can I do that ?


title: create pseudo shell for a command

text: I feel like this should be straighforward to some degree... Basically, for some command, I want to be able to invoke another command that will scope all params to that command. so...               git commit -am "test"      would become...               ./shell_comand git     >commit -am "test"     >status      so, obviously things like autocomplete and whatnot wouldn't work, but I would expect otherwise this should be doable to some degree? I'm just not quite clear on how...


title: How to regenerate /etc/init.d/.depend.(boot|start|stop) on Debian?

text: Suppose one deleted the following files.               /etc/init.d/.depend.boot     /etc/init.d/.depend.start     /etc/init.d/.depend.stop      How to regenerate them?


title: Why does tmux fail to "scroll" when entering a command that exceeds one line? (OSX Terminal.app)

text: When I use `tmux` and enter a command that exceeds the line, it fails to redraw the previous line. It simply clears the current line and I can't see what I just wrote. **It does only redraw the first line.** This also happens when I press `up` and the last command does not fit the current line (I only see the last line). If I then press `up` and `down` again, I can see all lines of the command. I'm not sure what causes that problem, but it's pretty annoying. Does it have to do something with my prompt? Just in case, here it is:               export PS1="%{$fg[blue]%}%n%{$reset_color%}@%{$fg[green]%}%m %{$fg[yellow]%}%~ %{$reset_color%}% "     export PS2=$_>     ($TERM is set to screen)      By the way, I'm using zsh and OSX Termial, but the problem is also there with bash. Also the problem does not exist with `xterm` (XQuartz), so i guess it's caused by OSX' Terminal.app.   * Does anyone know a way to fix this anyways?   * Perhaps I could force a redraw somehow? Just found this old thread on the tmux mailinglist. I tried different values for `$TERM` (screen, screen-256colors, xterm, xterm- color, nsterm) but the error persists. So I guess there is nothing I can do despite switching to another terminal emulator?


title: How to resume pacman package downloads?

text: I'm trying to install some updates while on a sketchy connection in Arch Linux. What is the best way to do that?               while ! pacman --noconfirm --needed --refresh --upgrade     do         :     done      took over 90 minutes to complete. Possibly this is because I used the strangely named `\--upgrade` option which is for _reinstalling_ packages rather than doing a package upgrade (`\--sysupgrade`).


title: How do I set up the SELinux sandbox in Debian?

text: I've installed SELinux in Debian sid in order to use the sandbox that locks down apps to a restricted enviroment, but I can't get it to work. If I try to use the sandbox command in permissive mode without any options, like `sandbox nano`, I get the following error:               /usr/bin/sandbox: [Errno 22] Invalid argument      And if I try to run it with options for temporary home and tmp dirs, with or without the -X option, another error message pops up:               Could not set exec context to unconfined_u:unconfined_r:sandbox_x_t:s0:c236,c539.     Failed to remove directory /tmp/.sandbox-root-vfZJIt: No such file or directory      I have tried using the sandbox app in enforced mode, but it complains about missing type enforcement rules. I don't think that's the issue though. Does anyone know how to fix this?


title: Keyboard only desktop environment

text: Is there a (more than a terminal) desktop environment/distro that can be run using only a keyboard - I have an old computer on which I cannot use a mouse - the PS/2 port is broken and it won't accept USB


title: Bash autocomplete with vim command

text: In bash, autocompletion of paths has recently stopped working when issuing `vim` commands where the path is deeper than two directories (it continues to work as expected with other commands, such as `ls` and `cd`). For example, if I type `ls .config/btsync/bt` and then press TAB, it expands to `ls .config/btsync/btsync.conf`. If I type `vim .config/bt` and then press TAB, it expands to `vim .config/btsync/`. However, if I type `vim .config/btsync/bt` and then press TAB, nothing happens (I would expect it to expand to `vim .config/btsync/btsync.conf`, as in the `ls` example, above. I get the same issue when running as my own user and when running as su. I read this post which mentioned an issue with older versions of bash- completion but I'm running 2.1-5. UPDATE: After some additional testing, I've found that the root issue is that bash will _only_ complete directory names, not filenames. **UPDATE: It turns out that`bash-completion` was the overall cause. See my second comment on the accepted answer.** Any suggestions as to the potential cause of this behaviour would be gratefully received!


title: Bash: test whether original script was run with `-x`

text: Is it possible to test whether a bash script was executed with `-x`? I'm writing a script which also runs some remote scripts, and I'd like to be able to do something like:               USE_X="$( run_with_x && "-x" || "" )"     ssh $host "bash $USE_X some_script.sh"


title: SSH remote command execution: get output before execution ends

text: Consider the following simple C program `test.c`:               #include <stdio.h>          int main(void){             printf("foo\n");             sleep(5);             printf("bar\n");             return 0;     }      The program prints "foo" on stdout, waits for 5 seconds and outputs "bar" then. If I run it remotely using               $ ssh remotehost /path/to/test      I do see nothing for 5 seconds, and get both entries displayed altogether when the program quits. Is there any way to get ssh to redirect each output of stdout before command execution is finished?


title: How to rename file to .. (dot dot)?

text: Apparently you can rename file to `...`. If I were insane, how would I rename file to `..` or `.`? Is such a filename even allowed? Backslash doesn't seem to disable dot's special meaning:               $ mv test \.     mv: `test' and `./test' are the same file


title: lvm devices under /dev/mapper missing

text: I'm using Debian squeeze, and running LVM on top of software RAID 1. I just accidentally just discovered that most of the links under `/dev/mapper` are missing, though my system seems to be still functioning correctly. I'm not sure what happened. The only thing I can imagine that caused it was my failed attempt to get a LXC fedora container to work. I ended up deleting a directory `/cgroup/laughlin`, corresponding to the container, but I can't imagine why that should have caused the problem. `/dev/mapper` looked (I made some changes, see below) approximately like               orwell:/dev/mapper# ls -la     total 0     drwxr-xr-x  2 root root     540 Apr 12 05:08 .     drwxr-xr-x 22 root root    4500 Apr 12 05:08 ..     crw-------  1 root root  10, 59 Apr  8 10:32 control     lrwxrwxrwx  1 root root       7 Mar 29 08:28 debian-root -> ../dm-0     lrwxrwxrwx  1 root root       8 Apr 12 03:32 debian-video -> ../dm-23      debian-video corresponds to a LV I had just created. However, I have quite a number of VGs on my system, corresponding to 4 VGs spread across 4 disks. `vgs` gives               orwell:/dev/mapper# vgs       VG         #PV #LV #SN Attr   VSize   VFree         backup       1   2   0 wz--n- 186.26g  96.26g       debian       1   7   0 wz--n- 465.76g 151.41g       olddebian    1  12   0 wz--n- 186.26g  21.26g       testdebian   1   3   0 wz--n- 111.75g  34.22g      I tried running                /dev/mapper# vgscan --mknodes      and some devices were created (see output below), but they aren't symbolic links to the dm devices as they should be, so I'm not sure if this is useless or worse. Would they get in the way of recreation of the correct links? Should I delete these devices again? I believe that udev creates these links, so would a reboot fix this problem, or would I get an unbootable system? What should I do to fix this? Are there any diagnostics/sanity checks I should run to make sure there aren't other problems I haven't noticed? Thanks in advance for any assistance.               orwell:/dev/mapper# ls -la     total 0     drwxr-xr-x  2 root root     540 Apr 12 05:08 .     drwxr-xr-x 22 root root    4500 Apr 12 05:08 ..     brw-rw----  1 root disk 253,  1 Apr 12 05:08 backup-local_src     brw-rw----  1 root disk 253,  2 Apr 12 05:08 backup-video     crw-------  1 root root  10, 59 Apr  8 10:32 control     brw-rw----  1 root disk 253, 15 Apr 12 05:08 debian-boot     brw-rw----  1 root disk 253, 16 Apr 12 05:08 debian-home     brw-rw----  1 root disk 253, 22 Apr 12 05:08 debian-lxc_laughlin     brw-rw----  1 root disk 253, 21 Apr 12 05:08 debian-lxc_squeeze     lrwxrwxrwx  1 root root       7 Mar 29 08:28 debian-root -> ../dm-0     brw-rw----  1 root disk 253, 17 Apr 12 05:08 debian-swap     lrwxrwxrwx  1 root root       8 Apr 12 03:32 debian-video -> ../dm-23     brw-rw----  1 root disk 253, 10 Apr 12 05:08 olddebian-etch_template     brw-rw----  1 root disk 253, 13 Apr 12 05:08 olddebian-fedora     brw-rw----  1 root disk 253,  8 Apr 12 05:08 olddebian-feisty     brw-rw----  1 root disk 253,  9 Apr 12 05:08 olddebian-gutsy     brw-rw----  1 root disk 253,  4 Apr 12 05:08 olddebian-home     brw-rw----  1 root disk 253, 11 Apr 12 05:08 olddebian-lenny     brw-rw----  1 root disk 253,  7 Apr 12 05:08 olddebian-msi     brw-rw----  1 root disk 253,  5 Apr 12 05:08 olddebian-oldchresto     brw-rw----  1 root disk 253,  3 Apr 12 05:08 olddebian-root     brw-rw----  1 root disk 253, 14 Apr 12 05:08 olddebian-suse     brw-rw----  1 root disk 253,  6 Apr 12 05:08 olddebian-vgentoo     brw-rw----  1 root disk 253, 12 Apr 12 05:08 olddebian-wsgi     brw-rw----  1 root disk 253, 20 Apr 12 05:08 testdebian-boot     brw-rw----  1 root disk 253, 18 Apr 12 05:08 testdebian-home     brw-rw----  1 root disk 253, 19 Apr 12 05:08 testdebian-root


title: Solaris 11 text mode after boot

text: I am running Solaris 11 on VMWare Workstation host machine Windows 7. Here is my OS and system details: SunOS solaris 5.11 11.0 i86pc i386 i86pc I want to boot Solaris 11 in text mode only i.e make it persistently boot in text mode and not boot into GUI. I tried editing menu.lst. My menu.lst is as follows:               default 0     timeout 30     splashimage /boot/grub/splash.xpm.gz     foreground 343434     background F7FBFF     title Oracle Solaris 11 11/11     bootfs rpool/ROOT/solaris     kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS,console=text     module$ /platform/i86pc/amd64/boot_archive     title solaris-backup-1     bootfs rpool/ROOT/solaris-backup-1     kernel$ /platform/i86pc/kernel/amd64/unix -B $ZFS-BOOTFS,console=text     module$ /platform/i86pc/amd64/boot_archive      My problem is that when I reboot Solaris 11 it initially shows up with a command line login asking for username, but as I'm typing the username in, it just boots into GUI anyway showing up a GUI login screen. How can I make Solaris persistently boot into text mode. I have tried boot time grub parameter editing and that way doesn't work either.


title: Adding multiple gateways for separate physical interfaces with various metrics/priorities

text: My system has 3 interfaces. These are eth0, eth1 and usb0. eth0 is linked to my router and is the line I want to be used by default. eth1 is un used. usb0 is a 3G phone that's tethered. My issue is that I wan't to be able to access the internet via both eth0 and usb0 at the same time. Currently as soon as I change the gateway to match each interface, the other connection no longer responds. I have tried adding metric values on my interfaces file:               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo eth0 usb0     iface lo inet loopback             allow-hotplug eth0 usb0          # The primary network interface     iface eth0 inet static             address 192.168.1.67             netmask 255.255.255.0             broadcast 192.168.1.254             network 192.168.1.0             post-up route add default gw 192.168.1.254 metric 1             pre-down route del default gw 192.168.1.254               iface usb0 inet static             address 192.168.42.86             netmask 255.255.255.0             broadcast 192.168.42.254             network 192.168.42.0             post-up route add default gw 192.168.42.129 metric 2             pre-down route del default gw 192.168.42.129      Unfourtunately when it starts up, only the usb0 is actually accessible. When I check the routes, I can see that there is no gateway for the eth0.               ~# route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.42.129  0.0.0.0         UG    0      0        0 usb0     0.0.0.0         192.168.42.129  0.0.0.0         UG    2      0        0 usb0     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     192.168.42.0    0.0.0.0         255.255.255.0   U     0      0        0 usb0      And when I try to access the internet via each of them. eth0 gives me the following:               ~# ping -I eth0 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 192.168.1.67 eth0: 56(84) bytes of data.     From 192.168.1.67 icmp_seq=1 Destination Host Unreachable     From 192.168.1.67 icmp_seq=2 Destination Host Unreachable     From 192.168.1.67 icmp_seq=3 Destination Host Unreachable     From 192.168.1.67 icmp_seq=4 Destination Host Unreachable     From 192.168.1.67 icmp_seq=5 Destination Host Unreachable     From 192.168.1.67 icmp_seq=6 Destination Host Unreachable     ^C     --- 8.8.8.8 ping statistics ---     7 packets transmitted, 0 received, +6 errors, 100% packet loss, time 6030ms      However, usb0 has internet access.               ~# ping -I usb0 8.8.8.8     PING 8.8.8.8 (8.8.8.8) from 192.168.42.86 usb0: 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_req=1 ttl=43 time=188 ms     64 bytes from 8.8.8.8: icmp_req=2 ttl=43 time=127 ms     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=108 ms     64 bytes from 8.8.8.8: icmp_req=4 ttl=43 time=98.3 ms     64 bytes from 8.8.8.8: icmp_req=5 ttl=43 time=96.9 ms     64 bytes from 8.8.8.8: icmp_req=6 ttl=43 time=165 ms     64 bytes from 8.8.8.8: icmp_req=7 ttl=43 time=226 ms     ^C     --- 8.8.8.8 ping statistics ---     7 packets transmitted, 7 received, 0% packet loss, time 6002ms     rtt min/avg/max/mdev = 96.981/144.575/226.027/46.357 ms      I can't see where I'm going wrong, and on some occasions, though not often, I get the following appearing in my ping:               64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=132 ms     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=672 ms (DUP!)     64 bytes from 8.8.8.8: icmp_req=3 ttl=43 time=1212 ms (DUP!)      Any assistance would be greatly appreciated.


title: How to count similar results in several columns in Libre Office Calc?

text: On LibreOffice Calc, I have seven columns filled with any one of the non- numerical values _a_ , _b_ or _c_. For each line, I want to count how many times the _a_ value has been entered. How can I do that? I couldn't find a way to do that with the Data Pilot.


title: netcat from ubuntu

text: I'm trying to use netcat to catch kernel printing (netconsole) using `nc -l -u -p 6666`. But when I use this utility in Ubuntu, it immediately exits. Trying to figure out why, I see that in the manual page it is described that `-l` & `-p` can't be used together. The next time I tried to execute it as following. This time I started to get some reply but then it exits.               $ nc -l -u 6666     netconsole: local port 6665     netconsole: local IP 0.0.0.0     netconsole: interface 'eth0'     netconsole: remote port 6666     netconsole: remote IP 10.0.0.1     netconsole: remote ethernet address ff:ff:ff:ff:ff:ff     netconsole: local IP 10.0.0.2      Then I get back host prompt, as if netcat existed without printing anything more. Can someone help me figure out what I'm doing wrong ?


title: How can i check that a remote computer is online for ssh / script acess?

text: i'm writting a script that will backup data from my laptop to an ubuntu server. to do so, i'm looking for a (ba)sh command to test if the server is available before starting the backup. something like "ping" on port 22 that returns a boolean how can i do this ? thanks for helping


title: Execute user script as root in startup applications

text: I just created a script (logscreenlock) to log lock/unlock screen events (derived from this post):               #! /bin/bash     dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" | ( while true; do read X; if echo $X | grep "boolean true" &> /dev/null; then echo `date` "screen locked"; elif echo $X | grep "boolean false" &> /dev/null; then echo `date` "screen unlocked"; fi done )      I wanted to have a startup daemon running `logscreenlock > /var/log/screenlock.log`. Now, to write into /var/log, I need root permissions (I am a sudoer). So I would need `sudo logscreenlock > /var/log/screenlock.log`, but I have two problems with that:   1. logscreenlock is owned by my user and and I would like to keep it that way, but even after `chmod a+x logscreenlock`, I get permission denied if I try to `sudo ./logscreenlock`. I tried to `usermod -a -G <myusergroup> root`, but no luck. How can I overcome this?   2. How can I sudo in the startup applications? will it prompt me for a password right away? * * * EDIT: I found out later that the reason why I couldn't execute logscreenlock as root was that this script is in a remote filesystem where my machine's root is not authenticated.


title: Getting tmux to copy a buffer to the clipboard

text: I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like               bind-key p select-pane -t 2 \; split-window 'xsel -i -b' \; paste-buffer      which gets me fairly close, all I have to do is hit control-d after I do prefix-p. I tried fixing that by doing               bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE\; tmux paste-buffer\; echo HERE'      But that just doesn't work. In fact if I pair this down to just               bind-key p select-pane -t 2 \; split-window 'xsel -i -b << HERE'      it doesn't do anything so I am assuming that split-window doesn't like << in a shell command. Any ideas? Edit: You can skip the `select-pane -t 2` if you want, it inst really important. I just use a specific layout and pane 2 is the one i prefer to split when I doing something else so that goes into my bindings involving splits by default.


title: Red hat linux command line character underscore problem

text: When I type a command e.g.               cd /etc/         I get the following               cd /etc$       if I press the backslash key again then I get the correct entry               cd /etc/        I am using gnome but I get the same problem with KDE. Does anyone know what may be causing this problem?


title: Init-systems and service management on different distributions

text: Is there some overview which Linux distribution comes with which (default) init system and uses which tool for starting/stopping services? Is there some distribution independent way to start/stop/query a service?   * `/etc/init.d/xyz start` does only work with system-v init systems   * `service xyz start` is not available on every distribution (which distribution does (not) have this?)   * case switching depending on available commands seems to be the only reliable way Background: We need to write an installer for different Linux distribution which needs to restart/query services. Calling the `service` tool would be cool for that, but I'm not sure which distributions support this.


title: XFCE session fails to load when launched via LightDM

text: I have set up LightDM as the desktop manager on an ARM Ubuntu install (running with a chroot on an Android device) and this loads and works fine, however when I try to launch a Xfce session as a normal user I end up with a blank black screen with just the mouse (which works). When I check logs I have LightDM outputting: Logging to `.xsession-errors`               ** (process:2129): WARNING **: Failed to open CK session: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files     [+302.39s] DEBUG: Activating VT 7     [+302.39s] WARNING: Error using VT_ACTIVATE 7 on /dev/console: Invalid argument     [+302.39s] WARNING: Error using VT_WAITACTIVE 7 on /dev/console: Invalid argumen      And then in xsession-errors:               init: Unable to register as subreaper: Invalid argument     init: Failed to spawn logrotate pre-start process: unable to granpt: Exec format error     init: Failed to spawn dbus pre-start process: unable to granpt: Exec format error     init: Failed to spawn ssh-agent pre-start process: unable to granpt: Exec format error     init: Failed to spawn ssh-agent post-stop process: unable to granpt: Exec format error     init: Failed to spawn xsession-init pre-start process: unable to granpt: Exec format error      Xorg.0.log:               [  4020.847]      X.Org X Server 1.14.3     Release Date: 2013-09-12     [  4020.847] X Protocol Version 11, Revision 0     [  4020.847] Build Operating System: Linux 3.2.0-51-highbank armv7l Ubuntu     [  4020.847] Current Operating System: Linux localhost 3.0.36+ #34 SMP PREEMPT Sat May 17 17:42:40 CST 2014 armv7l     [  4020.847] Kernel command line: console=ttyFIQ0 androidboot.console=ttyFIQ0 init=/init initrd=0x62000000,0x00170000 mtdparts=rk29xxnand:0x00002000@0x00002000(misc),0x00006000@0x00004000(kernel),0x00006000@0x0000a000(boot),0x00010000@0x00010000(recovery),0x00020000@0x00020000(backup),0x00040000@0x00040000(cache),0x001FE000@0x00080000(userdata),0x00002000@0x0027E000(metadata),0x00002000@0x00280000(kpanic),0x00180000@0x00282000(system),0x01000000@0x00402000(uoa),-@0x01402000(user) bootver=2013-12-27#2.10 firmware_ver=4.4.2     [  4020.848] Build Date: 15 October 2013  09:25:29AM     [  4020.848] xorg-server 2:1.14.3-3ubuntu2 (For technical support please see http://www.ubuntu.com/support)      [  4020.848] Current version of pixman: 0.30.2     [  4020.848]    Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     [  4020.848] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [  4020.849] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jun 19 23:16:02 2014     [  4020.850] (==) Using config file: "/etc/X11/xorg.conf"     [  4020.850] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [  4020.851] (==) ServerLayout "Layout0"     [  4020.851] (**) |-->Screen "Screen0" (0)     [  4020.851] (**) |   |-->Monitor "<default monitor>"     [  4020.852] (**) |   |-->Device "Card0"     [  4020.852] (==) No monitor specified for screen "Screen0".         Using a default monitor configuration.     [  4020.852] (**) |-->Input Device "USB Mice"     [  4020.852] (**) Option "AutoAddDevices" "on"     [  4020.852] (**) Automatically adding devices     [  4020.853] (==) Automatically enabling devices     [  4020.853] (==) Automatically adding GPU devices     [  4020.853] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.     [  4020.853]    Entry deleted from font path.     [  4020.853] (==) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/Type1,         built-ins     [  4020.853] (==) ModulePath set to "/usr/lib/arm-linux-gnueabihf/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"     [  4020.853] (II) The server relies on udev to provide the list of input devices.         If no devices become available, reconfigure udev or disable AutoAddDevices.     [  4020.853] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.     [  4020.853] (WW) Disabling USB Mice     [  4020.853] (II) Loader magic: 0x401deee0     [  4020.853] (II) Module ABI versions:     [  4020.854]    X.Org ANSI C Emulation: 0.4     [  4020.854]    X.Org Video Driver: 14.1     [  4020.854]    X.Org XInput driver : 19.1     [  4020.854]    X.Org Server Extension : 7.0     [  4020.855] Initializing built-in extension Generic Event Extension     [  4020.855] Initializing built-in extension SHAPE     [  4020.855] Initializing built-in extension MIT-SHM     [  4020.855] Initializing built-in extension XInputExtension     [  4020.855] Initializing built-in extension XTEST     [  4020.855] Initializing built-in extension BIG-REQUESTS     [  4020.855] Initializing built-in extension SYNC     [  4020.855] Initializing built-in extension XKEYBOARD     [  4020.855] Initializing built-in extension XC-MISC     [  4020.855] Initializing built-in extension SECURITY     [  4020.855] Initializing built-in extension XINERAMA     [  4020.855] Initializing built-in extension XFIXES     [  4020.855] Initializing built-in extension RENDER     [  4020.855] Initializing built-in extension RANDR     [  4020.855] Initializing built-in extension COMPOSITE     [  4020.855] Initializing built-in extension DAMAGE     [  4020.855] Initializing built-in extension MIT-SCREEN-SAVER     [  4020.855] Initializing built-in extension DOUBLE-BUFFER     [  4020.855] Initializing built-in extension RECORD     [  4020.856] Initializing built-in extension DPMS     [  4020.856] Initializing built-in extension X-Resource     [  4020.856] Initializing built-in extension XVideo     [  4020.856] Initializing built-in extension XVideo-MotionCompensation     [  4020.856] Initializing built-in extension SELinux     [  4020.856] Initializing built-in extension XFree86-VidModeExtension     [  4020.856] Initializing built-in extension XFree86-DGA     [  4020.856] Initializing built-in extension XFree86-DRI     [  4020.856] Initializing built-in extension DRI2     [  4020.856] (II) "glx" will be loaded by default.     [  4020.856] (WW) "xmir" is not to be loaded by default. Skipping.     [  4020.856] (II) LoadModule: "dri2"     [  4020.856] (II) Module "dri2" already built-in     [  4020.856] (II) LoadModule: "glamoregl"     [  4020.857] (II) Loading /usr/lib/xorg/modules/libglamoregl.so     [  4020.869] (II) Module glamoregl: vendor="X.Org Foundation"     [  4020.869]    compiled for 1.14.2.901, module version = 0.5.1     [  4020.869]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.869] (II) LoadModule: "glx"     [  4020.870] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so     [  4020.871] (II) Module glx: vendor="X.Org Foundation"     [  4020.871]    compiled for 1.14.3, module version = 1.0.0     [  4020.871]    ABI class: X.Org Server Extension, version 7.0     [  4020.871] (==) AIGLX enabled     [  4020.871] Loading extension GLX     [  4020.871] (II) LoadModule: "fbdev"     [  4020.871] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so     [  4020.872] (II) Module fbdev: vendor="X.Org Foundation"     [  4020.872]    compiled for 1.14.1, module version = 0.4.3     [  4020.872]    Module class: X.Org Video Driver     [  4020.872]    ABI class: X.Org Video Driver, version 14.1     [  4020.872] (II) FBDEV: driver for framebuffer: fbdev     [  4020.872] (++) using VT number 7          [  4020.873] (WW) Falling back to old probe method for fbdev     [  4020.873] (II) Loading sub module "fbdevhw"     [  4020.873] (II) LoadModule: "fbdevhw"     [  4020.874] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so     [  4020.874] (II) Module fbdevhw: vendor="X.Org Foundation"     [  4020.874]    compiled for 1.14.3, module version = 0.0.2     [  4020.874]    ABI class: X.Org Video Driver, version 14.1     [  4020.875] (II) FBDEV(0): using /dev/graphics/fb2     [  4020.875] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support     [  4020.876] (**) FBDEV(0): Depth 24, (--) framebuffer bpp 32     [  4020.876] (==) FBDEV(0): RGB weight 888     [  4020.876] (==) FBDEV(0): Default visual is TrueColor     [  4020.876] (==) FBDEV(0): Using gamma correction (1.0, 1.0, 1.0)     [  4020.876] (II) FBDEV(0): hardware: fb2 (video memory: 24576kB)     [  4020.876] (**) FBDEV(0): Option "fbdev" "/dev/graphics/fb2"     [  4020.876] (II) FBDEV(0): checking modes against framebuffer device...     [  4020.876] (II) FBDEV(0):     mode "1280x800_60.00" not found     [  4020.876] (II) FBDEV(0): checking modes against monitor...     [  4020.876] (--) FBDEV(0): Virtual size is 1920x1080 (pitch 1920)     [  4020.876] (**) FBDEV(0):  Built-in mode "current": 148.5 MHz, 67.5 kHz, 60.0 Hz     [  4020.876] (II) FBDEV(0): Modeline "current"x0.0  148.50  1920 2008 2052 2200  1080 1084 1089 1125 -hsync -vsync -csync (67.5 kHz b)     [  4020.876] (==) FBDEV(0): DPI set to (96, 96)     [  4020.876] (II) Loading sub module "fb"     [  4020.877] (II) LoadModule: "fb"     [  4020.877] (II) Loading /usr/lib/xorg/modules/libfb.so     [  4020.878] (II) Module fb: vendor="X.Org Foundation"     [  4020.878]    compiled for 1.14.3, module version = 1.0.0     [  4020.878]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.878] (**) FBDEV(0): using shadow framebuffer     [  4020.878] (II) Loading sub module "shadow"     [  4020.878] (II) LoadModule: "shadow"     [  4020.878] (II) Loading /usr/lib/xorg/modules/libshadow.so     [  4020.879] (II) Module shadow: vendor="X.Org Foundation"     [  4020.879]    compiled for 1.14.3, module version = 1.1.0     [  4020.879]    ABI class: X.Org ANSI C Emulation, version 0.4     [  4020.879] (==) Depth 24 pixmap format is 32 bpp     [  4020.881] (==) FBDEV(0): Backing store disabled     [  4020.881] (==) FBDEV(0): DPMS enabled     [  4020.882] (==) RandR enabled     [  4020.906] (II) SELinux: Disabled on system     [  4020.910] (II) AIGLX: Screen 0 is not DRI2 capable     [  4020.910] (II) AIGLX: Screen 0 is not DRI capable     [  4020.927] (II) AIGLX: Loaded and initialized swrast     [  4020.928] (II) GLX: Initialized DRISWRAST GL provider for screen 0     [  4020.998] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm     [  4023.502] (EE) Server terminated successfully (0). Closing log file.      Also I can launch xfce from the terminal as root fine with `startxfce4` Any ideas what the issue could be?


title: pwd resolving symbolic links

text: > **Possible Duplicate:**   >  pwd without symlinks Imagine I have a directory               /home/me/dir      and a symbolic link to it called               /home/me/dirlink      now if I enter `dirlink` and use `pwd`, it of course prints the 2nd one. Is there a flag to make it resolve the symlink and print the 1st one?


title: Why do I get a 'conformability error' when I attempt to convert water in GNU units?

text: I've been using the GNU units program and I seem to think that I should be able to convert water between a volume and a weight. Examples:               You have: 1 gram water     You want: cm^3     conformability error         1 gram water = 9.80665 kg^2 / m^2 s^2         cm^3 = 1e-06 m^3      and               You have: 1 gallon water     You want: pounds     conformability error         1 gallon water = 37.122208 kg m / s^2         pounds = 0.45359237 kg


title: NetBSD 5.1 NDIS Kernel Compile Error

text: I have an old Toshiba Satellite 4015CDT, with Pentium II MMX, 32MB RAM, 4GB HDD. It also has one USB 1.0 port, parallel and serial ports, a 3.5" floppy drive and a CD-ROM drive (almost dead). I've installed NetBSD on this machine (full install) and now I want to connect it to the Internet. Although it has one PCMCIA modem card in it, it is obviously not an option. In order to do that I tried to connect my Realtek RTL8192U wireless adapter, but although the system gives me the device's name (through dmesg) it fails to recognize it as a network adapter. I followed the instructions here and here to recompile the kernel with NDIS support (I gave this configuration the name "NDIS"). At compile time I got the following error messages:               cc1: warnings being treated as errors     ../../../../dev/if_ndis/if_ndis.c: In function 'ndis_detach':     ../../../../dev/if_ndis/if_ndis.c:1187: warning: passing argument 1 of 'mutex_destroy' from incompatible pointer type     *** Error code 1     Stop.     make: stopped in /usr/src/sys/arch/i386/compile/NDIS      I would very much appreciate any help on this matter. Thanks in advance. P.S. If it is of any help, the system was installed by first booting off the installation floppies ("boot1.fs" and "boot2.fs" downloaded from the official ftp server), and then the packages were copied from a USB flash drive (packages also downloaded from the ftp server).


title: Is my laptop's overheating issue CPU (Dual Core i5) or GPU (Nvidia 320M) related, and can I fix it in Linux Mint?

text: I've had the same problem in both Ubuntu 12.10 and Linux Mint 15. I've tried taking my Acer laptop apart (no mean feat for a noob like me) and cleaned and resat the GPU and CPU heatsinks and fan (with fresh heat paste of course).               $ sensors     acpitz-virtual-0     Adapter: Virtual device     temp1:        +64.0°C  (crit = +102.0°C)     temp2:        +43.0°C  (crit = +96.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Core 0:       +66.0°C  (high = +95.0°C, crit = +105.0°C)     Core 2:       +63.0°C  (high = +95.0°C, crit = +105.0°C)      It's helped a little, my 'temp 2' used to be higher, and it took much longer to cool down if I ran a game, but my CPUs are still running very hot (the above is just with chromium and a terminal open in Cinammon). I've installed the latest proprietary drivers (not the ones you can select in 'drivers,' which broke X). Instead I'm running 331.               $ inxi -Gxx     Graphics:  Card: NVIDIA GT216M [GeForce GT 320M] bus-ID: 02:00.0                 X.Org: 1.13.4 drivers: nvidia (unloaded: fbdev,vesa,nouveau) Resolution: 1366x768@60.0hz                 GLX Renderer: GeForce GT 320M/PCIe/SSE2 GLX Version: 3.3.0 NVIDIA 331.13 Direct Rendering: Yes      Despite being 'better than before' my computer still crashes not long after starting any kind of graphics intensive task. Even the game 'Thomas is not along' (seems relatively simple visually) is too much. Now it takes about 20 minutes to crash (rather than 5), but I really would like my laptop to stop overheating so easily. =( I tried installing Bumblebee as I read it's due to some kind of issue that forces the GPU to run but, again, X stopped working. I uninstalled it, and have since spent time trying to find a solution. My googlefu is failing me, so I turn to you for help. Do I need to step back from my nvidia updates to get bumblebee working? Is there a more up to date version I should be using? Maybe it's not the GPU (I would have thought that's what temp 2 is reading, and it's cool). Maybe something is happening to make my CPU run through the roof?               $ inxi -fxz     CPU:       Dual core Intel Core i5 CPU M 430 (-HT-MCP-) cache: 3072 KB bmips: 9043.48                 Clock Speeds: 1: 1199.00 MHz 2: 1199.00 MHz 3: 1199.00 MHz 4: 1199.00 MHz                CPU Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts                 acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good                 nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt                 lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid       EDIT: I just tried the 'Advanced' install here: https://wiki.ubuntu.com/Bumblebee installing bumblebee-nvidia, virtualgl and virtualgl-libs-ia32 and had the same problem (X server stopped working).


title: How to replace quotation marks in a file with sed?

text: I have a file that contains multiple lines of xml. I would like to replace certain parts of the file. Some parts of the file contains quotation marks (`"`) which I would like to replace. I have been trying to _escape_ the quotation mark with `\`, but I don't think this is working based on the result of my file. Here is an example of one of my sed commands:               sed -e "s/\"text\"/'text'/ig" file.xml > temp.tmp      Is this how you escape quotation marks in a sed command or am I doing something wrong?


title: Do I need to encapsulate awk variables in quotes in order to sanitize them?

text: As per an answer on stackoverflow, it's my understanding that encapsulating bash variables in double-quotes is a fairly safe way of sanitizing user input. What about awk variables? For example, if I have something like:               awk -v SOURCEIP="$SOURCEIP" -v REVERSEDNS="$REVERSEDNS" '{        gsub(/^_TMPSOURCEIP_/, SOURCEIP);        gsub(/^_TMPREVERSEDNS_/, REVERSEDNS);        print     }' /home/foo/footemplate      Should I put quotes around the variable in the gsub lines? So it would then look like:               awk -v SOURCEIP="$SOURCEIP" -v REVERSEDNS="$REVERSEDNS" '{        gsub(/^_TMPSOURCEIP_/, "SOURCEIP");        gsub(/^_TMPREVERSEDNS_/, "REVERSEDNS");        print     }' /home/foo/footemplate      Or does this not make a difference?


title: Is there a convenient general way to "grab" the echoed result of a command in Emacs (of M-: or M-!)?

text: Sometimes, I want to insert the result of an Emacs command (that has been echoed in the echo area) to another buffer or another running X program. So, I'd like to put it to the kill-ring. What would be a convenient way to do this? For example: I could run a query with a shell command while in dired mode, say: `!``rpm -qf` (to find out which package owns the selected file in the directory listing), and then want to insert the result somewhere else. Or, another example: if I needed the filename of the current buffer (as in Is there a user interface in Emacs allowing one to "grab" the buffer's filename conveniently?), and there was not yet any predefined command for this, I could at least do `M-:``(buffer-file-name)` and then use this general-purpose way to copy the shown result to the kill-ring in order to paste it later. (Of course, I could eval `(kill-new (buffer-file-name))`, but this example here is to illustrate what kind of general-purpose way to do the grabbing of the echoed result I'm looking for.)


title: Numbering convention for the linux kernel?

text: What is the convention for numbering the linux kernels? AFAIK, the numbers never seem to decrease. However, i think I've seen three kinds of schemes   * 2.6.32-29   * 2.6.32-29.58   * 2.6.11.10 Can anybody explain what are the interpretations of these numbers and formats?


title: Can't access NTFS drives after Elementary OS install

text: I have just setup Elementary OS. I have two hard drives on my desktop and I can’t access either one of them via file manager. To be precise I have two partitions with data that I need to access; dev/sda4(on a 160GB hard drive) and dev/sdb1(on a 1 TB hard drive). I can see these drives using disk utility and gparted and they show them as unknown drives. I have searched the internet for this problem and can’t seem to get anywhere. I have found that I may need to run the command “sudo blkid” to find the device UID so I can mount them with fstab. But whenever I run "sudo blkid" , I just get the UIDs of the ext4 partion(where I installed elementary) and the swap partition. I really need to access the data on those NTFS partitions. Is there any way I can mount those drives on Elementary?


title: Negatives/downsides of Ubuntu's no-root sudo setup

text: By default, Ubuntu does not create a root account that the user can login to. Instead users use `sudo` when they need to perform actions that require administrative access. Obviously, the people at Ubuntu feel like this is a good idea, and everything I've read on the Ubuntu site gives plenty of reasons why they think it's a _good_ idea (see RootSudo @ the Ubuntu Wiki, for example). However, many other mainstream distributions, such as Debian, Gentoo, etc. don't set things up this way by default, and I'm trying to figure out why. If Ubuntu's default sudo-root setup is such a good idea, why aren't all of the other mainstream distros doing it too? This leads me to believe that there might be strong reasons for NOT setting it up this way; but I'm having trouble finding anything that gives any details on this. All I'm finding is articles/posts that talk about how great it is ... So my question is: Are there any major problems with Ubuntu's sudo setup (insecurity, functional limitations, etc.) that prevent other distributions from using this setup, and if so what are they? Of course, it might simply be a great idea that other distros have just been slow to pick up on, or resistant to because it's different from how things have worked for the past 30 years. If that's the case, I'd like to know that to.


title: How to register Nginx as a service, after installing Passenger?

text: I need passenger/nginx to run many sites on port 80. I have installed it with its own installer (per the instructions on the nginx website. But nginx is not registered as a service. I can only run it through the binary. I need to be able to do this:               $ service nginx restart      Shouldn't passenger have registered nginx as a service?   How can I get Ubuntu's daemon scripts to start the service?


title: Can I do ssh and do for loop and touch files in a single shot?

text: for account in ${accounts}     do             `ssh -q id@server "touch EVENTS_${account}_${date}.log"`     done      Instead of doing ssh so many times, can I just do ssh and run the for loop and touch the files?


title: Start up ssh connection on startup

text: I need to start a ssh connection to a proxy in order to have access to some resources. I have written the shell script and managed to run the script successfully. However, I found it very inconvenient to run it every time I need to use it. The best I think I should have is run the script in machine startup. But I have one problem: After my machine connects with the proxy, the proxy requires me to input the password in order to authenticate. But how can I tell the shell to "input" the password for me, so I do not need to type it? Any hint? **Solution：**               set timeout 60     spawn /usr/bin/ssh -D 22 -g name@ssh.sshcenter.info     expect {     "password:" {     send "*******\r"     }     }     interact {     timeout 60 { send " "}     }      Then use **expect** command to execute the script. Very nice.


title: How can I find out a file's range of LBA's using its inode?

text: While answering this U&L question titled: What command do I use to see the start and end block of a file in the file system?, I tried to figure out if it was possible to determine a file's LBA using it's inode. My answer determined that I could use `hdparm` as one method for finding LBAs:               $ sudo hdparm --fibmap afile           afile:      filesystem blocksize 4096, begins at LBA 0; assuming 512 byte sectors.      byte_offset  begin_LBA    end_LBA    sectors                0  282439184  282439191          8      But I was curious if there was some method using a file's inode to also get the LBA's; without using `hdparm`. I think there might be alternative methods hiding in the tools `filefrag`, `stat`, `debugfs`, and `tune2fs` but teasing it out is eluding me. Can anyone think of alternatives? * * * _Here's some of my research thus far that might be useful to those brave enough to attempt to answer this._ ### filefrag I suspect you could use the tool `filefrag` to do it, specifically using the results from its `-e` switch, perhaps by performing several calculations to get there that I'm not that familiar with. _sample output_               $ filefrag -e afile     Filesystem type is: ef53     File size of afile is 20 (1 block of 4096 bytes)      ext:     logical_offset:        physical_offset: length:   expected: flags:        0:        0..       0:   35304898..  35304898:      1:             eof     afile: 1 extent found      ### inodes Another potential method I suspect might have potential is to use a file's inode information, either directly or through some complex math that is poorly documented on the interwebs. _Example_ First we find out the file's inode. We can do this using either the `stat` command or `ls -i`. _stat_               $ stat afile        File: ‘afile’       Size: 20          Blocks: 8          IO Block: 4096   regular file     Device: fd02h/64770d    Inode: 6560281     Links: 1     Access: (0664/-rw-rw-r--)  Uid: ( 1000/    saml)   Gid: ( 1000/    saml)     Context: unconfined_u:object_r:user_home_t:s0     Access: 2013-12-27 18:40:12.788333778 -0500     Modify: 2013-12-27 18:40:23.103333073 -0500     Change: 2013-12-27 18:44:03.697317989 -0500      Birth: -      _ls -i_               $ ls -i      6560281 afile      With the inode information in hand, we can now open up the filesystem this file resides on using the tool, `debugfs`. **NOTE:** To determine the filesystem a file resides on you can use the command `df <filename>`. Now if we run `debugfs` and run the command `stat <inode #>` we can get a list of extents that contain this file's data.               $ sudo debugfs -R "stat <6560281>" /dev/mapper/fedora_greeneggs-home     debugfs 1.42.7 (21-Jan-2013)     Inode: 6560281   Type: regular    Mode:  0664   Flags: 0x80000     Generation: 1999478298    Version: 0x00000000:00000001     User:  1000   Group:  1000   Size: 20     File ACL: 0    Directory ACL: 0     Links: 1   Blockcount: 8     Fragment:  Address: 0    Number: 0    Size: 0      ctime: 0x52be10c3:a640e994 -- Fri Dec 27 18:44:03 2013      atime: 0x52be0fdc:bbf41348 -- Fri Dec 27 18:40:12 2013      mtime: 0x52be0fe7:18a2f344 -- Fri Dec 27 18:40:23 2013     crtime: 0x52be0dd8:64394b00 -- Fri Dec 27 18:31:36 2013     Size of extra inode fields: 28     Extended attributes stored in inode body:        selinux = "unconfined_u:object_r:user_home_t:s0\000" (37)     EXTENTS:     (0):35304898      Now we have the extents information above, and this is where I get lost and do not know how to proceed. ### References   * Finding what hard drive sectors occupy a file   * Identifying file associated with unreadable disk sector   * Bad block HOWTO for smartmontools   * C5170 Lecture notes -- Internal Representation of Files - The Unix File System   * Logical block addressing   * Ext4 Disk Layout


title: nginx + php5-fpm doesn't work properly. I see a white screen only

text: I've just installed nginx and php5-fpm and I wanna test it on port 82. So I call http://mysite.com:82/test555.php and I see nothing. Just a white screen. No errors, no warnings, I don't see nothing at all :) There are an error log of nginx and an error log of php5-fpm - but... There are no any errors. I don't undestand what's wrong. Please help me to find out it.               root@localhost:# echo "<?php phpinfo(); ?>" > /home/www/public_html/test555.php     root@localhost:# chmod 755 /home/www/public_html/test555.php     root@localhost:# cat /etc/nginx/sites-available/default     server {             listen 82;             root /home/www/public_html;             index index.php index.html;                  server_name mysite.com;             access_log /var/log/nginx/nginx-access.com.log;             error_log /var/log/nginx/nginx-errors.com.log;                  location ~ \.php$ {                     fastcgi_pass unix:/var/run/php5-fpm.sock;                     # fastcgi_pass 127.0.0.1:9000;                     fastcgi_index index.php;                     fastcgi_param SCRIPT_FILENAME   $document_root$fastcgi_script_name;                     fastcgi_param QUERY_STRING              $query_string;                     fastcgi_param REMOTE_ADDR               $remote_addr;             }     }          root@localhost:# /etc/init.d/nginx status      * nginx is running          root@localhost:# /etc/init.d/php5-fpm status      * php5-fpm is running          root@localhost:# ls -la /var/run/php5-fpm.sock     srw-rw-rw- 1 root root 0 Feb  3 01:14 /var/run/php5-fpm.sock          root@localhost:# cat /var/log/php5-fpm.log      ....     [03-Feb-2014 01:14:52] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful     [03-Feb-2014 01:14:52] NOTICE: fpm is running, pid 19080     [03-Feb-2014 01:14:52] NOTICE: ready to handle connections          root@localhost:# cat /var/log/nginx/nginx-access.com.log     ...ip... - - [03/Feb/2014:01:29:44 +0000] "GET /test555.php HTTP/1.1" 200 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:26.0) Gecko/20100101 Firefox/26.0"          root@localhost:# cat /var/log/nginx/nginx-errors.com.log          root@localhost:#      What can I do next to find out what's going on? I see it should work fine. PHP script returns me code=200 but I doesn't see the output. It never been called, because I tried to add file_put_contents there and it really never been called by nginx. I use ubuntu 12.04 fully upgraded today.