title: How does "cp" handle open files?

text: I'm having two separate directories. The user loads a file into the first. Theres a cronjob running in the background which copies the files every 5 minutes over to the second directory. What happens if the user has not completed his upload and the cronjob copies the files? Note that the two directories are owned by different users, the cronjob is performed as root.


title: how to open a knote file on knote

text: I was wondering if there is any way to open a knote file within knote. There is a knote save option but I am not sure how to open one. Any ideas? Any other program that could open .ics files?


title: Graphical interface on a remote server?

text: I've got a VPS with Debian running on it. I connect to it using SSH and configure it in a console mode. Now I want to install some graphical interface to it and use my VPS in graphical mode from my PC. What free software could you advice me? It will be laggy, won't it?


title: How to create Local Repositories in RHEL

text: I need to create a local repository in RHEl 5.5. i386 Because when I type some command in terminal it say that **RHEL is not subscribed with RHN** which is true. I took it from friend. So can someone tell me how to achieve this target. # Further Actions based on Warl0ck instructions.   * I copied the RPM's from Mdia to /home/Umair/RPM folder   * I installed the script createrepo-0.4.11-i386.el5.noarch.rpm located in Server directory of Installation Media. Then it took some time to generate metadata. Total Packages 2348 ![Metadata](http://i.stack.imgur.com/DGxMI.png)   * Then I create the local repo file using vi > vi /etc/yum.repos.d/local.repo These are the entries I added. ![Repo text](http://i.stack.imgur.com/XfuKs.png) And finally i run this command > yum -y install apache php{,-cgi,-cli,-gd,-mysql} mysql{,-server} and in reply bash slapped me with error ![erro](http://i.stack.imgur.com/CCEaG.png)


title: Linux does not see a file until I ls on that directory

text: I have a really weird problem. I have a php script that runs, submits a child process to run, and waits until its done by checking for a OUTFILE.end file to appear. The problem is the file appears, but the php script doesn't see the file. I tracked it down to a Linux problem, since if I check using the command line, Linux doesn't see it.               [katelyn@katelyn data]$ ls ./files/OUTFILE.end     ls: cannot access ./files/OUTFILE.end: No such file or directory      I know the OUTFILE.end file is there since the child job stopped running. The second I `ls` on the directory, the file then appears.               [katelyn@katelyn data]$ ls -l ./files/     total 4     -rw-rw-r--. 1 katelyn katelyn  0 Sep 10 16:30 OUTFILE.end     -rw-rw-r--. 1 katelyn katelyn 19 Sep 10 16:30 OUTFILE.txt     [katelyn@katelyn data]$ ls ./files/OUTFILE.end     ./files/OUTFILE.end      I am running CentOS release 6.5, and the ./files/ directory is actually a symlink to another folder that happens to be on a Luster distributed filesystem.


title: Creating an Ubuntu Live CD through SUSE Linux

text: How can I create a live Ubuntu 11.10 CD on SUSE?


title: Fedora 16 won't boot

text: Last night, I shutdown my system, and when I tried to boot it this morning it hung at the splash screen. What is wrong here? I'm not sure which details I can give apart from that I originally installed the OS from bootable USB and Gnome is the desktop environment I am using. During boot, when I enter the GRUB v1.99 screen, the following (editable) text appears:               setparams 'Fedora Linux, with Linux 3.1.0-7.fc16.i686 (recovery mode)'     load_video     set gfxpayload=keep     insmod gzio     insmod part_gpt     insmod ext2     set root='(hd0, gpt2)'     search --no-floppy --fs-uuid --set=root 9ff50bad-320d-4f07-8a14-4cd372185815     echo 'Loading Linux 3.1.0-7.fc16.i686 ...'     linux /vmlinuz-3.1.0-7.fc16.i686 root=/dev/mpper/vg_user-lv_root ro single \'     rd.lvm.lv=vg_user/lv_root rd.md=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 \`     rhgb rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_user/lv_swap     echo 'Loading initial ramdisk ...'     initrd /initramfs-3.1.0-7.fc16.i686.img


title: Bad Resolution - Missing, corrupt after suspend, x121e Mint 11 - Bad EDID?

text: After travelling with my ThinkPad x121e on suspend my resolution has altered and the correct resolution setting disappeared. This affects the whole computer, when using live USB as well. I do not expect a reinstall to work (I will reinstall later tonight perhaps to make sure). I run Linux Mint 11 x32, with the Intel Sandy Bridge graphics. Before travelling the resolution was fine, it recognised the correct 1366x768 resolution. After travelling, a whole new set of resolution options have appeared and it currently recognises 1280x800 as the optimal resolution. 4cm is missing from the right, 2cm from the bottom. I have already tried adding a new resolution mode using xrandr. This does not seem to work. I tried to add a new resolution mode setting, but it would not recognise the mode even when I had added it. It seemed to add it as DP1 instead. The Linux Mint forums suggested editing the grub configuration to insert `vga=844`, but this also did not work. What else can I try?


title: Omit Certain Entries from Apache Access Log

text: Is there a simple way to keep noise entries out of the `access_log` file short of doing piped logging to a script that does a `grep -v` on matching criteria or something? I have `collectd` monitoring apache statistics but as a consequence I get these messages:               157.98.65.xxx - - [23/Apr/2014:09:46:32 -0400] "GET /server-status/?auto HTTP/1.1" 200 439 "-" "collectd/4.10.9"     157.98.65.xxx - - [23/Apr/2014:09:46:32 -0400] "GET /server-status/?auto HTTP/1.1" 200 439 "-" "collectd/4.10.9"      When they run analytics against the apache logs they now get an entry for this which isn't really related to why they're wanting to run the analytics (they don't care about activity due to sysadmin monitoring).


title: Global Keyboard shortcuts in Ubuntu 14.04

text: I've just upgraded my distribution from 13.10 to 14.04, which seems to have broken global keyboard shortcuts. They are still present in the "Keyboard settings" as before. Although media keys are affected, so are other global shortcuts like Ctrl+Alt+T for Terminal. Other keyboard shortcuts work at an application level still, however. I am also currently using Gnome Shell as my desktop environment, although the Alt+F2 shortcut for shell commands still seems to work. Does anyone know of how this could have been caused?


title: Why are my application.desktop files not showing up in Linux application menu?

text: I've written quite a few open source programs over the years, but not very recently, and I've never had this problem before. The menu items for my new project simply refuse to show up in menus on either gnome or kde. I originally just installed the .desktop files to /usr/share/applications but later modified it to use desktop-file-utils - all to no avail. I've add update-desktop-database to my postinst script... nothing I've validated the entries, and in the file manager they are correct, I've tried giving them execute permissions... I can't find anything wrong but they just won't show up. Is there something new one has to do to get your app's menu items to show these days ? The .desktop files are:               silentcoder@ravenriley ~/SOURCE/ezdm $ cat ezdm.desktop      [Desktop Entry]     Type=Application     Name=EZDM     GenericName=Easy Dungeon Master     Comment=A tookit for AD&D Dungeon Master     TryExec=/usr/games/ezdm     Exec=/usr/games/ezdm     Categories=Game;RolePlaying;     Icon=/usr/share/icons/hicolor/128x128/ezdm.png     Terminal=false      cat ezdmconsole.desktop               [Desktop Entry]     Type=Application     Name=EZDM-Console     GenericName=Easy Dungeon Master (Console version)     Comment=A tookit for AD&D Dungeon Master     TryExec=/usr/games/ezdm --console     Exec=/usr/games/ezdm --console     Categories=Game;RolePlaying;     Icon=/usr/share/icons/hicolor/128x128/ezdm-console.png     Terminal=1     X-Desktop-File-Install-Version=0.20      And if any of the other code might be useful, it's all browseable on github: https://github.com/ajventer/ezdm UPDATE: The mystery deepens, if I copy the files to /usr/share/applications/kde4 (which I obviously don't want to do in my package - after all, it should work in gnome too) then suddenly ezdm.desktop does show up in the menu, but ezdm-console.desktop still refuses to. UPDATE: since it may be relevant: From Makefile:               install:                     $(PYTHON) setup.py install --prefix=/${PREFIX} --root $(DESTDIR) --install-scripts=/${PREFIX}/games/ --no-compile --force --record .install.record --install-layout=deb                     mkdir -p ${DESTDIR}/${PREFIX}/share/applications                     mkdir -p ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/                     desktop-file-install --dir=${DESTDIR}/${PREFIX}/share/applications/ ezdm.desktop                      desktop-file-install --dir=${DESTDIR}/${PREFIX}/share/applications/ ezdm-console.desktop                      install -g root -o root -m 0666 ezdm.png ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/ezdm.png                     install -g root -o root -m 0666 ezdm-console.png ${DESTDIR}/${PREFIX}/share/icons/hicolor/128x128/ezdm-console.png                      update-desktop-database ${DESTDIR}/${PREFIX}/share/applications      And debian/postinst:               cat debian/postinst      #!/bin/bash -x     ln -sf /usr/games/ezdm* /usr/bin     for I in /usr/lib/python2.7/dist-packages/ezdm_libs/*.py; do             python -m compileall $I     done     update-desktop-database     #DEBHELPER#


title: How do I gracefully suspend and resume `cmd1 && cmd2 && cmd3` chain?

text: From the previous question it seems I failed to understand how `&&` and `^Z` interact properly:               $ command1 && command2 && command3     Running command1 ...     Running command2 ...^Z     [1]+  Stopped     $ fg && command4     Running command3     Running command4      , which I thought can be used to "append" the chain after it started, seemed to work only because of `command3` was the last command; and stopping it on `command2`, for example, whould have provided different result (`command3` whould have been ignored). How do I suspend the `&&` chain gracefully, without cancelling the rest of the commands? I want also the exit code to be preserved if it is needed for further logic in the command line. If I know that I may want to suspend the chain in advance, I can start it like that: `( command1 && command2 && command3 )`, so it whould be gracefully suspendable. Buw how do I do it when it is started plainly? If the commands don't provide output (unlike in example above), should not be run twice or out of order then the only way I can think up is pressing `^Z`, analysing what was stopped, then manually constructing `fd && the_rest_of_commands`, which is inconvenient and error-prone.


title: Openbox won't load wallpaper on startup

text: I've tried a lot of things. I googled and followed tutorials and I'm still unable to have my wallpaper load on startup. What I've done so far is I've added the wallpaper of my choice via feh `feh --bg-scale /home/MYNAME/Pictures/wallpaper123.jpg`. This set's my wallpaper just fine. Obviously after restart, the wallpaper is not loaded. So I followed some tutorials that had me do the following I added this code `#My wallpaper eval cat $HOME/.fehbg &` to the `autostart.sh` file in `/etc/xdg/openbox`. Well, when I restart, my wallpaper is never loaded. I also tried adding a directory called "Wallpapers". I then copied the following code                #!/bin/env bash      WALLPAPERS="/home/yourUserName/wallpapers"      ALIST=( `ls -w1 $WALLPAPERS` )      RANGE=${#ALIST[@]}      let "number = $RANDOM"      let LASTNUM="`cat $WALLPAPERS/.last` + $number"      let "number = $LASTNUM % $RANGE"      echo $number > $WALLPAPERS/.last           feh --bg-scale $WALLPAPERS/${ALIST[$number]}      into a file called `wallpaper.sh` and saved it at `~/.config/openbox/` I ran `chmod +x wallpaper.sh` and added               #Random wallpaper     ./pathFromHome/wallpaper.sh      to my `autostart.sh` file. Still, nothing. What am I doing wrong?


title: Running GIMP properly?

text: I use GIMP 2.6.10 on Debian squeeze 6.0.3, and GIMP doesn't show some images (layers) or elements. For example, this is a PSD I loaded into GIMP, and it shows up like this: ![Screenshot of the problematic PSD](http://i.imgur.com/MC8WC.png) When I load the same PSD in Adobe PS it works fine. Do I need to install some plugins for GIMP in order to work or enable some options?


title: Pipe all input and output of terminal to file

text: I do not know if this is even possible or not, but in an attempt to keep track of many changes I am about to make to my system I want to track all input I type and all output from a terminal I'm working with to a file. I've been messing around trying to do this and here is what I have so far: `bash > /tmp/output.txt` This has some quasi success. I tested this with something simple: `sudo apt- get update && sudo apt-get upgrade` which dumped the normal output to the file, but not what I typed in. Additionally I'd like to be able to see the output as well as have it stream to my output file, just for readability. (This can be worked around with a second terminal running `tail -f`, but it'd be nice to have it in one place).


title: extract middle section of lines of a text file?

text: I am writing a php script to parse a large text file do to database inserts from it. However on my host, the file is too large, and I hit the memory limit for php. The file has about 16,000 lines; I want to split it up into four separate files (at first) to see if I can load those. The first part I can get with `head -4000 file.txt`. The middle sections are slightly trickier -- I was thinking about piping `tail` output into `head` ( `tail -4001 file.txt|head -4000 > section2.txt` ), but is there another/better way? **Edit** actually my logic is messed up -- for section two, I would need to so something like `tail -12001 file.txt|head - 4000`, and then lower the `tail` argument for the next sections. I'm getting mixed up already! :P


title: How can I move a process into the background and also silence its output?

text: Say I start a process in the terminal and it sends output to standard error while it runs. I want to move the process into the background and also silence it at the same time. Is there a way to do this without stopping the process and starting it again using `&` and `> /dev/null 2>&1` ? I'm wondering if there is some command that performs `bg` and can change the output descriptors of the target process too.


title: Why is $'\0' the same as ''?

text: A common way to do things with a couple of files is—and don't hit me for that:               for f in $(ls); do …      Now, to be safe against files with spaces or other strange characters, a naive way would be to do:               find . -type f -print0 | while IFS= read -r -d '' file; …      Here, the `-d ''` is short for setting the ASCII NUL as in `-d $'\0'`. But why is that so? Why are `''` and `$'\0'` the same? Is that due to the C roots of Bash with an empty string always being null-terminated?


title: MPI mpdboot error

text: I have a problem with mpi in a 3-box cluster with machines named `head`, `node1` and `node2` respectively. I install a newer version on `node2` and the problems arises. When I include only `head` and `node2` in the mpi ring, and try to boot with `mpdboot` from `head`, I get the error:               mpdboot_head (handle_mpd_output 399): from mpd on node2, invalid port info:     mpd_port=55270      When I try to boot from `node2`, I get the error:               mpdboot_node2 (handle_mpd_output 426): from mpd on head, invalid port info:     no_port      However, if I boot mpi with `mpd` manually on `head` and then add `node2` into the mpi ring, no errors are issued. What's more, `mpd` can be boot without any error on `head` and `node1` only. Is this some problems related to downward compatibility? How could I solve this? Any hints will be highly appreciated. Thanks and Best Regards!


title: Two mice pointers (xinput stuff) issue (logs me off)

text: I'm trying to use two mice (mouse pointers) on my laptop (Linux Mint 16) so I've been following some tutorials that I found: the idea is to work with the xinput command. I have two mice (Touchpad and a wireless one). So I create a new master               xinput --create-master secondmice      it seems to work since a new pointer appears on the screen (I can't move it though). Then I "bind" it to a mouse (the wireless one):               xinput reattach ID_WIRELESS ID_SECONDMICE      it looks ok for no error occurs. Once it's done I start moving the mice (wireless) to test. But it immediately crashes and logs me off. When I log back in, everything's alright, but I still have only my one unique pointer. Why does it crashes? I checked log files and I couldn't find anything "weird" or that might helped me (`/var/log/Xorg.0.log`, `/var/log/messages`, `~/.xsessions-errors`...) EDIT: When it crashes a black-screen shows up (tty), right before I got on the "Log-in page", here's what we can read:   Linux Mint 16 Petra AslComp tty1 AslComp: [ 24.263867] brcmsmac bcms0:0: brcmsmac: brcms_ops_bss_info_changed: associated [ 24.264035] brcmsmac brcms0:0: brcms_ops_bss_info_changed: qos enabled: true (implement)   "AslComp" is computer name.   I've searched those terms with Google but it's more related to Wifi than xinput.


title: If I have a really strong passphrase for my gpg private key, how reckless can I be with my .gpg directory?

text: The title pretty much explains it all: I have a very (read: **_very_** ) strong passphrase for my private key. How reckless can I be with my .gpg directory? Put another way, how many bits of entropy would I need in my passphrase to safely post my .gpg directory on the web? Put yet another way, how strong is the encryption algorithm protecting my secret key?


title: Copy a file into another directory's inside

text: I want to copy positionXYZ into another directory's inside I want both of them.I put:               Tutorials myname $ cp -r positionXYZ Documents/Gerris\ Programs/Tutorials/tutorial6/      Then it says :               cp: directory Documents/Gerris Programs/Tutorials/tutorial6 does not exist      Tutorials is the positionXYZ's current parent directory, tutorial6 is the directory which I want to copy the file into.


title: bash color echo : problem with '-n' option

text: here is my function to print color text:               cecho()     {     color=${1:-""}       #  defaults to original color if no color specified     colorreset="\E[0m"   #  back to black after function return     while read line; do       echo -e "$color$line$colorreset"     done     return     }          $ blue="\E[34m"     $ echo "message" | cecho $blue     $ message  #  it appears in blue      but if I use -n option then nothing is printed:               $ echo -n "message" | cecho $blue     $      I need '-n' option because sometimes I print text with only a word with color in the whole line, like:               $ echo -n "this is "     $ echo "blue" | cecho $blue


title: Stopping .bashrc without exiting shell

text: My .bashrc file is modularized and I've got some error checking in it. In bash scripts, I typically have a function _errexit (or something similar) that I call when I detect an error and want to exit. In the case of my bashrc file(s), I don't want to exit (it would close the shell) - but I do want to display an error message and stop processing immediately. Any ideas how this might be possible?


title: Issue with bad sectors on a laptop hard drive

text: I had Windows installed on my laptop and suddenly one morning Windows couldn't start. Then I tried after formatting and for once it became possible. I also installed Ubuntu as logical drive (deleted all HDD partitions) and then tried to install Windows but in the middle of the installation process (after expanding Windows files) it showed an error and stopped. I'm using Ubuntu with live CD. In the Ubuntu disk utility, I see all HDDs as unallocated free space. The following points are being shown:               ----smart status: disk failure is imminent          >>>results of selt-test     --self assessment-failing     --power cycles-1834     --bad sectors-2047     --overall assessment-disk failure is imminent(backup all data and replace the disk)     >>>Attributes     for reallocated sector unit     -assessment is failing     values---             normalized-1             worst-1             threshold-50             value-2047 sectors     >>>      Now I'm using the badblocks command.               sudo badblocks -v /dev/sda      But it has been running for 106 hours, and still continues. I don't want to replace my HDD. Please help me so that I can use Windows on my laptop.


title: Vi vs vim, or, is there any reason why I would ever want to use vi?

text: I know a bit about *NIX text editors (currently migrating from `nano` to `vim`), and, after looking around a bit on the Unix & Linux SE, have noticed that a fair about of question use `vi` instead of 'vim'. I know that 'vim' stands for 'Vi IMproved', and, with that in mind, am wondering why anyone would rather use vi instead of vim. Does vi have any significant advantage over vim? Edit: I think that my question is being misinterpreted. I know that vim is, for the most part, significantly more powerful and feature-complete then vi is. What I want to know is if there are any possible cases where vi has an advantage over vim, such as less memory use, prevalence on *nix systems, etc.


title: Send task to background in an "if"

text: Why is this?               if true; then sleep 3 &; fi     bash: syntax error near unexpected token `;'      I want to run               sleep 3      in the background so that the command ["sleep 3" is just an example] would run in "paralell" style, so it finishes faster. But I'm getting this:               bash: syntax error near unexpected token `;'      error message. Why? Why can't I send a task to the background?


title: How to /dev/null background processes "informational" output?

text: [USER@SERVER ~] sleep 3 &     [1] 5232     [USER@SERVER ~]      [1]+  Done                    sleep 3     [USER@SERVER ~]       How do I /dev/null these two messages?:               [1] 5232     [1]+  Done                    sleep 3      p.s.: so I need the output of the process, but not the mentioned two lines!


title: Skip first 3 byte of a file

text: I am using AIX 6.1 ksh shell I want to use one liner to do something like this               cat A_FILE | skip-first-3-bytes-of-the-file        I want to skip the first 3 bytes of the first line, is there a way to do this?


title: In terminal, I can search to end of log faster than the data gets there

text: [The Question]   _Is there some way to have the pipe/tee/write combo write lines immediately? ... if it can be done, what is the trade-off?_ [The Backdrop]   My script sends a keypress to the terminal, which is running `app`.   That keypress causes `app` to write a _marker_ to its log.   The log is the _app's_ normal screen output (timestamped lines).   The log is being written via `| tee -a log` The marker _marks_ the line I want; ie. the timestamped line _before_ the marker. The problem is that when I then _immediately_ search the log (using `sed` from the same script), it sometimes returns a previous marker, ie. the most recent marker has not been written to the log yet. I assume this is a buffering issue, but I'm in unknown territory with that. Not sure if it matters: The script is `elisp`. The terminal is `emacs terminal emulator` with a `bash` shell.


title: Network Interface Names output from ifconfig

text: So this has been driving me nuts for a good couple of hours, so I thought I'd ask about it here (let me know if there's a better forum for this question). I have a CentOS Virtual Machine on ESXi. I was trying to configure the network interface because it wasn't working, so I changed the file `/etc/sysconfig/network-scripts/ifcfg-eth0` to the right IP address/gateway/netmask/MAC ID etc. After restarting the network this has fixed my connection problem (I can ping the default gateway and other VMs). **However, when I type "ifconfig" I don't get the listing of "eth0" as an interface, but I get "eth2" and "eth3"instead** , even though the files `/etc/sysconfig/network-scripts/ifcfg-eth` and `/etc/sysconfig/network- scripts/ifcfg-eth3` do not exist. This makes me think that "ifconfig" gets its interface list from somewhere else, and I'm not really clear on how it does this. I tried editing `/etc/udev/rules.d/70-persistent-net.rules` to see if deleting the entries for eth2 and eth3 would fix this, but it doesn't. So if anyone knows why I'm getting this behavior for ifconfig, let me know. Thanks!


title: How to install vim-gtk in debian wheezy

text: this is the terminal trace               root@wheezy:/home/me# sudo apt-get install vim-gtk         Reading package lists... Done         Building dependency tree                Reading state information... Done         Package vim-gtk is not available, but is referred to by another package.         This may mean that the package is missing, has been obsoleted, or         is only available from another source              E: Package 'vim-gtk' has no installation candidate


title: Alpine using localhost address

text: I'm having a hard time figuring out what's going on with my setup, first there's no problem with the `imap` part as I can see my email, but when I try to send a message I get this error:               [Mail not sent. Sending error: 501 Syntax error in parameters or arguments]      As far as I know my `smtp` configuration is ok:               mail.gmx.com:465/user=user@gmx.com/ssl      When loking at the logs there are some entries that don't look like they're ok, it seems like alpine is using my localmachine address instead of my email address.               ... MAIL FROM:<myhost@mylocaldomain>     ... EHLO mylocaldomain      What can I do to change this behavior, I've been searching but can't find a parameter that to modify this. Thanks.


title: Running makefile results in "/sbin/modprobe: invalid option -- 'l'"

text: I'm trying to set up Slackware 14.0 on an Asus EEE PC Flare Series Netbook. Currently I'm trying to configure the wifi. When I enter the following:               # iwconfig      I get:               lo        no wireless extensions.      Which I've figured out means I don't have the driver for my wireless card installed (based on this - see the Wireless subheader). I checked `lspci` and here's the info on my network card:               02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev-01)      I managed to find a guide here detailing how to install the right driver. I downloaded the tarball from the tutorial, transferred it to the computer running Slackware via usb, extracted it, and ran the commands from the tutorial. When I got to the part where I ran `make`, however, I got the following output:               # make     /sbin/modprobe: invalid option -- 'l'     /sbin/modprobe: invalid option -- 'l'     ./scripts/gen-compat-autoconf.sh config.mk > include/linux/compat_autoconf.h      At which point it gets stuck. I eventually cancelled it with `Ctrl`+`C` and tried to run `make clean`. That also gave the `/sbin/modprobe: invalid option -- 'l'` error a bunch of times but eventually finished. At this point I googled a bit and eventually found this from 2 years ago which states that the `-l` flag was not implemented in the kernel at that point, but it was on a TODO list. I checked man modprobe and the `-l` flag wasn't mentioned anywhere, nor was there a TOOD section. I also checked the make file and sure enough it tries to invoke `/sbin/modprobe` with the `-l` flag, causing the `make` process to fail. Has anybody encountered this problem with `modprobe` before? Is there some alternative command I can substitute it with? (I can edit the makefile). Any help would be greatly appreciated.


title: mountall isn't running, it seems, and no log, and no clue

text: As shown below, I have /etc/init.mountall.conf, but /var/log/upstart has no mountall.log, and, more to the point, my non-root file system from /etc/fstab does not mount at boot. Mounts fine with mount -a.               benson@mmbackup:/var/log/upstart$ ls /etc/init/mountall*      /etc/init/mountall-bootclean.sh.conf       /etc/init/mountall-net.conf          /etc/init/mountall.sh.conf      /etc/init/mountall.conf                    /etc/init/mountall-reboot.conf       /etc/init/mountall-shell.conf      /etc/fstab line:               UUID=9cce2eed-c30e-43cb-b299-2a3303206ad8 /seagate ext4 noatime,data=journal 2 2


title: What does "if [ -e $name ]" mean? Where $name is a path to a directory

text: In the `if [ -e $name ]`, what condition check is `-e`?   `$name` is a variable of a path to a directory.


title: Should I restart after a pacman upgrade?

text: after running               sudo pacman -Syyu      or               sudo pacman -S [something to install]      should I restart just to be safe?


title: About the .file and ./directory confusion

text: This is a dumb question, but I recently moved from windows to linux, and I see one strange thing:               ./configure      or               nano /something/something2      Is this `something2` a file? It looks like a directory, I don't understand how it can be edited? Same for `./configure`. What does it means?


title: Grub modify menu screen [ advanced ]

text: I've modified my Grub menu. Here is how it looks like right now: ![enter image description here](http://i.stack.imgur.com/qvkSf.jpg) What I would like is to remove the top information about Grub version or even better to remove all " **GNU GRUB version 1.99-27.1crunchbang1** ". Additionally, it would be great to remove the bottom information about using the arrow keys to move within menu, and how to edit entries. To summarize - i want to get rid of text highlighted in red: ![enter image description here](http://i.stack.imgur.com/iYiZO.jpg)   1. Is it possible?    2. Is it possible without modifying the source code of Grub? I must admit I've searched for a good couple of hours in the web how to do it, but all i've got is how to do basic modifications within grub. I will appreciate any help or even a hint where to look next to a clue.


title: Can I pipe any two processes to each other?

text: In this page from _The Design and Implementation of the 4.4BSD Operating System_ , it is said that: > A major difference between pipes and sockets is that pipes require a common > parent process to set up the communications channel However, if I record correctly, the only way to create a new process is to `fork` an existing one. So I can’t really see how 2 processes could not have a common ancestor. Am I then right to think that any pair of processes can be piped to each other?


title: difference between X and Xorg executables under Debian 6.0(kernel 2.6.32-5-686)

text: What is the difference between `X` and `Xorg` executables? I have both in /usr/bin directory:               # file /usr/bin/Xorg     /usr/bin/Xorg: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped     # ls -lh /usr/bin/Xorg     -rwxr-xr-x 1 root root 1.7M Oct 30  2011 /usr/bin/Xorg     # file /usr/bin/X     /usr/bin/X: setuid setgid ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped     # ls -lh /usr/bin/X     -rwsr-sr-x 1 root root 7.1K Dec 16  2011 /usr/bin/X     #      I guess that while /usr/bin/X is not symbolic link to /usr/bin/Xorg, it still calls the /usr/bin/Xorg?


title: Maildir and mailutils?

text: I want to use the `mailutils` app on a install of Ubuntu 12.04.3 LTS with a Maildir format, but every time I run the `mail` command, the system looks in `/var/mail/user`, instead of the `Maildir` directory in the home folder. I'm aware that setting the `MAIL` variable will resolve this, however the changes only last until the user logs out. How can I make this permanent? In addition, how do I configure `mail` to not save messages into the `mbox` file in the user's home folder, but rather keep everything in `Maildir`?


title: Linux, GNU GCC, ld, version scripts and the ELF binary format -- How does it work?

text: I'm trying to learn more about library versioning in Linux and how to put it all to work. Here's the context: -- I have two versions of a dynamic library which expose the same set of interfaces, say `libsome1.so` and `libsome2.so`. -- An application is linked against `libsome1.so`. -- This application uses `libdl.so` to dynamically load another module, say `libmagic.so`. -- Now `libmagic.so` is linked against `libsome2.so`. Obviously, without using linker scripts to hide symbols in `libmagic.so`, at run-time all calls to interfaces in `libsome2.so` are resolved to `libsome1.so`. This can be confirmed by checking the value returned by `libVersion()` against the value of the macro `LIB_VERSION`. -- So I try next to compile and link `libmagic.so` with a linker script which hides all symbols except 3 which are defined in `libmagic.so` and are exported by it. This works... Or at least `libVersion()` and `LIB_VERSION` values match (and it reports version 2 not 1). -- However, when some data structures are serialized to disk, I noticed some corruption. In the application's directory if I delete `libsome1.so` and create a soft link in its place to point to `libsome2.so`, everything works as expected and the same corruption does not happen. I can't help but think that this may be caused due to some conflict in the run-time linker's resolution of symbols. I've tried many things, like trying to link `libsome2.so` so that all symbols are alised to `symbol@@VER_2` (which I am still confused about because the command `nm -CD libsome2.so` still lists symbols as `symbol` and not `symbol@@VER_2`)... Nothing seems to work!!! Help!!!!!!


title: Arch-Linux: xmonad configuration

text: I'm fairly new to Arch-Linux, but I managed to get my Thinkpad up and running with Xmonad as a window manager. Now I want to configure Xmonad, but I don't know Haskell very well and all `xmonad.hs` examples I can find do not work with the current version. I'm especially struggling to get `xmobar` running. Does somebody have a reference for me on how to configure the current Version (0.11) of Xmonad?


title: Where can I find documentation on shell script syntax for using a regex within a variable construct?

text: I'm debugging a shell script (which I didn't write) that contains this loop:               read line < "$pid_file"     for p in $line ; do       [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"     done      Can someone point me to documentation on using (what I'm assuming) is a regular expression within a string variable construct, i.e. the "${p//[0-9]/}". This topic isn't easy to narrow down in Google.


title: File permissions issue with webserver and ftp server

text: I have a question concerning permissions. I'm running lighttpd and a ftp server. I want to add a ftp user that is able to upload files to /var/www, which then are viewable in a browser. What is the safest way to set this up (apart from not using ftp)?


title: Are Linux utilities smart when running piped commands?

text: I was just running a few commands in a terminal and I started wondering, does Unix/Linux take shortcuts when running piped commands? For example, let's say I have a file with one million lines, the first 10 of which contain `hello world`. If you run the command `grep "hello world" file | head` does the first command stop as soon as it finds 10 lines, or does it continue to search the entire file first?


title: auto accepting rsa key in bash script

text: I have done a little googling and have not come up with a clear answer to this question. I was wondering if someone could help me out with this issue. Is there a way to auto accept any RSA key inside a bash script with no user interference? I need this script to run without user intervention and it will stop every time it encounters a new ip, i just need it to accept all of them.


title: Search text in command output on a PuTTY terminal

text: I would like to know how to search particular text on the terminal. If I do `cat` of log files, I would like to find certain words like job or summary so that I don't have to read through the entire log file. I know there have been a similar post about this. The answer from that post is `Ctrl` + `A` + `[` `<text>` which doesn't seem to work for me. When I press that I get a message `No bracket in top line (press Return)` or If I press those keys together I get the message `ESC`. It there a way to do this with PuTTY? Alternatively, is there a generic way to search for text in the output of commands?


title: Linux mint freezes on second account login - unable to handle kernel NULL pointer dereference at (null)

text: I have two accounts, `daniel` and `dn`. When I log in with `daniel` first, everything is okay. But I can't login with `dn`, it freezes. It's irrelevant if I log out `daniel` or try a parallel login. It's the same way round with the account `daniel` if I log in `dn` first. The desktop is shown, without any folders and I can't move the mouse. Some information about the system: 64 bit dual boot Mint 16 MATE / windows 8 Both Systems on the same SSD / Secondary HDD Error message from `syslog`               Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Successfully made thread 2507 of process 2507 (n/a) owned by '1001' high priority at nice level -11.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Supervising 7 threads of 3 processes of 2 users.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630773] BUG: unable to handle kernel NULL pointer dereference at           (null)     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630827] IP: [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630891] PGD 0      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630905] Oops: 0000 [#1] SMP      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.630927] Modules linked in: pci_stub vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) joydev(F) x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel(F) parport_pc(F) ppdev(F) kvm(F) crct10dif_pclmul(F) crc32_pclmul(F) ghash_clmulni_intel(F) cryptd(F) bnep rfcomm dm_multipath(F) scsi_dh(F) uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev btusb arc4(F) bluetooth iwldvm mac80211 microcode(F) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep(F) snd_pcm(F) psmouse(F) serio_raw(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) iwlwifi snd_rawmidi(F) snd_seq(F) snd_seq_device(F) snd_timer(F) cfg80211 lpc_ich snd(F) mei_me mei soundcore(F) fujitsu_laptop mac_hid lp(F) parport(F) dm_mirror(F) dm_region_hash(F) dm_log(F) hid_generic usbhid hid nouveau i915 mxm_wmi wmi i2c_algo_bit ttm drm_kms_helper drm r8169 ahci(F) libahci(F) mii(F) video(F)     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631442] CPU: 3 PID: 2281 Comm: Xorg Tainted: GF          O 3.11.0-12-generic #19-Ubuntu     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631489] Hardware name: FUJITSU LIFEBOOK AH531/GFO/FJNBB10, BIOS 1.16 06/21/2011     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631534] task: ffff8801fcacddc0 ti: ffff880230c4e000 task.ti: ffff880230c4e000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631578] RIP: 0010:[<ffffffffa01e0eb6>]  [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631649] RSP: 0018:ffff880230c4f5f0  EFLAGS: 00010206     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631679] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000500000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631718] RDX: 000000000000041f RSI: 0000000000000003 RDI: ffff88022dc84e80     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631758] RBP: ffff880230c4f640 R08: 0000000000000420 R09: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631799] R10: 0000000000000000 R11: 0000000000008000 R12: 0000000000001db0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631833] R13: ffff88022ec75240 R14: ffff88022dc84e80 R15: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631870] FS:  00007f065be1d980(0000) GS:ffff88023fac0000(0000) knlGS:0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631917] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631951] CR2: 0000000000000000 CR3: 000000022f4d7000 CR4: 00000000000407e0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.631990] Stack:     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632002]  ffff88020e237940 00001db40e237940 0000000000002100 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632048]  0000000500000000 0000000000000420 ffff88022e913d00 ffff88022ec75240     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632091]  ffff88020e237940 ffff88020e237900 ffff880230c4f698 ffffffffa01dedcc     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632136] Call Trace:     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632173]  [<ffffffffa01dedcc>] nouveau_vm_map_sg+0xdc/0x150 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632235]  [<ffffffffa021ab81>] nouveau_vma_getmap.isra.14+0x61/0x90 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632295]  [<ffffffffa021ac2a>] nouveau_bo_move_m2mf.isra.15+0x7a/0x130 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632351]  [<ffffffffa021b530>] nouveau_bo_move+0xa0/0x430 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632391]  [<ffffffffa008ee9d>] ttm_bo_handle_move_mem+0x24d/0x5c0 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632432]  [<ffffffffa008f8d9>] ? ttm_bo_mem_space+0x179/0x360 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632475]  [<ffffffffa008fecf>] ttm_bo_move_buffer+0x11f/0x140 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632517]  [<ffffffff810bf944>] ? tick_program_event+0x24/0x30     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632558]  [<ffffffffa008ff7a>] ttm_bo_validate+0x8a/0x100 [ttm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632612]  [<ffffffffa021bf3a>] nouveau_bo_pin+0xda/0x170 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632667]  [<ffffffffa023e42c>] nv50_crtc_swap_fbs.isra.12+0x2c/0xd0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632725]  [<ffffffffa021c27c>] ? nouveau_bo_rd32+0x2c/0x30 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632782]  [<ffffffffa0240481>] nv50_crtc_mode_set+0x121/0x3f0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632826]  [<ffffffffa010f02c>] drm_crtc_helper_set_mode+0x27c/0x450 [drm_kms_helper]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632877]  [<ffffffffa011067e>] drm_crtc_helper_set_config+0x99e/0xaf0 [drm_kms_helper]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.632936]  [<ffffffffa0052f8d>] drm_mode_set_config_internal+0x5d/0xe0 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.634614]  [<ffffffffa00559c7>] drm_mode_setcrtc+0xf7/0x650 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.636343]  [<ffffffffa0226db0>] ? nouveau_user_framebuffer_create+0x60/0xb0 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.638033]  [<ffffffff816e8902>] ? mutex_lock+0x12/0x2f     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.639735]  [<ffffffffa0046212>] drm_ioctl+0x532/0x660 [drm]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.641378]  [<ffffffff811b8ba5>] do_vfs_ioctl+0x2e5/0x4d0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.643044]  [<ffffffff811a91f1>] ? __sb_end_write+0x31/0x60     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.644726]  [<ffffffff811a6d82>] ? vfs_write+0x172/0x1e0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.646494]  [<ffffffff811b8e11>] SyS_ioctl+0x81/0xa0     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.648122]  [<ffffffff816f521d>] system_call_fastpath+0x1a/0x1f     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.649646] Code: 45 d0 48 8d 04 d5 08 00 00 00 48 89 45 c0 41 8d 44 24 04 89 45 bc eb 0c 0f 1f 44 00 00 48 8b 45 b0 8b 70 30 48 8b 45 c8 4c 89 f7 <4a> 8b 14 38 48 c1 ea 08 49 89 d5 48 83 ca 03 49 83 cd 01 83 e6      Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.652856] RIP  [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau]     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.654394]  RSP <ffff880230c4f5f0>     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.655842] CR2: 0000000000000000     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO pulseaudio[2507]: [pulseaudio] pid.c: Daemon already running.     Feb  9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [   74.666275] ---[ end trace fae09bf583a1a106 ]---      xorg.20.log (what does resizing framebuffer to 2390x768 mean? It's not my screen resolution):               [    74.441] reporting 5 6 34 244     [    74.461] reporting 5 6 34 244     [    74.467] reporting 5 6 34 244     [    74.517] (II) XKB: reuse xkmfile /var/lib/xkb/server-1BCDDEFD4E35562D3483623A3498B96EFC960598.xkm     [    74.532] reporting 5 6 34 244     [    74.546] reporting 5 6 34 244     [    74.575] reporting 5 6 34 244     [    74.577] reporting 5 6 34 244     [    74.592] reporting 5 6 34 244     [    74.595] (II) intel(0): EDID vendor "LGD", prod id 732     [    74.595] (II) intel(0): Printing DDC gathered Modelines:     [    74.595] (II) intel(0): Modeline "1366x768"x0.0   70.00  1366 1402 1450 1492  768 771 776 782 -hsync -vsync (46.9 kHz eP)     [    74.596] (II) intel(0): EDID vendor "LGD", prod id 732     [    74.596] (II) intel(0): Printing DDC gathered Modelines:     [    74.596] (II) intel(0): Modeline "1366x768"x0.0   70.00  1366 1402 1450 1492  768 771 776 782 -hsync -vsync (46.9 kHz eP)     [    74.612] reporting 5 6 34 244     [    74.623] (II) intel(0): resizing framebuffer to 2390x768     [    74.623] (II) intel(0): switch to mode 1366x768@60.0 on pipe 0 using LVDS1, position (0, 0), rotation normal     [    74.640] have a master to look out for     [    74.640] adjust shatters 0 2390     [    74.640] need to create shared pixmap 1      output of df               Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda6      148860244  34569704 106705824  25% /     none                   4         0         4   0% /sys/fs/cgroup     udev             4028988         4   4028984   1% /dev     tmpfs             808724      1232    807492   1% /run     none                5120         0      5120   0% /run/lock     none             4043620       416   4043204   1% /run/shm     none              102400        36    102364   1% /run/user     /dev/sdb1      527771640 143074604 384697036  28% /media/sw/Volume     /dev/sdb2      201586656   4858500 186488108   3% /media/sw/LINPROG


title: Why does this not work when the load average exceeds 1?

text: I have been testing this script and its behavior has been odd. The script should generate notifications whenever the load average exceeds a specified limit. Whenever I pass a CPU_LOAD_LMT >=60, no notification is generated whenever the load average exceeds 2 * 0.6 or 1.20 (2 since my system has 2 cores, explained below). There doesnt seem to be anything wrong with the script since notifications **are** generated uptill I pass 50. The CPU_LOAD_LMT is multiplied with number of cores (`nprocs`) and is then compared to the 100 * loadaverage. Here is the relevant portion of the code.                  list=`cat /proc/loadavg`        set -- $list             load=$CPU_LOAD_TIME #Extract required cpu load                load=`echo "scale=2; $load * 100" | bc` #Convert to integer        load=`printf "%.0f" $load` #Remove decimal digits              highload=$((`nproc`*$CPU_LOAD_LMT)) #Calculate high load threshold based on number of cores              if test $load -ge $highload         then                  if [ "YES" == $AUDIO ]              then                  paplay /usr/share/sounds/ubuntu/stereo/system-ready.ogg &             fi                  #Generates visual notification             if [ "YES" == $GRAPHICAL ]             then                 notify-send -i /usr/share/icons/default.kde4/128x128/devices/cpu.png "High CPU Load"'!' \                 "The CPU has been hard at work in the past minute." #No support for timeouts. Default is 5 seconds.             fi            What could be the reason?


title: 2pass encoding by ffmpeg at once

text: I encode a video file by using ffmpeg like this.               $ ffmpeg -i input.avi -pass 1 -an output.mp4     $ ffmpeg -i input.avi -pass 2 -ab 128k -y output.mp4      So I typing always 2 times, is there way to encode a video by 2-pass at once? I change a options often and of course input and output file name is different each times.


title: How do I disable and re-enable Java whenever I want?

text: For me Java is just a security threat. Not many legitimate Linux apps use Java. However there is an abundance in Java malware and malicious remote administration tools like Jrat among others. But one legitimate app I run like the "Arduino IDE" may unfortunately need Java. So, I want an option to enable or disable Java whenever I want without uninstalling it. I was thinking of denying Java permission to execute using `chmod`. Would this work? Is there a better alternative? Would moving Java from a "bin" folder work? Edit: I just realized that Java may be deeply integrated with the OS and `chmod` method may work for `.jar` files but may not actually work for all Java executables. **Important:** I am not talking about Java browser plugin. I'm talking about Java on my linux system. I chose linux because it didn't have many **malicious rats** and **botnets** like **Darkcomet** , **Poison IVy** , **Zeus**. However there are **Java rats** like **Jrat**. Which could be autostarting once I accidentally gave them root.


title: Is space not allowed in a filename?

text: It is said that on Unix and Linux in general, you should avoid having spaces in a filename of a file (ordinary file, dir, link, device file, ...). But I do that all the time. For a filename with a space inside,   * In Nautilus, the space character is shown as a space.    * In Bash terminal, I either use `\ ` to represent a space, or enclose the filename within a pair of double quotes.   * in some applications's files (Nautilus, not sure if OS will also do so), the filename is written with the space replaced with `%20`. Is a space really not allowed in a filename? How do you use or deal with a space in a filename correctly?


title: Creating shell script on Desktop and not getting a prompt?

text: I have created a shell script on Desktop. Whenever I open it , I get a prompt to either run in terminal, display and etc. How to remove this prompt?


title: What is the difference between OSX, Linux and Windows System Authorisation?

text: Last week my lab instructor started giving us introduction about linux and how to use CLI commands. Anyway, he started insulting and joking about Mac OSX systems and how they are a joke systems. He said that, he used it for a week in my university department and he faced a problem, "you don't have a fully control on your machine; you always have to sudo to be a superuser -- that's why I use Windows" he said. "Mac is a **_linux_** based, Apple basically modified some codes, and mixed some to make this OS" he said. I've been a Mac user since a kid, and I have learned that having a root access to do any daily work is a very bad and dangerous practice. What do you guys think about what he said? did he really misunderstood Unix machines? I'm not trying to prove or argue with anyone nor him, I just want to know if what he said could possibly be true? or he was just sharing his biased opinion? **Update:** _**What I meant is, if there is any difference between OSX, Linux and Windows authentication system?_**


title: How to install Intel Graphics drivers for Mint 13

text: I have **choppy video** and my **windows are choppy** when I move them around. Also when my PC 'turns off monitor' it **does not turn off normally but like the cable was unplugged**. I guess I need to install a driver for my new 'graphics' chip. Can someone please provide the 'best' way of installing graphics drivers for my **Celeron G1820** CPU. Here is what I get from `lspci`:               00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)      I can provide any additional info if needed.


title: How to permanantly disable /var/log/secure?

text: When I delete /var/log/secure this file will be recreated. How do I disable the recreation of this file?


title: Debian: An MTA just to solve dependencies, not because I really need one

text: It has bothered me for years that with every new Debian installation, a full MTA (Mail Transport Agent) was installed even if I had no desire to use the machine as a mail server. The MTA was necessary to satisfy package dependencies, though. I ended up with exim (which took forever to load during boot on some machines) and others (which seemed to run memory-heavy background stuff that slowed down the entire system). Removing one required installing another...


title: questions on find and grep

text: With respect to the following `find` command-line               find . -type f -exec grep -l strings {} \;      I do not understand the usage of `-exec` and `{} \`.


title: Restore /etc/hosts on SuSE

text: I have lost my `/etc/hosts` file on SuSE Enterprise 11.3 64 bit. Is there any way to get the original file back?


title: Does /var keep growing in size?

text: tldp.org quotes /var as: > Files in /var/log can often grow indefinitely, and may require cleaning at > regular intervals. So without cleaning, using a system for a long enough period will fill up all of /var. Do some distros rotate logs automatically or is in generally accepted it's the user's role. With so many new people getting into *nix, this be better know, and how should this be handled?


title: 16 Colors in ZShell

text: I only seem to be able to call 8 colors in my zshell prompt. Example:               PROMPT="[%n@%{$fg[magenta]%}%m%{$reset_color%} %.]     %# "      Works fine. However,               PROMPT="[%n@%{$fg[brmagenta]%}%m%{$reset_color%} %.]     %# "      Doesn't work. Basically, none of the "bright" color variations appear. After doing some research, I found that zsh's colors are called by the "colors" setopt. doing               echo ${(o)color}      yields this output:               00 01 02 03 04 05 07 08 22 23 24 25 27 28 30 30 30 30 31 31 32 32 33 33 34 34 35 35 36 36     37 37 39 39 40 40 41 42 43 44 45 46 47 49 bg-black bg-blue bg-cyan bg-default bg-green     bg-magenta bg-red bg-white bg-yellow black blink blue bold conceal cyan default faint green     magenta no-blink no-conceal no-reverse no-standout no-underline none normal red reverse     standout underline white yellow      As you can see, only the standard 8 colors are available. I've tried using the "bg-" variants, which also leave the output as the default text color. Any help you can provide will be greatly appreciated. I could, of course, just use one of the normal colors, but then I'd learn nothing!


title: Problem with path MTU discovery over pppd

text: I'm having an issue with pppd doing PPPoE on CentOS 6.3. The CentOS system is a dedicated router/gateway which performs NAT (both directions) and various packet filtering. It has separate NICs for the LAN and Internet side, eth0 and eth1, respectively. On the Internet side is a DSL modem. The modem likes doing everything itself, including NAT. In order to prevent it from doing so I have to give it invalid account info and then implement PPPoE on the CentOS system. I had a problem when doing PPPoE on the CentOS system with Internet connectivity being very flaky. Clients could access some sites and not others, some web pages would half-load and then always stop at the same position, and TCP connections would often reset. I've isolated this down to an MTU issue. I can get any given client system (all Windows) on the LAN side working fine by reducing its MTU down to 1492 from the standard 1500. On the other hand, if I allow the modem to do PPPoE and NAT, enable IP and the DHCP client on eth1, and set my IP filtering script to route to eth1 instead of ppp0, clients work fine with their MTU set to 1500. (The problem with this config is that double NAT can impact performance and makes inbound connection routing trickier.) Ping testing (with DF) reveals that the Internet-bound MTU is actually still limited to 1492, even though the clients don't need to be set as such. It therefore seems that clients are normally doing path MTU discovery but that pppd (or perhaps NetFilter) is somehow getting in the way of it. I normally have NetFilter (iptables) on the CentOS system set to drop all INPUT and OUTPUT traffic (since the system's only job is forwarding). I tried temporarily changing these policies to ACCEPT, in case path MTU discovery was depending on ICMP errors from it, but the problem remained. I'm not at all experienced in PPPoE and am hoping someone might be able to point me in the right direction. Thanks!


title: Any command to view the file system internal fragmentation size under a directory?

text: If the block size of a file system is 4KB, then for a 1KB file, 3KB space(which is internal fragmentation) is wasted. So, under a directory, is there any command to summarize how much disk space is wasted due to internal fragmentation?


title: Netbook w/ Fedora 17 and USB Numpad at Boot Disables Internal Keyboard

text: I have a netbook with F17 installed. No X, just text console. The system boots fine and the internal keyboard works. I can plugin a USB numpad after boot and it functions reliably. However, if the system is booted with the USB numpad attached the entire internal keyboard is frozen until the USB numpad's numlock key is pressed. I've tried using usbreset and setleds to reset the numlock programatically - unsuccessfully. The only thing that works is to press numlock on the USB numpad or unplugging and replugging.


title: HTTPS Redirecting to Subdomain

text: I have a subdomain at `https://mail.example.com` with a valid certificate. However, if someone were to accidentally type in `https://example.com` to the address bar, the certificate for the mail server is picked up instead, and thus displays the subdomain contents. How can I fix this using apache's vhost config files?


title: VPS freezes every few days (rcu_sched_state detected stall on CPU x)

text: **Background:** I have an Ubuntu 12.04 (64bit) in Xen virtualization environment. 1 GB RAM, 1 processor. Every few days I get the following error message: > rcu_sched_state detected stall on cpu 0 (t=xxxxx jiffies) Before when I had Ubuntu 11.01; after a distribution upgrade the error is still occurring. The server runs (don't ask, I'm just a Linux rookie developer who has to "maintain" this): OEMPro, Apache2/MySQL/PHP, on main website with 2 Wordpress blogs. Daily page-loads are not more then 5-7K. There are no huge peaks of memory or CPU usage before the stall (as tracked on our Munin graphs). ### Questions   1. The freeze can be caused via huge sql queries?   2. How can I fix it?


title: Only one CPU core is active on Fedora 16

text: I've upgraded from F15 to **F16** and noticed that I have a problems with hardware detection. Upon loading I can see message like               ...     CPU#1 not responding     ...      on the screen. It disappears and I can login then as usually. But I have **only 1 CPU** in System Monitor and it is **always loaded** by 80-100%. So my PC is very noisy. :) I've noticed also that Caps Lock indicator is always on irregardless of actual caps lock status. And the system freezes out after 5-10 minutes. :( I've tried **clean install of F16** and the problem is the same. My PC is **Compaq Presario CQ56-118EO** with **Intel Pentium Dual Core T4500 CPU**. I've tried to google but failed. Is my hardware/BIOS/karma incompatible with Linux 3.x? dmesg output P.S. I upgraded my BIOS to the last version available at HP site dated back to April of 2011. No changes... P.P.S. Not Foedora specific. Exactly the same situation with openSUSE 12.1


title: Cannot install Debian on QEmu-arm

text: I'm trying to run Debian 6 network install with this command:               sudo qemu-system-arm -M versatilepb -kernel ./vmlinuz-2.6.32-5-versatile -initrd ./initrd.gz -hda ./debianlxde.img -m 256 -append "root=/dev/ram"      where kernel and initrd are taken from:               http://ftp.de.debian.org/debian/dists/squeeze/main/installer-armel/current/images/versatile/netboot/initrd.gz     http://people.debian.org/~aurel32/qemu/armel/vmlinuz-2.6.32-5-versatile      The installer runs but when it tries to recognize hard drives, it cannot. My OS is Fedora 16, qemu-system-arm version is 0.15.1 How can I fix it?


title: CentOS doesn't know what the internet is

text: So I've done my share of investigating this problem... I just recently created a CentOS 6 VM on my LinuxMint box using VirtualBox. I left all the recommended values the same upon creation (8GB HDD, 512MB RAM, blah blah blah...). But it DOESN'T connect to the internet! When I try to ping an external network (google.com) it doesn't recognize the host:               ping: unknown host google.com      and when I try to ping my internal IP of my host box it says that:               connect: Network is unreachable      (perhaps it can see my host network, just doesn't know a route to it?) I've cleared my `iptables`, used every single given network adapter VirtualBox offers, and used both NAT and Bridged Adapter modes. I also reaped Google of all that I could mentally find. When I `ifconfig` it only shows the `lo` interface (loopback), unless I manually enable the `eth0` interface via the `ifcfg-eth0` file (set `ONBOOT="yes"`) and restart. But when I enable the `eth0` interface, it doesn't show an IP; just the MAC and IPv6 one. I don't think its the host's internet or link to the Guest OS at all... I have a WinXP VM set up and it can access the internet. Perhaps the answer is more obvious than I think?


title: Display all the dates in week numbers in UNIX

text: I know the command to get the week number of a date is `date +%W` Output: `03` Now, is there a way of giving a week number it will display all the dates in that week? Or should I write a script? Eg: Input: `03` Output:               Jan 20     Jan 21     Jan 22     Jan 23     Jan 24     Jan 25     Jan 26      First week (Jan 1, 2, 3,4 and 5) are considered as week no '0'. So the first week starts from 6th jan(First Monday in Jan 2014), 2nd week starts from 13th and third week starts from 20th


title: Running any kind of login script when sh is linked to bash

text: My problem: My web host offers ssh to their shared server. I want to set up a couple of aliases and such, so I'm trying to get a login script of any flavor to run. If my shell was plain bash, I would simply add my stuff to one of the dotfiles and be done with it. Now, as it happens, my shell is specified as `/bin/sh`, which is linked to bash:               sh-3.2$ /bin/sh --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.     sh-3.2$ /bin/bash --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.     sh-3.2$      I've tried creating all the usual suspects, `~/.bash_profile`, `~/.bash_login`, `~/.bashrc`, `~/.profile` and `.login` without luck. What can I do to execute a command on startup? Any file names I've forgotten to try? **Should** any of these work under my conditions? I.e. has my host done something to disable login script? I'd prefer not asking my host to set a different shell for me until I've gotten my facts straight about this.


title: How to utilize XDG directories and paths in Bash?

text: I wonder how to access not only the variables defined in `~/.config/user- dirs.dirs` with `xdg-user-dir`, e.g. `"$(xdg-user-dir VIDEOS)"`, but also the following standard variables:   1. `XDG_CACHE_HOME:-$HOME/.cache`   2. `XDG_CONFIG_HOME:-$HOME/.config`   3. `XDG_DATA_HOME:-$HOME/.local/share`   4. `XDG_RUNTIME_DIR:-"/run/user/$USER"`   5. `XDG_CONFIG_DIRS:-/etc/xdg`   6. `XDG_DATA_DIRS:-/usr/local/share:/usr/share` For that purpose I do the following in my `~/.bash_login` file:               # Define standard directories.     declare -gx XDG_CACHE_HOME=~/.cache     declare -gx XDG_CONFIG_HOME=~/.config     declare -gx XDG_DATA_HOME=~/.local/share     declare -gx XDG_RUNTIME_DIR="/run/user/$USER"     declare -gx XDG_CONFIG_DIRS="$(IFS=: path /etc/xdg)"     declare -gx XDG_DATA_DIRS="$(IFS=: path /usr/local/share:/usr/share)"     # Source supplementary directories to export or overwrite existing standard ones.     declare a="$XDG_CONFIG_HOME/user-dirs.dirs"     if [[ -e $a ]]; then       source "$a"       declare b=""       for b in ${!XDG_*}; do         if [[ $b =~ ^XDG_[_[:alnum:]]+_DIR$ ]]; then           declare -gx "$b"         fi       done     fi      Is there a mechanism to access the above directory and path variables other than the user directory variables defined by the "XDG" directory structure specification?


title: Linux Mint 13 XFCE freezes when external monitor connected

text: I am running Linux Mint 13. The problem is that whenever I connect/disconnect an external monitor to my laptop it freezes. If the monitor is connected on boot it works fine. Any ideas ? Output from inxi -SGxc 0               System:    Host: ****-VGN-NS140E Kernel: 3.2.0-23-generic x86_64 (64 bit, gcc: 4.6.3)                 Desktop: Xfce 4.10.0 (Gtk 2.24.10) Distro: Linux Mint 13 Maya     Graphics:  Card: Intel Mobile 4 Series Chipset Integrated Graphics Controller bus-ID: 00:02.0                 X.Org: 1.11.3 drivers: intel (unloaded: vesa,fbdev) Resolution: 1280x800@59.9hz                 GLX Renderer: Mesa DRI Mobile Intel® GM45 Express Chipset GLX Version: 2.1 Mesa 8.0.4 Direct Rendering: Yes


title: How to access a machine behind a restricted NAT gateway I don't manage?

text: I have a linux machine that I'd like to be able to access remotely for SSH, FTP, HTTP, and so forth. I signed up for Dynamic DNS with No-IP.com, but this isn't adequate because I am on a college campus network, behind an NAT, and don't have permission to access the router to set up port forwarding. I don't know if the campus routers support UPnP or NAT-PMP but I doubt it. Anyways, I was wondering if there was a way to get around this using a VPN. I know that a VPN would allow me to, for instance, access my linux box from my laptop if I had the VPN software installed on both machines. But I'd like to be able to access my linux box from any computer, without having to install software. Or at the very least be able to access the HTTP part that way. And while I know that many VPN services offer web interfaces for file transfer, etc., I'd rather be able to access my linux box using regular FTP and SSH client software. Anyways, is this something you can do with a VPN? Or is there a way to chain a VPN with Dynamic DNS somehow? I looked at the website for Hamachi VPN, but it described all the features in nontechnical terms, so I wasn't able to figure out these questions and I'd prefer to know before creating an account.


title: Script to insert line into files in sub-dirs

text: I have a sub-dir tree with varying number of branches and most of the branches contain .cpp files (many of them). I have a header-file at the root of the tree that I want to have as a               #include "<constructed-relative-path-to-root>/headerfile.h"      as the first line of each .cpp.      an alternative to `constructed-relative-path-to-root` would be the hard-coded path, which would have to be adjusted whenever the project is relocated)      a second alternative would be to copy the content of the header-file in at the top of each .cpp file I have no idea how to write such a script. Can anyone please help?


title: how to write a script that will run commands after su, without using -c

text: I'm trying to automate a standard activity on a system I do not have root access on. The administrator of the systems have given me authority to run `sudo su - 'user'` command, and _only_ that command. I can not add a `-c` argument or `sudo` will fail. My script will have to start with my permissions, and midway through change to running with the user's permissions. I'm trying to figure out if there is a way to make a script do this for me in a single command? Before anyone asks, trying to get my `visudo` permissions extended is quite difficult. While I could probably `su` using the password I do not know the password of the user, don't want to change it, and really should hardcode it in my script anyways, so regular `su` without `sudo` isn't really an option. It seems like there has to be some way to work with the command I'm authorized to use?


title: ranger image-preview with transparent terminal background

text: I like the image-preview in ranger, but I also like my terminal transparent. Is there really no way to get the image-preview work with w3m and transparent background? (I'm willing to change my terminal-emulator if that's necessary, currently urxvt)


title: Universal Node.js shebang?

text: Node.js is very popular these days and I've been writing some scripts on it. Unfortunately, compatibility is a problem. Officially, the Node.js interpreter is supposed to be called `node`, but Debian and Ubuntu ship an executable called `nodejs` instead. I want portable scripts that Node.js can work with in as many situations as possible. Assuming the filename is `foo.js`, I really want the script to run in two ways:   1. `./foo.js` runs the script if either `node` or `nodejs` is in `$PATH`.   2. `node foo.js` also runs the script (assuming the interpreter is called `node`) * * * **Note:** The answers by xavierm02 and myself are two variations of a polyglot script. I'm still interested in a pure shebang solution, if such exists.


title: Process auto starts itself not by cron

text: My linux server was hacked. and now there is a file in root directory that generates big traffic. when i kill this process it autostarts itself again. then i did chmod -x. but it returned x option. there is no crontab job. i have installed auditd to check what is going on. but i cannot find how it autostarts itself? and maybe some other processes (daemons) work there to autostart it. how can i trace the daemons activity that starts this process? thanks.


title: Bash expansion of ${@} as command

text: I have a parent script               while read cmd      do       nohup ./script ${cmd[@]} &>> log &     done < ~/list       that executes this child script               while true     do        eval "${CMD[@]}"       #${CMD[@]}       #./panic     done      with this list of commands               node ~/www/splash/app.js     node ~/www/splash-two/app.js      When the child script calls `eval ${CMD[@]}` it executes the way I expect running that command with no complaints but when I try to remove the eval and run the command using `${CMD[@]}` it throws the error:               Error: Cannot find module '/home/rumplefraggle/SYS/RABBOT/~/www/splash/app.js'      Now I thought possibly this had something to do with the node command so I tried to execute   `ls ~`   as the command and it throws the error that `~` can not be found. Echoing `${@}` and not running it expands as I would expect it to. Also manually inserting the command into the child script also works as expected I don't understand why `eval` works and simply running the command using `${@}` does not. What is causing `${@}` to not expand the `~`? Why is node appending the directory name to the command when `${@}` is used?


title: Regex to Cisco Interface

text: I would like to know if have some `sed`, `grep` or `awk` regex to parse Cisco interface section and exclude if interface is down (shutdown), like example below. Example:               !     interface FastEthernet0/1      ip address 10.16.0.1 255.255.255.224     !     interface FastEthernet0/2      ip address 10.17.0.1 255.255.255.224      shutdown     !      I'm using `sed` regex below to parse interface section:               sed -n -e '/^interface/,/^!/p' file.txt      But the regex above, parse all interface and not exclude interface down.


title: When running to a run level does it execute previous run levels?

text: If I tell my system to go to run level 3 does that mean that it first runs through run level 0, 1, 2, and then finally runs through run level 3? I thought the answer to this question was yes. But when I look on my RHEL 6 system I see that many of rcX.d directories contain same symbolic links. In My **/etc/rc.d/rc0.d/**               [root@centos6 rc.d]# ls -lah /etc/rc.d/rc0.d/     total 8.0K     drwxr-xr-x.  2 root root 4.0K Jun 27 11:59 .     drwxr-xr-x. 10 root root 4.0K Jul  9 15:06 ..     lrwxrwxrwx.  1 root root   13 Jun 12 13:02 K05atd -> ../init.d/atd     lrwxrwxrwx.  1 root root   14 Jun 12 13:01 K10cups -> ../init.d/cups     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd     lrwxrwxrwx.  1 root root   18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve     lrwxrwxrwx.  1 root root   14 Jun 12 10:58 K25sshd -> ../init.d/sshd     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K30postfix -> ../init.d/postfix     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq     lrwxrwxrwx.  1 root root   20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole     lrwxrwxrwx.  1 root root   15 Jun 12 10:57 K60crond -> ../init.d/crond     lrwxrwxrwx.  1 root root   25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service     lrwxrwxrwx.  1 root root   17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd     lrwxrwxrwx.  1 root root   21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K73winbind -> ../init.d/winbind     lrwxrwxrwx.  1 root root   19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon     lrwxrwxrwx.  1 root root   26 Jun 12 10:58 K75blk-availability -> ../init.d/blk-availability     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K75netfs -> ../init.d/netfs     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K75udev-post -> ../init.d/udev-post     lrwxrwxrwx.  1 root root   24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager     lrwxrwxrwx.  1 root root   24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant     lrwxrwxrwx.  1 root root   19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor     lrwxrwxrwx.  1 root root   20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus     lrwxrwxrwx.  1 root root   20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd     lrwxrwxrwx.  1 root root   21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K88auditd -> ../init.d/auditd     lrwxrwxrwx.  1 root root   15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid     lrwxrwxrwx.  1 root root   21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 K90network -> ../init.d/network     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables     lrwxrwxrwx.  1 root root   18 Jun 12 10:57 K92iptables -> ../init.d/iptables     lrwxrwxrwx.  1 root root   22 Jun 12 10:58 K99lvm2-monitor -> ../init.d/lvm2-monitor     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 S00killall -> ../init.d/killall     lrwxrwxrwx.  1 root root   14 Jun 12 11:15 S01halt -> ../init.d/halt     lrwxrwxrwx.  1 root root   15 Jun 26 12:32 S95jexec -> ../init.d/jexec      And in **/etc/rc.d/rc1.d/** I see the same set of symbolic links as in rc0.d plus extra links. This seems to indicate that the directories rc0.d, rc1.d are independent and that to get to run level 1 it does not execute the stuff in run level 0. Which means that bad things can happen if some how the symbolic links in rc0.d were not exactly replicated in rc1.d, ... etc. So how does it really work? Does it just scan the files in a specific rc.X dir or run through all rc.X dirs that have a lower level than rc level passed to init?               [root@centos6 rc.d]# ls -lah /etc/rc.d/rc1.d/     total 8.0K     drwxr-xr-x.  2 root root 4.0K Jun 27 11:59 .     drwxr-xr-x. 10 root root 4.0K Jul  9 15:06 ..     lrwxrwxrwx.  1 root root   13 Jun 12 13:02 K05atd -> ../init.d/atd     lrwxrwxrwx.  1 root root   14 Jun 12 13:01 K10cups -> ../init.d/cups     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K10saslauthd -> ../init.d/saslauthd     lrwxrwxrwx.  1 root root   18 Jun 12 12:51 K15svnserve -> ../init.d/svnserve     lrwxrwxrwx.  1 root root   14 Jun 12 10:58 K25sshd -> ../init.d/sshd     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K30postfix -> ../init.d/postfix     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K50dnsmasq -> ../init.d/dnsmasq     lrwxrwxrwx.  1 root root   20 Jun 12 10:57 K50netconsole -> ../init.d/netconsole     lrwxrwxrwx.  1 root root   15 Jun 12 10:57 K60crond -> ../init.d/crond     lrwxrwxrwx.  1 root root   25 Jun 27 11:59 K65vboxadd-service -> ../init.d/vboxadd-service     lrwxrwxrwx.  1 root root   17 Jun 27 11:58 K70vboxadd -> ../init.d/vboxadd     lrwxrwxrwx.  1 root root   21 Jun 27 11:59 K70vboxadd-x11 -> ../init.d/vboxadd-x11     lrwxrwxrwx.  1 root root   17 Jun 12 12:26 K73winbind -> ../init.d/winbind     lrwxrwxrwx.  1 root root   19 Jun 12 12:26 K74haldaemon -> ../init.d/haldaemon     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K75netfs -> ../init.d/netfs     lrwxrwxrwx.  1 root root   24 Jun 12 12:26 K84NetworkManager -> ../init.d/NetworkManager     lrwxrwxrwx.  1 root root   24 Jun 27 11:59 K84wpa_supplicant -> ../init.d/wpa_supplicant     lrwxrwxrwx.  1 root root   19 Jun 12 10:58 K85mdmonitor -> ../init.d/mdmonitor     lrwxrwxrwx.  1 root root   20 Jun 12 12:25 K85messagebus -> ../init.d/messagebus     lrwxrwxrwx.  1 root root   20 Jun 12 10:58 K87multipathd -> ../init.d/multipathd     lrwxrwxrwx.  1 root root   21 Jun 12 10:57 K87restorecond -> ../init.d/restorecond     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K88auditd -> ../init.d/auditd     lrwxrwxrwx.  1 root root   15 Jun 27 11:59 K88iscsi -> ../init.d/iscsi     lrwxrwxrwx.  1 root root   17 Jun 12 10:57 K88rsyslog -> ../init.d/rsyslog     lrwxrwxrwx.  1 root root   16 Jun 12 10:58 K89iscsid -> ../init.d/iscsid     lrwxrwxrwx.  1 root root   21 Jun 12 13:01 K89portreserve -> ../init.d/portreserve     lrwxrwxrwx.  1 root root   15 Jun 12 11:15 K89rdisc -> ../init.d/rdisc     lrwxrwxrwx.  1 root root   17 Jun 12 11:15 K90network -> ../init.d/network     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 K92ip6tables -> ../init.d/ip6tables     lrwxrwxrwx.  1 root root   18 Jun 12 10:57 K92iptables -> ../init.d/iptables     lrwxrwxrwx.  1 root root   22 Jun 12 10:58 S02lvm2-monitor -> ../init.d/lvm2-monitor     lrwxrwxrwx.  1 root root   26 Jun 12 10:58 S25blk-availability -> ../init.d/blk-availability     lrwxrwxrwx.  1 root root   19 Jun 12 10:57 S26udev-post -> ../init.d/udev-post     lrwxrwxrwx.  1 root root   15 Jun 26 12:32 S95jexec -> ../init.d/jexec     lrwxrwxrwx.  1 root root   16 Jun 12 11:15 S99single -> ../init.d/single


title: What is the recommended way of checking running services?

text: I'm often exposed to various GNU/Linux systems including CentOS, SLES and Debian. I want to know: what is the recommended method of checking all running services across these systems? I am aware of `service --status-all` and `chkconfig` but they are not always available. Please advise.


title: Smooth font rendering with xmonad in linux mint

text: I am using the xmonad windows manager under Linux Mint 13 and is lacking a smooth font rendering. Under MATE or Cinnamon, the fonts are smoothed, and choosing the session `xmonad with Gnome`, fonts are smoothed also. In addition, if I run `gnome- settings-daemon` while in xmonad, the fonts become smoothed also. But is there a way to have nice looking fonts without resorting to Gnome?


title: What makes ext3 determine how frequently to perform file system checks when no options are specified?

text: I created two partitions on a 1.5 TB drive, the first was 1 TB, the latter was the remaining .5 TB. Both were formatted as ext3. I don't mind the automatic filesystem checks occurring every so often, so I never bother configuring the frequency of it. What I found odd was that it decided to make the automatic check occur every 39 mounts for the 1 TB, and 27 mounts for the .5 TB partition. I attempted to look in the man pages as well as various forums, but I couldn't find any mention about how it determines the frequency for file system checks. I assume it is a simple formula, so does anyone know what it is?


title: sed: multi-line replace of config block

text: I have some configuration files that basically look like               (...content...)     # BEGIN DYNAMIC BLOCK - DO NOT EDIT MANUALLY     (... more content ...)     # END DYNAMIC BLOCK     (... even more content ...)      Now, in bash using `CONTENT=`wget -O - http://$SERVER/get_config.php``, I have the replacement for the dynamic block. How do I do the replace now and how do I make the script insert the block at file's end if it isn't there?


title: Simplest screen echo server?

text: What is the simplest way to do the following thing? Run a program which will open specified port, listen for it, and display whatever it receives. Also if type something -- then send back to connected peer. This is for debug purposes.


title: Optimal way to setup user account / accesses?

text: I have a (home) Ubuntu machine; upon installation I created the "x" user during the installation (who is not the root) so often when I want to run apt- get or other things that require write access to `/usr` or `/var` I need to sudo. My question is is there a safe way to setup the "x" user in such a way that he has more rights so that I don't have to sudo or su? What would be the optimal way to do the user account management? (On a home machine - so no production.)


title: vim: How to switch to the directory listing from file view?

text: I have opened a dir `vim some/dir`. I can navigate within the tree, yet once I opened a file I wonder, how do I close the file view in order to go back to the directory listing to navigate to another file. `:wq` is no option, as it closes the whole vim session. I guess there is a for mode to that, yet I do not know what it is called nor how I start it. How to close the file to file navigation view?


title: How do I get my Virgin Media wireless internet to work on Crunchbang linux?

text: I am struggling to get my internet to work on Linux. I am able to connect to my wireless internet through any other device I choose but my laptop will not find it. I have tried using the hidden connection option but still cannot find it. Is there anything else I can do?


title: Trying to compress avi file using ffmpeg

text: I used the command below to compress an avi file(using ubuntu)               ffmpeg -i input.avi -vcodec msmpeg4v2 output.avi      but I am getting these errors               Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'     [ac3 @ 0x9cd1fa0] invalid bit rate          Error while opening encoder for output stream #0.1 - maybe incorrect           parameters such as bit_rate, rate, width or height      What's wrong?


title: bash: escape individual lines from `-x` echoing

text: In bash, when running with the `-x` option, is it possible to exempt individual commands from echoing? I'm trying to make the output as neat as possible, so I am running certain parts of my script in a subshell with `set +x`. However, the row `set +x` itself is still echoed and adds no valuable information to the output. I remember back in the bad old `.bat` days, when running with `echo on`, individual lines could be exempted by starting them with a `@`. Is there any equivalent in bash?               #!/bin/bash -x          function i_know_what_this_does() {       (         set +x         echo do stuff       )     }          echo the next-next line still echoes 'set +x', is that avoidable?     i_know_what_this_does     echo and we are back and echoing is back on      When running the above, output is:               + echo the next-next line still echoes 'set +x,' is that 'avoidable?'     the next-next line still echoes set +x, is that avoidable?     + i_know_what_this_does     + set +x     do stuff     + echo and we are back and echoing is back on     and we are back and echoing is back on


title: Xorg and Xserver not starting up after hibernate

text: I'm currently running Mint 14 on this computer, but it also previously happened with Fedora 16 so I'm guessing it's a general problem with my drivers. The display will not start up after the laptop hibernates. If I close the lid it will just show a weird snowy display from which I need to reboot, If I don't close the lid it will show some errors and take me to the console where i can reboot. The log files are pretty massive, but I've pulled out the bits that looked to give the most vital information. It looks most likely a driver issue and I've been to http://wiki.x.org/ to have a hunt around but it's not really something I'm familiar with. Running lsmod | grep nouveau               nouveau               895609  3      ttm                    83595  1 nouveau     drm_kms_helper         46784  1 nouveau     drm                   275528  5 nouveau,ttm,drm_kms_helper     i2c_algo_bit           13413  1 nouveau     mxm_wmi                12979  1 nouveau     video                  19335  1 nouveau     wmi                    19070  3 asus_wmi,nouveau,mxm_wmi      Running lspci               01:00.0 VGA compatible controller: NVIDIA Corporation Device 1251 (rev a1)      /var/log/syslog:               Jan  2 18:13:30 user-G74Sx mdm[1586]: WARNING: Failed to start X server several times in a short time period; disabling display :0      /var/log/X.org.log:               [    23.428]      X.Org X Server 1.13.0     Release Date: 2012-09-05     [    23.428] X Protocol Version 11, Revision 0     [    23.428] Build Operating System: Linux 3.2.0-30-generic x86_64 Ubuntu     [    23.428] Current Operating System: Linux user-G74Sx 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64     [    23.428] Kernel command line: BOOT_IMAGE=/vmlinuz-3.5.0-17-generic root=UUID=e7c94e41-c243-45b2-9cdc-e851b5cf16d0 ro quiet splash     [    23.428] Build Date: 08 October 2012  03:34:01PM     [    23.428] xorg-server 2:1.13.0-0ubuntu6 (For technical support please see http://www.ubuntu.com/support)      [    23.428] Current version of pixman: 0.26.0     [    23.429]    Before reporting problems, check http://wiki.x.org     to make sure that you have the latest version.     [    23.429] Markers: (--) probed, (**) from config file, (==) default setting,     (++) from command line, (!!) notice, (II) informational,     (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [    23.429] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jan  2 18:15:32 2013     [    23.438] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [    23.439] (==) No Layout section.  Using the first Screen section.     [    23.439] (==) No screen section available. Using defaults.     [    23.439] (**) |-->Screen "Default Screen Section" (0)     [    23.439] (**) |   |-->Monitor "<default monitor>"     [    23.439] (==) No monitor specified for screen "Default Screen Section".     Using a default monitor configuration.     [    23.440] (==) Automatically adding devices     [    23.440] (==) Automatically enabling devices     [    23.440] (==) Automatically adding GPU devices     [    23.440] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.     [    23.440]    Entry deleted from font path.     [    23.440] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.     [    23.440]    Entry deleted from font path.      It also tries to load the modules nv and nvidia a few times but fails each time because the modules do not exist so I'm guessing I'll have to install the modules. It looks like it eventually uses the module nouveau               [    23.473] (II) NOUVEAU driver Date:   Wed Sep 12 13:42:43 2012 +0200     [    23.473] (II) NOUVEAU driver for NVIDIA chipset families :     [    23.473]    RIVA TNT        (NV04)     [    23.473]    RIVA TNT2       (NV05)     [    23.473]    GeForce 256     (NV10)     [    23.473]    GeForce 2       (NV11, NV15)     [    23.473]    GeForce 4MX     (NV17, NV18)     [    23.473]    GeForce 3       (NV20)     [    23.473]    GeForce 4Ti     (NV25, NV28)     [    23.473]    GeForce FX      (NV3x)     [    23.473]    GeForce 6       (NV4x)     [    23.473]    GeForce 7       (G7x)     [    23.473]    GeForce 8       (G8x)     [    23.473]    GeForce GTX 200 (NVA0)     [    23.473]    GeForce GTX 400 (NVC0)      Any help in the right direction would be great as this isn't really an area I'm particularly strong with. If there are any parts of the log files which might help please let me know and I'll paste them in


title: Where to get UUID libraries and code

text: What is the difference between the libuuid that comes with the util-linux-ng package and the one that comes with e2fsprogs? Also, if I want to compile libuuid from source, where should I get said source?   * https://www.kernel.org/pub/linux/utils/util-linux/   * https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.8/ Those are my best guesses, are they trustworthy and correct?


title: tftpput in U-Boot: error: 'Access violation' (2)

text: I have enabled `CONFIG_CMD_TFTPPUT` in U-Boot, but I am not able to use it. I have set the `serverip` and `ipaddr` environment variables. When I use it as follows, it times out:               u-boot# tftpput                 link up on port 0, speed 100, full duplex     Using cpsw device     TFTP to server 192.168.1.3; our IP address is 192.168.1.106     Filename 'uImage'.     Save address: 0x0     Save size:    0x0     Saving: ##T ###T ####        If I set the bootfile name to `temp`, it gives the following error:               u-boot# tftpput               link up on port 0, speed 100, full duplex     Using cpsw device     TFTP to server 192.168.1.3; our IP address is 192.168.1.106     Filename 'temp'.     Save address: 0x0     Save size:    0x0     Saving: *     TFTP error: 'Access violation' (2)     Not retrying...      Wireshark capture: ![Wireshark log](http://i.stack.imgur.com/8OrsW.png) Any help/pointers/suggestion?


title: How to make a secure-boot compliant boot CD

text: I've found quite a bit of information floating around on the Internet about how to _install_ Linux onto a _harddisk_ and get Secure Boot to work with it. But I can't find a single shred of information about how to make a _bootable live CD_. Does anybody know how to accomplish this? I'm using Kiwi to build a CD based on OpenSUSE 13.1. The actual OpenSUSE installation DVD boots in Secure Boot mode, but I'm unsure how to replicate this feat myself. Does anybody know what magic button I need to press? I can't test this, but I imagine the boot CD already works with EFI. But it doesn't work with Secure Boot. (And why would it? It isn't signed with anything.) (Just to clarify: The test machine I have available does not allow you to disable Secure Boot. You can disable EFI completely and revert to legacy BIOS, but you can't turn off just the Secure Boot part. Which isn't terribly helpful, but anyway...)


title: VirtualBox abnormal behavior when mouse focus from iMac Maverick to vm running Debian wheezy

text: I am experimenting this really **annoying** behavior. I never had this problem with other platform combination. In this combination:   * Hardware OS Host: iMac Maverick   * Oracle VirtualBox 4.3.2 r90405   * Vm Debian Wheezy. When I unfocus the mouse from the vm I normally can interact with any iMac window. As soon as I click in the vm, then either one of these scenario happen:   * some text becomes selected, in an app like (xterm, chrome, ...) or any window opened in the Debian XWindow running environment.   * worse, one of the Debian XWindow gets resized or moved, I loose the window title bar, and I have to play with the maximize, minimize, ... to get back the apps window to the correct position and size. The only solution to avoid this behavior is to do, before interacting with the Debian Xwindow environment, the following:   * click to the VirtualBox surrounding window to get the vm be the active window from iMac context, and only then interacting with the apps windows in the vm without any side effect. Since I am switching between the host and the vm many times a minute, every now and then, I unfortunately forget this trick and here we go again... I am considering hosting this vm on Windows7, where I do not seem to have the same problem. Any suggestions would be really appreciated.


title: Unique lines with unique words

text: Help me to print unique lines in Linux. Word examples like               A B     B C     C D     A E     F G     H I     I J      the output should be               F G     H I      I.e., the line should be unique at first and the words in the line should also appear only once as in above example “F G” is a unique line and neither “F” or “G” never exists in any other line similarly “H I”.


title: rc.status equivalent in Redhat

text: I need to have `rc.status` file in RedHat Linux, to install one software(java app). Is there any way to enable it on RedHat? Or is there an equivalent on RedHat?


title: How can my server detect IP changes in order to notify my dynamic-DNS provider?

text: Just set up ubuntu server, which has a dynamic ip. I am looking for a way to keep my dns server updated. Im using entrydns to do this and they provide the following command to update the server.               curl -k -X PUT -d "" https://entrydns.net/records/modify/TOKEN      What I need is a way of checking whether the ip has changed so I can update the dns server.


title: rsync server/daemon security

text: I have a NAS (Netgear Readynas NV+) at home and a linux (Arch) box at work that is always on. The linux box is already running an ssh server/daemon and the NAS is already running an rsync server/daemon. The NAS does not support rsync over ssh. The way I understand it is I can either enable port forwarding on my home router to enable my linux box to initiate an rsync with the NAS or I can enable an rsync server on the linux box and allow the NAS to initiate the sync. Since my home router does not have a static ip address, I am leaning towards running an rsync server on the linux box. Is one way more secure than another? Are there major security drawbacks to doing either?


title: Fedora 17 Performance Issues

text: I have a Dell Latitude E4310. I have Windows 7 and Fedora installed on it. I rarely use windows and I have been using fedora for a good 9 months now. Recently the performance on my machine degraded considerably. I got a hardware servicing done as well however it continues to worsen each day. What tools can I use to analyze and further resolve the problem? I have ample of disk space > 30 GB unused.


title: Multiple gcc and linking between them

text: I'm running centOS 6.3 which comes with gcc 4.4.6 and I installed gcc 4.6.3 using these instructions. But when I type `gcc -v` it still says gcc 4.4 is the version I'm using. The newer version is under /opt/gcc-4.6.3. When I run a `make` command do I have to specify a path to use the newer gcc? If so how do I do this, or can I replace the older version fully with the newer one? Thanks in advance.