title: System boots only with CD inserted

text: I have a weird problem lately: My system only boots if either a CD is inserted (any CD, not a specific CD(*)) or if I enter UEFI-BIOS before boot. Otherwise, `grub2` would start but afterwards the screen stays black. The last thing I did before this problem occured (at least I think this was the last thing) was adding partitions on `/dev/sdb` and `/dev/sdc`, generating a raid-1 out of these two partitions and adding the RAID to `/etc/mdadm/mdadm.conf` and `/etc/fstab`. My boot-device however is `/dev/sda` (I have a EFI-partition on `/dev/sda1`) If that helps: I run Debian Wheezy (but also have some packages from experimental). How can I locate the error and solve it? (*) I tried the following CDs:   1. A Debian Wheezy Live DVD (actually a DVD, not a CD) => System booted   2. A Mini CD which came with my WiFi-Router (so to say a driver CD) => System booted   3. Another driver CD that came with my printer ages ago => System booted   4. A music CD (Vive la Fête - République Populaire, but I'm quite convinced that doesn't matter) => System _didn't_ boot It looks like all data CDs work... [edit] here's my dmesg file (with inserted CD)   http://pastebin.com/cxvv0Hqe   maybe that helps!?


title: How can I grep contents of files with bash only without using find or grep -r?

text: would like to write a bash program which if I type in the following:               -bash-4.1$ ./sample.sh path regex keyword      that will result something like that:               path/sample.txt:12          path/sample.txt:34          path/dir/sample1.txt:56          path/dir/sample2.txt:78      I have absolutely no idea how can I achieve this without using find or grep -r (but I can use grep/ sed/ awk) in bash... Please help... Thank you very much!!


title: why kjournald uses writes so much?

text: Total DISK READ: 1056.26 K/s | Total DISK WRITE: 9.20 M/s       TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND      1055 be/4 root          0.00 B     11.64 M  0.00 %  1.99 % [kjournald]      1054 be/4 root          0.00 B      9.72 M  0.00 %  1.70 % [kjournald]      1053 be/4 root          0.00 B      5.21 M  0.00 %  0.73 % [kjournald]      1056 be/4 root          4.00 K      2.77 M  0.00 %  0.39 % [kjournald]      1082 be/4 root          0.00 B      0.00 B  0.00 %  0.34 % [flush-8:48]      1078 be/4 root          0.00 B      0.00 B  0.00 %  0.33 % [flush-8:32]      1080 be/4 root          0.00 B      0.00 B  0.00 %  0.09 % [flush-8:16]       493 be/3 root          0.00 B   1128.00 K  0.00 %  0.04 % [jbd2/sda3-8]      1081 be/4 root          0.00 B      0.00 B  0.00 %  0.01 % [flush-8:64]      1079 be/4 root         16.00 K    228.00 K  0.00 %  0.01 % [flush-8:0]      1126 be/4 root          0.00 B      0.00 B  0.00 %  0.00 % [kjournald]      1125 be/0 root          0.00 B     56.00 K  0.00 %  0.00 % [loop0]      2974 be/4 nobody        4.00 K     12.00 K  0.00 %  0.00 % httpd -k start -DSSL      5506 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       301 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL       311 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL       314 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       332 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     24916 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       347 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       348 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     16741 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       367 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       368 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       384 be/4 nobody        0.00 B     12.00 K  0.00 %  0.00 % httpd -k start -DSSL       394 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       414 be/4 nobody        0.00 B     12.00 K  0.00 %  0.00 % httpd -k start -DSSL       421 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       422 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     21049 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29281 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29289 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL      3517 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29389 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29390 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     29398 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL     32207 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL       874 be/4 nobody        0.00 B      8.00 K  0.00 %  0.00 % httpd -k start -DSSL     29562 be/4 nobody        0.00 B      4.00 K  0.00 %  0.00 % httpd -k start -DSSL      kjournald writes 11.64 mb data and stuff. THe sum of ALL other writes are not that much. Also what is jbd2/sda3-8


title: Difference between >> and >\> operators?

text: RHEL 6 Is there a difference between the `>>` and `>\>` operators? I read the following blurb in a RHEL training book: > "You can add standard output to the end of an existing file with a double > redirection arrow with a command such as `ls >\> filelist` I'm more accustomed to the `>>` operator and when I try both, I get different results.   * Using `>>` seems to append output to the file that follows it (as expected).   * Using `>\>` seems to append output to a file literally called **>** Is this a error in the book I'm reading? Or am I missing the author's point?


title: Intro to shell scripts with basic application: how do I set my computer to make an archive of a particular folder every day?

text: I've got a situation where I need to give some people access to my dropbox folder. Already so far they have deleted huge folders full of important data. Their computer skills could use a bit of work, apparently. Thankfully there is a restore function on the dropbox website. But the gui doesn't seem super- powerful, and I'm afraid that these people are going to permanently delete something. I've been making a zip archive of the folder, and saving it every day on my local machine. I've already restored files on it that I couldn't find on the dropbox restore gui. But I'm afraid that I'll get busy or lazy and forget to make the archive. So I figure that this is a good opportunity to learn basic automated shell scripting. How can I design a script that will   1. Run on startup   2. Prompt me (I don't know how) to see if I want to make a zip archive of a specific directory   3. Do so, and save it as `/path/to/archives/<date>` ?? I know only minimal bash at present (`cd`, `ls`, `ssh`, etc), so a working example of how to do such a thing would be a springboard to doing other useful similar things in the future. I'm running Ubuntu on a thinkpad x230.


title: 24gb files removed but no changes to the available space. What could have happened?

text: We have this virtual machine that has Apache2 installed, we forgot to install a log rotate and we got 24gb of logs from Apache2, We removed those 24gb of log files but no changes occurred to the disk whatsoever, It was like I didn't removed the logs at all. Does any one understand what may have happened?               root@Web:~# cat /etc/*-release     DISTRIB_ID=Ubuntu     DISTRIB_RELEASE=10.04     DISTRIB_CODENAME=lucid     DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS"          root@Web:~# df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1              29G   27G  675M  98% /     none                  744M  176K  744M   1% /dev     none                  748M     0  748M   0% /dev/shm     none                  748M  568K  748M   1% /var/run     none                  748M     0  748M   0% /var/lock     none                  748M     0  748M   0% /lib/init/rw     none                   29G   27G  675M  98% /var/lib/ureadahead/debugfs          root@Web:~# du -kh /var/log/apache2     24G     /var/log/apache2          root@Web:~# rm /var/log/apache2/*          root@Web:~# du -kh /var/log/apache2     4.0K    /var/log/apache2          root@Web:~# df -kh     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1              29G   27G  673M  98% /     none                  744M  176K  744M   1% /dev     none                  748M     0  748M   0% /dev/shm     none                  748M  568K  748M   1% /var/run     none                  748M     0  748M   0% /var/lock     none                  748M     0  748M   0% /lib/init/rw     none                   29G   27G  673M  98% /var/lib/ureadahead/debugfs


title: Which kind of additional cleanup may be required after removing manually added entries from /etc/hosts?

text: My system is "Unable to resolve" removed entry from /etc/hosts. During development, I needed to add the custom domain entry to /etc/hosts, stating it resolves to 127.0.0.1. This mapping worked fine. After I have finished with it and removed the entry, now I see error messages from different tools that claim this my custom name cannot be resolved any longer. Seems that every Java program that attempts to get the local host address is now crashing. I tried to reboot the machine, did not help. To make possible to work again, I have returned my custom naming to /etc/hosts. Which cleanup is required to get rid of it completely?


title: chmod + silent mode + how force exit code 0 in spite of error

text: Is it possible execute chmod and ignore error from command Example ( remark file.txt not exsist to show the example ) When I type               chmod 777 file.txt      I get error on the output                 chmod: cannot access file.txt : no such file or directory      So I add the-f flag to the command as the following: ( file.txt not exist in order to show the case )                 chmod -f 777 file.txt       echo $?       1      But from the example chmod return 1 Please advice how to force the chmod command to give exit code 0 in spite of error


title: if/then/else man page

text: I would like to know if there is any man page documenting the construction of the most basic script commands like `if/then/else`, `while`, `for each`, and all the relative switches, like `-eq`, `-e`, `-ge`, and so on.


title: How to execute Netscaler commands through a remote machine via SSH connection

text: I have been trying to execute some NetScaler commands like "bind" & "unbind" through a Linux Box via an SSH Connection. Now the Problem is, Manually we are able to enter & execute commands on NetScalar, but through SSH we are not. Netscaler is a hardware device (or network appliance) manufactured by Citrix, which primary role is to provide Level 4 Load Balancing. It also supports Firewall, proxy and VPN functions. if we log on to the Machine (in which NetScaler is configured), through a connection manager(Putty) we get a different prompt other than the shell. & Here we need to execute the commands like ... unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession & bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155 which we are able to execute, But when we try to execute the same through script (as given below), we are not able to. ./rem_expect_con.sh $SERVER $PASSWORD ``unbind lb vserver VS_Netbanking_443_26 -policyName manual_checkSession` ` & ./rem_expect_con.sh $SERVER $PASSWORD ``bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155` ` Above "rem_expect_con" is a script built for Password less connection. i have tried giving above arguments as ./rem_expect_con.sh $SERVER $PASSWORD 'bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155' ./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155" ``./rem_expect_con.sh $SERVER $PASSWORD "bind lb vserver VS_Netbanking_443_26 -policyname manual_checkSession -priority 155"` ` But none of them are working. None of them are executing on the Netscaler. Please help.


title: Korn Shell: End, pgup, pgdown, and delete key not working

text: So basically my `End`, `Pageup`/`Pagedown`, and `Delete` key are not working in ksh93. I'm running FreeBSD by the way. My arrow keys are working, and so is my home key. Those keys work when I put this in my `.kshrc`               set -o emacs      I have tried doing THIS, by putting this in my `.kshrc`. To make the `End` key work.               alias __Y=`echo "\005"`     # end = ^e = end of line      I opened up vim, and pressed `Ctrl``v`, and typed `0``0``5`. And the `^E` showed up. Still, nothing worked. Anyone know anyway to get those key to work? Also, When ever I press those keys it prints out a `~`. I also know that I could use `Ctrl``d`, or `Ctrl``a`, I do NOT want to use these.


title: rsync hardlink attempt copies

text: I've tried setting up a script to hardlink my files to my box.com account (as it's a backup of my music library). As I want to run it automatically to sync my music across several devices, I wanted to use rsync as I'm on Mac OS X 10.7.4 (if anyone cares). The script I came up with however only copies the files instead of hardlinking them (the available disc space lowers when I start the script). What I'm trying to achieve is the box.com app syncing something outside its actual folder. I already RTFMed and googled but I can't come up with a proper solution so I hope you guys could help me. This is the script I use:               rsync -azluPhmt --progress --link-dest=./iTunes ./iTunes/Users/admin/Box.com/iTunes --delete-during --exclude="*Album Artwork*"


title: luakit + awesome wm: make youtube fullscreen work

text: I'm running Arch Linux on my box. I use the awesome window manager, which is a tiling WM, but allows floating windows too. The ArchWiki's _Awesome_ entry tells me to put the following in my awesome `rc.lua` to make youtube's fullscreen floating by default:               { rule = { instance = "plugin-container" },       properties = { floating = true } },      Yet this doesn't seem to be working. I've tried the rule they suggested for the `chromium` browser and this worked, which is leading me too believe that the approach is correct. I'm guessing that the `"plugin-container"` is not the correct specifier for the browser I'm am using: `luakit`. So here's the question: what is the correct `instance` specifier to make `luakit` youtube videos be recognized by the `awesome` rules?


title: How to install/setup psftp in open suse linux?

text: I'm a newbie in linux. we need to do a file transfer from an open SUSE Linux server to a Windows server and vice versa. We are required to use `psftp` for the file transfer. Can anyone tell me how to setup/install `psftp` in our Linux server and the steps to do a transfer? and please tell me how to know if `psftp` is already installed in my server (both OpenSUSE Linux and Windows).


title: Dropbox on Debian EAGAIN error on NTFS share

text: I am experiencing some weird problems, when using dropbox on my Debian install:   * I run Debian with testing repositories enabled   * I have Dropbox installed from the website   * My dropbox-location is on a shared partition that is formatted with NTFS I mount the dropbox-location in my fstab with the following line:               UUID=662058B320588C45 /media/ntfs-data ntfs-3g uid=1000,gid=users 0 0      This provides me with read/write permissions on the drive - and as long as I use a filemanager or console (or any other program) to access the drive it works. After setting up my dropbox to access the already existing location on this drive it indexed nearly all files and then stopped with the message:               Downloading 38 files ...      I tried to check what is happening by attaching `strace` to the process which yields the following results (this is an excerpt only, as the message keep on appearing):               recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 496) = 0 (Timeout)     futex(0x9ee784, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 49446674, {1372094398, 476504000}, ffffffff) = -1 EAGAIN (Resource temporarily unavailable)     futex(0x9ee804, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee800, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee840, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee784, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee780, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee784, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 49446680, {1372094398, 476765000}, ffffffff) = -1 EAGAIN (Resource temporarily unavailable)     futex(0x9ee804, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee800, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee840, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee784, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee780, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 1     futex(0x9ee784, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 49446687, {1372094398, 477169000}, ffffffff) = -1 EAGAIN (Resource temporarily unavailable)     futex(0x9ee804, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee800, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 0     futex(0x9ee784, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x9ee780, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1     futex(0x9ee7c0, FUTEX_WAKE_PRIVATE, 1)  = 1     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"5\30\4\0\26\10@\1[\0@\1\17\0\17\0=\0\4\0[\0@\1\0\0\0\0\17\0\17\0"..., 96}, {NULL, 0}, {"", 0}], 3) = 96     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"$\30\1\0&\10\2\0\341\0\0\0", 12}, {NULL, 0}, {"", 0}], 3) = 12     poll([{fd=12, events=POLLIN}], 1, 4294967295) = 1 ([{fd=12, revents=POLLIN}])     recvfrom(12, "\1\1;U\0\0\0\0\341\0\0\0\177\0\300\0\246\5S\1\246\5S\1\24\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"&\30\2\0\177\0\300\0", 8}, {NULL, 0}, {"", 0}], 3) = 8     poll([{fd=12, events=POLLIN}], 1, 4294967295) = 1 ([{fd=12, revents=POLLIN}])     recvfrom(12, "\1\1<U\0\0\0\0\341\0\0\0G\0`\2\246\5S\1\246\0*\1\24\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"&\30\2\0G\0`\2", 8}, {NULL, 0}, {"", 0}], 3) = 8     poll([{fd=12, events=POLLIN}], 1, 4294967295) = 1 ([{fd=12, revents=POLLIN}])     recvfrom(12, "\1\1=U\0\0\0\0\341\0\0\0N\0`\2\246\5S\1\244\0*\1\24\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"&\30\2\0N\0`\2", 8}, {NULL, 0}, {"", 0}], 3) = 8     poll([{fd=12, events=POLLIN}], 1, 4294967295) = 1 ([{fd=12, revents=POLLIN}])     recvfrom(12, "\1\1>U\0\0\0\0\341\0\0\0\0\0\0\0\246\5S\1\244\0\25\1\24\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=12, events=POLLIN|POLLOUT}], 1, 4294967295) = 1 ([{fd=12, revents=POLLOUT}])     writev(12, [{"%\30\1\0", 4}, {NULL, 0}, {"", 0}], 3) = 4     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 0) = 0 (Timeout)     recvfrom(12, 0x33b3ae4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)     poll([{fd=10, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}], 3, 496  C-c C-c^C <unfinished ...>     Process 5687 detached      I already ran `ntfsck`:               sudo ntfsck /dev/sdb1     Unsupported: replay_log()     Unsupported: check_volume()     Checking 219648 MFT records.     Unsupported cases found.      Rebooting into Windows and running chkdsk did not solve the error neither. Anybody has any idea what this is / how I can fix it?


title: Which partitions should I encrypt?

text: My laptop is currently running Windows and Fedora, but I'm planning to install Arch Linux as my sole OS soon. This current setup is using whole disk encryption through TrueCrypt, but I'm unsure if it might be unnessesary for me. I think I'll be using a somewhat simple partition sceme, something like: `/`, `/boot`, `/home` and `swap`. I'm using my laptop for average everyday PC usage, programming, testing on local web server or on a virtual web server, audio/video playback, audio editing/recording etc. I want to encrypt my next Arch only setup as well, but I can't decide whether to partition the whole disk, just the home partition or something else. I want to encrypt the system mainly for securing eventual lost/stolen data. I'm thinking that dm-crypt with LUKS would be my best choice, but I'm not sure. What should I choose and why?


title: Linux chrgrp and chown remove capabilities added by setcap

text: I'm running a kernel derived from 2.6.32 on RHEL 6.4. If I add some capabilities to a file such as:               # setcap  CAP_AUDIT_CONTROL=eip ls     # getcap ls     ls = cap_audit_control+eip      And then I run either chown or chgrp against it:               # chown bob ls     # getcap ls     #      Those capabilities have been erased. Is this an expected behavior? I cannot find it documented anywhere (certainly not in the chown(1) or chgrp(1) man page. Nor have I found anything in the capabilities(7), or setcap(8) man page).


title: setting up exim4 for vep

text: I have exim4 running on a Debian server. A couple of applications send VERP mail from specific domains. Reading the exim docs it suggests a **router** that looks for certain domains and passes off to a special **transport** for which is sensitive to VERP (i.e. it does not mangle individual return paths by using `max_rcpt = 1`) The exim docs example use a hard-coded regex to identify the domain (and, in the example the local part suffix `-request` but I don't need that). I would like to write a router that identifies whether the return_path that is set is one from a list of given domains, and if so, use the special verp transport. I'd like to maintain the list of domains in a list rather than keep editing a regexp as I believe this will make for a more robust config file! Normally in Exim I could do something like `domains = +some_domain_list` but this only works to test the destination domain; I want to test the `return_path` domain. i.e. I want to do something like:               # domains that are used for VERP     my_domains_list = foo.example.com : bar.org          # my router     myrouter:        driver = dnslookup        return_path_domains = +my_domains_list        transport = verp_sensitive_transport


title: How to safely shutdown computer during boot sequence?

text: Due to a bug my computer has stopped in the middle of the boot sequence, just waiting. If I type anything, it prints stuff like `^[[B`. I do not want to damage the files on the computer by pressing the power button. Is there some way I can exit the boot sequence and go to a prompt so that I can type `shutdown -h now` or `reboot` to safely turn off or restart the system?


title: How can I control an existing remote shell?

text: On my remote machine, an xterm/shell has been created (by another process). I have full access to that shell through VNC. But really I would like to be using a text mode shell on my local machine. How can I control the existing remote shell from a local one? I can't create a new shell, that's the point. But I have non-privileged access to the existing remote shell.


title: How can I stop my Linux machine from broadcasting its name on the network?

text: I have a Linksys router and I've noticed that when I look for connected PC's on the router, the name of my computer and MAC address of the wireless device appears. However, I've noticed that for some devices it appears only the device MAC address, without a name. For example, Apple computers connected to the router appear without a name. The PlayStation 3 and the printer appears without a name too. So my question is, how can I stop my PC with Linux from broadcasting its name so the router can only present its MAC address and not the name? I really don't have any share utility so I don't see any use for broadcasting my PC name.


title: Using "${a:-b}" for variable assignment in scripts

text: I have been looking at a few scripts other people wrote (specifically Red Hat) and a lot of their variables are assigned using the following notation `VARIABLE1="${VARIABLE1:-some_val}"` or some expand other variables `VARIABLE2="${VARIABLE2:-`echo $VARIABLE1`}"` What is the point of using this notation instead of just declaring the values directly? e.g. `VARIABLE1=some_val` Are there benefits to this notation or possible errors that would be prevented? Does the `:-` have specific meaning in this context?


title: Does an in-kernel firewall sit between the network access layer and Internet layer?

text: _This question is a follow-up to myprevious question._ Logic for me to says that an in-kernel firewall sits between the network access layer and the Internet layer, because it needs to have access to the IP-packet header to read the source and destination IP address in order to do filtering before determining if the packet is destined for the host, or it the packet should forwarded to the next hop if it is destined elsewhere. Somehow, it also seems logical to say that firewall is part of Internet layer, because that is where routing table is and a firewall is in some respects similar to routing table rules.


title: Compile IMAP with certain PHP API version for MAMP

text: I've installed MAMP on Mac OS X (where PHP 5.3.15 with API version `20090626` is installed), but IMAP there is without SSL support. As long as MAMP using PHP v5.4.4 (API version `20100525`) I've downloaded its sources. But. When I type `phpize` the `phpize` from Mac OS X called, not from MAMP (maybe because it's installed in system when MAMP has PHP libs inside itself). So how do I compile IMAP sources with API version of MAMP's PHP?


title: Adding Windows user to Linux group; possible?

text: I have a NAS that runs on Linux and I connect to it from my Windows desktop. I noticed that all directory in that drive belongs to user 'root' and group 'root'. That effectively denies me the right to write on those directory; only read rights. Is there a way I can add my desktop username e.g. sara-laptop/sara into the Linux root group which will then give me rights to write on those directory? I was thinking about changing the ownership to nobody/nobody which will give everyone rights to write on it. But could be a bad idea as I'm worried that other users will accidentally delete some of my items. Thanks.


title: How can I reinstall Network Manager after uninstalling it?

text: I am running a version of RHCE6 on my laptop, and lately I've been trying various stuff about network configuration through command line. Last night, I tried removing the NetworkManager using               yum remove NetworkManager      from the system, so that I could have more control of the network through the command line. But the result is, I didn't manage to configure the wireless connection through `wpa_supplicant` , and I need wireless connection during my travel.   I tried to reinstall using :               yum install NetworkManager      Some version installed, but I didn't get an icon in the taskbar, and of course, the network doesn't work. The package I previously removed (about 24MB) was much larger that the one I just installed(about 2MB), I think some dependencies must be missing. How could I Reinstall network manager correctly to restore my connectivity?


title: How can i specify directory user & group for files inside an RPM?

text: I am building RPMs using FPM. When using the --rpm-user and --rpm-group, I notice as advertised that in the specfile that the %defattr(-,user,group,-) is set under %files. This does indeed set the user and group settings of files, but how do i set the directory user & group?


title: Can't use Control key while setting shortcut keys for compiz

text: I might got a problem along with my Xorg config, all control keys are now shown as `<Primary>`, what is that? I just mapped `Capslock` to `Left Control`, and I can't set the shortcut key to `Control` + `Tab` now ![enter image description here](http://i.stack.imgur.com/1Pu7q.png)


title: Concatenate Sequences under a Heading

text: I have a file like File1. With a heading for example ">Contig1" and I want to concatenate all the sequences under the respective heading. File1:               >Contig1     ACCCCATACATCCAAA     NNNNNNNNNNCATACA     AAAAAAAACTANNNNN     ACATACAAAAA     >Contig12     CCCCACAATTTTTAAA     GGGGGNNNNNCATACA     AGGAATTAACTANNAC     GGATATA      Expected Output:               >Contig1     ACCCCATACATCCAAANNNNNNNNNNCATACAAAAAAAAACTANNNNNACATACAAAAA     >Contig12     CCCCACAATTTTTAAAGGGGGNNNNNCATACAAGGAATTAACTANNACGGATATA      Can you please help me with it. Cheers!


title: What's the newline symbol in zsh's PS1?

text: I'm trying to setup a multiple line PS1, for zsh, but `\n` doesn't was parsed by zsh, `PS1="%~\n %> "` How should I set it up?


title: Copy multiple files into one (append, merge) in single invocation without shell redirection?

text: I'm looking for some sort of a command that I can use, to copy/append multiple files into one; but _without_ shell redirection (I'd like to try it in `call_usermodehelper`, see similar issue in call_usermodehelper / call_usermodehelperpipe usage - Stack Overflow). I know I could otherwise use:               cat file1 file2 > file.merge      ... but that requires shell redirection. My findings so far:   * Cannot use `cat`, as it's default stdout output cannot be redefined (through, say, command line argument) - and other than that, it's shell redirection   * Cannot use `dd` in single invocation, as it can only accept one (and only one) `if=` input file argument   * Cannot use `cp`, as it will treat multiple files individually, and cannot copy them all "merged" into a single location So - is there any standard tool, that would allow me to do something like (pseudocode):               copytool -i file1 -i file2 -o file.merge      ... such that the output `file.merge` represents `file2` appended to `file1` contents?


title: Ethernet-bridged OpenVPN server not accepting connections from outside

text: I have configured an OpenVPN server with ethernet bridging using this howto and this page regarding ethernet bridging. The server is also running Samba, Apache and Webmin.               Linux klesk 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux          Distributor ID: Debian     Release:    6.0.7     Codename:   squeeze      The problem is that I cannot access the server from outside of the LAN. When I connect to the webmin or Samba share internally I have no problems. The configuration on the router has not been changed and is still correct. I have tried disabling the iptables firewall with the following commands (this has been restored already)               iptables -F     iptables -X     iptables -t nat -F     iptables -t nat -X     iptables -t mangle -F     iptables -t mangle -X     iptables -P INPUT ACCEPT     iptables -P OUTPUT ACCEPT     iptables -P FORWARD ACCEPT      But still no connections from outside are allowed. I believe the problem lies with the network interfaces created for OpenVPN. When I check Webmin I get the following information: ![enter image description here](http://i.stack.imgur.com/Z3WGU.png) Currently I have iptables setup as described in the ethernet bridging setup page of OpenVPN:               iptables -A INPUT -i tap0 -j ACCEPT     iptables -A INPUT -i br0 -j ACCEPT     iptables -A FORWARD -i br0 -j ACCEPT      To summarize, with the current setup, as shown in the screenshot and iptables settings, I am able to connect to the server from within the LAN (SSH, Apache, Webmin, Samba, they all work) but from outside of the LAN the server isn't accepting any connections.


title: Resolving MAC Address from IP Address in Linux

text: I need to write a bash script wherein I have to create a file which holds the details of IP Addresses of the hosts and their mapping with corresponding MAC Addresses. Is there any possible way with which I can find out the MAC address of any (remote) host when IP address of the host is available?


title: looking for light weight Linux for a old 104 pc

text: I am looking for a light weight Linux for a PC that runs at 200 Mhz with 256 Megs of RAM. I was thinking maybe Lubuntu, as the system requirements state it needs at least a Pentium 2 generation with 128 Megs of RAM. The GUI is not all that important to have, so would I be better off going with something like Ubuntu server? I was kinda hoping to go with a Ubuntu flavor due to their great support base, but I am willing to try other flavors.


title: Modelsim for ubuntu

text: I am looking to download modelsim for ubuntu. But the site gives only .exe file. Can I still install the software? Does modelsim exist for ubuntu? If yes, where can I find it? Thank you.


title: Can I have my shell history record how wildcards expanded?

text: If I run:               $ ls *     foo bar buzz     $ history | tail -1     ls *      You can see that in my shell history it remembers that I ran `ls *` rather than `ls foo bar buzz`. Ideally, I'd like to record both in separate histories. When I wonder, "what the heck happened to file foo?", it would be nice to be able to have a way to go back and figure out that I did `rm *` in the wrong directory by searching through my history and finding 'foo'. I'm interested in solutions for both zsh and bash.


title: How to decide on a partitioning scheme?

text: I am changing my current partition scheme (personal development laptop, dual boot) to remove the Windows partition and leave only my Slackware64 instance. What thought should go into my partitioning? I have been keeping `/` and `/home` in separate partitions, as well as a `swap` partition too. How do I decide what other partitions would be good to have in their own section of the disk?


title: echo of a string with an exclamation point

text: Here are what I put in bash and the results I got about 'echo':               $ echo '!$'        !$       $ echo "!$"       echo "'!$'"       '!$'      I'd like to know how 'echo' deals with the second input. It seems to me that 'echo' would first print the strings (expand some if necessary) you entered, then execute certain if they are executable. A more mind-blowing example I can construct but am not able to understand is:               $ echo '!$'       !$       $ echo "!echo "!$""       echo "echo '!$' "'!$'""       echo '!$' !$


title: Compiling software with the same options as a previous install

text: I want to compile and install a software on a new VM. The software was installed successfully on a different VM by a different admin, but I want to duplicate the exact command with the options that he used. Is this possible? BTW, the folder from where he ran `./configure` is still intact.


title: Delete every number that comes before "="

text: i have a very, very, very long list. Like over 830,000 characters. I will of course perform said command on a copy. There are multiple lines, like this               hey1=lol     hey2=lol     hey3=lol      I want that to turn out like this               hey=lol     hey=lol     hey=lol      This must be possible with sed, awk or similar? The reason im not using Sumblime text is because all lines do not have a number before them.


title: find all end subdirectories in a tree

text: given the following structure:               oz123@debian:~/ $ tree .     .     ├── a     │   ├── a1     │   ├── a2     │   └── a3     ├── a1     │   ├── a11     │   ├── a12     │   └── a31     ├── b     │   └── b1     │       ├── b11     │       │   └── b21     │       │       └── b31     │       ├── b12     │       └── b3     └── c          16 directories, 0 files      ### How do I find all the end nodes? I found the following solutions which _seems_ to be good, but I have to proof that there is not test case which will fail it. The help page of the `-links` states: > You can also search for files that have a certain number of links, with > ‘-links’. Directories normally have at least two hard links; their . entry > is the second one. If they have subdirectories, each of those also has a > hard link called .. to its parent directory. The . and .. directory entries > are not normally searched unless they are mentioned on the find command > line. ### possible solution:               oz123@debian:~/ $ find .  -type d  -links 2     ./a/a2     ./a/a3     ./a/a1     ./c     ./a1/a31     ./a1/a11     ./a1/a12     ./b/b1/b12     ./b/b1/b3     ./b/b1/b11/b21/b31        * Can anyone provide a better solution (without using pipes and sed, this has be performant ...)   * Will it work on any filesystem?


title: recursive delete with sftp?

text: I have a host that I can only access with sftp, scp, and rsync-- no ssh. I have a large tree of directories that I want to delete, but my sftp client apparently does not support recursive `rm`s or `rmdir`s. In the help screen, it shows I can do recursive `put`s, but that doesn't help me. How can I delete my files?


title: Use a different shell by default in each terminal emulator

text: I would like to change the default shell in each terminal emulator separately. To clarify, I want Xterm to use TCSH, pterm to use pysh, gnome-terminal to use BASH, etc. Is this possible? If so, how can this be accomplished.


title: Troubleshooting span traffic shutdown interface?

text: I'm using guardium appilance, which has one of its port used to analyze span traffic. The base os is linux. The span traffic stopped coming during some time of operations. I asked the network team, and was told that port was shut down on the guardium device end. I'm convinced that this activity has taken on switch level as it was unable to handle the traffic being passed through it. Is there a command that i can run on the linux o/s that would tell exactly if the interface was shutdown ; if yes for what reason? Thanks.


title: Wget, downloading outdated files [debian running on Mips - malta]

text: I am over writing a particular file (called "demo") on my server and wget-ting it. However, sometimes wget retrieves an outdated file, despite my checking on the net that the file has been updated. I've tried deleting before re-writing, sometimes I even delete all the files; but when I try to wget "demo" I still get an outdated copy. I'm running debian on a simulated MIPS malta board (basically, linux running on MIPS) if that makes a difference. Is this a known bug and if so, is there a way around it?


title: Unix and Linux without a file system?

text: I was reading **Eric Raymond's** the **Art of Unix Programming** , (Amazon and online) and at the very beginning of the book where he analyses what Unix does wrong he says: > Having a file system at all may have been the wrong choice. **So I am asking: What could be a viable alternative to file systems? Because Unix was built upon (and therefore heavily utilises the concept of) file descriptors and file systems.**


title: Find packages not maintained in main repo?

text: > **Possible Duplicate:**   >  listing packages in Debian, a la `dpkg -l`, but including the package > origin/source E.g. Ubuntu Server offers only security updates for software contained in the main repository - how can I check, which installed packages are / are not in the main repo? Thanks!


I have recently had an incident in which my /var/mail/spool/ file grew to the size of 32G (yes, that is gigabytes), completely filling its system partition (/dev/sda2) and most of what I saw inside were Hibernate messages. When I tried to restart my laptop, I got an error message from the GUI saying that the system was unable to start. Then I went into the recovery mode (command-line only) and was able to shell into the system. I did some du investigation and found the above described anomaly. I deleted the file and then was able to log into X11 (KDE Desktop) fine. My question is: Why does X11 on Fedora 16 rely on non-boot device for startup? Can it be configured to only use the boot device or is X11 considered almost like any other application? I would like to be able to at least get inside my D.E. even if all other disk partitions are unusable but the boot partition is. RELATED: Disk size management


title: How to put the specific files from a directory in an array in bash?

text: Suppose I have a directory under which there are 3 files named: file1.txt,file2.txt and file3.txt. Now how can I fill an array with those file names(I just know that all the files have certain prefix, i.e. file, after file it can be 1,2,3 etc.


title: Window manager and desktop environment for touchscreens

text: What are some good choices for desktop environments and window manager for touchscreens? Currently I am using XFCE with custom GTK settings for making the controls larger, but that is far from optimal. What is the current state of touch-screen desktop environments, and are there any promising projects out there? **Edit:** Are there any "lightweight" touch-optimised desktop environments available?


title: nagios w/o apache?

text: I want to install nagios but instead of using apache i would like to use nginx. I installed nagios-cli and it automatically brings parts of apache which puts a script into `/etc/init.d/apache2` and annoy me on every bootup. I have nginx with php,cgi and mono working fine. But i am unsure how to remove apache from my system How do i remove apache or not get it included with nagios? I am using debian squeeze (6)


title: Reducing ubuntu boot time using dmesg

text: The boot time is 141 seconds. Here's the most interesting parts of dmesg command:               [    2.870498] usb 1-1.2: new high-speed USB device number 5 using ehci_hcd     [   80.669210] ADDRCONF(NETDEV_UP): eth0: link is not ready      I takes 78               [   86.108371] intel ips 0000:00:1f.6: i915 driver attached, reenabling gpu turbo     [  102.924783] cfg80211: All devices are disconnected, going to restore regulatory settings      16 more seconds               [  109.643299] wlan0: associated     [  140.406853] wlan0: deauthenticated from 00:3a:9a:49:27:60 (Reason: 23)      and 31 seconds. Is it possible to do something with these parts in order to reduce total boot time?


title: Reverse tunnelling with “stunnel” in linux

text: Scenario: Central Log-Server(logserv)- only private IP interfaces Multiple client servers (logclient)- has public IPs. Requirement: Need to tcp logs of syslog application from various logclients to logserv. Is this possible to achieve this using "stunnel", like its normally implemented via reverse tunnelling with ssh and autossh? Is reverse tunnelling possible with "stunnel". The idea behind going for tunnel was to avoid giving logserv a public IP to prevent public access. Once a reverse tunnel was made, then transferring logs from logclients to logserv would be possible. But not sure if it will work using stunnel. Kindly advise.


title: Loop over multiple addresses: ping and drop data into file

text: I would like to be able to have a script that will:   1. look at a list of IP addresses    2. Ping one of the addresses   3. Take the data and drop it in to a file   4. Move on to the next IP So far I have:               cd /Path/to/addressees || exit 1     for targethost in a b c; do       {ping {targethost}           echo $'\n'"finished:       } >"$log_file" 2>&1     done      When I run this I receive the errors:               ./ping_address: line 3: cd: /path/to/ip_adress: No such file or directory     ./ping_address: line 7: unexpected EOF while looking for matching `"'     ./ping_address: line 8: syntax error: unexpected end of file      I am still a little new to scripting on Unix so any help would be really helpful!


title: Kill only one Java process

text: I usually run few Java applications, one for server running locally and other for some IDE like NetBeans. And from time to time, after lots of redeployments, my server get stuck on OutOfMemoryException so I need to kill Java process in order to reboot. So I do `pkill -9 java` but this also kills my running IDE which I don't want to. So how do I kill only application linked to running server and not the other ones?I assume that they all are running under same process but there has to be some way how to distuingish them.


title: Can ps display only non kernel processes on Linux?

text: How can I ask `ps` to display only user processes and not kernel threads? See this question to see what I mean...


title: Pattern matching on path names in bash

text: I want to act on a list of subdirectories in a directory. Consider:               for x in x86-headers/*/C/populate.sh; do echo $x; done      This gives               x86-headers/elf/C/populate.sh     x86-headers/gl/C/populate.sh     x86-headers/gmp/C/populate.sh     x86-headers/gnome2/C/populate.sh     x86-headers/gtk2/C/populate.sh     x86-headers/jni/C/populate.sh     x86-headers/libc/C/populate.sh      But I want values that corresponds to the second part of the path, `elf`, `gl`, etc. I know how to strip off the leading `x86-headers`.               for x in x86-headers/*/C/populate.sh; do i=${x##x86-headers/}; echo $i; done      which gives               elf/C/populate.sh     gl/C/populate.sh     gmp/C/populate.sh     gnome2/C/populate.sh     gtk2/C/populate.sh     jni/C/populate.sh     libc/C/populate.sh      I also know how to strip off later terms in the path. I.e. going down one level:               cd x86-headers     for x in */C/populate.sh; do i=${x%%/*}; echo $i; done      gives               elf     gl     gmp     gnome2     gtk2     jni     libc      But, trying to combine these doesn't work. I.e.               for x in x86-headers/*/C/populate.sh; do i=${${x##x86-headers}%%/*}; echo $i; done      gives               bash: ${${x##x86-headers}%%/*}: bad substitution      No doubt this is incorrect syntax, but I don't know the correct syntax. Of course there might be better ways to do this. If I was using Python, I'd use split on `/`to break each path into a list, and then pick the second element, but I don't know how to do that in bash. EDIT: Thanks for the answers. I should also have asked, is it possible to do this portably, and if so, how?


title: How to create a PCM wav with mplayer?

text: I want to reencode a audiobook for my mobile with speexenc. The first step is to reencode the file with mplayer.               for i in *.mp3; do         mplayer -ao pcm:waveheader "$i" -af pan=1:0.5:0.5,resample=22050 -ao pcm:file="$i.wav";     done      Is what I found on the internet. But the outfile is not a pcm wav:               file *.wav     RIFF (little-endian) data, WAVE audio, mono 22050 Hz      Where a reference wav from xiph.org is pcm.               file wb_male.wav      RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz      speexenc does encode the last PCM WAV, but does not with the mplayer file. Why not? The does the Audiooutput called "pcm" does not ouput a pcm file? How to Fix it? And is there a easy way to pipe the wav directly to speexenc without a named fifo?


title: Removing Debian Installation Prompt

text: I attempted to install Debian through a CD, with the initial .exe working fine. However, when I rebooted and went through the installation procedure, my system could not tell that there was a disk there (or the media was unreadable). Now whenever I boot up my computer, I get the choice between continuing on to windows or to complete my installation. How do I remove that choice? Do I have to go through BIOS or are the files on my Windows partition?


title: Configure SSH keys for production and DR server

text: Here is the case, we have successfully configured SSH keys (and hence password-less SFTP connection) between ProdServer-A to ProdServer-B. It works, or so I thought still yesterday. Yesterday ProdServer-B failed over to DisasterServer-B. When it did, the SSH connection failed. In ProdServer-A we get an alert saying ProdServer-B has changed (known-hosts) and could be "man-in-middle" attack (which is as expected, but we know why this is happening). So, my question is, how can we add keys from two servers (same hostname, but only one active at a time) into known_hosts? Or even better, how can we successfully avoid SSH connection failures if a production server failed over to disaster server? Suggestions are welcome. Thanks!


title: Why is I/O uninterruptible?

text: What is the rationale behind making I/O uninterruptible? What would be the negative consequences if a process handling I/O were allowed to handle a signal?


title: increasing a logical volume

text: I need to increase the logical volume of the `var` directory, the maximum size of `var` right now is 10GB, I need to make it 50GB. I have a Centos 6 server. The output of `df -h` is:               Filesystem            Size  Used Avail Use% Mounted on     rootfs                 10G   10G     0 100% /     /dev/root              10G   10G     0 100% /     none                  991M  312K  990M   1% /dev     /dev/sda2             455G  3.6G  429G   1% /home     tmpfs                 991M     0  991M   0% /dev/shm     /dev/root              10G   10G     0 100% /var/named/chroot/etc/named     /dev/root              10G   10G     0 100% /var/named/chroot/var/named     /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.conf     /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.rfc1912.zones     /dev/root              10G   10G     0 100% /var/named/chroot/etc/rndc.key     /dev/root              10G   10G     0 100% /var/named/chroot/usr/lib64/bind     /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.iscdlv.key     /dev/root              10G   10G     0 100% /var/named/chroot/etc/named.root.key      I followed this tutorial. In order to increase the volume you have to do: `lvextend -L +40G /Path/To/var` My problem is simple, I don't know where my var is located. If i do `lvextend -L +40G /dev/root/var` I get `Volume group "root" not found` If i do `lvextend -L +40G /dev/var` I get                 Path required for Logical Volume "var"       Please provide a volume group name       Run `lvextend --help' for more information.      I tried every possible path, still can't find the right path to var, so where my `var` is located? **EDIT** If i do `lvextend -L +40G /dev/root` I get                 Path required for Logical Volume "root"       Please provide a volume group name       Run `lvextend --help' for more information.      `pvs` gives no output at all. `lvs` gives this output `No volume groups found`


title: Wlan0 Static Ip bridge

text: EDIT: Even taking br0 out, still cannot get a static IP connection. I had the following /etc/network/interfaces configuration and it was working               auto lo     iface lo inet loopback          auto eth0     iface etho inet manual          allow-hotplug wlan0          auto wlan0     iface wlan0 inet dhcp     wpa-ssid "xxxx"     wpa-pskl "xxxx"          auto br0     iface br0 inet dhcp     bridge_ports wlan0 eth0      I changed the config for wlan0 to the following and now it doesn't work               auto wlan0     iface wlan0 inet static     address 192.168.1.124     netmask 255.255.255.0     network 192.168.1.1     broadcast 192.168.1.255     wpa-ssid "xxxx"     wpa-pskl "xxxx      I am trying to setup a wireless network with static IP that is also bridge to ethernet connection. Im doing this on Raspberry Pi. Thanks for help.


title: Why "uninterruptible sleep" is not counted as "IDLE"?

text: When I run `top -bi`, where the parameter -i means "ignore idle processes", the resulted list(see below) of processes are either R or D, although there're S processes at that time. So, why uninterruptible sleep is not counted as "idle"? And, it seems that "load average" equals the number of R processes plus the number of D processes?               top - 17:47:44 up 141 days, 14:29,  2 users,  load average: 4.10, 4.18, 4.17     Tasks: 224 total,   1 running, 223 sleeping,   0 stopped,   0 zombie     Cpu(s):  0.1%us,  0.4%sy,  0.0%ni, 87.2%id, 12.3%wa,  0.0%hi,  0.0%si,  0.0%st     Mem:  16432240k total, 16345816k used,    86424k free,  4934652k buffers     Swap: 16386292k total,     6996k used, 16379296k free,    71432k cached          PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                  7479 root      18   0 1357m 1.1g  904 D    1  7.0  10:27.86 rsync                                                                    7463 root      18   0 1315m 1.0g  840 D    1  6.6   9:45.83 rsync                                                                    7469 root      18   0 1088m 889m  840 D    0  5.5   8:10.20 rsync                                                                    7524 root      18   0 1106m 895m  840 D    0  5.6   8:13.60 rsync                                                                    30958 root      15   0 12720 1148  788 R    0  0.0   0:01.07 top


title: Simple Shell script to log disk space

text: I'm working on automating collecting disk space on a group of servers. In a standard terminal, if I run:               ssh server1 ssh server2 df -h       Then I get the output of the command, just fine. However, if I attempt this method from within a script using a For Loop. Then it fails. Example Script:               #!/bin/bash          GROUP="server1 server2"          for s in $GROUP; do          ssh bastion1 ssh ${s} df -h     done      In the latter example, I get no output (or errors for that matter). I've tried various escaping and quoting, but still no luck...I have a feeling it's something blatantly obvious that I am overlooking. Any pointers?


title: What happens when you rsync without a destination?

text: To make the story short, I did an rsync: `rsync -avP root@exampleserver.com:/tmp/` And I forgot to put in my source directory... :( I really meant to run: `rsync -avP /tmp/ root@exampleserver.com:/tmp/` It printed a bunch of files, but I don't know where it copied them because I didn't specify a destination. Does anyone know what happened? I did an `ls` on the folder, but I didn't find anything.


title: Port forwarding and masquerading

text: What is the relationship between port-forwarding and masquerading? If server A is configured to masquerade its clients, and client B accesses the Internet through server A, then since client B is masquerading as server A, is that essentially the same thing as having all of client B's ports forwarded?


title: When sh is a symlink to bash or dash, bash limits itself to POSIX-compliance, so it should be 100% compatible with sh?

text: From Difference between bash and sh: > ABck to the question: If you have `/bin/sh` as a link to bash, then bash > will not behave the same when called as `/bin/sh` as it does when called as > `/bin/bash`. When called as `sh`, it will limit itself to mostly POSIX- > compliance plus a limited set of extensions. Does it mean that whenever I come across a shell script in Linux with a shebang to sh: `#!/bin/sh`, even if on that distro, `bin/sh` is a symlink to another shell, like dash or bash, it should be 100% compatible with the bourne shell, since it limit itself to a limited set of extension? So I could execute them in FreeBSD? Is there are exception to that? Or I should be safe to assume that it will work? So if on a distro, `bin/sh` is a symlink to `bin/bash`, and a script use `#!/bin/sh` and the script contain bashism, it will not run, since bash will like be in sh mode?


title: merging all files into one file?

text: I was trying to merge all the text files in to one file. All the text files has one column and equal number of rows. My data file names are data_1.txt, data_2.txt, data_3.txt, . . . data_n.txt. where n is the number of text files to be merged. I want the merge from 1 to n in their order. I tried the following code, but it doesn't work as I wanted. It doesn't keep the column order. My sample data looks like data_1.txt               0.020085     0.0017361     0.77963     0.98659     0.33102     0.099835     0     0     0.073004     0.29978      data_2.txt               0.021407     0.0017191     0.82385     1.0449     0.34593     0.10535     0     0     0.078362     0.31509      data_3.txt               0.022706     0.0016876     0.85447     1.0922     0.35556     0.11063     0     0     0.083983     0.32536      required output combined.txt               0.020085    0.021407    0.022706     0.0017361   0.0017191   0.0016876     0.77963 0.82385 0.85447     0.98659 1.0449  1.0922     0.33102 0.34593 0.35556     0.099835    0.10535 0.11063     0   0   0     0   0   0     0.073004    0.078362    0.083983     0.29978 0.31509 0.32536      Would you please help me in correcting my problem.               #!/bin/bash     paste data_*.txt > combined.txt


title: Why does root not have /usr/local in path?

text: I've noticed that the default path for root on my of my vm's and servers do not include /usr/local/bin ` sudo -s   echo $PATH /sbin:/bin:/usr/sbin:/usr/bin ` Whereas normal users on the server do have /usr/local/bin               /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/sowen/bin      Why would root not need /usr/local in the path? Where is the default path for a user defined?


title: What configuration can insert lines between commands?

text: I've noticed on some Linux servers, that bash has a very elegant feature that adds visual breaks. What program is it that appends the `\-------- <time>` after each command? ![enter image description here](http://i.stack.imgur.com/ptNiI.png)


title: Principle of least privilege: Does Authbind helper really need setuid root, or can it run with cap_net_bind_services?

text: Does Authbind's helper really need setuid root, or can it run with the CAP_NET_BIND_SERVICES capability and still work?


title: How to make a key simulate another key?

text: In my keyboard the `I` key doesn't work. So, I use an on-screen keyboard. I'm using Ubuntu 13.04. But its hectic. Is there a way so that I can make another key (for example `Home` on my keypad) to behave like `I`? Also, if you have any other easy way to achieve this please share.


title: Archlinux: No binaries can be executed

text: Yesterday I ran an archlinux system upgrade which updated a lot of things, one of them being glibc. Here's a screenshot. Obviously the upgrade of glibc failed. But as you can see on the bottom I cannot execute anything anymore. The files themselves are still there, which i can see using `echo /usr/bin/*` Since I cannot run anything on the machine: is there any way to fix this? Or am I forced to re-install the whole OS?


title: How to properly disable Gnome 3 shell in Debian?

text: I just did a Debian install on an old laptop, and I don't need Gnome shell on it. I did it with `apt-get remove gnome-shell`, and it worked after I restarted. However, later I did `apt-get autoremove`, and I was a bit tired and didn't read any of the package names it listed - turned out it removed a whole bunch of important packages from my system, forcing me to re-install Debian from scratch. Is there another way to disable Gnome shell as the default? I tried the following command from the Debian wiki, but it didn't work:               $ gconftool -s /desktop/gnome/session/required_components/windowmanager \            -t string metacity


title: Debian: I can't change GTK_IM_MODULE in .xprofile

text: I want to use `fcitx` to type Chinese in my Debian (jessie amd64). But it's wired in such a way that I can't change the value of `GTK_IM_MODULE` in `~/.xprofile`. My `.xprofile` is like this:                 1 # im       2 export GTK_IM_MODULE=fcitx       3 export XMODIFIERS=@im=fcitx       4 export QT_IM_MODULE=fcitx      Each time I rebooted, or started a new `gnome-terminal`, I got this:               benben@debian:~$ echo $GTK_IM_MODULE     scim      So I tried to figure out whether `.xprofile` still works, by modifying it to the following:                 1 # im       2 export GTK_IM_MODULE=fcitx       3 export XMODIFIERS=@im=fcitx       4 export QT_IM_MODULE=fcitx       5        6 export hello=world      Then each time I rebooted, or started a new `gnome-terminal`, I got:               benben@debian:~$ echo $hello     world      So I think `.xprofile` still works.   Is there some other application that keeps `GTK_IM_MODULE` from changing to other values?


title: How to configure external IP addresses for LXC guests?

text: I'm exploring the LXC features in Ubuntu 12.04 and I really want to set up a network like this:               client1:   192.168.56.101/24     lxc-host:  192.168.56.102/24     guest1     192.168.56.201/24     guest2     192.168.56.202/24     guest3     192.166.56.203/24      I just want a "flat" network where the guests have full access to the LAN and are visible from the clients. I'm used to bridged networking with libvirt/KVM, as described here: http://libvirt.org/formatdomain.html#elementsNICSBridge On the host:               # /etc/network/interfaces     auto br0     iface br0 inet static         address 192.168.56.102         netmask 255.255.255.0         broadcast 192.168.56.255         bridge_ports eth1      lxc.conf for the first guest:               # /var/lib/lxc/guest1/config:     lxc.network.type=veth     lxc.network.link=br0     lxc.network.flags=up     lxc.network.hwaddr=00:16:3e:13:48:4e     lxc.network.ipv4=192.168.56.201/24      It looks like 192.168.56.201 is invisible to the outside world, which isn't what I want. Seems like I have to do one of these things: 1) Manually set up routing on the host and guest 2) Do something hokey...create virtual interfaces on the host ahead of time, and configure the guests to use them `lxc.network.type=phys`. I don't know if that would actually work. I'm focused on Ubuntu, but answers for RHEL/Fedora would be useful too....


title: Map Control-Shift-Tab in rxvt-unicode

text: I'd like to map the keybinding `Ctrl`+`Shift`+`Tab` in `rxvt-unicode`. I managed to map `Ctrl`+`Tab` as follows. The corresponding entry in `.Xresources` is               URxvt.keysym.Control-Tab: \033[27;5;9~      Using `cat -v` confirms that this mapping works:               $ cat -v     ^[[27;5;9~      The sequence `^[[27;5;9~` can then be used in applications like `vim` for mapping `Ctrl`+`Tab`. I would expect the following `.Xresources` entry to work the same.               URxvt.keysym.Control-Shift-Tab: \033[27;6;9~      However, `cat` does not show the correct mapping:               $ cat -v     ^[[Z      How to set up the `Ctrl`+`Shift`+`Tab` mapping? **Edit** The mappings               URxvt.keysym.Control-ISO_Left_Tab: \033[27;6;9~         URxvt.keysym.Control-Shift-ISO_Left_Tab: \033[27;6;9~      behave the same. After first pressing `Ctrl`+`Tab`, releasing both and then pressing `Return` _twice_ and then pressing `Ctrl`+`Shift`+`Tab`, releasing all and then pressing `Return` _twice_ I get the following output:               $ cat -v     ^[[27;5;9~     ^[[27;5;9~               ^[[27;6;9~↵     ^[[27;6;9~M-bM-^FM-5        * Case `Ctrl`+`Tab`: The first return makes the input appear again as output.   * Case `Ctrl`+`Shift`+`Tab`: The first return produces the sign `↵`, the second return produces the last line shown above. **Next edit: More information** > What happens if you press ctrl-shift (release both without pressing any > keys), then enter, in a different window? In a different urxvt window? When I press Ctrl+Shift and release both keys a strident yellow box appears in the lower left corner: `KEYCAP PICTURE INSERT MODE` it seems to come from urxvt, it does not appear in other applications. > Or even just ctrl-shift-tab then enter in a different window (i mean not > rxvt, like in a gedit window or the web browser or something.) I get a new line. > What happens if you press shift+ctrl+tab [i.e. shift down, ctrl down, tab, > ctrl up, shift up] instead, or vice versa if that was what you were doing? In urxvt?               $ cat -v     shift+ctrl+tab then enter: ^[[27;6;9~     ctrl+shift+down: ↓     ctrl+shift+up: ↑     shift+down: ^[[b     shift+up: ^[[a     ctrl+down: ^[Ob     ctrl+up: ^[Oa     tab: |       | (tab)      > I'm trying to narrow down things because I think you might have some sort of > mapping on "ctrl+shift" in xcompose or something. Not that I'm aware of, but you never know. > What is the output of xev when you press "ctrl+shift+tab, enter"?               KeyPress event, serial 32, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311734869, (567,395), root:(567,411),         state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311734971, (567,395), root:(567,411),         state 0x4, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311736110, (567,395), root:(567,411),         state 0x5, keycode 23 (keysym 0xfe20, ISO_Left_Tab), same_screen YES,         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311736494, (567,395), root:(567,411),         state 0x5, keycode 23 (keysym 0xfe20, ISO_Left_Tab), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311736525, (567,395), root:(567,411),         state 0x5, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          KeyRelease event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311736525, (567,395), root:(567,411),         state 0x4, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,         XLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311737530, (567,395), root:(567,411),         state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,     "   XLookupString gives 1 bytes: (0d) "     "   XmbLookupString gives 1 bytes: (0d) "         XFilterEvent returns: False          KeyRelease event, serial 35, synthetic NO, window 0x4800001,         root 0xb4, subw 0x0, time 311737633, (567,395), root:(567,411),         state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,     "   XLookupString gives 1 bytes: (0d) "         XFilterEvent returns: False


title: How can I remove all my docker images?

text: Sometimes I just want to clear everything out of docker, and start with a clean slate. Is there a systematic way to just remove all my Docker containers & images? ### Containers               $ docker ps -a | head     CONTAINER ID        IMAGE                COMMAND                CREATED             STATUS                     PORTS               NAMES     7b055e9e5f1f        fedora:latest        /bin/sh                6 days ago          Exited (0) 6 days ago                          ecstatic_colden             40da968258eb        fedora:latest        /bin/sh                6 days ago          Exited (127) 6 days ago                        naughty_thompson            5be4581afad6        fedora:latest        /bin/bash              6 days ago          Exited (0) 6 days ago                          kickass_wright              4d6c33d4be6d        fedora:latest        /bin/bash              6 days ago          Exited (0) 6 days ago                          furious_fermat              db7a29bdbc2d        fedora:latest        /bin/bash              6 days ago          Exited (0) 6 days ago                          mad_hawking                 e6b7365690ce        fedora:latest        /bin/bash              6 days ago          Exited (0) 6 days ago                          trusting_ardinghelli        15655c21fcd3        8018e08e6a58         /bin/sh -c 'apt-get    3 weeks ago         Exited (100) 3 weeks ago                       drunk_bardeen               607547aabbca        f02ed0c206d5         /bin/sh -c 'apt-get    3 weeks ago         Exited (100) 3 weeks ago                       cocky_franklin              f031f28bd29a        f02ed0c206d5         /bin/sh -c 'apt-get    3 weeks ago         Exited (100) 3 weeks ago                       stoic_mcclintock            ### Images               $ docker images -a | head     REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE     docker              master              266a5746d179        2 weeks ago         1.528 GB     <none>              <none>              c1f6a4b1345c        3 weeks ago         1.526 GB     <none>              <none>              6558c36ecb3f        3 weeks ago         1.526 GB     <none>              <none>              b1b7c7a6b6a7        3 weeks ago         1.24 GB     <none>              <none>              0bf9d6bf97e9        3 weeks ago         1.182 GB     <none>              <none>              48c444f1d2e7        3 weeks ago         1.182 GB     <none>              <none>              5c5c172a0038        3 weeks ago         1.182 GB     <none>              <none>              de5e09bb86c1        3 weeks ago         1.182 GB     <none>              <none>              785aaf265f18        3 weeks ago         1.182 GB


title: changing current working dir with a script

text: I've read this question and answer, but it doesn't quit fit my problem, even tho it's similar. I'm writing a script (called cpj) that will launch one of my current projects. I have about 5 of them. When I type `$ cpj blah` I want the current working directory to change to the blah project directory (which I hold in $PROJDIR) and I want emacsclient to open the main file for that project (which I hold in $MAINFILE). The question I cited says that you can't directly change the environment of the shell running the script, but you can source a script and it will do so. To test this I wrote a shell script (called chcwd) which has one line: `cd $1` If, from the command line I do: `$ . chcwd $PROJDIR` my current working directory will change as I desire. If, on the other hand, from my cpj script, I have the same line: `. chcwd $PROJECT` it will not change the current working directory of the shell. I realize that I'm running 2 scripts (cpj and then chcwd), and so creating 2 shells, but I see no way to get done what I want. Can anyone show me how to accomplish my goal?


title: I want to suppress "no access to tty" error message?

text: I have a bash script where I use `ssh` to connect to another server and run some commands there. I found some sites that the error (`Warning: no access to tty (Bad file descriptor). Thus no job control in this shell.`) is a friendly message but my bash script gets "stuck". No other commands are executed after this message appears. Other forums said to use `ssh -t` to suppress the message but its not working for me. My code looks something like this:               .     .     .     stty -echo     sshpass "pwd" ssh -o StrictHostKeyChecking=no usr@1.1.1.1 'su -lc "rm -rf tmp"' 2>/dev/null     stty echo     .     .     .      The reason why I'm using `stty-echo` is because I need to switch users to root and the password is displayed on the terminal (which I don't want). I get the error message (`Warning: no access to tty (Bad file descriptor). Thus no job control in this shell.`) after I enter the password for root on the connect server (ip: 1.1.1.1). Any suggestions? Let me know if further explanation is required. Thanks! (My version of bash is GNU bash version 3.2.51(1)) **EDIT** The error message I get when removing `2>/dev/null` is:               Warning: no access to tty (Bad file descriptor).     Thus no job control in this shell.      stty: standard input: Invalid argument


title: Clone installed system by using the hardware RAID 0+1 synchronization

text: **Alright, following setup:**   * 2 identical machines (DELL Power Edge T320) with a hardware raid.   * one machine is running for a while now, one machine hasn't even been set up at all   * The running machine has a RAID 0+1. 4 disks (4TB each) in total all together **The task:**   * cloning the running machine with everything on there and everything like it is configured on the second machine. They will be used at two different locations but need exactly the same system and data to start from. The state, the running system is in should be used as this desired state and we want to have the complete system on the second machine as well. **The idea:**   * checking the raid to be syncronized on machine 1   * once it's syncronized, exchanging two hard drives (e.g. 1 and 3) with two empty ones   * waiting until they are syncronized again   * exchanging another two harddrives (e.g. 0 and 2) with another two empty ones   * waiting until they are syncronized again   * putting the 4 original harddrives back in machine 1   * putting the 4 copied (via RAID) harddrives in machine 2 and have a cloned copy of machine 1 on machine 2 That would you say to such idea? Thanks!


title: python error using an executable with Z shell

text: I'm getting this error from the Unix Z shell (I'm on Mac):               python: posix_spawn: /System/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: No such file or directory      What am I doing? I'm just running a software in which I put my executable python script. My script is working without any issue, I can also run it from the shell by itself and still works. I have to mention I'm using Python 2.7, even when I launch Python from the shell it starts with Python 2.7 and not the Version2.6. I actually tried to remove Python 2.6 from the Frameworks but again the same error. Putting `python2.7 sreloc.py` as a line (instead of just `sreloc.py`) for example (this is a piece of the big code where my script lies):               do        $inv        python2.7 sreloc.py        $fmm>$diagnos        cp $ttim $mtrav      the error I'm getting is:               /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'sreloc.py': [Errno 2] No such file or directory      I'm really interested in solving this last problem, or anyway being able to run sreloc.py as a part of the main code, but any idea about the first one would be appreciated. Cheers


title: Best way to download dropbox folders to raspberry Pi

text: I'm trying to sync some folders to raspberry Pi. For now, I have a script that gets the dropbox folders using curl that runs every so often using `cron` (once every hour for most of the folders). I'm wondering if there are any better solutions (perhaps that check if the folder has changed since the past sync). I'm running a very lightweight Arch distribution and I don't want to install the official dropbox app (which I'm not even sure will work on arm), because it has a lot of prerequisites.


title: full-featured WLAN USB adaptor

text: I am searching for a WLAN USB adaptor that can be used as an Access Point as well as a mere client and in an AdHoc setup. It should support IEEE 802.11n and transmit rather fast (300Mbps). As I compile custom kernels for my machines, the driver should come as part of the current kernel (3.7.1 at the time of writing) and does not need to be built externally. If possible, I would even like to avoid installing external firmware. Driver and hardware should support power saving mode. Currently, I am using the AVM Fritz Wlan Stick N which has nearly all the features but under load crashes every few minutes and has to be restarted. So stability is also a requirement. Does such a wondrous device exist?


title: Reserved characters in file names

text: I was under the impression that the only character not allowed in file names was `/`, but I don't seem to be able to create a file whose name contains characters such as `*`, `\`, `"`, `:`, `|`, `<` or `>` either. For instance,               $ echo "*"     > *     $ touch "*"     > touch: setting times of `*': No such file or directory      I'm writing a shell script that requires the user to type a file name and I would like to make sure the name doesn't have any invalid characters. Is there a list somewhere? **Update:** I didn't realise I was doing this in a FAT32 filesystem (USB stick), which does not allow `*' and other characters in file names. No wonder it didn't work. Sorry, my bad!!


title: Is it possible to lock bad bits in RAM on Linux?

text: Recently I bought 8 GB of RAM and it has bad bits. Is it possible to lock the bad bits to make Linux avoid them?


title: Open a window on a remote X display (why "Cannot open display")?

text: Once upon a time,               DISPLAY=:0.0 totem /path/to/movie.avi      after ssh 'ing into my desktop from my laptop would cause totem to play `movie.avi` on my desktop. Now it gives the error: > >     No protocol specified >     Cannot open display: >   I reinstalled Debian squeeze when it went stable on both computers, and I guess I broke the config. I've googled on this, and cannot for the life of me figure out what I'm supposed to be doing. (VLC has an HTTP interface that works, but it isn't as convenient as ssh.)


title: How to start X program on local display?

text: I'm ssh-ing into a Raspberry Pi. I would like to start an X program remotely, on the Pi's display. I know you can `export DISPLAY` to have programs open up on your computer when you ssh-in. But I'm looking for the opposite. What I'd like to have is have a program open up on the Pi's own (HDMI connected) display, when I run a command from ssh. What I'm looking for is to have a program run on the Pi and display it on the Pi. Pretty much I'd like to just remote control the Pi, using my desktop's keyboard. I'm on Raspbian / Deb Wheezy.


title: Script executed from cron doesn't display GUI notifications

text: The script below has the name **notifyrssh.sh**.               1:  File=/home/vaios/Desktop/tempcron/liveusers.txt    //OK     2:  cd /home/vaios/Desktop/tempcron                          3:  ps -aux | grep sshd > liveusers.txt                //OK file is being updated      4:                                                     //   every minute      5:  for name in gus tom max    //***crontab-problem***                              6:  do     7:     notify-send "$name" "DEBUG_MSG"     8:     if grep -q $name "$File"; then     9:             notify-send  "$name" "ONLINE"     10:    fi     11: done      The above script is being run in crontab. I open crontab list with :               crontab -e      And then i add the line :               * * * * * bash /home/vaios/Desktop/tempcron/notifyrssh.sh      **Execution from shell prompt** The script seems to be executing fine when i run it regularly from the shell prompt. Being in the directory where the executable script is, i execute it like this :               ./notifyrssh.sh      ...and it works as i expect (updates the file liveusers.txt and gives me all the notification messages) . I again execute it like this :               bash /home/vaios/Desktop/tempcron/notifyrssh.sh      ...and again the results are correct (update file liveusers.txt etc and gives me the notification messages). **Execution from crontab, every minute** The problem when the script is being executed every minute by crontab begins from **line 5** and onwards until the end. The file **liveusers.txt** is being updated regularly every minute (I check this with : cat liveusers.txt) but then it doesn't give me the notifications i expect. Let me explain what the above script actually does:   * In the first 3 lines it updates the file liveusers.txt with the contents of the command : ps aux | grep sshd   * From line 5 onwards it checks a list of names ( **gus tom max** ) and then if it finds the name in the file liveusers.txt it gives me the notification message from line 9.    * The notification message from line 7 is being put for debugging purposes exclusively. I expected that crontab script will give me at least the notofication from line 7 but that didn't happen also. Any ideas?


title: Calling xrandr via SSH

text: > **Possible Duplicate:**   >  Open a window on a remote X display (why "Cannot open display")? I'd like to ssh to a host running an X server and use `xrandr` to query and update things related to that host's display. I don't forward X connections (no `-X`), but `xrandr` keeps saying it can't find the display. Invoked locally on that host, `xrandr` works as intended. How do I make `xrandr` ignore the fact that I'm logged in remotely, and just operate on the host on which it is running?


title: Notify-send not working when run from apache

text: I have the following script (`alert.sh)` which has been setuid'd:               DISPLAY=:0.0 notify-send --urgency=low -i python "The job has finished"      and the following PHP file `alert.php`:               <?php     echo exec("/path/to/alert.sh")      When I `su` to `www-data` and run `php alert.php`, I get an alert on my screen. All good. However, when I open `alert.php` in the browser, nothing happens. I suspect some environment variable needs to be set, but I'm not sure which.


title: How to access X display from a cron job when using gdm3?

text: > **Possible Duplicate:**   >  Open a window on a remote X display (why "Cannot open display")? I'm trying to run a cron job that needs access to my X session. I know my X session will always be :0, so part of it is easy:               /30 * * * * DISPLAY=:0 command      but the problem is that gdm3 no longer uses `$HOME/.Xauthority`; instead it uses `/var/run/gdm3/auth-for-anthony-XXXXXX/database` where the X's change each login. Other than symlinking `$HOME/.Xauthority` to the GDM3 file each login (or editing crontab each login, etc—automatically in `.xsession` of course), is there some way to get the cron job working?


title: Xlib: No protocol specified

text: > **Possible Duplicate:**   >  Open a window on a remote X display (why "Cannot open display")? I have a script that when run independently works that needs X11 Display variables to be set. When I invoke this script using a background daemon job, I get the following error.   `Xlib: connection to "localhost.localdomain:0.0" refused by server`   `Xlib: No protocol specified`   Please help me identifying the possible mistake that I have in this.   Commands given below which is inside the script.   `export DISPLAY=`hostname`:0.0`   `java ScreenCapture`   If the same script is invoked by a background daemon running as a service, I get the error.


title: unable to forward X11 applications

text: I installed a headless Debian server which has Wireshark installed. Now I would like to run Wireshark in a way that it uses X11 server running in my Linux Mint laptop. As a first step I permitted X11 forwarding in Debian SSH server configuration file:               root@A58:~# grep X11Forwarding /etc/ssh/sshd_config      X11Forwarding yes     root@A58:~#       Then I restarted SSH server with `/etc/init.d/ssh restart` and finally executed SSH client in my laptop using `-X` which enabled X11 forwarding. However, I still receive the "cannot open display" error:               root@A58:~# echo "$DISPLAY"     localhost:11.0     root@A58:~# wireshark           (wireshark:3590): Gtk-WARNING **: cannot open display: localhost:11.0     root@A58:~# time xterm     Warning: This program is an suid-root program or is being run by the root user.     The full text of the error or warning message cannot be safely formatted     in this environment. You may get a more descriptive message by running the     program as a non-root user or by removing the suid bit on the executable.     xterm: Xt error: Can't open display: %s          real    1m3.131s     user    0m0.000s     sys 0m0.000s     root@A58:~#      Is the "$DISPLAY" variable correct? At the moment it's pointing to Debian server.. If the "$DISPLAY" variable is correct, then it's probably an authorization issue with X11 server? EDIT: if it helps, then X11 in laptop is started in following manner:               root      1113  0.1  4.3 101396 89992 tty7     Rs+   2013  44:28 /usr/bin/X :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-FHVC1j/database -nolisten tcp vt7


title: Is there a way to get the Public DNS address of an instance?

text: I have a project wherein I need to update configuration files each time an EC2 instance is booted with the Public DNS address of the current instance. I'll be using Perl or Sed for this, so that's not really the question, but the real question is: is there a way that I can determine the instance's public DNS address? Is there an EC2 api that I can access from the instance to determine it?


title: Can a service script put inside init.d be called at startup and shutdown?

text: I'm running Red Hat 5.1. I have a script called sysinit that I added as a service using chkconfig --add sysinit. I have the following set in the file:               #chkconfig 4 01 01      This creates one symlink in my rc4.d directory for S01sysinit. However, I want the script to be run on startup and shutdown. No matter what I do, I cannot get a custom script (Service) to run on shutdown. I even tried separating out my functionality into two scripts, one to run at S01 and the other to run at K01 but it didn't work. I don't want to have to resort to modifying the rc.sysinit file to do what my script should be doing (I shouldn't have to touch that I would think). The reason I need to do this is because I need to unmount a samba share inside the /opt directory before the rc.sysinit file tries to unmount the /opt directory (right now I get "device is busy" failures because the cifs mount is still there). Is there something special I need to do so that my script can run on startup and on shutdown and reboot? Can I have a K01sysinit and S01sysinit in the same run level? Or am I misunderstanding how run levels work? I have the sections for )start and )stop already in the script.


title: How to install backtrack 5 onto a USB that doesnt mount with existing OS

text: I believe the title states what im mostly asking but here's the specs. Sandisk Cruzer 4GB USB 2.0 Existing OS: Windows Xp Professional SP3 Hardware: Intel Pentinium 4 Xeon Class (x86 F15 M2 S4) [1.8Ghz] IBM Thinkpad T-Series T30 So what I am wanting to do is, Put backtrack onto the usb and run it like the usb was a hard drive. This way it doesnt affect the physical machine and doesnt erase the current OS. Is there a way of doing this?


title: Error while loading shared libraries after installing a program

text: I was installing rfc5766-turn-server. But it fails to launch with an error: `error while loading shared libraries: libevent_core-2.0.so.5: cannot open shared object file: No such file or directory` Here's a copy-paste of how I did the installation:               $ cd /var/tmp;     wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz; tar xvfz libevent-2.0.21-stable.tar.gz; cd libevent-2.0.21-stable; ./configure; make; make install;     wget http://rfc5766-turn-server.googlecode.com/files/turnserver-1.8.6.3.tar.gz ; tar xvfz turnserver-1.8.6.3.tar.gz; cd turnserver-1.8.6.3; ./configure; make; make install;     /var/tmp/turnserver-1.8.6.3/bin/turnserver;      I tried this, but it didn't help (same error):               $ ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5;     /var/tmp/turnserver-1.8.6.3/bin/turnserver ;      **EDIT:** (without changes if i run as below it runs it, but when i test with client it does not show any kind of logs that TURN is hitting or reached by client)               $ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/;      PATH="bin:../bin:../../bin:${PATH}" turnserver -L 176.34.x.x -a -b /usr/local/etc/turnuserdb.conf -f -r 176.34.x.x     1371111272: RFC 5389/5766/5780/6062/6156 STUN/TURN Server, version Citrix-1.8.6.3 'Black Dow'     1371111272: Config file found: /usr/local/etc/turnserver.conf     1371111272: Listener address to use: 176.34.x.x     1371111272: Config file found: /usr/local/etc/turnserver.conf     1371111272: WARNING: cannot find certificate file: turn_server_cert.pem (1)     1371111272: WARNING: cannot start TLS and DTLS listeners because certificate file is not set properly     1371111272: WARNING: cannot find private key file: turn_server_pkey.pem (1)     1371111272: WARNING: cannot start TLS and DTLS listeners because private key file is not set properly     1371111272: Relay address to use: 176.34.x.x     1371111272: IO method (listener thread): epoll     1371111272: WARNING: I cannot start alternative services of RFC 5780 because only one IP address is provided     1371111272: IO method: epoll     1371111272: IPv4. UDP listener opened on : 0.0.0.0:0     1371111272: IPv4. TCP listener opened on : 0.0.0.0:39227     1371111272: IO method (auth thread): epoll     1371111272: IO method (relay thread): epoll


title: Entries I can safely exclude doing backups

text: I'm planning a backup strategy based on rsnapshot. I want to do a full system backup excluding files and directories that would be useless for the restore to have a working system again. I already excluded:               # System:     exclude /dev/*     exclude /proc/*     exclude /sys/*     exclude /tmp/*     exclude /run/*     exclude /mnt/*     exclude /media/*     exclude /lost+found          # Application:     exclude /*.pyc     exclude /*.pyo      I wonder which other entries I can add to the exclude list without compromising the restored system. Talking about a "generic" Linux system, can you suggest further glob extensions, temporary directories, caches, etc. I can exclude safely?


title: Recovering files from partition (ext4)

text: a part of out homework assignment is to recover deleted files from the partition with the ext4 file system. I've tried using the extundelete tool, by following this tutorial. The tool recovered a lot of files, which couldn't be opened, so I guess this doesn't do me any good. Is there any other tool I could try, to recover the deleted files, or is this tool the best there is? I didn't write anything to the partition, before the recovery process, and I recovered the files to another partition.


title: Is there an all-in-one command for RPM to downgrade a package to an older version?

text: I want to downgrade a couple RPMs. Is there a switch combination for that? For example, when upgrading, I usually run `rpm -Uvh foo.rpm` but my understanding is that the `-U` switch means that it only replace the package if it's older... so it won't work for downgrades.


title: Kernel panic in Fedora 18 after updating to kernel-3.9

text: I'm really a beginner in Linux, I've installed Fedora 18 and did `yum update` to update my system. I got a bunch of updates (around 350 MB download), among them is `kernel-3.9.4-200.fc18.x86_64`. Now, when I boot my system to the new added boot entry with the new kernel I get the following kernel panic message: ![enter image description here](http://i.stack.imgur.com/3hqPj.jpg) I tried to remove the kernel by:               yum remove kernel-3.9.4-200.fc18.x86_64      Then reboot and do another update:               yum update      The kernel is re-installed but is still getting that kernel panic message. How can I fix this?


title: Text to yaml conversion

text: I have a tab separated text file in this format:               your-email  your-order-id   PayPal-transaction-id   your-first-name your-second-name     s@ess.com   12345   54321   sooky   spooky     t@tee.com   23456   23456   kiki    dee     r@arrgh.com 34567   76543   cheeky  chappy      and I'd like to use awk to convert this to yaml:               ---          your-email: s@ess.com     your-order-id: 12345     PayPal-transaction-id: 54321     your-first-name: sooky     your-second-name: spooky          your-email: t@tee.com     your-order-id: 23456     PayPal-transaction-id: 23456     your-first-name: kiki     your-second-name: dee          your-email: r@arrgh.com     your-order-id: 34567     PayPal-transaction-id: 76543     your-first-name: cheeky     your-second-name: chappy      So far my awk script looks like this               #!/usr/bin/awk     FS=="\t"     BEGIN {print "---"}      NR==1 {for (i=1;i<=NF;i++) print $i ": "}      But I can't figure out how to get each field from line 1 onwards to print after it's header and then recreate the yaml key values from the first line of the input file. In the real file there are 38 fields and 34 records (so not huge).


title: What are commands to find shell keywords, built in functions and user defined functions?

text: I was discussing with my friend on how the commands are parsed in the shell, and he told me that bash searches the command in following order   1. List of aliases    2. List of shell keywords    3. List of user defined functions    4. List of shell built in functions    5. List of directories specified in the PATH variable , from left to right. I know aliases can be found by issuing the `alias` command. PATH variable contents can be found using `echo $PATH` command. Can you please tell me which commands do I need to use ?   1. To list all shell keywords    2. To list all user defined functions    3. To list of shell built in functions


title: rsync and SMB share

text: If I'm performing an `rsync` copy operation on a file that is on an SMB (Samba) share, is the file actually being pulled down from the network onto my client, pieces at a time, and then copied back onto the share? I'm seeing file copy commands with `rsyn`c topping out at around 10 MB/s, which seems quite slow considering the enterprise storage this mount is on. Specifically I'm invoking rsync via Python.


title: Contentless modal windows on RHEL Gnome

text: I'm a Linux newbie, so please be understanding if I mix terminology. I've got a pc with RHEL 6.4 installed. I'm using Gnome for my GUI and frequently I'm having a problem with modal windows displaying without content (but with shadow). I have to hover over the active (that can be clicked or hovered over) items to see what's there. Excellent example is Network connections: ![enter image description here](http://i.stack.imgur.com/sGlnX.jpg) Although it doesn't happen often, it's happens frequently enough to be terribly annoying. What can I do to make this issue go away? I know I have Compiz installed. Ask questions if you need more details.


title: Relative line offsets in awk (/pattern/+1 or /pattern/-1)

text: When I want to print lines between two patterns, excluding the lines with those patterns, I can do it in `ex` using `+1` and `-1` after the pattern. That is awesome. Is this possible in `awk`? Right now, I kludge it by setting an `is_printing` flag. This is `ex` to get the column definitions from an SQL table creation:               $ ex schema/media.sql <<< '/^CREATE TABLE/+1,/^)/-1p'     #        id     #                SMALLINT     #                UNSIGNED     #                NOT NULL     #                AUTO_INCREMENT     #                COMMENT 'The auto-generated ID.',     #        parent_id     #                SMALLINT     #                UNSIGNED     #                NULL     #                COMMENT 'The ID of the parent album, if any.',     #        title     #                VARCHAR(255)     #                COLLATE utf8_unicode_ci     #                NOT NULL     #                DEFAULT ''     #                COMMENT 'The album title.',     #        description     #                TEXT     #                COLLATE utf8_unicode_ci     #                NOT NULL     #                COMMENT 'The album''s description.',      This is an `awk` command to do the same:               $ awk '/^\)/ { exit; } is_printing; /^CREATE TABLE/ { is_printing = 1; }' schema/media.sql      I find the awk version not as readable. Is there an idiom I am missing? Can `sed` do something like this, too? (I prefer `awk`'s syntax over `sed`'s.)