title: strange "bad file descriptor" error

text: I've run into a perplexing error that I'd like to understand better. The problem seems to require the presence of a "wrapper" shell function (as described below), so my immediate interest is to find out how to modify such a shell function to get rid of the error. (I give a more specific statement of my question at the end of the post.) The simplest code that I've come up with to reproduce this error is given in the following script. (This script is certainly artificial and silly, but the real-life situation in which the error first surfaced is a bit too complicated for a demonstration like this one.)               # create an input file     cat <<EOF > demo.txt     a     b     c     EOF          # create a "wrapper shell function" for /usr/bin/join     my_join_fn () {       /usr/bin/join "$@"     }     cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt))     cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1          # create a "wrapper shell function" for /usr/local/bin/gjoin, a port of     # GNU's join function for OS X     my_gjoin_fn () {       /usr/local/bin/gjoin "$@"     }     cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt))     cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1          # show the version of zsh     $SHELL --version      If one sources this script (under `zsh`), it terminates successfully, and produces the following (correct) output:               % source demo.sh     a     b     c     a     a     b     c     a     zsh 5.0.2 (x86_64-apple-darwin11.4.2)      But if one then re-executes _directly from the command line_ either one of the two lines in the script that end with `| head -1`, one gets a `bad file descriptor` error:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1     join: /dev/fd/11: Bad file descriptor     % cat <(my_gjoin_fn <(cat demo.txt) <(cat demo.txt)) | head -1     /usr/local/bin/gjoin: /dev/fd/11: Bad file descriptor      _These are the only two lines in the script that produce an error when run directly on the command line._ As indicated in the output of `$SHELL --version`, the results shown above were obtained under OS X, but I get similar results when I perform an analogous test under Linux:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | head -1     /usr/bin/join: /proc/self/fd/11: No such file or directory     % $SHELL --version     zsh 4.3.10 (x86_64-unknown-linux-gnu)      * * * I have not been able to reproduce this error under `bash` (OS X or Linux). This leads me to suspect that the error is due to a bug in `zsh`. But, if so, it is an extremely arcane bug, and thus not likely to be fixed any time soon. Therefore, I'd like to find a workaround. My question is: > How should I modify the definition of the wrapper shell function > `my_gjoin_fn` so as to avoid this error? (The real-life counterpart for `my_gjoin_fn` is almost identical to the one given above, differing only in the inclusion of a flag in the invocation of `gjoin`:               my_gjoin_fn () {       /usr/local/bin/gjoin -t$'\t' "$@"     }      I use this wrapper shell function _all the time_ , therefore I'd really like to "salvage" it.) EDIT: The error persists even if I replace the `| head -1` at the end of the command with `| head -10`, `| cat`, `| tee /dev/null`, `| :`, etc. E.g.:               % cat <(my_join_fn  <(cat demo.txt) <(cat demo.txt)) | cat     /usr/bin/join: /proc/self/fd/11: No such file or directory      Also, adding `ls -l /proc/self/fd`, as suggested by msw, produces the following:               % cat <(ls -l /proc/self/fd; my_join_fn  <(cat demo.txt) <(cat demo.txt)) | cat     total 0     lrwx------ 1 jones jones 64 Aug 21 12:29 0 -> /dev/pts/18     l-wx------ 1 jones jones 64 Aug 21 12:29 1 -> pipe:[312539706]     lrwx------ 1 jones jones 64 Aug 21 12:29 2 -> /dev/pts/18     lr-x------ 1 jones jones 64 Aug 21 12:29 3 -> /proc/23849/fd     /usr/bin/join: /proc/self/fd/11: No such file or directory      ...which doesn't tell _me_ much, but may be more informative to others. FWIW, the output produced by the `ls -l /proc/self/fd` subcommand looks the same whether I run this under `zsh` or under `bash`. Also, FWIW, the output of `ls -l /proc/self/fd` when run by itself is               % ls -l /proc/self/fd     total 0     lrwx------ 1 jones jones 64 Aug 21 12:32 0 -> /dev/pts/18     lrwx------ 1 jones jones 64 Aug 21 12:32 1 -> /dev/pts/18     lrwx------ 1 jones jones 64 Aug 21 12:32 2 -> /dev/pts/18     lr-x------ 1 jones jones 64 Aug 21 12:32 3 -> /proc/5246/fd


title: Exclude paths that make find complain about permissions

text: I need to generate a file list from a disk volume. Some of the directories (all hidden directories under the root directory) have strange permissions that causes find to complain. I try to exclude all these paths, but one directory still complains:               find . -type f -not -path './.*/*'     find: ./.DocumentRevisions-V100: Permission denied      The rights are like this (set so by the operating system, so I assume they shouldn't be messed with).               d--x--x--x root  wheel   .DocumentRevisions-V100      How do I change the `find` statement to effectively omit all the hidden directories as to not complain. (I do not want to do `2>/dev/null` as I want to know about other problems).


title: Zsh script how to concatanate array elements with string

text: I have written a `zsh` script to automize an analysis in high energy physics and now I would like to use an element of the one of the defined array some string and another element of some another array in a command that is passed to one of the string. My code follows below:               bkgarr=(TopJets BosonJets DiBoson TTbar)     sigarr=(NM1 NM2 NM3 Scenario4 Scenario6)     puarr=(50PU 140PU)     lumarr=(30 300 3000)          echo Please type 1 for 50PU samples and 2 for 140PU samples     read PU     if [[ $PU -ne 1 && $PU -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          echo Please type 1 for 300fb-1 and 2 for 3000fb-1     read lum          if [[ $lum -ne 1 && $lum -ne 2 ]] ; then         echo You have to enter 1 or 2         return 1     fi          if [ $PU = 1 ]; then         let "lum = $lum + 1"         #echo $lum     fi          root -l << EOF     .L readerSummerStd.C+     .q     EOF          ex NEWrunReader.py  <<EOEX       :43s/Lumi.*/Lumi=$lumarr[lum]/       :x     EOEX          echo Press any key to proceed or Ctrl+C to abort!     read     for index in $bkgarr     do         screen -dmS $index"_"$lumarr[lum]         #screen -S $index -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S $index"_"$lumarr[lum] -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$index >& $index"_"$lumarr[lum].txt &"$'\r'     done     for sigind in $sigarr     do         screen -dmS $sigin"_"$lumarr[lum]         #screen -S $sigind -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'         screen -S $sigin"_"$lumarr[lum] -p 0 -X stuff "./NEWrunReader.py SummerStd $puarr[PU]_$sigind >& $sigind"_"$lumarr[lum].txt &"$'\r'     done     return 0      I thought the following code snippets would do, but they failed:               $index+"_"+$lumarr[lum]     $index"_"$lumarr[lum]      I would appreciate it if you could help me with this.


title: Different behavior of mktemp Ubuntu 12.02 / Mint 9 Isadora

text: In a bash script I use ImageMagick's convert command for doing some image processing. I generate a temporal gif file for convert to write to. I really need the file to have the .gif extension so convert knows that the destination file should be a gif file. In Ubuntu 12.04 the following works fine:               mktemp /tmp/pre_XXXXXXXXXX.gif      But in Mint 9 Isadora I get the following error:               mktemp: too few X's in template       No matter how many X's I give it, it gives the same error, which is only fixed when I delete the ".gif" suffix. **Why is that ? Isn't Mint based on Ubuntu ?**


title: Why does uucp take group 10?

text: According to YoLinux, group ID 10 typically belongs to wheel. And on my Arch Linux installation, sure enough there in `/etc/group` is wheel:10. However, on my Ubuntu machine instead I'm greeted with `uucp`. A quick search turns up the Ubuntu man page of uucp, which seems to have a different purpose. So why does `uucp` get that group ID? Can I replace it or should I just make wheel a different group ID instead?


title: Unable to delete file, even when running as root

text: I am in the process of migrating a machine from RHEL 4 to 5. Rather than actually do an upgrade we have created a new VM (both machines are in a cloud) and I am in the process of copying across data between the two. I have come across the following file, which I need to remove from the new machine but am unable to, even when running as root:               -rw-------  1 2003 2003  219 jan 11 14:22 .bash_history      This file is inside /home/USER/, where USER is the account of the guy who built the machine. He doesn't have an account on the old machine, so I am trying to remove his home folder so that the new machine tallies with the old one, but I get the following error:               rm: ne peut enlever `.bash_history': Opération non permise      (translated from the French: cannot remove XXX, operation not permitted) I have tried using the following command but this has made no difference:               chattr -i .bash_history      Is the only choice to create a user with the ID 2003, or is there another way around it? * * * # Edit I have tried using `rm -f`, and I get the same error. I get the same kind of error using `chmod 777` first. I have been able to `chown` the folder that contains the file I am trying to delete, so it is:               drwx------ 2 root root 1024 jan 24 15:58 USER      * * * # Edit2 Running the `lsattr` command as suggested by Angus gave the following output:               -----a------- USER/.bash_history     ------------- USER/..     ------------- USER/.      The file is flagged as append-only - on changing this flag using `chattr -a .bash_history` I was able to delete the file.


title: How to get vim to work with tmux properly?

text: I'm trying to figure out how to get `vim` and `tmux` play together. My problem is: When I use `xterm-256color` I get `vim` to work nicely, but the background doesn't render properly. I fixed this by using `screen-256color`. This looks nice but breaks the `Ctrl + arrow keys` (they go in insert mode and delete 4 lines). I want to use these mappings instead to switch tabs in `vim`. How do I get this to work?


title: Delete range of lines above pattern with sed (or awk)

text: I have the following code that will remove lines with the pattern `banana` and 2 lines after it:               sed '/banana/I,+2 d' file      So far, so good! But I need it to remove 2 lines **before** banana, but I can't get it with a `minus sign` or whatever (similar to what `grep -v -B2 banana file` should do but doesn't):               teresaejunior@localhost ~ > LC_ALL=C sed '-2,/banana/I d' file     sed: invalid option -- '2'     teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,-2 d' file     sed: -e expression #1, char 16: unexpected `,'     teresaejunior@localhost ~ > LC_ALL=C sed '/banana/I,2- d' file     sed: -e expression #1, char 17: unknown command: `-'


title: xargs -r0 vs xargs -0

text: I have seen examples on the web of `xargs` with the argument `-r0`. What does this argument mean? My man pages don't show any entries for -`r0` nor do most man pages I have seen (e.g. http://linux.die.net/man/1/xargs)


title: cp file device:directory on Minix

text: In my operating systems class we had to modify the boot screen of the Minix OS. I understood just about everything we did, but at the end of the make for compiling the new OS, there's a line:               cp image /dev/c0d0p0:/minix/2.0.4r2      I don't understand what the colon is for, can anybody explain this? I've searched all over with no luck.


title: Command substitution: file or command not found

text: The following script               #!/bin/bash     QUERY='select * from cdr;'     MYROWS=$("sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db '${QUERY}'")      gives me               ./bla.sh: row 35: sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;': file or directory not found      If I execute directly               sqlite3 -list -nullvalue NULL -separator ',' /var/log/asterisk/master.db 'select * from cdr;'      then it works. I guess there is some error with the quotes that can't be seen on the error message. Please note that I need the single quotes around               select * from cdr;      Thanks for any hint on what I am doing wrong!


title: online installer Qt for chessx on Centos 6.4 compile with qmake

text: Using `yum install qt` has installed `qt.i686 1:4.6.2-28.el6_5` to my `/usr/share` folder on Centos 6.5 but I need to follow these instructions to get chessx working: > To compile ChessX, you need Qt version 4.2.0 or above.   1. Compilation Compiling the source is simple. Execute: qmake and then make If the compilation is successful you should be able to run ChessX executable in bin subdirectory. It is called: chessx on Linux, chessx.app on Mac OS, chessx.exe on Windows   1. Problems If you have both Qt3 and Qt4 installed, verify that Qt4 is first on your path. You may check it, running: qmake -v But I don't know how to do the above exactly. chessx I have downloaded and installed in `/usr/local/games` as that seems logical to me.How do I set the path to make qmake work? Read "For simple projects, you only need to run qmake in the top level directory of your project." So the directory above chessx or qt4? NB: Since found out this is only to install locally where I was attempting to install remotely.


title: PS tags does not work

text: I run a ps command inside a startup script, if I put in:               ps -A -o euser,pid...      I get this output:               EUSER      PID CMD                         %CPU   RSS    SZ     ELAPSED      root       644 ./code                       0.0   996  2963       00:00      It's there each time. If I run:               ps -C ./code -o euser....      it does not display anything at all. Any suggestions?


title: How to stop XEmacs from teaching me that my keyboard settings are "bad"?

text: I've changed (using the keyboard layout options in Linux Mint 13) the keyboard layout as follows:   * The Caps Lock key is reconfigured as Compose key.   * Pressing both Shift keys at once toggles Caps Lock. Since both options are offered by the menus (no `xmodmap` or similar involved), I figure they should work fine, and indeed, I've never noticed any problems (including inside XEmacs), with one exception: Whenever I start XEmacs (version 21.4.22), I get an extra window (in the Emacs sense of "window") with the following text:               (1) (key-mapping/warning)          The meanings of the modifier bits Mod1 through Mod5 are determined         by the keysyms used to control those bits.  Mod1 does NOT always         mean Meta, although some non-ICCCM-compliant programs assume that.          (2) (key-mapping/warning)          The semantics of the modifier bits ModShift, ModLock, and ModControl         are predefined.  It does not make sense to assign ModControl to any         keysym other than Control_L or Control_R, or to assign any modifier         bits to the "control" keysyms other than ModControl.  You can't         turn a "control" key into a "meta" key (or vice versa) by simply         assigning the key a different modifier bit.  You must also make that         key generate an appropriate keysym (Control_L, Meta_L, etc).          (3) (key-mapping/warning) XEmacs:  Shift_L (0x32) generates ModLock, which is nonsensical.      Is there any way to tell XEmacs to stop teaching me that my keyboard settings are "bad"?


title: How do I find a tag that contains a commit?

text: I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.


title: Run one screensaver across multiple monitors

text: Is there a way to make `xscreensaver` run a single screen saver across the whole X display, ignoring Xinerama/XRANDR geometry? I have three monitors appearing as a single X screen on one X display. XRANDR provides information about where each physical monitor starts and ends on the single X screen. `xscreensaver` uses this to either run a different screen saver on each monitor, or to run the same screen saver three times, once for each monitor. I would like to change this so that only one screen saver is run, and it spans all three monitors (i.e. it takes up the entire X screen.) This way animations in the screen saver will be free to roam from one monitor to the next. Is this possible?


title: dd and rm -r commands

text: For me, the following commands do exactly the same thing:               dd if=/dev/zero of=/dev/sd1          dd if=/dev/null of=/dev/sd1          rm -r /dev/sd1/*      meaning, the result of their application is the same. Or least, that's true for the first and the third ones. Is this really the case?


title: how can I set yate to be my default tel: protocol handler?

text: On http://www.frigidaire.com/kitchen-appliances/ranges/ I clicked on the support link and a phone number popped up. It was formatted via the tel: protocol, and as such was underlined and highlighted like a web link. On my phone, clicking on such a link opens my default dialer and places the call. When links are not formatted via this protocol, my browser's Google voice plugin usually auto-detects the phone number and gives me a chance to call via Google voice. It would be nice if I could also do this for tel: formatted numbers, or better yet, as I don't always have a voice session open, set tel:formatted numbers be handled by `yate`. ### How can I fix my browser's handling of the `tel:` protocol links such that it opens in `yate` or google voice?   * In Chromium I get a warning saying that xdg-open will be used to handle the link, but when I click 'Launch Application' nothing happens.   * In Firefox, clicking on the link leads me to a blank page with the url tel:18003744432   * In Konqueror clicking on the link produces a "Access by untrusted page to tel:18003744432 denied." error I'm using Linux Mint 16 KDE x64


title: Redmine upgrade doesn't find mocha dependency

text: I've tried to upgrade my redmine 1.3.0 to 2.0.0 following these instructions. I am at step 3/6. In this step, I am trying to run the `rake generate_session_store` command, but I receive the following error: `Could not find gem 'mocha (= 0.12.3) ruby' in any of the gem sources listed in your Gemfile.` Do you have any idea how this can be solved?


title: Unmounting HTC device takes forever

text: Not sure if should post this on Android SE because I don't think this is directly related to the Android OS. On my system I manually `mount` and `umount` my HTC device with these options in `/etc/fstab`:               UUID=3465-3762 /mnt/htc auto gid=100,umask=002,noauto,user,rw,exec 0 0      This works fine when modifying small amounts of data on the SD card, but whenever I copy e.g. a couple of music albums encoded in FLAC from another device - unmounting the SD card seems to take forever:               $ time umount /mnt/htc/     real    1m17.195s     user    0m0.000s     sys     0m0.237s      Is this time proportional to the amount of data modified? Should it take this long to unmount it anyway?


title: add new language to /usr/share/dict/words

text: In this directory I have English dict and my language file, but where I can download other language? Or maybe you known other free dictionary? I need to make list of word that are not in the dictionary.


title: Why would a partition be in use by the system if it isn't mounted?

text: I've been migrating my system from btrfs to ext4 after running into performance issues with VMs. I have two hard drives in my laptop to work with. I've successfully moved my home partition, but the same steps I used aren't working for root. Progress so far: I've `dd`'d my root partition from `/dev/sda3` into `/dev/sdb3`. I modified `/etc/fstab` to the following:               $ cat /etc/fstab     #      # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>       <dump>  <pass>     # UUID=95f13c34-96ca-49e3-bcb2-ff594df31506     /dev/sdb3               /               btrfs           rw,noatime,ssd,space_cache,discard      0 0          # UUID=0fe04f59-599f-41e2-ac30-2ad0f17a9727     /dev/sda2               /boot           ext2            rw,relatime     0 2          # UUID=44741e0f-924a-4841-80ef-2132bef84182     /dev/sda4               /home           ext4            rw,noatime,discard      0 0      and run `sudo mkinitcpio -p linux`. It seems to work. I'm able to boot by mounting the partition on the second disk. `df` shows:               $ df     Filesystem      Size  Used Avail Use% Mounted on     /dev/sdb3        28G   18G  9.8G  65% /      So, clearly, `sdb3` is mounted, not `sda3`. Here's the problematic step: When I try to format `sda3`, which is supposedly unused, I get the following:               $ sudo mkfs.ext4 /dev/sda3     [sudo] password for stew:      mke2fs 1.42.11 (09-Jul-2014)     /dev/sda3 contains a btrfs file system     Proceed anyway? (y,n) y     /dev/sda3 is apparently in use by the system; will not make a filesystem here!      `sda3` is in use. How and why could it possibly be in use? ### As per casey's comment, the output of mount:               mount | grep sd     /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)      ### As per Warwick's comment, unmounting:               $ sudo umount /dev/sda3     umount: /dev/sda3: not mounted      Mounting and umounting sda3 elsewhere works successfully, but changes nothing. ### Update: More fishy behavior:               $ mount | grep sd     /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)     $ sudo mount /dev/sda3 mnt     [sudo] password for stew:      $ mount | grep sd     /dev/sda3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)     /dev/sda3 on /home/stew/mnt type btrfs (rw,relatime,ssd,discard,space_cache)      After mounting sda3, sdb3 is no longer mounter. Weird, huh? ### As per mikeserv:               $ rmmod btrfs     rmmod: ERROR: Module btrfs is in use      This is very much expected, since sdb3 is btrfs and supposed to be mounted to root. From my mkinitcpio.conf file:               MODULES=""     HOOKS="base udev autodetect modconf block filesystems keyboard fsck"


title: Youtube Videos become Choppy When Maximised [Ubuntu Maverick]

text: I just installed 32-bit Ubuntu Maverick 10 Stable everything is working fine, The system spec's are as below: 3 Ghz Intel DG101 512 MB RAM 80 GB HDD 256 MB Ati Radeon Xpress the only problem is when the Youtube videos are maximized they consume allot of CPU plus video bacomes slower and choppy..... What to do? I have FireFox and installed the FlashPlayer 10 also. But no luck...Any Ideas how to fix? The videos work absolutely good in XP in same computer..... I have tried Google Chrome also but no luck in that also.... Any answer 'll be appreciated.


title: Disabling sentbox in postfix over Squirrelmail

text: I have installed **POSTFIX** over `Squirrelmail` on CentOS Linux... The services I have ran are:               service httpd     service ssl     service mysql     service postfix     service saslauthd     service dovecot      But I want to know : How can I send mail but nothing go to my sentbox?


title: How do I make sure that a script is run exclusively?

text: So I have a bash scripts that does some things (pull from github, delete folders .. etc ..) pretty basic stuff. I usually run it whenever I need a new version of the web app on the server. The thing is there isn't anything that stopping this script from running simultaneously by different people (almost all developers connect to this server and they execute the same command). So far, it didn't happen that the script is run by more than 1 developer at a time. How do I make sure that this script cannot be run if it's already running by another user? Folder locking or checking if the script is running by another user (is this doable?) something else? All users that can run this script are sudoers. EDIT: Well after checking my colleagues turns out that not all of them are using the script .. some of them are executing the commands by hand so I need to lock the folder itself.


title: lockfile-progs utilities usage

text: **There isanother question that is related, but it is actually different, because I'm asking why the behavior of lockfile-create & lockfile-touch is different to the current contents of the manual page.** I have this script to learn and understand the lockfile-progs utilities. I've tested it and works good. But, I find the lines related to lockfile-touch unnecessary. My script only needs to launch one xterm instance on one machine per user. I will do the right thing removing the lockfile-touch lines? Someone knows if I will have some trouble with the modified script?               #!/bin/bash          function atexit {         kill $LOCKFILE_TOUCH_PID         lockfile-remove $DOTLOCK_FILENAME         echo atexit!         exit     }          DOTLOCK_FILENAME=/tmp/xterm-one-instance-$UID     lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit          lockfile-touch $DOTLOCK_FILENAME & LOCKFILE_TOUCH_PID=$!     echo lockfile-touch running, PID=$LOCKFILE_TOUCH_PID          trap atexit EXIT HUP INT TERM     xterm      My modified script:               #!/bin/bash          function atexit {         lockfile-remove $DOTLOCK_FILENAME         echo atexit!         exit     }          DOTLOCK_FILENAME=/tmp/xterm-one-instance-$UID     lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit          trap atexit EXIT HUP INT TERM     xterm      still prevents another xterm instance after 5m 33s. I found this behavior confusing after reading in the manual page that I need touch the lock file every five minutes.


title: Extend Linux partition in Dual boot with Windows without losing data?

text: I've the following partitions on my hard drive (copied from Gparted): ![](http://i.stack.imgur.com/6thI1.png) As you can see:   * **ext4 Linux HOME** partition   * THEN ==> **windows (8.1) ntfs** partition    * THEN ==> **178 GB of UNUSED space** (I got it by resizing **from the end** ntfs partition) The problem here is that it seems **I can't free space BEFORE ntfs partition** to make free space to **extend ext4 home partition** because this would mean moving ntfs start sector, i.e. , (maybe?) corrupt Windows boot. Any suggestion? How should I do to pass from the situation shown in the image above to ext4 partition with about 100 GB space?


title: Debian - Docky compiz settings?

text: I really like Docky and I wanted that genie 'magic lamp' effect. So I Googled it and it said I needed Compiz settings and to install it I did               $ sudo apt-get install compizconfig-settings-manager      it wasn't found so I did some more researching and I can't find it. The closest thing I can find to something compiz was compiz-fusion something. I tried it and it was not it. So does anybody know where I can get this package? I'm running Crunchbang.


title: Embedded Linux Power Failure Issues

text: Many routers run a Linux OS and abrupt power failure can happen. Considering this - how do they handle the possibility of file system corruption caused by a power failure? If they make the system read only, how are you able to change settings?


title: Debian 6 installation DVD required

text: I just want to install the operating system and SSH printserver . I just burned the first DVD of the 8 avaible for the amd64 architecture. How many DVDs should i burn in order the operating system to install ? Note: Connection is slow as hell that is why i choose DVD solution


title: awk expand window to 500% for two numbers from column file

text: I've got a file with two columns corresponding to start-end ranges like this:               awk '{print $2"-"$3}' file.txt     91082802-91082990     94018177-94018321     146945732-146945949     88701397-88701594     80922510-80922643     28800551-28800680     23612818-23613016     69178478-69178630     107524531-107524669     73153734-73154149     [...]      I would like to expand the start-end ranges to up to 500%, except if the range goes beyond a certain value, N=1000. If the start-end range is already above N=1000, I want to rewrite the start-end to a n=1000 window around the centre. How can I do that with an awk/bash one-liner?


title: How to set MSS manually for IPv6 in Linux?

text: Suppose I have a networking problem and try to debug it by setting the MSS manually to ex.: 1392. How can I achieve this permanently? I have a native IPv6 address. OS is Debian/CentOS


title: How to correctly integrate FreeRadius and eDirectory for eduroam?

text: Does anyone have any experience implementing `eduroam` and integrating `Free- Radius` and `eDirectory`? If yes pleas share your experience on how to correctly configure both. Also, do I have to retrieve `edirectory` universal user password in clear text, in order to make it compatible with **EAP-PEAP MSCHAP2** and **EAP-TTLS MSCHAP2**? I've looked up numerous forums and wikis, but would like to hear from someone's personal experience.


title: How to start line with command from output of another command

text: Sometimes the output of some command include other commands. And I'd like to start that command from output without using a mouse. For example, when command is not installed there is a message with line for installing this command:               $ htop     The program 'htop' is currently not installed. You can install it by typing:     sudo apt-get install htop      So. There I'd like to type a command, that will start the command from last line from output of `htop`. How it can be done? _**Edit:_** I'll try show what I mean. There are two lines in "output" of command `htop` (actually, it's an error message). Second line of this message is the command `sudo apt-get install htop`. So I'd like to extract second line from output, and start it's like command itself. The following is a rubbish but it shows what I mean:               htop | tail -1 | xargs start_command


title: Improving OpenOffice speed

text: I'm looking for some tips and tricks on how to improve the performance of OpenOffice on my desktop. Any ideas, tutorials or articles on this? Thanks in advance!


title: AMD Drivers make Linux Mint 17 Cinnamon crash

text: I just installed Linux Mint 17 Cinnamon on my Samsung Series 5 netbook (dual boot with Windows 8.1, which I reinstalled myself). The first boot worked fine but I then installed the package `fglrx-uptades` for my **AMD Radeon HD 8750M**. And finally I installed the **AMD Drivers and the Catalyst Control Center** software. Upon rebooting, the X Server didn't start and I can only use the console mode. I removed the `fglrx-uptades` package with apt-get, but I don't know how I could remove the AMD Drivers. Can you please help me restarting my X Server ?


title: How to search text throughout entire file system?

text: Assuming that the grep tool should be used, I'd like to search for the text string "800x600" throughout the entire file system. I tried:               grep -r 800x600 /      but it doesn't work. What I believe my command should do is grep recursively through all files/folders under root for the text "800x600" and list the search results. What am I doing wrong?


title: "Clean" Filesystem Hierarchy

text: The Linux filesystem hierarchy is full of unused folders that only exist for historical reasons. Do any distros install with only the directories that are actually used?


title: How to effectively use bash scripting (different cost reductive ways and good habits)?

text: This is one of the most perennially important questions. How to effectively script ? What are the bad ways and what are the good ways ? I know of some, which i will point out here. If anybody does know of something else, kindly do leave a comment for the same. This question has been asked to know about the best practices available. It's very difficult to google everything and always all the things do not appear in the same place. Hence, this question has been asked to all of you experienced guys. I am myself trying to learn these things. Hence, i think any comments/answers that you guys provide here will be very helpful for me and people like me. Thanks in advance .


title: Encountering this error /usr/bin/ld: final link failed: No space left on device

text: **/usr/bin/ld: final link failed: No space left on device** is the error coming when I'm trying to complie Open Source code project I have about 7GB free space over the Disk so I think that cannot be the cause of the issue. I have read some where, that if source file is too big the linker error like this can be encountered; this can be true because source file is really huge. If the linker is giving an error due to file size then what can be done to solve the problem.


title: Typing in Chromium's/Chrome's Omnibox crashes browser

text: Very often, when I type something in Omnibox (address-bar), Chromium/Chrome crashes. W/ crash I mean that it freezes and refuses to any signals (mouse, keyboard etc.). This is what got printed out to terminal (if browser is spawned through it):               Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory      I'm using Arch Linux and all system is up to date. Also, I'm dealing w/ this problem for like few weeks now... so it can't be tempory bug in any package because I have upgraded browser and other related packages too. Also, I have tried to downgrade packages as well — it sadly doesn't help. On system w/ almost the same configuration all works and browser has never crashed even once. I'm using Awesome WM, if it matters somehow, but problem persisted also when I was using Xmonad. It seems that Firefox works, but I would like to keep using Chromium or Chrome. P.S. If any other logs are needed, please tell me in the comments and I will update the question.


title: How can I run a separate X session on a different physical display?

text: Here's what I need to do. I need to be playing a movie over HDMI to a television screen for my friends while I'm hacking on some personal projects over VGA to a smaller monitor. It's imperative that the screens be separate, as I have a work monitor application running on the VGA screen which will be taking screenshots at random and it'd be nice to not have the screenshots be half Megamind and half Eclipse. I've heard that you can run a different X session on each screen, but I don't know how to do it. Essentially, I need VLC in fullscreen on one screen and my full desktop environment on the other. I'm running Linux Mint 11 (Ubuntu 11.04) 64bit. Is there a way to do this? If so, could I make it so I could switch the X session my mouse is associated with in order to control the movie?


title: How should I search for packages to install on CentOS 5.5?

text: _**Backstory:_** Recently, it was explained to me that to upgrade any package via terminal on a linux machine, I will need to use the distributions package management system to install or upgrade the package. Since I use CentOS, which is a RHEL variant, the rpm command will need to be executed in terminal to accomplish this (I believe so). Therefore if I need to upgrade or install a package I will first use the wget command to download the package and then the rpm command to install it. The process is clear till here! _**The actual question:_** However, to use the wget command to download the package, I will need a url that points to the package. How should I find this url? My personal research has shown that there are sites like rpm.pbone.net (the only one I know off) to search for these packages. A search for 'firefox' (selecting search for rpms by name) as the keyword has given results for a whole lot of distributions. CentOS 5 is listed on page 3 but the latest version seems to be 3.6.18. Given that version 5.0.2 is available for Fedora (another RHEL variant), where is the latest version of firefox for CentOS? I am unsure which package should I download to upgrade firefox. _**Plea:_** It'll be great if someone can point out how should I go about searching for packages to install on CentOS. Is there an official site for CentOS packages similar to rpm.pbone.net (which I believe is unofficial). I am currently, just for practice, searching for the mozilla firefox and vlc's latest releases.


title: Running mame on Linux

text: I tried to install `mame` on Linux, and the icons appear inside the game folder (`xmame`, `xmame.sdl`, `xmame.x11`) but none of them would run. What is the problem? * * * **Edit** : It says they are read-only, but I cannot change permissions, it says, because I am not the owner. So what should I do? Run sudo command?


title: How do I find the X window ID under the mouse pointer in bash?

text: From a bash script, is there some way to get the ID of the X window under the mouse pointer? (edit) I need the process to be non-interactive.


title: How is whonix blocking UDP traffic (except udp-dns related traffic)?

text: I want to know how whonix manages to block unwanted UDP-Traffic i.e. all UDP- traffic but DNS related udp traffic. I looked at the iptable rules both in the Workstation and Gateway. There are no iptable rules in the Workstation. So the Workstation doesn't seem to block UDP-Traffic. However, there are many ip- table rules in the Gateway. I went through the iptable rules of the Gateway one-by-one but I couldn't find any udp-related blocking rule either. So, how is this udp-traffic blocked?


title: Automatic transformation of newlines in shell variable assignment

text: This came out of one of my comments to this question regarding the use of `bc` in shell scripting. `bc` puts line breaks in large numbers, e.g.:               > num=$(echo 6^6^3 | bc)     > echo $num     12041208676482351082020900568572834033367326934574532243581212211450\ 20555710636789704085475234591191603986789604949502079328192358826561\ 895781636115334656050057189523456      But notice they aren't really line breaks in the variable -- or at least there are not if it is used unquoted. For example, in fooling around with more pipe in the assignment, e.g.:               num=$(echo 6^6^3 | bc | perl -pne 's/\\\n//g')      I realized that while there really is an `\n` in the `bc` output, checking `echo $num > tmp.txt` with `hexdump` shows the `\n` (ASCII 10) has definitely become a space (ASCII 32) in the variable assignment. Or at least, in the output of unquoted `$num >`. **Why is that?** As fedorqui points out, if you use quotes: `echo "$num"`, you get newlines again. This is evident by examining the difference between `echo $num > tmp.1` and `echo "$num" > tmp.2` with hexdump; the former contains `\` (backslash space) whereas the later contains `\\\n` (backslash newline).


title: How to wait for a subprocess used for I/O redirection?

text: Consider the following snippet of Bash script:               exec 3> >(sleep 1; echo "$BASHPID: here")     do-something-interesting     exec 3>&-     wait $!     echo "$BASHPID: there"      When executed, it produces:               a.sh: line 4: wait: pid 1001 is not a child of this shell     1000: there     1001: here      How can I modify the `wait` line so that it actually waits for the termination of `1001`? In other words, I can I change the script so that the output becomes:               1001: here     1000: there


title: Creating a Safe Web Server

text: Web server hosts multiple websites. Multiple users update each website. ` User home directory   /home/user1   /home/user2` ` Web directory   /var/www/site1   /var/www/site2` Each user uses SFTP to upload files to their home directory.   Each user is chrooted to their home directory.   Each user has the /var/www directory mounted in their home directory.   `mount --bind /var/www/ /home/user1/   mount --bind /var/www/ /home/user2/` With 2 users, this isn't a problem but these teams will grow quickly. Each time a search is conducted, a file could appear in multiple places. SCM using .git would be the preferred method but is not possible for various reasons. **Is this the correct approach (mount --bind) since SFTP needs to be used?** Are there other security measures to take?


title: Has the Unix Philosophy been abandoned in web application design?

text: The Unix Philosophy encourages the use of small, generically reusable cooperating programs that collaborate with forms of inter-process communication like pipes, fifos, sockets, as opposed to shared memory space and linkage. The programs MH and uzbl are often given as examples of applications that exemplify the Unix Philosophy in their design. If this is the case, isn't true that Unix Philosophy has been totally abandoned in the design of web applications? Almost all web applications that process requests are now built as single large monolithic long-running processes that handle the whole request/response cycle (aside from calls to an external database program) not only for one resource, but all resources across a whole domain. Is this primarily because piping out to a collection of external programs to construct a dynamic response to a web request has too much process startup- time overhead? I can see how this is the case if you want to pipe out to Ruby or Python scripts, but perhaps if you use a language like Haskell which you can compile, any real obstacles to following the Unix Philosophy in building web apps go away?


title: ssh to different server based on user?

text: Is there a simple way to have my router forward ssh logins for certain user names to a different server on my internal network? For example, ssh router@url would log me in as router on the router and ssh steve@url would log me in as steve on the server. Also, this needs to be a server side solution because I want it to be simple and easy to use.


title: networkmanager with gnome 3.6.2 in Arch Linux

text: Every `networkmanager` I've tried is "incompatible with this version" in gnome's settings panel. I can still connect from command line fine, but that's just kind of a pain. **Solutions I have tried:**   * `pacman -Syu networkmanager` installed everything fine, but didn't solve the problem.   * `pacman -S gnome-extra` installed everything fine, but didn't solve the problem.   * `pacman -S gnome-network-manager`: pacman says "package not found" (the package is outdated according to wiki)   * `pacman -S network-manager-applet` installed everything fine, but didn't solve the problem. The arch wiki says `network-manager-applet` should suffice for gnome, but the GUI won't support it, which is inconvenient. Any help is appreciated.


title: How is it possible to sort ps command's CPU field?

text: I'm trying to make a small command that will find the processes that use the most CPU power. Firstly, I use `ps aux > file.txt` and then `cut -c 16-20 file.txt | sort -n | tail -5`. The result I get is this:               1.0      2.7     8.     14.5     14.5       So my question is how can I have both the `%CPU` usage and the other fields outputted together?


title: vdsm service won't start

text: I am currently evaluating Red Hat Enterprise Virtualization and have managed to set up the management server and the bare metal hypervisor. Now I'm trying to add a regular box running RHEL server 6.5 to the data center as a host. The add new host process starts fine and installs all the packages successfully. But after a certain time it fails saying network communication failure. From `/var/log/ovirt-engine/engine.log` I figured out this was caused by `vdsmd` service not restarting properly on the target. And indeed when I manually try to start the service at the host itself, it fails.               # service vdsmd status     VDS daemon is not running, and its watchdog is running     # service vdsmd start     vdsm: already running                                      [  OK  ]     vdsm start                                                 [  OK  ]     # service vdsmd status     VDS daemon is not running, and its watchdog is running      The log has the following error:               Jul  8 16:34:46  respawn: slave '/usr/share/vdsm/vdsm --pidfile /var/run/vdsm/vdsmd.pid' died too quickly, respawning slave     Jul  8 16:34:47 python: vdsm user could not manage to run sudo operation: (stderr: ['sudo: sorry, you must have a tty to run sudo']). Verify sudoer rules configuration      I tried commenting out and removing the "Defaults requiretty" line in `/etc/sudoers` file, but I keep getting the same error. As i'm evaluating RHEV, I am not entitled to Red Hat support and have to fix it myself. Any ideas on what to do ?


title: Archlinux ARM Rasperry Pi login buffer display and decryption fail

text: I have put the Archlinux Arm on my SD card and the first time I have done this it was all correct and worked well but I had to "reinstall" everything for several reason. So now I am doing the same steps as before but I getting a weird "problems". When I first started everything seems normal than I update the system and install "sudo mkinitcpio rsync". When I now reboot it and see the login screen it looks like this:               alarmpi login: [    14.9646851 smsc95xx 1-1.1:1 eth0 link up, 100Mbps, full-dupley, lpa 0x41E1      And I have to first press Enter to login and when I wait a bit some new lines appear they look like the following one:               [   602.262297] bcm2708_fb_blank blank_mode=1      I want to encrypt a part of my SD card and I have followed this https://gist.github.com/pezz/5310082 instructions which worked the first time just fine, as I am having a German keboard I need to use "keyboard keymap encrypt" in the mkinitcpio.conf file, but I have not able to decrypt it, it is always returned that there is no such key, although I am preatty sure I am doing the same steps as before when it has worked quite well and nicely. So, I have made a test, I have used the word "root" as my keyphase for my encryption. This works and I can boot but if I am using the following key: "Xö&(4n=%YF3Ü!BN" it does not work. Could anybody give me a hint why? Are there any characheters I am not allowed to use, although I am using the German keyboard layout de-latin1 an I do load keymap after keyboard, so the needed keyboardmaps should be loaded correctly, although it should have worked I have tested this with the keyphrase "y" which was on the right place as y and z poition are exchanged on US and Germany keyboard layouts. Also when I need to open the encrypted volume after I have created it the key works. I am looking forward to hear from you. :-) King regards, Greeneco


title: How does sudo decide whether a command is only executable by sudoers with ALL rights?

text: I just wondered why on a Debian system with sudo installed a default user can execute `ls` but not `ifconfig` since the binaries do have the same rights:               -rwxr-xr-x 1 root root 114032 Jan 26  2013 /bin/ls     -rwxr-xr-x 1 root root 72296 Sep  7  2012 /sbin/ifconfig      So I suppose there must be some kind of database or policy that tells the system who's allowed to execute a command and who is not, but where do I find it? It can't be `/etc/sudoers` since in that file one only defines who is a root sudoer and who is not just like that:               %admin  ALL=(ALL)   ALL     john ALL=/usr/sbin/useradd, /usr/sbin/userdel, /usr/bin/passwd      So `john` wouldn't be able to execute `/sbin/ifconfig`, but how does the system know he's not allowed?


title: Equivalent of memmove on files: copy a range of bytes to an earlier position

text: What is an equivalent of memmove on files with the same input and output file, which works with large files? `dd` works when I move the file contents towards the right, but not if I move the contents left, since there's no handling of overlap. `ddrescue` has a reverse copy, but refuses to work on the same input & output file.


title: Buffer each line locally on a serial terminal

text: I use kermit to connect to a device over serial. The device is quite "dumb" and doesn't have any fancy shell. It is really just receiving commands over serial and sending outputs back over serial. The problem is I make a type every other word, and I have no way to backspace, so I simply have to start over again. Is there some way I can get kermit (or equivalent) to buffer each line locally for editing before sending it down the line when I press enter, so that I can backspace if I need to?


title: Unable to change the default printer

text: When I use the command               $ sudo lpoptions -d Deskjet-F300-series      it won't change the default printer.               $ lpstat -a     Deskjet-F300-series accepting requests since Sun 10 Apr 2011 11:02:12 AM CEST     Deskjet-F4200-series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST     Deskjet_F4200 accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST     HP_Deskjet_F4200_series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST          $ lpstat -d     system default destination: HP_Deskjet_F4200_series          $ lpstat -p     printer Deskjet-F300-series is idle.  enabled since Sun 10 Apr 2011 11:02:12 AM CEST         Printer is now online.     printer Deskjet-F4200-series disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off     printer Deskjet_F4200 disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off     printer HP_Deskjet_F4200_series disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off      Do you know where is the fault? Thank you


title: Can't install 32 bit gstreamer-ffmpeg normally, library can't find other 32 bit libs

text: I'm on Ubuntu 12.04 64 bits and I'm trying to get a game (GTA SA) working in wine, but it keeps crashing. After reading error logs it seems I needed some 32 bit versions of gstreamer, probably to play the intro video. I already have `ia32-libs`, because I read somewhere I will need that in order to run 32 bit software. I first tried:               sudo apt-get install gstreamer0.10-ffmpeg:i386      Which returns:                gstreamer0.10-ffmpeg:i386 : Depends: libavcodec53:i386 (>= 4:0.7.3-1) but it is not going to be installed or                                           libavcodec-extra-53:i386 (>= 4:0.7.3-1) but it is not going to be installed      And it also depends on libavformat, libpostproc and libswscale with about the same error. So I kept searching and found a nice tool, getlibs, which allows you to install 32 bit libraries. I think it just places them in the `/usr/lib32` directory, which probably isn't the best way to do this, but I tried it anyway. So I installed the 32 bit libraries with getlibs which wine was complaining about. Now I got different errors, basically the 32 bit library is referencing other libraries which it now can't find. For example one of the errors says:               Failed to load plugin '/usr/lib32/gstreamer-0.10/libgstffmpeg.so': libavformat.so.53: cannot open shared object file: No such file or directory      So my initial thought was correct, since it now uses the 32 bit version. Now I was trying to figure it out with ldd to see where the library references other libraries:               # This one is fine     ldd /usr/lib/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => /usr/lib/x86_64-linux-gnu/libavformat.so.53 (0x00007f8314181000)          # This one isn't     ldd /usr/lib32/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => not found      So indeed, libgstffmpeg.so can't find the correct libavformat.so. I tried installing the 32 bit version of libavformat with getlibs again, which placed it in `/usr/lib32/i386-linux-gnu/libavformat.so`. But ldd still tells me it can't find libavformat. Then I tried to make a symbolic link in the same directory but named it `libavformat.so.53` and even made a symlink to `/usr/lib/i386-linux-gnu/libavformat.so.53', but both give me the same error. Now I am sure this really isn't the correct way to go, but I didn't know the right way to do it. So what is the correct way to do this, or does gstreamer0.10-ffmpeg simply doesn't have 32 bit or multilib support? And how can I find out what the directory is, where libgstffmpeg (or any library I guess) checks for it's 32 bit libs it is referencing?


How can I switch one user to another in Freebsd? For examples, I am user david now and I want to change to user Bob. This is a personal OS for my study. not a server. I searched it, but only got sites about how to create new user. Thank you.


title: Does research unix have any binary editor?

text: I cannot find any binary editor in v7 unix by reading volumn 1 of the manual. Is there any?


title: How do I execute a script later?

text: I need to compile gcc45 on my computer and that's a lengthy and resource- intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to:               $ @2300 sudo port install gcc45


title: How to create shell script command so that it will self-detruct after performing it's task?

text: I want to make command run in Ubuntu 13.10 as soon as I login. I know for that I have to add certain command in `~/.profile` file. That's not the problem. I want to certain line of that `~/.profile` file to be deleted and to be restored in it's original state. I want to perform that task just one time, so any help regarding that issue would be appreciated. ### EDIT #1 I'm attempting to run `sudo startx` as soon as I login. I've found that using that command gives me a GUI temporarily. But, to open some file with a GUI, I need to use `gnome-open <file path>`.


title: Is it a bad idea to not have a swap partition on an embedded linux setup?

text: I have a small embedded linux kernel and file system created via buildroot that is installed onto a compact flash drive running on an x86 board. I am using an initramfs (due to power loss concerns) but mounting a small number of directories on ext3 partitions on the CF drive for data that has to be persistent. However, recently I have been reading about swap partitions and their uses and as my current setup does not employ a swap partition at all. I am wondering if this is safe? I do not anticipate that the applications running on the device will be using a great deal of memory but is it better to create a swap partition regardless? I am very conscious of the limited writes that can be made to CF devices so if it is not vital then I would prefer not to use a swap partition. What would be the worst case scenario if I go ahead without a swap partition?


title: Load average per process or user

text: is it possible to obtain load average values (as displayed by `uptime`) individually per process or user. I would like to be able to see what user is causing what load. `top` is not really suitable because it only displays instantaneous values. Any ideas?


title: Copy files excluding x,y,z causing error in shell script

text: I'm not well versed in shell scripting but I imagine this to be a painfully easy fix but its eluding me. I need to copy the contents of a directory excluding a number of files. I have a command that works when I enter it into the terminal, but when its run in a shell script it fails with a syntax error or just doesn't work. The command in question is:               cp -r path/to/!(dir1|dir2|dir3) destination      Any help would be greatly appreciated!


title: Switching from LMDE to debian testing + LMDE

text: I currently have LMDE UP8 with cinnamon installed. I want to add debian testing repos for all my packages but I still want to keep LMDE repos for specific packages like cinnamon, firefox, flashplayer, etc. My `/etc/apt/sources.list` is blank. `/etc/apt/preferences.d/official-package-repositories.pref`               Package: *     Pin: release o=linuxmint     Pin-Priority: 700          Package: *     Pin: origin packages.linuxmint.com     Pin-Priority: 700          Package: *     Pin: release o=Ubuntu     Pin-Priority: 500      How can I add debian testing repos?


title: Fluxbox, bbkeys and java

text: I have installed `bbkeys` so I could choose a window when `ALT-TAB`ed, but the java applications are not amoung the selectable. Is there anything special that needs to be done for a java app to be amoung the selectable applications?


title: Is there an easy way to log all commands executed, including command line arguments?

text: I am trying to find how to log a specific instantiation of `rrdtool` to see whether the path it is receiving is incorrect. I know I could wrap the executable in a shell script that would log the parameters, but I was wondering if there was a more kernel-specific way to monitor for that, perhaps a filesystem callback that sees when a particular /proc/pid/exe matches a given binary?


title: How do I run a script just before halt using LSB headers on Raspbian

text: I'm building a shutdown button for my Raspberry pi, and for that I have a python script that needs to change a GPIO pin on my Raspberry Pi just before the system runs the halt script. Now Raspbian uses LSB headers to determine the order in which scripts are run at shutdown, but I can't for the life of me figure out what to put in the header so that the script will run AFTER everything except /etc/init.d/halt has run. The problem right now is that the script runs too soon (it always installs at K01xx), thus cutting the power before all other services have shut down properly. I tried setting a custom priority as described in the guide here: http://www.debuntu.org/how-to-managing-services-with-update-rc-d/, but that does nothing as the command just says "using dependency based boot sequencing", with the end result being the same as before. I tried manually renaming the K01xx script in /etc/rc0.d to K09xx, so that it would be the last one before the halt command in the directory. But that had no effect either. Any suggestions? My init.d script:               #! /bin/sh     ### BEGIN INIT INFO     # Provides:          shutdown     # Required-Start:         # Required-Stop:     # Default-Start: 2 3 4 5     # Default-Stop: 0     # Short-Description: Detect shutdown button     ### END INIT INFO               PATH=/sbin:/usr/sbin:/bin:/usr/bin          . /lib/init/vars.sh     . /lib/lsb/init-functions          do_start() {         if [ -x /home/pi/bin/shutdown.py ]; then                 [ "$VERBOSE" != no ] && log_begin_msg "Starting listening for shutdown button"             python /home/pi/bin/shutdown.py &             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES             return $ES         fi     }          do_stop() {         if [ -x /home/pi/bin/shutdown_pin.py ]; then             [ "$VERBOSE" != no ] && log_begin_msg "Lowering pin for complete shutdown"             python /home/pi/bin/shutdown_pin.py             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES         fi     }          case "$1" in         start)         do_start             ;;         restart|reload|force-reload)             echo "Error: argument '$1' not supported" >&2             exit 3             ;;         stop)         do_stop             ;;         *)             echo "Usage: $0 start|stop" >&2             exit 3             ;;     esac


title: How do I set default font for all Qt5 applications?

text: In Qt4, there used to be a tool called qtconfig that allowed you to set the fonts and other stuff. It also picked up the settings from KDE4's control panel. I'm working with Qt5 now (binary distribution downloaded from qt-project.org), but the default font in all Qt5 applications is too small for me. Is there any way I can increase it to match the rest of the desktop? My default Qt5 style is Fusion. I tried playing with ~/.config/QtProject.conf (copying the Qt4 settings there), but it didn't help. I'm using openSUSE 12.2 x86-64.


title: contents of xp cd is not visible

text: I'm using Ubuntu 13.04. I want to take an ISO copy of XP installation CD but when I insert CD it's seen as empty CD. Is there any way to access the content of CD?


title: Starting with bash: -lt and -gt arguments

text: I'm starting with bash and I found the following:               if test $first -lt $second     then       echo $first is lower than $second     else       if test $first -gt $second       then         echo $first is higher than $second       else         echo $first and $second are equals       fi     fi      For reading the script and executing it, I know what it does, but not what -lt and -gt are for. Can somebody tell me what is the name of that kind of 'tool' and what they(-lt and -gt) do? Thanks!


title: Why am I getting apparmor error messages in the syslog about NTP and LDAP?

text: On my newly installed Ubuntu 12.04 machine, with `ntp` and `slapd` installed, the following messages appear in `/var/log/syslog` at regular intervals:               Feb 23 18:54:07 my-host kernel: [   24.610703] type=1400 audit(1393181647.872:15): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/ntpd" name="/etc/ldap/ldap.conf" pid=1526 comm="ntpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0      I've searched, but can't find any info on what may be causing these messages and how to fix the problem. Can anyone shed any light on what's causing this and what to do about it?


title: VMD X11 session over ssh

text: I have a remote compute server on which I would like to run VMD. Every time I start the application, it crashes with the following error report:               Info) VMD for LINUXAMD64, version 1.9.1 (February 1, 2012)     Info) http://www.ks.uiuc.edu/Research/vmd/                              Info) Email questions and bug reports to vmd@ks.uiuc.edu                Info) Please include this reference in published work using VMD:        Info)    Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual        Info)    Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.     Info) -------------------------------------------------------------     Info) Multithreading available, 48 CPUs detected.     Info) Free system memory: 102376MB (79%)     Warning) Detected a mismatch between CUDA runtime and GPU driver     Warning) Check to make sure that GPU drivers are up to date.     Info) No CUDA accelerator devices available.     Warning) Detected X11 'Composite' extension: if incorrect display occurs     Warning) try disabling this optional X server feature.     XRequest.154: BadAlloc (insufficient resources for operation) 0x17     XRequest.154: GLXBadContext 0x3800001     Segmentation fault      I heard from other users of the same server that they did not have any problems, so I assume this must be an issue with the X window system on my local machine. Further points:   * I connect to the server using `ssh -X`.    * Opening a remote `xterm` window works.    * Local X windows version: 1.13.0


title: How to select which graphics card to use?

text: I have a desktop with an integrated graphics card, which i want to use, and a PCI graphics card. I would like to display video through the integrated graphics, and use the PCI card for CUDA based tasks, and not bog it down with video generation. Is there a way to select which one to use, and make it permenant?


title: copy recursively except hidden directory

text: How do I copy recursively like `cp -rf *`, but excluding hidden directories (directories starting with .) and their contents?


title: Why do Unix-heads say "minus"?

text: A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say "seemed to be" because he kept saying "dash" when referring to command-line options. I then recalled something that I found curious in my early days of learning Linux; that is, when referring to options, the resident Unix-heads always said "minus". That is:               rm -rf /var/tmp/bogus/junk      Would be said "arr em minus arr ef" as opposed to "arr em dash arr ef". Why is this?


title: Allowing rename but not moving to other directory

text: Users can upload/delete/rename files via `vsftp` server and everything works well except they can also move files across directories. Is it possible to allow renaming of files but disallow moving them around? Example,               /ftp/work/xls/list.xls # can be deleted/renamed but should not moved to ie. 'doc'     /ftp/work/doc/list.doc # same thing, should not be moved elsewhere


title: Buffer overflow attacks

text: I just learnt today in a Distributed Systems class that there is an address space allocated for every user by the kernel, and if a user wants to get the su privilege, he needs to shift to the kernel address space. Is this the basis for buffer overflow attacks, where a user, if exceeds his address space, may be able to access the kernel address space or just overwrite it?


title: Safe to disable boot fsck on read-only ext3 file system?

text: I have a large, frequently read, ext3 file system mounted read-only on a system that is generally always hard power cycled about 2-3 times per day. Because the device is usually powered off by cutting the power, fsck runs on boot on that file system, but for this application fast boot times are important (to the second). I can disable boot time checks on the file system in fstab, but my question is, is it safe to do this? Given that the file system is mounted read-only but is never unmounted properly, is there _any_ risk of accumulating file system corruption over a long period of time if I disable the boot time check?


title: How can I restart a network interface?

text: How can I restart a network interface? I have a vm that doesn't update its IP address correctly when switching between home and work. The vm runs Ubuntu server and uses a bridged network adapter.


title: Can /mnt/hgfs/'shared folder' be used as apache root?

text: I have an Ubuntu Server (12.04) running on my development machine. It is in a VM. I have succeeded with the task of setting up Apache2, MySQL, and PHP. I can access the server from my host browser by pointing it to the IP. Hurray! My next task is to set up the filesystem so that I can edit project files on my host computer (Mac OS X 10.7) hit save and view them in my browser through the Linux server. How I am trying to accomplish this is by sharing a folder on my Mac with the VM, which mounts to `/mnt/hgfs/foldername`. Then I pointed my virtual host in Apache2 to that folder. `chmod` the folder to `777` for testing purposes and tried to access the files from my Mac. I get a `403 Forbidden`. How can I set up the VM to share a folder with my Mac so that I don't have to FTP all my files to the server? A thought a had was `rsync` the `/mnt/hgfs/*` folder to the `public_html`


title: How to allow mysql remote connections via particular interface

text: I have a `10.237.49.251` IP on `eth0` and another IP on another interface How do I enable remote mysql calls on `eth0` device?


title: How to find the driver (module) associated with a device on Linux?

text: On Linux, given:   * a device, for example `/dev/sda`,    * and its major and minor numbers, for example `8, 0`,  how can I know which module / driver is "driving" it? Can I dig into `/sys` or `/proc` to discover that?


title: Grep expression with special file names

text: I have to go through some regular files in directories and find those files, that have their own name in its content. In the following piece of script is a cycle in which I am going through paths and using grep to find the file's name in its content. What is surely correct is $something:q - is array of paths where i have to find files. The next variable is name in which is only name of current file. for example: /home/computer/text.txt (paths) and: text.txt (name) And my biggest problem is to find names of files in their content. It's quite difficult for me to write correct grep for this, cause the names of files and directories that I am passing through are mad. Here are some of them:               /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/!_1     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/dam/$user/:e/'/-r     /home/OS/pocitacove/testovaci_adresar/z/test3/skusime/ taketo/   taketo     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/.a=b     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/@     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/:     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/'ano'          foreach paths ($something:q)         set name = "$paths:t"         @ number = (`grep -Ec "$name" "$paths"`)              if ($number != 0) then             echo -n "$paths "             echo $number         endif              @ number = 0     end


title: Debian: package updates in stable distribution

text: I am running Debian Wheezy, which is the current stable Debian distribution. In my `/etc/apt/sources.list`, I have something like the following:               deb http://ftp.de.debian.org/debian wheezy main     deb http://ftp.de.debian.org/debian-security/ wheezy/updates main      When I run `apt-get update` and `apt-get upgrade`, I would expect that only security updates will be installed. However, I see that there are other packages which want to be updated, such as:               dpkg (1.16.10) -> (1.16.12)      could somebody please explain what is the debian update policy? Why were these packaged updated? I was under the impression, that only security issues are being fixed in stable distribution.


title: How to change gnome session locale?

text: How do I change the default locale for my gnome session? I created `/etc/default/locale-local` with this content:               LANG=pt_PT.UTf-8     LC_MESSAGES=en_US.UTF-8      and added this to `/etc/pam.d/gdm3`, `/etc/pam.d/gdm3-autologin`, `/etc/pam.d/gdm-welcome`, /etc/pam.d/login, `/etc/pam.d/su` and `/etc/pam.d/sshd`:               session required pam_env.so readenv=1 envfile=/etc/default/locale-local      What am I missing?


title: Eclipse crash with Fedora 19

text: I'm trying to work with eclipse Galileo with Fedora 19. Executing `./eclipse` loads and opens normally, but when I type some java code on the editor the application crashes and closes instantly. This happens in the moment when the popup with the tips should appear, e.g. when you type an object instance name followed by a dot, and the Eclipse shows the possible methods. And in the prompt appears this message:               GLib-GObject:ERROR:gobject.c:4127:g_weak_ref_set: assertion failed: (weak_locations != NULL)      I've tried to start with the `-vm` argument point to jr6, jre7 and openjdk and the error persists.


title: Meaning of the following linux commands

text: cat "$1" > /tmp/file.$$   2>/tmp/file0.$$     grep "*"  /tmp/file.$$    >/tmp/file0.$$      I understood that in the `cat` command, if an error occurs, the error will be shown in `file0.$$` and if it does not, then contents will be shown in `file.$$`. What I don't understand is what `$1` is. Also what is happening in the `grep` command.


title: Understanding different Linux Distros

text: I'm having a little bit of confusion when understanding linux based OS's. When I download the newest version of Mint and Ubuntu, aren't they the "same" at their core (kernel)? It just seems that they have different GUI's? Isn't a GUI technically just a program that runs on startup of a computer? Same as with windows (dos is the core but explorer.exe is the gui). Is anyone able to explain this? With the sudo apt-get command can't I install Ubuntu from a mint Terminal? I know that this is a mess of questions, but hopefully someone can clarify the differences between multiple distros before the GUI appears, and then after the GUI appears.


title: How do I achieve higher resolution than physical resolution of an LCD?

text: I'm using the original `EeePC` with screen resolution of `800x480`. Some screens and dialogs do not fit into that resolution, so I have to use `Alt- Drag` to move windows around to reveal the bottom part of the window, but this doesn't work for a particular application I'm going to use since it's basically a fullscreen DirectX app running via wine, so some buttons are just cut off by the edge of the screen. Is there a way to make `Xorg` desktop to render at higher resolution (`1024px` wide or so) and then transparently scaled down to the display's native resolution, so the applications think the resolution is bigger? I do not care much about output getting blurred or text getting too small. Alternatively, is there a way to switch the video adapter to the resolution above physical resolution of the LCD screen and have the screen/video adapter itself to handle scaling (as used to be possible with CRT monitors)? I'm using **Lubuntu 12.04** so I guess have `Compiz` installed. There is Scale plugin in `Compiz`, but I don't think it does what I need.


title: Trapping "READ FPDMA QUEUED"

text: Recently I encountered a kernel message:               ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0     ata3.00: irq_stat 0x40000008     ata3.00: failed command: READ FPDMA QUEUED     ata3.00: cmd 60/08:00:98:b2:78/00:00:13:00:00/40 tag 0 ncq 4096 in              res 41/40:08:9a:b2:78/00:00:13:00:00/00 Emask 0x409 (media error) <F>     ata3.00: status: { DRDY ERR }     ata3.00: error: { UNC }     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: configured for UDMA/133     sd 2:0:0:0: [sda] Unhandled sense code     sd 2:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     sd 2:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor]     Descriptor sense data with sense descriptors (in hex):             72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00              13 78 b2 9a      sd 2:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed     sd 2:0:0:0: [sda] CDB: Read(10): 28 00 13 78 b2 98 00 00 08 00     end_request: I/O error, dev sda, sector 326677146     ata3: EH complete      I managed to correct the error and wrote a detailed description of the convoluted process I used to repair the disk. Then got too lazy to post it ( guess I will this weekend ). What I would like to do now is create some programs for automating the process. To do this I need to "trap the kernel error". By trap I mean: 1) Terminate the system call that is causing the error. I notice that often times errors like this will cause the hd to hang, that is ignore requests from other system command calls until this process has run its course. Often times causing the other calls to return errors. With a diagnostic program this will cause the wrong action to be identified as the culprit. 2) Send a signal of some sort to the calling process to let it know that it is the culprit. Suggestions?


title: Print console colors

text: Wrote a bash function to display the console colors. But, it seems some of the colors are not possible to show that way! (?) Also, note the strange "bright black"! (Note: The below screendump is of xterm, but this is meant to be used in console mode. I had to use xterm to get a screendump. But it looks much the same.) ![clr](http://user.it.uu.se/~embe8573/clr.png)               function clr () {       Color_names="bla red gre yel blu mag cya whi"       Color_arr=($Color_names)       for m in {0..15}       do         tput setaf $m         echo -n ${Color_arr[$((m % 8))]}" "       done       echo       tput sgr0       cat /sys/module/vt/parameters/default_red \           /sys/module/vt/parameters/default_grn \           /sys/module/vt/parameters/default_blu | tr "," "\t"     }


title: mysql USER unclear about what can be dropped?

text: When `show databases` there is the `information_schema` below it listing my created databases but what is 'USER' and 'mysql' listed in there? I don't know if ages ago I made a mistake and created them or if they are default listings which reveal something?


title: How to save “text/pdf” PDF files on the disk from an incoming mail in Mutt

text: I receive emails with PDF attachments that have the MIME type "text/pdf". This is obviously not good, but some mail clients are doing that... The problem is that saving such an attachment in Mutt leads to a file on the disk that cannot be opened by a PDF viewer. The file size is indeed different by a few bytes from what it should be. How can I save such attachments?


title: awk one single line

text: hello i try to use a awk that compiles several lines into one, how can ia do that? i'm using the comand:               awk < $pot/towhee.prod 'NR==411{print$5,$6}''NR==412{print$5,$6}''NR==430{print$7,$8}'       and it produces this:               0.24975E-01 0.00000E+00     0.36574E+04 0.59343E+02     -3340.691 0.399      but i want this:               0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399      how can i do it?


title: Packaging with tar

text: I am trying to package the files:               file1     folder2/hello     folder2/world     file3      into a tar file so they are encapsulated in a custom defined folder, so the `tar -tvf archive.tar` appears as:               mycustomfolder/file1     mycustomfolder/folder2/hello     mycustomfolder/folder2/world     mycustomfolder/file3      Currently to come around this I am:   * Creating an archive(x) of `file1`, `folder2` and `file3`.   * Creating a `mycustomfolder` folder.   * Extract the archive(x) into `mycustomfolder`   * Create an archive(y) from `mycustomfolder` I can't help it think their might be one step of doing this or a better way?


title: Execute command on remote host fails

text: I'm trying to execute some commands on remote host like this :               ssh -t -t -l user 172.20.20.20 <<EOF       pid=$(ps -ef | grep [a]pp-management | awk '{print $2}') && kill -9 $pid && rm -rf CI/*     EOF      What happens is that I remain logged at remote server and the kill is not executed :               user@ubuntu:~$ pid= && kill -9  && rm -rf CI/*     kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]      Neither `rm` gets executed, what am I doing wrong? I see that nothing get passed to kill -9 command, why is this?


title: Substite values from file1 to file2 awk

text: I have input file in xml FILE1 :                <Sector sectorNumber="1">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>       <Sector sectorNumber="2">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>       <Sector sectorNumber="3">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>      and other FILE2:               Cell11="42921"     Cell12="42925"     Cell13="42928"     Cell21="42922"     Cell22="42926"     Cell23="42929"     Cell31="42923"     Cell32="42927"     Cell33="42920"      where I want to subistitue values from FILE2 to FILE1 , so it should look like :               <Sector sectorNumber="1">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42921" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42925" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42928" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="2">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42922" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42926" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42929" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="3">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42923" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42927" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42920" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>       So basicly, all the vaules are inserted in cellIdentity="" in order, s it is in FILE2. I have awk code :               awk 'FNR==NR{FS="=";a[NR]=$2;next}/cell/{c++;FS=OFS;$4="cellIdentity="a[c];}1' FILE2 FILE1      but I get this :               <Sector sectorNumber="1">             <Cell cellNumber "1" cellCreated "YES" cellIdentity cellIdentity= "35000" numberOfTxBranches "1" hsCodeResourceId "0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42925" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42928" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="2">     <Cell cellNumber="1" cellCreated="YES" cellIdentity="42922" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42926" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42929" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="3">     <Cell cellNumber="1" cellCreated="YES" cellIdentity="42923" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42927" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42920" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     </Sector>      So the probelm is only in first row, it's not good. I don't know how to fix it.


title: Is it possible to transfer the history of commands from one system to another?

text: I am going to have all my data transferred to a new PC. Is it possible to transfer the command history of the previous Linux to the new system as well? So that when I type the `history` command, I get the same results as I did on the old system.


title: Cannot get Systemd working on GENTOO: Where am i going wrong?

text: I'm having a massive amount of trouble installing gentoo with systemd; this is a fresh install and not an upgrade. Steps (after partitions etc.. are setup):   1. Unpack AMD64 stage3 and emerge-webrsync and then `emerge --sync` for good measure   2. Eselect profile gnome/systemd   3. `emerge --update --deep --with-bdeps=y --newuse @world`   4. `emerge` gentoo sources; config and `make` the kernel -the gentoo systemd option is enabled as is openrc   5. Install the kernel   6. install mdm and lvm (I'm running a raid0 as root)   7. install gentoo-next and `genkernel --install --no-ramdisk-modules -mdadm -lvm --udev initramfs` (this is as suggested by the systemd and raid install wikis)   8. `emerge` grub2 and install it with init set to systemd   9. install some utils (e.g `dhcpcd`) When I boot into the system i get nothing but a bunch of trouble - never actually having the system boot in full. Errors (in no particular order as I had to write them by hand):               Failed to start trigger flushing of journal to persistent storage     Systemd-journal-flush service entered failed state     Systemd-journald.service.watchdog.timeout     Systemd-journal-flush.service exited, code=exited status=1/Failyre          A start job is running for udev Kernel Device Manager service...     Systemd-udevd.service.start operation timed out          Failed to start udev kernel device manager      It just sits there looping for the udev KDM startup always failing if i hit control alt delete (or indeed type `shutdown -h` now from within the chrooted environment) i get the following:               Failed to start reboot     Dependency for reboot failed          systemd-reboot service main process exited..          shutdown -h now          shutdown: /dev/initctl: No such file or directory     init: /dev/initctl: No such file or directory      I've been googling for a couple days now but couldn't find anything (though it is possible I'm blind). Journactl (when i `chroot` into the setup) says No Journal Files Were Found. I'm at a complete loss at this point. If anyone has any suggestions i would greatly appreciate them!


title: How to setup Nvidia GeForce 9800 card on Ubuntu 10.10

text: I have problem on graphic card with ACER V193w LCD display. I really don't know how to configure /setup/ Nvidia GeForce 9800 on Ubuntu 10.10. Can you guys please help me!


title: Where does xfce4-notes store data?

text: I have a lot of xfce-notes groups containing each a lot of text. I want to transfert them to a new machine without copying the whole home directory. Where does xfce4-notes store its data and configation files?


title: Is it possible to uninstall OpenOffice?

text: I installed OpenOffice using the installer downloaded from openoffice.org on Fedora 14. I went to use it today for the first time and it won't open. I'm assuming with updates that have been installing that perhaps something got overwritten or something since I didn't install it through yum. I wasn't sure how to go about uninstalling it now so that I can reinstall it using yum so that it can monitor dependencies for me. How would I do this?


title: Script for running sequential job

text: I started recently to learn using Linux. I want to write a script in bash shell to run a serial job on a cluster. I have been searching for hints and instructions on how to write such a script. I managed to write the following:               #!/bin/bash     #PBS -l nodes=1:ppn=8     #PBS -l walltime=1:00:00     #PBS -e test.err     #PBS -o test.log     cd /home/myuser/     echo "Running on host `hostname`"     echo "Time is `date`"     echo "Directory is `pwd`"     /home/myuser/comsol4.3b/bin/comsol batch -inputfile DF.mph -outputfile output.mph -batchlog out.log      The last line calls the program (it is called COMSOL) to run. One of the things that are missing in my code is the command “qsub”; I don’t know how to incorporate it with the rest of commands in my code. Can anyone please instruct me how to modify the line that calls the program I am using by “qsub” command please? Sorry if my question is so simple, I spent a lot of time trying to make it work but I couldn’t unfortunately. **EDIT** : To summarize, if I typed the last line of the code ONLY it will be run on the main node only, I don't want that. What I want is to modify the last line of the code such that it uses the resources I allocated to it using PBS lines, how should I do that? For the record, the command `qhost` shows there are 250 nodes with varying cores per node from 4 cores/node to 16 cores/node


title: Bafflingly baroque Debian ps: show threads in forest tree

text: My favourite `ps` invocation is:               ps -efww ef      as I need to `watch` all processes (`-e`), get extended information about them (`-f`), see the environment (`e`) they operate within, wrapping lines (`-w -w`) so I don't lose any part of that, and visually group (`f`) child processes under their parents, for an at-a-glance overview. I have "wasted" the whole morning trying to get _any_ thread information to appear as well, following the same visualisation logic above. I must have tried 40 different combinations of options. ( _Actually, I just checked my`.bash_history` and I have tried more!_). Combinations included swapping `f` and `-H` for forest display, for instance. Sometimes I even tried permutations to check insidious "orderings"... None of the threading options seem to be compatible with my "monitoring screen" setup. I am talking about `H`, `-L`, `m`, `-m` and `-T`. I am baffled. Am I doing it wrong? How are you guys doing it? Specifically: I need to watch for processes like download managers who go funky with 30 to 80 threads all of a sudden...


title: How to wget website with same page and content names?

text: I'm trying mirror a website where it has page:               http://www.site.com/news      and contents:               http://www.site.com/news/36-news/news-one     http://www.site.com/news/37-news/news-two     http://www.site.com/news/38-news/another-news-here      This is what I'm using               wget -m -Dsite.com -e robots=off -r -q -R gif,png,jpg,jpeg,GIF,PNG,JPG,JPEG \         -t 10 http://www.site.com &      When wget is run, it will create a HTML file with the name `news`. I'm unable to download the contents because the file with the name `news` already exists (I'm running Ubuntu: directories cannot have same name as files) Below is the message that appeared when running `wget` without `-q` > www.site.com/news/36-news: Not a directory   >  www.site.com/news/36-news/news-one: Not a directory


title: How can I diagnose and repair missing drive space?

text: I have a small ext3 `/` partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed. After trying everything I could think of, I forced a fsck on boot which didn't have any affect. I have other systems configured identically which don't exhibit this condition.               # df -h /     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             9.7G  8.9G  318M  97% /          # du -shx --max-depth 1 /     5.2G    /          # lsof | awk 'BEGIN {t=0} /(deleted)/ {t+=$7} END {print t}'     0          # tune4fs -l /dev/sda1 | grep -E 'state|Free|Reserve|size|Inode'     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file     Filesystem state:         clean     Inode count:              2621440     Reserved block count:     131029     Free blocks:              212317     Free inodes:              2487281     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      639     Inodes per group:         32768     Inode blocks per group:   1024     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     Inode size:               128      **Edit:** `fsck` says the partition is 2% non-contiguous. For comparison to `du` above (sparseness):               # du -hxs --apparent-size /     4.9G    /


title: What's the best way to install a system-wide certificate from a website?

text: I want to use the Cisco Easy VPN to connect to the OpSource cloud machines. When I open the app, it directly shows a certificate error message, I suspect that the certificate is not trusted from their domain because I tried it on a Windows machine and I had to add an exception for it. I am using Fedora 15 and I want to make the certificate to this domain accepted system-wide, The only way to get the certificate will be by accessing it through the browser and exporting the certificate from Firefox for example. How could I install this certificate, and is there a better way to obtain it other than exporting it from the browser?


title: How do I determine where DNS requests fail in the TCP stack?

text: I have the networking setup described here: Why is this static route not taking effect? Currently, I can ping my DNS server but all DNS requests fail:               ~$ ping 130.35.249.52     PING 130.35.249.52 (130.35.249.52) 56(84) bytes of data.     64 bytes from 130.35.249.52: icmp_seq=1 ttl=57 time=105 ms     64 bytes from 130.35.249.52: icmp_seq=2 ttl=57 time=111 ms     ^C     --- 130.35.249.52 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1000ms     rtt min/avg/max/mdev = 105.604/108.388/111.172/2.784 ms          ~$ nslookup oracle.com 130.35.249.52     ;; connection timed out; no servers could be reached      I can think of no good reason for this, because Ubuntu is (to my knowledge) not running a firewall. However, Ubuntu is virtualized, so I hope that it isn't something wrong with the way that its VirtualBox host is set up.


title: An Error Occured, Error attaching disk image: GDBus.Error:... when opening downloaded files in firefox, how to fix this?

text: `Error attaching disk image: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error setting up loop device /dev/loop0: Invalid argument (udisks-error-quark, 0)`      That one above is the error Im having with my Linuxmint 15 Olivia, using Mozilla Firefox for Linux Mint 1.0.   The error occurs when I am opening a downloaded file using the "Open Containing Folder" context menu. and also when opening the c: drive of my newly installed "Wine" installation.   I have 3 Linux Mint 15 machines with exact software packages installed. The others are not having this error.   The machine that this error occurs from is installed in a Fake RAID0. **Update** The application involved in this error is the `gnome-disk-image-mounter `   **UPDATE** I've just re-installed everything since I can't fixed it.   It's working well now.


title: Creating a Linux distribution that only runs one application

text: > **Possible Duplicate:**   >  How can I build a custom distribution for running a simple web browser? Is it possible to create a Linux distribution that only runs one application? For example, I want it to just run a browser, and not support any other applications. How can I do that?


title: Need small distro without a desktop or windows manager, just to run a single graphical app

text: I am looking for some help on this from a linux expert. I am very novice when it comes to linux so I am hoping someone can help out. I need a small distro, that is stable. I don't need a full X server or window manager, I only need it to run one single application with a basic UI that consists of a viewport. I would like for the distro to be as small as possible. 700 mb or less would be ideal. Is their a base distro of ubuntu or similar that I can add whatever I need to it from the command line. Which basically is the kernel and some way of graphical output. I was thinking of putting Direct FB on it to render the application. Can anyone help me out here? Even a live distro would work.


title: rkhunter warns about chkconfig

text: I ran `rkhunter` and received the following warnings in its output:               $ rkhunter --update     $ rkhunter -c          ...     ...     ...          Performing file properties checks         /sbin/chkconfig                                          [ Warning ]      In the `/var/log/rkhunter.log`, it shows this message:               Warning: The command '/sbin/chkconfig' has been replaced by a script: /sbin/chkconfig: Perl script, ASCII text executable      Though I am on a Debian system and am aware of `update-rc.d`, I occasionally use `chkconfig` to configure services. What does this warning mean? How serious is this?


title: Cannot redirect output from sed

text: I'm piping output from clock through sed to remove leading zeroes from numbers. It looks like this:               clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\b0\+\([0-9]\+\)/\1/g'      That works fine and produces the output I want. However, when I try to redirect the output to a file, nothing is written to the file. The following does NOT work.               clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\b0\+\([0-9]\+\)/\1/g' > testfile      Nothing is written to testfile. What am I doing wrong?


title: What is the concept hidden behind the term "command"?

text: I have been using, studying and developing for Linux for quite a few years now, and over time, I have successfully convinced a few people to _join the cause_ , and make the switch to Linux. However, when these people went discovering this brand new world, every one of them eventually came to me, asking _what the command was to do this or that_ :   * What's the command to install a piece of software?   * What's the command to list currently directory contents?   * What's the command to open my web browser?   * ... To me though, it feels like they are asking the wrong questions. Indeed, I would actually expect them to ask:   * What program do we use to manage software installed on the system?   * What program can list current directory contents?   * What are the available web browsing programs?   * ... It would seem to me that the term **command** is a very abstract word used to describe pretty much everything you type after your shell prompt. With this thinking, several of the newcomers I brought started to believe that:   * Linux is made of a huge amount of commands.   * There is a command for everything, and every command does one thing specifically.   * By learning more commands, I'll become more capable as a Linux user/administrator.   * By running `./something` I don't run a command, but a program stored in my current directory, probably something I compiled myself.   * ... Due to that, I tend not to use the word **command** , and prefer to use **program** or **executable file**. I also explain that these executable files can be found automatically, without typing their absolute paths, thanks to the `$PATH` mechanism. Thanks to that, typing `ls` executes `/bin/ls`, which is a **program** stored in `/bin`, a directory registered within the `$PATH` variable. Still, I come across the word **command** in many books, tutorials, guides, ... which eventually brought this question to my mind: does the word _command_ actually have a meaning in the UNIX/Linux vocabulary? Does it refer to an actual concept other than _"whatever you type in your terminal"_?