title: Is there a way to run an XWindow program with out a desktop manager?

text: I need to run a program over VNC, but don't want the Desktop Manager or Window Manager to run. Can the .xstartup program be configured that way? PS. I am sure I have done it before whilst conducting some experiments. It was a long time ago and I just can't remember how.


title: How to dual boot windows 8?

text: I just installed debian on my computer which has windows 8 from before (has 2 hds installed debian on the storage hd), however it booted straight into windows 8 without loading grub or anything. What can I do to get the choice between windows and debian at start up?


title: telneting to ssh port works, but SSH not

text: I installed a machine with two network cards: one goes in the router, gets IP via DHCP, OK, another is connected to my notebook directly, using a different IP subnet. I can ping both IP addresses, telnet to port 22 and see the "SSH prompt".. just fine. (trying them with switching the cable in my notebook) **Question:** but when it comes to connecting to this machine via SSH I can only connect through the NIC that is connected via the router, not directly. It just timeouts when I try to connect directly. Why? The firewall rules are the default, tried rebooting both sides, I only modified the "UseDNS to no" in the `sshd_config` on the machine.


title: How to get Oracle java 7 to work with setcap cap_net_bind_service+ep

text: I am trying to grant the java executable the right to open ports below 1024 on Linux. Here is the setup   * `/home/test/java` contains the Oracle Server JRE 7.0.25    * CentOS 6.4 Here is what getcap returns               [test@centos6 java]$ pwd     /home/test/java          [test@centos6 java]$ getcap bin/java     bin/java = cap_net_bind_service+ep          [test@centos6 java]$ getcap jre/bin/java     jre/bin/java = cap_net_bind_service+ep      Trying to execute java gives the following error.               [test@centos6 java]$ bin/java     bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory     [test@centos6 java]$ jre/bin/java     jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory      Is it possible to run Java 7_u25 when the binary has been given elevated privileges with setcap, if so how? JDK-6919633 : Runtime does not support POSIX File Capabilities (A.K.A. Linux Capabilities) says that               Note: when using the setcap the libraries needed by the java launcher     should be present in /usr/lib or any other "trusted" location that the     runtime loader (rtld) uses to find shared libraries.      How do I make the shared libraries trusted?


title: Exiting out of an infinite reboot loop in startup (rc.local)

text: I am creating a startup script (called from rc.local) in Debian Squeeze. The startup script checks for a variable value from a file, decrements the variable and writes it back to the file, then if the variable was greater than 0 then it executes a test and reboots the system. If the variable is 0 or less than 0, then it doesn't reboot the system. My question is as follows: Suppose I realize after a couple of tests that there is a bug in the test. Is there any way to break the **execute_test->reboot->repeat** loop that I have set up. Putting a **"sleep 1000"** in the test or doing a **ps aux|grep** might work, but I am not sure if I shall have access to them before the rc.local scripts have run. What if I run the script in the background instead of the foreground? Would I have access to bash login shell etc. while the test is running in the background in that case?                COUNT=`cat $testFile|wc -l`      if [ $COUNT -gt 0 ];then                     ARGS=`head -1 $testFile`                     cd /testCode                     /testCode/startTest.sh $ARGS                     sed -i '1d' $testFile                     echo "rebooting"                     /sbin/reboot &                     exit 0                 fi      I know I have given very few details, since I am not sure what information would be required. I will update the question as required. UPDATE: I ran the test. I get the login prompt before the test finishes. I had though that I would get the login prompt only after rc.local is done executing. Could someone throw light on that?


title: Linux Mint: How to disable or remove applications comment from favorites menu?

text: How can I disable or remove application comments from the "favorites menu" on Mate? Or remove them completely from Mint? ![enter image description here](http://i.stack.imgur.com/q5oOp.png) There is an option for disabling comments from "all applications menu" but not for "favorites menu".


title: How can I suppress the space between generated arguments during brace expansion?

text: I used the following command to create a list of URLs that I want to test:               echo -e localhost:8080/reports/{promos,promo-updates,scandown}/{130,139,142}{,-unburdened,-burdened}{,.pdf,.xls,.xlsx,.csv,.preload}"\n" >> urls.txt      Unfortunately the URLs appended to `urls.txt` each had a space before them (except for the first, of course). I understand why that happened, and I realize I could just strip it off by piping throug a `sed` expression, but I'd like to know if there's a way to suppress it instead. (It may seem silly and pedantic, but it's no different than the preference so many people feel for not "abusing cats".) I tried double-quoting to suppress word-splitting, but that suppressed the brace expansion too, so that was a no-go. I tried changing IFS to an empty string, but it didn't work either:               IFS='' echo -e localhost:8080/reports/{promos,promo-updates,scandown}/{130,139,142}{,-unburdened,-burdened}{,.pdf,.xls,.xlsx,.csv,.preload}"\n" >> urls.txt      Nor did changing it to a newline:               IFS='\n' echo -e localhost:8080/reports/{promos,promo-updates,scandown}/{130,139,142}{,-unburdened,-burdened}{,.pdf,.xls,.xlsx,.csv,.preload}"\n" >> urls.txt


title: diabling cpu cores on quad core processor on linux

text: I want to disable 3 CPU cores and run my processor on a single core. I have used command:`maxcpus=1`. But after this I executed this command `ls /sys/devices/system/cpu`. It still shows `cpu0,cpu1,cpu2,cpu3`. I also tried :`echo 0 > /sys/devices/system/cpu3/online` but I get the following error: `no such file or directory`.


title: Install the latest gcc on Pygoscelis Papua (Gentoo)

text: I would like to try out Gentoo and I started a Pygoscelis Papua instance on Amazon EC2. How do I install the latest version of `gcc` to compile my programs? I tried               emerge -u gcc     gcc-config -l      as it says in "Upgrading GCC" section of Gentoo wiki, but it only shows one option of gcc 4.7.3; I'd like to use 4.9.0 or 4.9.1.


title: How to get all my keys to send keycodes

text: I'm using Gentoo with XFCE. I have a logitech K350 keyboard, all but a few of the keys work as expected but there is one specific key that I want to use but when I run `showkey` no key codes are being sent. The key is the arrange windows button on the bottom left of the keyboard. ![enter image description here](http://i.stack.imgur.com/M99Zh.png). Is this a driver issue and is it possible to get that key to send a code so that I can map an action to it?


title: Cannot compile samtools due to errors caused by libz

text: I am having the same problem with samtools-0.1.19 installation. But we have libz.so.1.2.3 .               gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview.c -o bam_tview.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_plcmd.c -o bam_plcmd.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. sam_view.c -o sam_view.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_rmdup.c -o bam_rmdup.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_rmdupse.c -o bam_rmdupse.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_mate.c -o bam_mate.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_stat.c -o bam_stat.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_color.c -o bam_color.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bamtk.c -o bamtk.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. kaln.c -o kaln.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam2bcf.c -o bam2bcf.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam2bcf_indel.c -o bam2bcf_indel.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. errmod.c -o errmod.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. sample.c -o sample.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. cut_target.c -o cut_target.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. phase.c -o phase.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam2depth.c -o bam2depth.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. padding.c -o padding.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bedcov.c -o bedcov.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bamshuf.c -o bamshuf.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview_curses.c -o bam_tview_curses.o     gcc -c -fPIC -g -Wall -O2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1 -I. bam_tview_html.c -o bam_tview_html.o     gcc -fPIC -g -Wall -O2 -o samtools bam_tview.o bam_plcmd.o sam_view.o bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o bam_tview_curses.o bam_tview_html.o  libbam.a -Lbcftools -lbcf  -lcurses  -lm -lz -lpthread     phase.o: In function `loadpos':     /home/whitejo/Downloads/samtools-0.1.19/phase.c:475: undefined reference to `gzopen64'     bedcov.o: In function `main_bedcov':     /home/whitejo/Downloads/samtools-0.1.19/bedcov.c:69: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `__bam_get_lines':     /home/whitejo/Downloads/samtools-0.1.19/bam_import.c:76: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `sam_open':     /home/whitejo/Downloads/samtools-0.1.19/bam_import.c:472: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `sam_header_read2':     /home/whitejo/Downloads/samtools-0.1.19/bam_import.c:126: undefined reference to `gzopen64'     libbam.a(bedidx.o):/home/whitejo/Downloads/samtools-0.1.19/bedidx.c:107: more undefined references to `gzopen64' follow     collect2: ld returned 1 exit status     make[1]: *** [samtools] Error 1     make[1]: Leaving directory `/home/whitejo/Downloads/samtools-0.1.19'     make: *** [all-recur] Error 1     [root@ogi samtools-0.1.19]# ls /lib64/libz*     /lib64/libz.so.1  /lib64/libz.so.1.2.3      I cannot find any alternative `libz` or `zlib` libraries. Do I need to downgrade to a different `libz` version, or upgrade?


title: linux stdbuf - line-buffered stdin option does not exist

text: The man page for the stdbuf command states that line-buffered mode is invalid as a standard input buffering option. What is the reason for this?               tail -f access.log | stdbuf -iL cut -d' ' -f1 | uniq          stdbuf: line buffering stdin is meaningless     Try `stdbuf --help' for more information.


title: Using Fifo hang script

text: out="$katalog/out" # wyjscie     fifo="$katalog/fifo" # wejscie     mkfifo $fifo      touch $out     [...] #k     ./a.out <$fifo >$out & pid=$!     [...] # get input line by line loop start     echo "$liniain" >> $fifo         [...] # loop end      I try this but after first input line to program script stop and don't respons ### Complete script               #!/bin/bash     #Debuger programow w c ++     katalog="/tmp/debuger$$"     mkdir $katalog # katalog tymczasowy z danymi     out="$katalog/out" # wyjcie     fifo="$katalog/fifo" # wejscie     mkfifo $fifo # nawet powstalo (potok nazwany)     touch $out     if [ -n $0 ] ; then echo "podaj -h"     fi     while getopts hvar opt ; do         case $opt in         h) echo "Script prowadzi za raczke -r reset ustawien -a autor ";;         v) echo "--wersja---";;         a) echo "Jakub Staniszewski";;         r) rm ./debug.cfg;;         *) echo "nie rozumiem";;         esac     done          if [ ! -e ./debug.cfg ] ; then         dialog --title "PLIKI IN"  --fselect ./ 10 40 2>$katalog/dial          pliki_in=$(<$katalog/dial)         dialog --title "PLIKI OUT"  --fselect ./ 10 40 2>$katalog/dial          pliki_out=$(<$katalog/dial)         dialog --title "CO SKOMPILOWAC"  --fselect ./ 10 40 2>$katalog/dial          plik_compile=$(<$katalog/dial)           dialog --title "Opcje_kompilatora" --inputbox "Podaj Nazwe pliku wykonywalnego" 8 40 "a.out" 2> $katalog/dial          program=$(<$katalog/dial)         dialog --title "Opcje_kompilatora" --inputbox "Podaj opcje cd" 8 40 "" 2> $katalog/dial          flagi=$(<$katalog/dial)         dialog --title "Polecenie do debugowania" --inputbox "Podaj polecenie do debugowania" 8 40 "debug" 2> $katalog/dial          debugpolecenie=$(<$katalog/dial)         echo "pliki_in=$pliki_in" > ./debug.cfg         echo "pliki_out=$pliki_out" >> ./debug.cfg         echo "plik_compile=$plik_compile" >> ./debug.cfg         echo "program=$program" >> ./debug.cfg         echo "flagi=$flagi" >> ./debug.cfg         echo "debugpolecenie=$debugpolecenie" >> ./debug.cfg          fi          . debug.cfg     g++ $plik_compile -o $program $flagi     find $pliki_in | grep .in$ | sort -u > $katalog/lista.in     find $pliki_out | grep .out$ | sort -u > $katalog/lista.out     for in_plik in `cat $katalog/lista.in` ; do #przez wszystkie pliki in         ./$program <$fifo >$out & pid=$! #odpalam program         nazwa_in=`echo "$in_plik" | sed 's/\// /g'|awk '{ print $(NF) } '| sed 's/.in$//g'` # wyciagam nazwe np ./testy/12.in da 12         outtest=`cat ${katalog}/lista.out| grep /${nazwa_in}.out$` # wybieram plik z odpowiedziami         echo $outtest          przeczytane=1 # o jeden wiecej niz liczba lini ktore zostaly przeczytane z pliku in         wyjscie=1 # o jeden wiecej niz liczba lini sprawdzonych  ( plik *.out)         for liniain in `cat $in_plik`; do             if ps -aux 2>/dev/null |awk '{ print $2 }'| grep $pid  ; then   echo "$liniain" >> $fifo #czy nasz program dziala                else                  echo "cos zdechlo"                 break             fi             for linia in `tail -n +$przeczytane $out` ; do                  liniatest=`cat $outtest | head -n$wyjscie | tail -n1`                 echo "$liniatest"                 if [ "$linia" = "$liniatest" ] ; then  true #echo "$linia"                 else                     echo " Powinno byc:  `cat $outtest | head -n $wyjscie | tail -n1` "                     echo " a jest :$linia"                       echo "$debugpolecenie" > $fifo #2>/dev/null                     echo "-+-+-=_=="                     tail -n +$przeczytane $out                     q="t"                     break                  fi                 wyjscie=$((wyjscie + 1))                 done;             if [ "$q" = "t" ] ; then break             fi             przeczytane=$((wyjscie + przeczytane))         done;         kill -9 $pid 2>/dev/null         rm $out         touch $out     done;          rm -rf $katalog      ### Logs of execution               wytrzeszcz@wytrzeszczPC:~/Dokumenty/PG/so$ ./projekt.sh     + ./projekt.sh     podaj -h     + . debug.cfg     ++ pliki_in=./     ++ pliki_out=./     ++ plik_compile=./a.cpp     ++ program=a.out     ++ flagi=     ++ debugpolecenie=debug     + g++ ./a.cpp -o a.out     + find ./     + grep '.in$'     + sort -u     + find ./     + grep '.out$'     + sort -u     ++ cat /tmp/debuger9348/lista.in     + for in_plik in '`cat $katalog/lista.in`'     + pid=9365     + echo 9365     9365     + cat /tmp/debuger9348/fifo     + ./a.out -f /tmp/debuger9348/out     ++ echo ./1.in     ++ sed 's/\// /g'     ++ sed 's/.in$//g'     ++ awk '{ print $(NF) } '     + nazwa_in=1     ++ cat /tmp/debuger9348/lista.out     ++ grep '/1.out$'     + outtest=./1.out     + echo ./1.out     ./1.out     + przeczytane=1     + wyjscie=1     ++ cat ./1.in     + for liniain in '`cat $in_plik`'     ++ ps -aux     ++ awk '{ print $2 }'     ++ grep 9365     + zycie=9365     + '[' -n 9365 ']'     + echo a     + echo 'linia in: a'     linia in: a     + cat /tmp/debuger9348/out     a     TEST: 0 a


title: minimal X.org xserver installation on Debian Wheezy

text: I installed _Debian Wheezy_ with no desktop environment as I would like to use lightweight dwm window manager instead. However, as a first step, I need to install xserver. I would like to install minimal components needed for running the xserver. What are the exact components(binaries, libraries, configuration files, etc) needed to run xserver? Obviously xinit(starts X server session), but what else? Or are the components needed for running xserver so scattered that practically one needs to install _xserver-xorg_ package which will handle all the dependencies needed?


title: problem with unique ssh public/private key pair on second user

text: I have created an ssh key pair using `ssh-keygen -t rsa` for my main user and everything seems to be working well. Password login has been disabled. I have a second user that I am trying to create a pair for, and I am having trouble logging in. I did the process identically to the first user, but when I log on Putty gives me the following error --> `server refused our key` There is an error box that pops up as well saying `Disconnected: No supported authentication methods available(server sent publickey, gssapi-keyex,gssapi- with-mic)` I have tried re-doing the process with `ssh-keygen -t rsa` and performing the process differently with Puttygen, although it is always the same error. Any advice? I am on a CentOS virtual private server logs from non-working user:               [deploy@server .ssh]$ sudo /usr/sbin/sshd -d     debug1: sshd version OpenSSH_5.3p1     debug1: read PEM private key done: type RSA     debug1: private host key: #0 type 1 RSA     debug1: read PEM private key done: type DSA     debug1: private host key: #1 type 2 DSA     debug1: rexec_argv[0]='/usr/sbin/sshd'     debug1: rexec_argv[1]='-d'     Set /proc/self/oom_score_adj from 0 to -1000     debug1: Bind to port 22 on 0.0.0.0.     Server listening on 0.0.0.0 port 22.     debug1: Bind to port 22 on ::.     Server listening on :: port 22.     debug1: Server will not fork when running in debugging mode.     debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8     debug1: inetd sockets after dupping: 3, 3     Connection from 85.105.187.20 port 4040     debug1: Client protocol version 2.0; client software version PuTTY-Local: Mar 19                                2005 07:19:17     debug1: no match: PuTTY-Local: Mar 19 2005 07:19:17     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.3     debug1: permanently_set_uid: 74/74     debug1: list_hostkey_types: ssh-rsa,ssh-dss     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: client->server aes256-cbc hmac-sha1 none     debug1: kex: server->client aes256-cbc hmac-sha1 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received     debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT     debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: KEX done     debug1: userauth-request for user root service ssh-connection method none     debug1: attempt 0 failures 0     reverse mapping checking getaddrinfo for 85.105.187.20.static.ttnet.com.tr [85.1                               05.187.20] failed - POSSIBLE BREAK-IN ATTEMPT!     debug1: PAM: initializing for "root"     debug1: PAM: setting PAM_RHOST to "85.105.187.20"     debug1: PAM: setting PAM_TTY to "ssh"     Received disconnect from 85.105.187.20: 11: No supported authentication methods                                available     debug1: do_cleanup     debug1: do_cleanup     debug1: PAM: cleanup      Logs from working user:               [arguably@server .ssh]$ sudo /usr/sbin/sshd -d     debug1: sshd version OpenSSH_5.3p1     debug1: read PEM private key done: type RSA     debug1: private host key: #0 type 1 RSA     debug1: read PEM private key done: type DSA     debug1: private host key: #1 type 2 DSA     debug1: rexec_argv[0]='/usr/sbin/sshd'     debug1: rexec_argv[1]='-d'     Set /proc/self/oom_score_adj from 0 to -1000     debug1: Bind to port 22 on 0.0.0.0.     Server listening on 0.0.0.0 port 22.     debug1: Bind to port 22 on ::.     Server listening on :: port 22.     debug1: Server will not fork when running in debugging mode.     debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8     debug1: inetd sockets after dupping: 3, 3     Connection from 192.185.0.164 port 15567     debug1: Client protocol version 2.0; client software version zabbix_agent     debug1: no match: zabbix_agent     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.3     debug1: permanently_set_uid: 74/74     debug1: list_hostkey_types: ssh-rsa,ssh-dss     debug1: SSH2_MSG_KEXINIT sent     Connection closed by 192.185.0.164     debug1: do_cleanup     debug1: do_cleanup


title: Is there a tool(!) to list assigned subuid and subgid values for users?

text: The question is basically in the title. `usermod -v` (`\--add-sub-uids`) and `usermod -w` (`\--add-sub-gids`) can be used to manipulate the subuid and subgid ranges for a user account, but there appears to be no tool that can merely list them. Is there one? At least on my Ubuntu 14.04 box `getent` doesn't seem to be prepared to handle that information from `/etc/subuid` and `/etc/subgid`. Currently I am using a little shell script, using `awk` for the purpose. * * * Here's an excerpt from `usermod(8)`:               -v, --add-sub-uids FIRST-LAST         Add a range of subordinate uids to the users account.     [...]     -V, --del-sub-uids FIRST-LAST         Remove a range of subordinate uids from the users account.     [...]     -w, --add-sub-gids FIRST-LAST         Add a range of subordinate gids to the users account.     [...]     -W, --del-sub-gids FIRST-LAST         Remove a range of subordinate gids from the users account.     [...]


title: How do I compile the linux kernel version 3.16.1 to run in Slackware 14.1?

text: Could someone teach me or give me some tutorial? How do I compile the linux kernel version 3.16.1 to run in Slackware 14.1.


title: CPU frequency goes back after scaling down by indicator-cpufreq, suspension and waking up

text: I scale down the CPU frequency by indicator-cpufreq on Ubuntu 12.04. After I suspend Ubuntu and wake it up, the CPU goes back to"on demand" (the default). I wonder if there is a way to keep the CPU frequency after scaling it? **NOTE:** sometimes, my Ubuntu can't wake up completely, and my laptop can easily become overheated under CPU frequency on demand.


title: How to use yum to install from a DVD

text: I use Fedora 14 and I am a newbie to Linux. Some days ago, I used the command `yum remove openoffice.org-*` and removed openoffice successfully. The, I wanted to get it back. I have all the packages and dependancies required to install in an installation dvd. The problem is that when I try to manually install each package, **yum** does not check dependencies in the DVD. How can I configure yum to look for all dependancies and packages required, in the DVD?


title: Why do some symbolic links affect program behavior?

text: One thing that has been puzzling me for some time is this:               % which halt     /sbin/halt     % file /sbin/halt     /sbin/halt: symbolic link to `reboot'      However, executing `sudo halt` does, of course, **not** reboot the system. Why is that? There are several other programs working that way, for example `pdflatex`.


title: \n prints an n instead of a newline when using sed in MaxOSX

text: It's a general problem when I use `sed` but `\n` works when I use it outside of `sed`. This is one example of what I get with `sed`. I have the file `myfile` with the following content:               1 2 3 4 5      When I use this:               sed 's/ /\n/g' myfile      I get this:               1n2n3n4n5      Instead of getting this:               1     2     3     4     5      Does anybody know where the problem is?


title: Shell script to check server state

text: I am writing a script that would ssh into the VMWare server and check if the VMs are up or not. There's some error in the `server=awk "/$i/{print $2}" /home/dharmit/scripts/vmids` line. I am getting following error               ./server_notify.sh: line 38: /688/{print }: No such file or directory      I know that I have made some error in quoting. But I can't find what the error is.               for i in {144,528,544,576,592,624,640,688}     do             ssh root@some.ip vim-cmd vmsvc/power.getstate $i | grep off > /dev/null             if [ $? -eq 0 ]             then                     server=awk "/$i/{print $2}" /home/dharmit/scripts/vmids                     echo "$server is Down"             fi     done      Contents of /home/dharmit/scripts/vmids               144 Web Server     528 N-Zimbra Mail Server     544 Zenoss     576 OTRS Supporting Tool     592 Proconsol     624 SVN     640 SFTP     688 FTP      Can someone please point me where I am making a mistake and what the solution is?


title: Why EC2 instance spends all its time in "IRQ" and what to do about it?

text: I have an m1.small EC2 instance that is mostly just running Apache as a web server for several simple PHP web sites (that use RDS as a database). The server is constantly with a very high load average - around 8, and never below 5. This causes my web sites to be annoyingly slow, much more then I'd expect from a supposedly 2.6GHz CPU with 1.7GB RAM. `top` and friends shows that other then ~50% "steal" time (AFAIU, time stolen by the hypervisor for other VMs on the same CPU), the rest is almost entirely "IRQ" time. `mpstat` says that this time is spend on a very stable 191.59 interrupts/sec (i.e. that number almost doesn't change over time), and according to '/proc/interrupts' these are mostly spend on `xen-percpu-virq timer0` and `xen-dyn-event eth0`. What are these, and how can I get the EC2 instance to lower the load and spend some more time on my PHP sites?


title: Linux (debian/testing) cannot boot after installing kernel 3.9.1

text: Today I wanted to upgrade the kernel on my debian/testing system from `2.6.32-5-686` to `3.9-1-686-pae`. So I installed the image by `sudo aptitude install linux-image-3.9.1-686-pae` (or something like that). Then it said, I need to install some headers, so I did by `sudo aptitude install linux- headers-3.9.1-686-pae` or something like that. Now my system doesn't boot correctly. Both kernels are still installed or at least I can choose both of them in GRUB to load. However, I still have the system here, it just doesn't boot. I have two partitions on my disk: (1) sda1, which is my boot partition (flag is still there) and (2) sda2, on which I created two virtual volumes using `lvm`: `base-root` for `/` and `base-home` for `home`. I managed to mount each partition/volume on a live system I'm on (using an usb stick). This is what is happening while booting with any of the installed kernels:               early console in decompress_kernel          Decompressing Linux ... Parsing ELF... done.     Booting the kernel.     Loading, please wait...     Gave up waiting for root device. Common problems:      - Boot args (cat /proc/cmdline)       - Check rootdleay= (did the system wait long enough?)       - Check root= (did the system wait for the right device?)      - Missing modules (cat /procmodules ls /dev)     ALERT! /dev/disk/by-uiid/<some_uuid> does not exist.     Dropping to a shell!          BusyBox...     Enter 'hel...          /bin/sh: can't access tty; job control turned off      The system waits/searches for about 30s after the "please wait..." message. This is the output of `cat /proc/cmdline` (while trying to boot the new kernel, for the old kernel, there is an analogous message):               BOOT_IMAGE=/vmzlinuz-3.9.1-686-pae root=UUID=<someuuid>      Now, this is the output of `ls /dev/mapper/`:               control      Usually, there are also entries for `base-root` and `base-home`. **So my guess is** , that there is some lvm kernel module which is needed to interpret the volumes from lvm and isn't loaded in the kernel. Strangely, it seems to be missing in the olde kernel, too. This is the output of `cat /proc/modules` when booting the new kernel:               usbhid 35908 0 - Live...     hid 64559 1 usbhid  - ...     ohci_hcd 22150 0 - ...     dm_mod 577277 0 - ...     sd_mod 577277 - ...     crc_t10dif 12332 1 - ...     ahci 25000 0 - ...     libahci 22632 1 ahci - ...     thermal 13172 0 - ...     ata_generic 12450 - ...     thermal_sys 18359 thermal, ...     libata 126017 3 ahci, libahci,ata_generic, ...     uhci_hcd 22424 0 - ...     ehci_pcs 12432 - ...     e1000e 123671 0 - ...     ehci_hcd 3570 1 ehci_pci -     usbcore 110217 5 usbhis,ohci_hcd,uhci_hcd,ehci_pci,ehci_hcd, ...     scsi_mod 135333 2 sd_mod,esndld, ...     ptp 131711 e1000e, ...     usb_common 12338 1 usbcore, ...     pps_core 13071 1 ptp, ...      (I might fill in the "..." later.) Anyway, what I want to do is obviously to boot from properly into my installed debian system on `base-root`. My strategy so far is:   * write down error messages returned while booting (and post them here)   * google them, try to understand the error Momentarily, I have these questions:   * What does this error mean? What is /proc/cmdline for? How can I change its contents?   * Which modules/devices should I have installed? Which modules are missing and should be loaded?   * How can I tell my kernel to load some other module. Edit: Googling the error messages, I found this, seems related.


title: How to upgrade a tbz package that I create in Freebsd?

text: I am newbie at freebsd packaging and I want to learn way of upgrade a package. I created a package on my development server and I installed it to test server by               pkg_add foo-1.0.tbz      then I changed version of package as 1.1. In my freebsd test server there is only `pkg-config, pkg_add, pkg_create, pkg_delete, pkg_info, pkg_updating, pkg_version` commands. I figure out none of these commands used for upgrade a package. Now, I can only install a new package after delete older version.               pkg_delete foo-1.0     pkg_add foo-1.1.tbz      Is this the only way? or is there any gracefully way to upgrade a package?


title: Partition scheme for installation of Debian

text: I'm installing Debian Wheezy on a 50 GB partition of a 500 GB Seagate SATA hard disk with 2 GB RAM. I want to use following partition scheme, but stuck at:   1. How much ( _in percent_ ) of disk space should be given to following partitions?   2. The order in which partitions should be created? **So that system runs very fast and smooth.**               /     /boot     /home     /tmp     /usr     /var     /srv     /opt     /var/www     /usr/local     SWAP      ### MACHINE INFORMATION   1. Debian Wheezy 64 Bit Update up to Date   2. Role of Machine Server   3. Main Software   4. Bind9, Apache2, Mysql-Server, PHP5   5. 500 GB Seagate SATA Hard Disk   6. 2 Partitions 50 GB & 450 GB _I do not want touch 450 GB Partition (sda2) however I can take 50 GB more from sda2 if required_


title: GNU screen startup is really slow

text: I connect to a RHEL 5.7 server via Putty or VNC (not sure it matters) but when I try to run `screen`, it takes _forever_ (on order of 20-30 secs). Same thing if I run `screen -ls`, takes just as long. I don't know if it has to do with where `screen` is configured? But when I go to `$HOME`, there was no `.screenrc` file. (So where is it? I read I can define my own location, so maybe this is a minor point...) `screen -v` gives `Screen version 4.00.03 (FAU) 23-Oct-06` Does anyone have ideas on what the issue could be or is it just the way it is? * * * **Update 2**   1. I've tried setting environment variables `$SCREENDIR` and `$SCREENRC` to `~/.screenrc` and to a location on the server `/home/myusername` = no change   2. I've tried a blank `.screenrc` file = no change   3. I've tried adding `defnonblock on` to `.screenrc` = no change   4. Also tried running strace with the additional `-f` option, but didn't notice any new info? **strace file #2, snippet 1** , first occurrence of that funny number `4294967295`               11:24:23 connect(4, {sa_family=AF_FILE, path="/dev/log"...}, 110) = 0     11:24:23 sendto(4, "<14>Jun 25 11:24:23 screen: nss_"..., 129, MSG_NOSIGNAL, NULL, 0) = 129     11:24:23 write(3, "\27\3\1\0\33\331\331\30\274MD\374s\375ia\341!\200\16\4&\205\177\320\274\213\224gz\376l", 32) = 32     11:24:23 write(3, "\25\3\1\0\26\304\345w\317\273\257\256\322\314.\20T\372;'EQ\222\10z\375\234", 27) = 27     11:24:23 shutdown(3, 2 /* send and receive */) = 0     11:24:23 close(3)                       = 0     11:24:23 read(4294967295, 0xe5d3350, 5) = -1 EBADF (Bad file descriptor)     11:24:23 shutdown(4294967295, 2 /* send and receive */) = -1 EBADF (Bad file descriptor)     11:24:23 close(4294967295)              = -1 EBADF (Bad file descriptor)     11:24:23 stat("/etc/ldap.conf", {st_mode=S_IFREG|0644, st_size=10681, ...}) = 0     11:24:23 geteuid()                      = 287621     11:24:23 open("/etc/hosts", O_RDONLY)   = 3      **New theory** : In-between those `nanosleep` calls, I see it's doing something with a unix auth server. What is it doing or why... I don't know. But then this line appears > sendto(4, "<14>Jun 25 11:24:28 screen: nss_"..., 129, MSG_NOSIGNAL, NULL, 0) > = 129 and I can't read the entire error message?? Then, the "Bad file descriptor" lines showup, and _bam_ , going to sleep again. Could understanding what it's doing with the unix auth server be key to understanding these delays? **strace file #2, snippet 2** , zooming in on what happens before the sleeps occur. Changed the company name and IP addresses to dummy values.               11:24:28 recvfrom(3, "\266!\201\200\0\1\0\2\0\0\0\0\10unixauth\2cs\6company\3"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("987.654.321.09")}, [16]) = 86     11:24:28 close(3)                       = 0     11:24:28 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3     11:24:28 fcntl(3, F_SETFD, FD_CLOEXEC)  = 0     11:24:28 setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0     11:24:28 setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = 0     11:24:28 fcntl(3, F_GETFL)              = 0x2 (flags O_RDWR)     11:24:28 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0     11:24:28 connect(3, {sa_family=AF_INET, sin_port=htons(636), sin_addr=inet_addr("123.456.789.01")}, 16) = -1 EINPROGRESS (Operation now in progress)     11:24:28 poll([{fd=3, events=POLLOUT|POLLERR|POLLHUP}], 1, 90000) = 1 ([{fd=3, revents=POLLOUT}])     11:24:28 getpeername(3, {sa_family=AF_INET, sin_port=htons(636), sin_addr=inet_addr("123.456.789.01")}, [4294967312]) = 0     11:24:28 fcntl(3, F_GETFL)              = 0x802 (flags O_RDWR|O_NONBLOCK)     11:24:28 fcntl(3, F_SETFL, O_RDWR)      = 0     11:24:28 write(3, "\200w\1\3\1\0N\0\0\0 \0\0009\0\0008\0\0005\0\0\26\0\0\23\0\0\n\7\0\300"..., 121) = 121     11:24:28 read(3, "\26\3\1\0Q\2\0", 7)   = 7     11:24:28 read(3, "\0M\3\1^\270\3\2\277\353\23\377\211\336\255Q\213\342\272\236@\242\252\5\357T\254\207\326\377Jl"..., 79) = 79     11:24:28 read(3, "\26\3\1\16\356", 5)   = 5     11:24:28 read(3, "\v\0\16\352\0\16\347\0\4\2520\202\4\2460\202\3\216\240\3\2\1\2\2\3\v\334/0\r\6\t"..., 3822) = 3822     11:24:28 read(3, "\26\3\1\0\4", 5)      = 5     11:24:28 read(3, "\16\0\0\0", 4)        = 4     11:24:28 write(3, "\26\3\1\0\206\20\0\0\202\0\200+\34JE5\2234\204I\233g@&m\4\232\317\335\323\373\366"..., 186) = 186     11:24:28 read(3, "\24\3\1\0\1", 5)      = 5     11:24:28 read(3, "\1", 1)               = 1     11:24:28 read(3, "\26\3\1\0$", 5)       = 5     11:24:28 read(3, "j\213\362\240R\244\35\257\243/\311\307\360\206\362\314\3\227\353\351\243\242=\222k\0y\367\20\\[\245"..., 36) = 36     11:24:28 write(3, "\27\3\1\0\214\216\374\314\342\264p\205j?\311\356#d\200\25]1\256\371\341\215\325\275jj\26\273"..., 145) = 145     11:24:28 poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 90000) = 1 ([{fd=3, revents=POLLIN}])     11:24:28 read(3, "\27\3\1\0\255", 5)    = 5     11:24:28 read(3, "s\315\357J\363\342\37\10\r\251\333v\302\357\207\3429\3633\345\5\17j\35*K\216\300\225,\r\265"..., 173) = 173     11:24:28 sendto(4, "<14>Jun 25 11:24:28 screen: nss_"..., 129, MSG_NOSIGNAL, NULL, 0) = 129     11:24:28 write(3, "\27\3\1\0\33H\6eq\267(\356\35\366i\364H\372m\17O\7\307d;&\37\345f\212\320H", 32) = 32     11:24:28 write(3, "\25\3\1\0\26\245\267\236\270a\356\227\233\243e\0[3\372\226\33\342f\306\257[ ", 27) = 27     11:24:28 shutdown(3, 2 /* send and receive */) = 0     11:24:28 close(3)                       = 0     11:24:28 read(4294967295, 0xe5d3350, 5) = -1 EBADF (Bad file descriptor)     11:24:28 shutdown(4294967295, 2 /* send and receive */) = -1 EBADF (Bad file descriptor)     11:24:28 close(4294967295)              = -1 EBADF (Bad file descriptor)     11:24:28 sendto(4, "<14>Jun 25 11:24:28 screen: nss_"..., 89, MSG_NOSIGNAL, NULL, 0) = 89     11:24:28 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     11:24:28 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0     11:24:28 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     11:24:28 nanosleep({8, 0}, {8, 0})      = 0      * * * **Update 1** Here's the strace interesting bits... I see it's doing `nanosleep` repeatedly (each doubling the sleep time) but why?               09:10:05 read(4294967295, 0xca3b350, 5) = -1 EBADF (Bad file descriptor)     09:10:05 shutdown(4294967295, 2 /* send and receive */) = -1 EBADF (Bad file descriptor)     09:10:05 close(4294967295)              = -1 EBADF (Bad file descriptor)     09:10:05 sendto(4, "<14>Jun 25 09:10:05 screen: nss_"..., 89, MSG_NOSIGNAL, NULL, 0) = 89     09:10:05 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     09:10:05 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0     09:10:05 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     09:10:05 nanosleep({4, 0}, {4, 0})      = 0     09:10:12 stat("/etc/ldap.conf", {st_mode=S_IFREG|0644, st_size=10681, ...}) = 0     09:10:12 geteuid()                      = 287621     09:10:12 open("/etc/hosts", O_RDONLY)   = 3     09:10:12 fcntl(3, F_GETFD)              = 0     ...     09:10:20 read(4294967295, 0xca3b350, 5) = -1 EBADF (Bad file descriptor)     09:10:20 shutdown(4294967295, 2 /* send and receive */) = -1 EBADF (Bad file descriptor)     09:10:20 close(4294967295)              = -1 EBADF (Bad file descriptor)     09:10:20 sendto(4, "<14>Jun 25 09:10:20 screen: nss_"..., 90, MSG_NOSIGNAL, NULL, 0) = 90     09:10:20 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0     09:10:20 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0     09:10:20 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0     09:10:20 nanosleep({16, 0}, {16, 0})    = 0     09:10:36 stat("/etc/ldap.conf", {st_mode=S_IFREG|0644, st_size=10681, ...}) = 0     09:10:36 geteuid()                      = 287621     09:10:36 open("/etc/hosts", O_RDONLY)   = 3     09:10:36 fcntl(3, F_GETFD)              = 0     ...     09:10:36 write(3, "\27\3\1\0\33P\314s\21L-y\316\324\0\345!hd\212\351Q\33\345\335K\3\22\260r\312\332", 32) = 32      09:10:36 write(3, "\25\3\1\0\26V\20\224{t2\364\250k\241\363\363\337V\370\236m\261I\240xw", 27) = 27      09:10:36 shutdown(3, 2 /* send and receive */) = 0      09:10:36 close(3)                       = 0      09:10:36 read(4294967295, 0xca3b350, 5) = -1 EBADF (Bad file descriptor)      09:10:36 shutdown(4294967295, 2 /* send and receive */) = -1 EBADF (Bad file descriptor)      09:10:36 close(4294967295)              = -1 EBADF (Bad file descriptor)      09:10:36 sendto(4, "<14>Jun 25 09:10:36 screen: nss_"..., 90, MSG_NOSIGNAL, NULL, 0) = 90      09:10:36 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0      09:10:36 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0      09:10:36 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0      09:10:36 nanosleep({32, 0}, {32, 0})    = 0      09:11:08 stat("/etc/ldap.conf", {st_mode=S_IFREG|0644, st_size=10681, ...}) = 0      09:11:08 geteuid()                      = 287621      09:11:08 open("/etc/hosts", O_RDONLY)   = 3      09:11:08 fcntl(3, F_GETFD)              = 0      09:11:08 fcntl(3, F_SETFD, FD_CLOEXEC)  = 0      ...     09:11:08 rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0      09:11:08 rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0      09:11:08 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0      09:11:08 nanosleep({64, 0}, {64, 0})    = 0      09:12:12 stat("/etc/ldap.conf", {st_mode=S_IFREG|0644, st_size=10681, ...}) = 0      09:12:12 geteuid()                      = 287621      09:12:12 open("/etc/hosts", O_RDONLY)   = 3      09:12:12 fcntl(3, F_GETFD)              = 0


title: How to turn off DELL BIOS beeping through Ubuntu?

text: I removed my LCD with Inverter, because it was broken. I'm using a Inspiron 4050 with a HDMI or VGA connected at TV, but the BIOS beeps(8times) continuos for ever and ever. There is a way to control the beep volume or mute it through Ubuntu?


title: subsitute removing zero numbering

text: I would like to subsitute in a txt file the followings targets for example "code_000040" by "code_40" and "code_067340" by "code_67340" and so on.., in other words to remove the zeros in the 6 number ids before the real numbering id starts Plaese any help!!


title: Commands run when terminal is open do not appear in history

text: I have the simple following `terminal.sh` script:               #bin/bash --login     str=(--tab --title="Test" -e "bash --login -c 'echo history';bash")     gnome-terminal "${str[@]}"     exit 0      I basically use it to open a terminal with several tabs that I need to use daily. But the problem is that the `echo history` command is not added to the history of that tab. So, for example, one of my tabs is the application server. When I need to restart it, I usually type `Ctrl`+`C`, `Ctrl`+`L`, `Up` and `Enter`, but when I use this script to run it, it doesn't add the line executed to the bash, and then the last command executed is normally `exit`. So I end up closing the tab instead of restarting the server, which is incredbly annoying. I saw this, and I tried adding:               HISTFILE=~/.bash_history     set -o history      To the start of my `terminal.sh` script, and also tried adding to the script executed:               str=(--tab --title="Test" -e "bash --login -c 'HISTFILE=~/.bash_history;set -o history;echo a';bash")      But neither helped. I also tried adding `history -s echo history` before executing the script, but that didn't help either. How can I add all commands executed this way to the history? I aslo tried:               #bin/bash --login          cmd='echo test'     cmd_e="bash --login -c 'unset PROMPT_COMMAND;history -s '\''$cmd'\''; eval '\''$cmd'\''';bash"     str=(--tab --title="History Test" -e "$cmd_e")          gnome-terminal "${str[@]}"          exit 0


title: Crontab suspicious activity

text: I tried using `crontab -l` from my terminal as root, it showed `no crontab for root`. So I tried `crontab -e`, it returns the following > no crontab for root - using an empty one 888 and then the cursor starts blinking. I am not able to quit or save the file. I am new to Linux, so I don't have any idea. What is the problem here? Anyone any ideas?


title: How to relate a kernel config setting to the source files?

text: Here is an example that will explain better: ![enter image description here](http://i.stack.imgur.com/0Yveq.png) I have a selected the audio driver from the picture and i would like to browse through its source. How do i get to the path of the source files from here? ![enter image description here](http://i.stack.imgur.com/FApCk.png)


title: What is the default root password for mariadb in Arch Linux?

text: I install `mariadb` in arch-linux. but I haven't got access to MySQL. I try this:                mysql -u root -p     Enter password:      ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)      I see very similar question, and test all of answers but I can't resolve it.


title: XMing - "XIO: fatal IO error 11

text: I am running Xming 6.9.0.31 on my local Windows 7 workstation. I am accessing a Ubuntu server to view large data sets graphically in my Xming session. When I request a smaller data set I have no problem but when I access a very large data set I receive the following error:               IO:  fatal IO error 11 (Resource temporarily unavailable) on X server "localhost:13.0"           after 629 requests (164 known processed) with 0 events remaining.      tks, steve


title: How to detect on Linux/AIX machines if they are vulnerable to the CVE-2014-0160?

text: I quickly wrote a script that outputs the openssl versions on AIX/Linux:               #/bin/ksh     # RUN THIS SCRIPT ON ANY AIX/LINUX TO DETECT IF THE SERVER IS VULNERABLE TO:      # https://www.openssl.org/news/secadv_20140407.txt     # https://www.us-cert.gov/ncas/alerts/TA14-098A     # warning: if openssl was custom compiled (in a non-default dir...) and not in the PATH variable.. then this script will not detect it..     # it works for RPM based Linux distros and AIX     # LAST UPDATE: 2014.04.10 16h          printf "`hostname -s`\t"          ###########################     # AIX PART     function isaix {          if which openssl > /dev/null 2>&1; then openssl version -a | head -1 | sed 's/^OpenSSL //g' | cut -d' ' -f1; else          RPM="`if which rpm > /dev/null 2>&1; then rpm -qa | grep -i ^openssl-[0-1]; fi`"         LSLPP="`if which lslpp > /dev/null 2>&1; then lslpp -l | grep -i openssl; fi`"              if [[ -n "$RPM" || -n "$LSLPP" ]]; then             printf "OpenSSL NOT found in PATH but found installed package(s): "             echo "$RPM" | perl -pe 's/\n/ /g'             echo "$LSLPP" | perl -pe 's/\n/ /g'             echo             else             echo "OpenSSL NOT found in PATH and NOT found as installed package"         fi     fi              }     ###########################          ###########################     # LINUX PART     function islinux {          if which openssl > /dev/null 2>&1; then openssl version -a | head -1 | sed 's/^OpenSSL //g' | cut -d' ' -f1; else          RPM="`if which rpm > /dev/null 2>&1; then rpm -qa | grep -i ^openssl-[0-1]; fi`"              if [[ -n "$RPM" ]]; then             printf "OpenSSL NOT found in PATH but found installed package(s): "             echo "$RPM" | perl -pe 's/\n/ /g'             else             echo "OpenSSL NOT found in PATH and NOT found as installed package"         fi     fi              }     ###########################          OSTYPE="`uname`"         if echo "${OSTYPE}" | grep -iq aix; then isaix; fi         if echo "${OSTYPE}" | grep -iq linux; then islinux; fi      +process the scripts output with a "cat *" and put that in an XLS or whatever OpenSSL versions 1.0.1 thru 1.0.1f are affected. **My question** : What is the best method to detect if a server is vulnerable to the bug or not? :) (besides this)


title: Shell script wait for background command

text: I am writing a script, but there is something I need that I can't find a way to do it... I need to make a command in background "command1 &" and then somewhere in the script I need to wait for it to finish before I do command2. Basically, I need this: NOTE: each command runs in a specific directory! at the end of the while loop my command1 created 4 directory's, where in each one run the specific process so the total of process running are 4               a=1          while [$a -lt 4 ]               . command1        #Generates 1 Process                 a= `export $a +1`     done             #Wait until the 4 process end and then run the command2               . command2      I've looked a lot of pages, but I couldn't make this simple task to be done. I've seen something about a `wait` command with the pid process number, but that didn't work also (or I couldn't make it work). Can anybody help me?


title: Is there a way to report incorrect login attempts in Ubuntu 12.10?

text: I am concerned with some people trying to access my laptop while I am away in my work place. Therefore I was wondering if is there a way to set up kind of automatically monitor and report wrong password login attempts.


title: Running tomcat under tomcat service account in CentOS

text: I'm installing tomcat on a CentOS box for use as an application server. My system admin created a tomcat user service account under which to run tomcat. I'm generally following instructions on this page but when I get to the step where I adjust the startup script to run the tomcat startup and shutdown commands as user tomcat (Step 6, item 4) I'm being asked for a password for the tomcat account. Since this is a service account should I be able to `/bin/su tomcat` to run certain commands as the tomcat user without entering the password? I'm generally unfamiliar with setting up tomcat to run under a service account. If anyone has best practices for this please let me know. **Update** : I found a good article covering installing tomcat as a service under a low privilege user here. Following that article I eventually got my installation working.


title: FreeBSD's net/ntp port is forbidden due to CVE-2013-5211, with no support upstream

text: FreeBSD port net/ntp was marked forbidden because it is vulnerable to traffic spoofing and amplification attacks, as documented in CVE-2013-5211. However, there's been no support from the upstream provider, ntp.org. It would also appear that the developers were aware of the issues as early as 2011-December, and have not sought recourse other than to suggest configuration changes to mitigate the problem: http://lists.ntp.org/pipermail/pool/2011-December/005616.html Without relying on FreeBSD's 'world' version of ntpd, what other packages are available to replace ntpd?


title: Localized wrapping in vim

text: I have wrapping turned on in vim, but is it possible to disable it for certain regions in the file I'm editing? To be specific, I'm editing LaTeX files, I would like the contents of some environments (tabular for example) not to be wrapped, since this would make the table contents much easier to read. A solution based on automatically detecting such environments based on their opening/closing tags would be the best of course, but I'm not against a solution needing some explicit tags or commands in a comment in the file.


title: starting multiple x-sessions with different DE/WMs with startx in Linux Mint

text: I'm using Linux mint, and I want two windows managers (MATE and xmonad) running on different pipes. I installed xmonad, and when I choose xmonad from the login screen it works perfectly. But, when I move to pipe tty1, login, and run `startx xmonad`, I get an error:               <home dir>/.xmonad/xmonad-i386-linux: executeFile: does not exist (No such file or directory)      The screen is white, and pressing Alt-Shift-Enter opens a window for a split second then returns to the white screen. Why? How can I fix this?


title: Error: Missing newline before EOF - inserted

text: In my application I am inserting some files in main file. In that there is common header file to all the code files `(*.c)`. This giving me error:               D:\New folder\COM_Port_Cont\COM_Port_Task.h(268) : Error 1 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\COM_Port_Task.c(48) : Error 2 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Hdw_Ecg_1X5.c(129) : Error 3 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Timer_Wdg_1XX.c(39) : Error 4 : missing newline before EOF - inserted     D:\New folder\COM_Port_Cont\Main_Prj_Rfid.c: 0 warnings, 4 errors.      In this `COM_Port_Task.h` is the common header file.


title: How can I get write access to my usb drives?

text: I have trouble writing to external drives. They are monuted automatically in Nautilus, but I can not copy anything there ('Paste' and 'create Folder' are just greyed out). Does Anyone have ideas what could be wrong? The drive is named 4E29-64CA (but other drives behave the same) and I get the following error when trying to do anything to it:               /run/media/username/4E29-64CA $ touch foo     touch: cannot touch ‘foo’: Read-only file system      As root same error:               /run/media/username/4E29-64CA $ sudo touch foo     [sudo] password for username:       touch: cannot touch ‘foo’: Read-only file system `ls /run/media/username` gives the following:               drwx------ 6 mophahr users 4096 Jan  1  1970 4E29-64CA      So it seems I have the right permissions. **Further relevant(?) stuff:** Output of `mount`:               $ mount | grep 4E29     /dev/sdc1 on /run/media/username/4E29-64CA type vfat (ro,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)     $ mount | grep 1000     tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=372244k,mode=700,uid=1000,gid=100)     gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)      Groups I am in:               $ groups     audio storage users networkmanager sudoers      From `/usr/share/polkit-1/actions/org.freedesktop.udisks2.policy`:               <action id="org.freedesktop.udisks2.filesystem-mount">         <description>Mount a filesystem</description>         <message>Authentication is required to mount the filesystem</message>         <defaults>               <allow_any>auth_admin</allow_any>               <allow_inactive>auth_admin</allow_inactive>               <allow_active>yes</allow_active>         </defaults>     </action>


title: How many Remote Users?

text: I need to count how many people are logged in remotely into my virtual machine at school. I can tell if someone ssh'd in from host, but am having trouble telling if someone is remotely logged into an XWindows session through VNC or if they are sitting at the console at school. When I log into my school VM from home and do a who, it show this when I am the only one logged in:                user1   tty7    2013-10-10 23:31 (:1)      user1   pts/0   2013-10-10 23:23 (:1.0)      Note: No one can log in directly to VM. Must log into school lan, then VM host and then VM. I'm really wondering if it is even considered a remote login if I have to login from my VM's host machine.


title: What is the relationship between GNU and GNOME?

text: Is there any relation between GNU and GNOME? And further related license GPL?


title: Sum in block with AWK (restart the sum when the pattern changes)

text: I have a file like this:               A 100     A 200     A 300 #sum=600     B 400     B 500 #sum=900     A 600     A 700     A 800 #sum=2100      I would like the output to be:               A 600     B 900     A 2100     C sum_of_C     D sum_of_D      I can do that with `for`, `sed`, `grep` and `awk`. However because I am learning `awk`, I would like to write an `awk` script. So far I have:               if (${NR {print $1}} == ${NR-1 {print $1}})        sum+=$2       print $0"\t"sum     else       sum=$2       print $0"\t"sum      `awk -f awkscript file` was not successful. What is the solution?


title: how to change a NCSA squid proxy user password from the client en

text: I have implemented a squid proxy web caching server with NCSA authentication. Proxy users are able to login and access the internet. Now my client wants to change his proxy password from their end. Any idea regarding that?


title: gvfs-mount auto password

text: I would like to make shortcuts for gvfs mounts (I prefer to mount from the shell). For this, it is quite necessary/convenient not to have to enter the password for the `ftp://` and `sftp://` connections . Currently the only way I know is:               echo 12345 | gvfs-mount sftp://user@example.com/      Even though I can make the file's rights `700` (or even `100`), I'm not sure if it's reasonably safe. Is it worse than `.netrc` items? I know about `ssh- copy-id`, but I can't access shell on most of my `sftp` servers. Is there a better (standard) alternative to my approach? What do `nautilus`/`caja` do when they store the passwords?


title: Low performace of Intel Haswell HD Graphic 4600 in 3D Games

text: I have a notebook (Lenovo IdeaPad G510) with Linux Debian Jessie. It has got a built-in, integrated GPU - Intel Haswell HD Graphic 4600. I've read postive opinions about the GPU, it has got good performance for 3D games like Battlefield 3 (~35-40 FPS). But in my case that doesn't look plausible. In Minecraft (opened by OpenJDK) I have got only 10 FPS and GTA San Andreas (launched on Wine Emulated Desktop 800x600) has around 4 FPS. I thought that this is, because I do not have any good drivers to my Intel Card. So I ran `lspci -vnn`:               00:02.0 VGA compatible controller [0300]: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller [8086:0416] (rev 06) (prog-if 00 [VGA controller])             Subsystem: Lenovo Device [17aa:3978]             Flags: bus master, fast devsel, latency 0, IRQ 43             Memory at b0000000 (64-bit, non-prefetchable) [size=4M]             Memory at a0000000 (64-bit, prefetchable) [size=256M]             I/O ports at 4000 [size=64]             Expansion ROM at <unassigned> [disabled]             Capabilities: <access denied>             Kernel driver in use: i915      As you can see, my Intel has the kernvel driver i915 in use. According to the Internet, drivers for Intel are built-into system kernel drivers and I do not have to install anything. My CPU is Intel i5 DualCore 2,5 GHz. I use GNOME3 on XServer. I ran also `glxgears`:               2164 frames in 5.0 seconds = 432.504 FPS     2298 frames in 5.0 seconds = 459.535 FPS     2212 frames in 5.0 seconds = 442.281 FPS     2250 frames in 5.0 seconds = 449.699 FPS      Results of `xrandr`:               Screen 0: minimum 1366 x 768, current 1366 x 768, maximum 1366 x 768     default connected primary 1366x768+0+0 0mm x 0mm        1366x768        0.0*      I do not know what's the matter. I tried to install drivers for my card from Intel Developers (and I think `i915` has been installed by my installation), but my card is still really, really slow. Can you tell me what should I do?


title: How can i set-up VIOs multiple VLANs in our p770 box?

text: There's a requirement setup needs to address to our pSeries box. We have one p770 box intended to setup UAT and Development VM Clients, but the requirement is to set different VLANs per Environment (UAT & Dev). Also a separation of VLANs with applications and databases, it will be assigned by specific VLAN ids by our LAN Team. ### Questions   * How can this be done in VIOs? The old setup of our p6 box was a single VLAN which configured in our VIOs thru SEA.    * How can we assign different VLANs in the SEA, or is it correct that its being configured via SEA or there is any other way?


title: How to open .Desktop file in Windows

text: I'm a Designer by profession, I need to know how can i open a .Desktop extension file in windows 7, the file contains info on creating icons for Linux to be used for a software that runs on Linux Operating system.


title: Dropbox insists on autostarting - Fedora 20

text: I'm trying to get Dropbox not to autostart. The manual shows a command line option that should do the trick but it doesn't seem to work here (`dropbox autostart n`). Running `dropbox autostart` issues a note warning that it may only work on current Ubuntu distributions. ### Questions   * How can I get it not to start?    * How should I proceed with the issue? ### EDIT After following some valuable tips, it seems every time I open dropbox, it adds itself to ~/.config/autostart list, which shows in the gnome-session- properties GUI. I wonder if there's a way to stop it. Perhaps not giving the process permissions on that folder?


title: List only files in a directory and show the inode number

text: How can I list all files but not directories in a given directory and show the inode-numbers. Something like `ls -li | grep ^-` does not work since the inode number is shown in the beginning of the line.


title: Checking and changing file permission with script

text: I'm new to bash and I can't get a script working. This is the code that I have:               #!/bin/bash     file=~/scripts/text.txt          if [ -e $file ]     then echo "The file exists"          elif [ ! -e $file ]     then echo "The file does NOT exist"          fi          sleep 1s          if [ ! -w $file ]     then { sudo chmod u+w $file; } && { echo "The file is now writable"; }          elif [ -w $file ]     then echo "The file is already writable"     fi      The top part of the script, that checks if the file exists, works just fine. The bottom part, that checks if the file is writable, partly works. It will change the permissions of the file. But after that, with write permissions enabled, it will still echo "The file is now writable" instead of "The file is already writable" Like I said, I'm new to bash so any help would be appreciated. Please keep it simple, because if statements are about as complex as I can go with my current knowledge.


title: Where does Linux store logs of WiFi networks when searching? Does it at all?

text: For research I wanted to try and keep a log of all the networks that my laptop sees (not connects connects to, but just gets a response from when searching) over a period of time walking around. I was curious if it saved this info to a cache file somewhere in the system or if I could make it do so. If it's relevant, I'm running the Debian derivative, CrunchBang. I'm fairly new to Linux and now I've finally found a purpose for using it!


title: Is it possible to share an external hard drive through server?

text: I was wondering if it is possible to share an external hard drive in CentOS server? Sorry if this question seems basic. I'm new to system administration.


title: Does Linux kernel 3.x use the CFS process scheduler?

text: Does the latest version of the Linux kernel (3.x) still use the Completely Fair Scheduler (CFS) for process scheduling which was introduced in 2.6.x ? If it doesn't, which one does it use, and how does it work? Please provide a source.


title: equivalent to 'cpusets' for gpu's

text: I work with clusters of computers and manage the nodes with torque and Moab. A user is able to submit a job to a node, and request the amount of resources they need.               #The following submits the job foo.sh to 1 node, requesting 8 cores, and 1 gpu     qsub foo.sh -l nodes=1:ppn=8:gpus=1      Because it is possible for a user to take more resources than requested, I've enabled the hwloc library (cpusets) to keep users in check. From what I have found, there is no possible way to prevent a user from taking more gpu's than they have requested. **Is there a 'cpuset' equivalent for gpu's?** * * * _Resources_ Moab Documentation Torque Documentation hwloc documentation


title: How do I get the right `lpr` for cups installed on Ubuntu Server 14.04?

text: **UPDATE** It appears the lpr in the `lpr` package is not the one that works with cups. The questions is, how do I get the cups version of `lpr` installed? **Old Question** lpr on ubuntu 10.04 includes an option "-o" that lets you pass extra options. lpr on 14.04 does not include this option. Our application that we are moving relies on lpr and the ability to set certain options so that pages print correctly. The command is:               lpr -P PrinterName -o orientation-requested=3 -o position=top-left     -o media=Letter -o page-left=0 -o page-right=0 -o page-top=0     -o page-bottom=0 /path/to/file.pdf      Worked fine on the old version but on the new server it fails with:               usage: lpr [-cdfghlmnpqrstv] [-#num] [-1234 font] [-C class] [-i [numcols]]     [-J job] [-Pprinter] [-T title] [-U user] [-wnum] [name ...]      So -o was removed? How do we pass options to lpr if the options option was removed?


title: chmod doesn't work on folder 'd --- --- ---' permissions

text: In `/var/www` I've got a folder:               d--------- 2 www-data www-data  4096 May 20  2012 update      reported by `ls -la`. I'm logged in as root, but I can't change permissions or ownership. `chown` and `chmod` returns 'Operation not permitted' An automatic update procedure demands all files and folders to be owned by 'www-data' and permissions set to 'u+w'.


title: How to merge partition with gparted?

text: How I can merge all of my three unallocated spaces? And i want the bigger one to be under `/dev/sda5`. Gparted screenshot: ![enter image description here](http://i.stack.imgur.com/2zR6s.png)


title: How do I build the iptables kernel module for a loaded kernel?

text: I've built a kernel with loadable module support for various reasons, one of them the possibility to compile modules and load them without rebooting. This is supposed to be useful when I need a module that I had not enabled in the kernel config. Now, with drivers like nouveau, it's as easy as going to the source directory, and running `make M=drivers/gpu/drm/nouveau`. How can I build an updated `iptables` module without compiling a whole kernel and rebooting? Is it even possible?


title: Containers for sandboxing

text: I'm trying to find a container stack for sandboxing and and would like to know which stacks do that particular job well. By sandboxing I mean running applications so that security flaws are confined to the application. I want such applications to be able to be run as cron jobs. I also want almost absolute control over where various files are stored and especially by default. Minor rant. I remember how upset I was when I discovered that VBox was dumping image diffs in my very small home folder, when I set aside a rather large amount of disc base for things VM related! PS: I don't know if it somehow got editted out, or if I simply forgot, but whatever scheme should be automatic. I want cron jobs to be able to start and stop containers.


title: Get list of Linux files recursively and direct output to file

text: I'm configuring software on Ubuntu for i2b2, and trying to find all of the relevant files on a CentOS image that I downloaded (path below) and am now running on Windows VMWare Player (free for download). I'd like to create a file of the Linux file hierarchy recursively, for both CentOS and Ubuntu, so I can find the relevant files for each program (ie: JBoss, Java, Apache, Axis, Spring Web Framework, Oracle, etc..) and compare configuration. I know how to do a similar thing in Windows by getting the output of all files. Long story short, I just want a dump of all files in the Linux file system starting at the root folder, and save it to a file. Here's the command in Windows to do this:               WINDOWS-COMMAND-PROMPT>dir /b /a /s >> files_on_windows.txt      Reference: http://www.i2b2.org > Software (menu) > VMWare Image


title: GTK3+ and C++ on OSX - "No GSettings schemas are installed" error

text: I'm trying to run a C++ example with GTK3+ and GStreamer components on OSX. I can gcc compile the source with: `gcc -o basic5 basic-tutorial-5.c 'pkg-config --libs --cflags gstreamer-1.0 gstreamer-video-1.0 gtk+3.0'` but when I try to run it I get the following error:               GLib-GIO-ERROR **: No GSettings schemas are installed on the system      I read somewhere to try gsettings list-schemas. That resulted in:               Segmentation fault: 11


title: Difference in regular expression handling between Perl, Kikki, and Kodos

text: #!/usr/bin/perl          $mystring = "[2004/04/13] The date of this article.";     if($mystring =~ m/(\d+)/) {             print "The first number is $1.";     }      Perl returns `2004`, but Kiki and Kodos return `/04/`. Why that?


title: Can I copy a MySQL database by copying the files? What do the files contain exactly?

text: I am using MySQL database and using an Ubuntu Linux machine. My database named `db_test` , I notice that under path `/var/lib/mysql/db_test` ,there are files suffix with `.frm`, `.MYD`, `.MYI` like following:               /var/lib/mysql/db_test# ls          cars.frm      cars.MYD      cars.MYI          customers.frm     customers.MYD     customers.MYI          departments.frm     departments.MYD     departments.MYI          ...       Seems each `.frm`, `.MYD`, `.MYI` files group mapped with one table in the database. I have following two questions to ask:   1. What are the three files doing exactly?   2. If I create a new directory under path `/var/lib/mysql/` say `db_test_2` , and copy every file from `db_test_1` directory to `db_test_2` , will it also create a new database `db_test_2` which has exactly the same contents(tables) as `db_test_1`'s ?  Does this physically database files moving action create the same result as following command-line actions:   1. dump the database `db_test_1` out   2. create a new database `db_test_2`   3. then dump the `db_test_1` database back into the new database `db_test_2`? If so, it seems moving files are much faster then using `mysqldump` to copy databases(or to importing data from one DB to another DB in MySQL). Any opinions on this?


title: How do I delete this folder in Solaris?

text: I am not sure how or when the below folder was created.. But I am unable to delete or open it..               bash-3.2$ cd '+%d-%m-%y'     bash: cd: +%d-%m-%y: No such file or directory     bash-3.2$ rm -f  '+%d-%m-%y'     bash-3.2$ ls -l | grep "+"     drwxr-xr-x   2 hypess   hypess         2 Dec 20 04:21 +%d-%m-%y


title: Displaying server information at login prompt (Ubuntu)

text: I'm wondering if there's a way to customize the Ubuntu server login prompt. Currently it shows the following:               Ubuntu 13.10 fw tty1     fw login: _      I know there's /etc/motd for the message of the day, also .bashrc for bash customization for each user, but how do I change the login prompt post? Thanks


title: Why the inode value of shadow file changes?

text: I created a hard link for the shadow file. For removing the passwd of the user I opened the shadow file in vi editor and removed the encrypted passwd and then saved. The inode value of the shadow file was changed. Then I updated the passwd of the user and again the inode value of the shadow file changed. Why the inode of the shadow file changes when it is edited/updated?


title: Is there a way to undo the 'cpp' command in terminal?

text: I accidentally typed `cpp Scriptname.py DestinationDirectory`, intending to copy the Python script into the folder. I realized afterward that I should have used `cp`, but now my Python script is completely gone. I have tried the `locate` command, but it says that it's still present in my user directory. When I type `ls` in my user directory, it is nowhere to be found. What are my options here? Edit: Here is an exact replica of what I did, showing how the script 'MYSCRIPT.py' disappears from the home directory.               vav7:~ tuc40953$ ls      Desktop            Dropbox         Movies         New.java                   Public         scripts     Documents       Library         Music           Peptoids      Theultimatescript.py     Downloads       MYSCRIPT.py     New.class       Pictures        rename.py     vav7:~ tuc40953$ clear          vav7:~ tuc40953$ cpp MYSCRIPT.py Desktop/Peptoids/Final-Structures/MyScript/     cc1: fatal error: opening output file Desktop/Peptoids/Final-Structures/MyScript/: Is a directory     compilation terminated.     vav7:~ tuc40953$ cpp Desktop/Peptoids/Final-Structures/MyScript/ MYSCRIPT.py      cc1: error: Desktop/Peptoids/Final-Structures/MyScript/: No such file or directory      vav7:~ tuc40953$ ls     Desktop         Dropbox         Music           Peptoids          Theultimatescript.py     Documents       Library         New.class       Pictures            rename.py      Downloads      Movies          New.java        Public             scripts


title: bash script loses readonly value after first time thru loop

text: I have a bash script which seems to lose the value of the readonly constant after the first time thru the for-in loop. For example:               #!/bin/bash     readonly DIR="./groups/"     for output in "${array[@]}"     do        catstring+="$DIR$output "     done     printf "$catstring"     cat $catstring > outputfile      The array has a bunch of names in it like: file1 file2 file3, etc. The output from the printf statement is "./groups/file1 file2 file3". What I'm expecting is "./groups/file1 ./groups/file2 ./groups/file3". Why is bash losing the value of $DIR after the first time thru the for-in loop?


title: How to create a user with limited RAM usage?

text: So I have 4 GB RAM + 4GB swap. I want to create a user with limited ram and swap: 3 GB RAM and 1 GB swap. Is such thing possible? Is it possible to start applications with limited RAM and swap avaliable to them without creating a separate user (and not installing any special apps - having just a default Debian/CentOS server configuration, and not using sudo)? _**Update:_** So I opened terminall and typed into it ulimit command: `ulimit -v 1000000` which shall be like `976,6Mb` limitation. Next I called `ulimit -a` and saw that limitation is "on". Then I started some bash script that compiles and starts my app in `nohup`, a long one `nohup ./cloud-updater-linux.sh >& /dev/null &`... but after some time I saw: ![enter image description here](http://i.stack.imgur.com/KS7yG.jpg) (which would be ok if no limitations were applied - it downloaded some large lib, and started to compile it.) But I thought I applied limitations to shall and all processes launched with/from it with `ulimit -v 1000000`? What I got wrong? How to make a terminal and all sub processes it launches be limited on ram usage?


title: Is Linux bad at handling misbehaving programs?

text: This is really not a duplicate, because my main question is how to get able to use the system again once it started swapping (maybe I can raise the priority of what handles ctrl-alt-F1, or something like that), and not how to avoid a program from using too much memory I use Linux (ArchLinux distribution) with XFCE window manager. 6-cores CPU, 6 GBs RAM, 2 GBs swap. A few days ago I run an application that started consuming too much RAM, and forced my system to swap. The whole system became completly unstable. Even Ctrl-Alt-F1 took about 2~3 minutes to work, and only then I was able to kill the misbehaving application. Is there a way to prevent that? I don't know how Windows do it, but in years using Windows 7, I never had this problem; the windows task manager always come up very quickly (in GUI mode even, but I'm also happy if Linux lemme do it on TTY at least). Please, no suggestions like disabling swap, not running this program, or something like that. I'm asking for a way to not let one single application running as an unpriviledged user to be able to lock the whole system, no matter what it does.


title: No networking for Centos under VirtualBox

text: Running an Ubuntu desktop server. I installed virtual box, then installed CentOS as a virtual machine. Centos is not starting the eth0 network adaptor. When I start it manually, I cannot connect outside the machine. Anyone know what I've done wrong? I'm new to Virtual Box and somewhat new to CentOS. Virtual Box 4.1.12 and CentOS 6.2 and Ubuntu 11.10 64 bit. Using NAT addressing. Networking for the Main Server:               eth0      Link encap:Ethernet  HWaddr c8:60:00:12:a7:9a                 inet addr:10.0.0.99  Bcast:10.0.0.255  Mask:255.255.255.0               inet6 addr: fe80::ca60:ff:fe12:a79a/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:15492 errors:0 dropped:0 overruns:0 frame:0               TX packets:7192 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:3083151 (3.0 MB)  TX bytes:1104784 (1.1 MB)               Interrupt:41 Base address:0x4000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:6398 errors:0 dropped:0 overruns:0 frame:0               TX packets:6398 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:789448 (789.4 KB)  TX bytes:789448 (789.4 KB)      Networking for the CentOS virtual Server:               eth0      Link encap:Ethernet  HWaddr 08:00:27:75:b2:9ac2               inet addr:10.0.0.98  Bcast:10.0.0.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe75:b2c2/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:27 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 b)  TX bytes:1350 (1.3 KiB)               lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:6398 errors:0 dropped:0 overruns:0 frame:0               TX packets:6398 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:789448 (789.4 KB)  TX bytes:789448 (789.4 KB)


title: How to clone/copy all file/directory attributes onto different file/directory?

text: I want to copy the attributes (ownership, group, ACL, extended attributes, etc.) of one directory to another but not the directory contents itself. This does not work:               cp -v --attributes-only A B     cp: omitting directory `A'                 **Note:** It does not have to be `cp`.


title: tar specific files based on a pattern

text: I got a lot of files with the following format:               2014_04_01_11.txt     2014_04_01_12.txt     2014_04_01_13.txt     2013_03_25_12.txt     2013_04_29_15.txt      I would like to tar all theses files into an archive 20?? _ ?? _ ??**.tar.gz. My actual command is:               find . -name '????_??_??_*.txt' | tar ...      I don't know how to define dynamically the name of the archive.


title: How to list all unique ip address currently connected to a specific port?

text: Say I want to know how many unique clients are connected to port 5222 on a server. Can you find a way better/faster/stronger than this?               netstat -nt | grep ':5222.*ESTABLISHED' | awk '{ print $5 }' \     | grep -Po '[0-9]{1,3}(\.[0-9]{1,3}){3}' | uniq | wc -l      I know this is a too simple regex for a internet address, but seems unecessary to check for well formed addresses, as netstat will probably output only valid ones. Can someone come to a `netstat -nt | awk { awesomeness }`? A `netstat -nt | awk { simplicity }| uniq | wc -l`, maybe?


title: How to use a built in driver in the kernel?

text: I am building the 3.14 kernel for a board that requires the intel e1000e driver. I would like this kernel to have the driver built in so that I can remove loadable module support. I have chosen the option in menu config and verified that the driver is compiled (the .o exists), however the device does not appear to be found or recognized. Is there something I am missing to add a module to the kernel?


title: How to write a function in bash?

text: I am drawing blank here. How should I have written this script?               #!/bin/sh          XZY_NODES="\     vl-ocnt-1 \     vl-ocnt-2 \     vl-onet-1 \     vl-onet-2 \     vl-ocmp-1 \     vl-oomp-2 \     "          is_xyz_node () {             host=$1             for xyznode in $XZY_NODES             do                     if [ $host == $xyznode ]                     then                             return 'Y'                     fi             done             return 'N'     }          if [ 'Y' == $(is_xyz_node $1) ]     then             echo "$1 is a xyz node"     else             echo "$1 is NOT a xyz node"     fi       When I run this script I get this output ...               $ ./test.sh not-xyz     ./test.sh: line 22: return: N: numeric argument required     ./test.sh: line 25: [: Y: unary operator expected     not-xyz is NOT a xyz node          $ ./test.sh vl-ocnt-2     ./test.sh: line 19: return: Y: numeric argument required     ./test.sh: line 25: [: Y: unary operator expected     vl-ocnt-2 is NOT a xyz node


title: 'seek' argument in command dd

text: Can some explain me what is happening in the following lines?               dd if=/dev/urandom bs=4096 seek=7 count=2 of=file_with_holes      especially seek part is not clear Man pages says :                seek=BLOCKS                   skip BLOCKS obs-sized blocks at start of output      What is obs-sized block?


title: Strange processes: "pro" and "proh" and slow Internet

text: I have two processes that start automatically and when that happens the internet speed decrease considerably. I tried to killed those processes but they start again, I tried to delete the executables too that are located at `/boot/pro` and `/boot/proh`, but they are recreated again. I made the following script to kill constantly those processes as a workaround, but this is a temporal solution.               while true ; do killall proh ; done      I am on Debian 7. I don't know who is executing constantly those processes. Does anybody think they can help me?


title: How to search for a string only in textfiles? (recursively)

text: I can list all the textfiles (by mimetype) in a folder with:               find . -type f -print0 | xargs -0 file -i | fgrep -i text | sed 's/:$//g' 2>/dev/null | awk 'BEGIN {FS=": "} {print $1}'      Ok. But how can I add "fgrep" to this, to search in these files for "STRING" (regexp not needed, that's why fgrep). this isn't good:               fgrep -iR "STRING" *      because it starts to search in ISO files, binary files too... Fedora14/bash.


title: Is it Possible to Boot a New OS While Currently Running?

text: Let's assume I'm running CentOS (actually, if this question only applies to certain distros, which ones?). I have another drive (that I can boot from - it's got everything installed) mounted into my file tree. Is it possible to just boot from that drive without restarting or anything? E.g. would there be something like `bootfrom /stuff/miscmounteddrive/` or some other such command?


title: Command like `column -t` that instead keeps separators in output

text: I'm editing a simple table. I would like to have it nicely formatted. While I could use `tbl`, `latex`, or similar, this seems overkill -- plain text really is sufficient. As it's simple I might as well have the source be the output. So the source should look good too. This seems like it should be a perfect job for `column -s '|' -t` -- it finds the separators and automatically inserts spaces to align according to the maximum width in each column. Unfortunately, it deletes the separators, so I can't rerun it after further editing. Is there any good text-processing tool that can do this idempotently, so that it's output serves as input? Or do I need to write my own? EDIT: here's an example of what I want:               foo |   bar | baz     abc def | 12 | 23456      should become               foo     | bar | baz     abc def | 12  | 3456      When `' '` is both the separator and the spacer, `column -t` works nicely. But my items have spaces in them, so I can't use that. Having the spacers be distinct from the separators complicates things. I think it's useful to have them be treated as separator characters when next to separators, but that's not what `column -s '|' -t` does (though obviously the current behavior is also useful).


title: Using setfacl to allow group members to write to any file in a directory

text: I'd like to use setfacl so that anyone in group 'app' can edit any file contained within /usr/local/users/app regardless of what the traditional UNIX permissions say. I have two users john and ben. I tried to follow the instruction from another question, but john is not able to write to some files. It looks like this is because of the acl mask. However, I've set default mask on the directory of rwx, so shouldn't the files within it inherit that when created? E.g. john cannot write to the file below, but he is a member of group 'app' which has write acls on the file so I'm surprised he can't edit the file.               ben@app1:/usr/local/users$ ls -la app/app-1.0-SNAPSHOT/lib/play.templates_2.10-2.1.1.jar      -rw-r--r--+ 1 ben users 38326 Apr  2 10:21 app/app-1.0-SNAPSHOT/lib/play.templates_2.10-2.1.1.jar          ben@app1:/usr/local/users/app$ getfacl app-1.0-SNAPSHOT/lib/     # file: app-1.0-SNAPSHOT/lib/     # owner: ben     # group: users     user::rwx     group::rwx          #effective:r-x     group:app:rwx       #effective:r-x     mask::r-x     other::r-x     default:user::rwx     default:group::rwx     default:group:app:rwx     default:mask::rwx     default:other::r-x          ben@app1:/usr/local/users$ getfacl app/app-1.0-SNAPSHOT/lib/play.templates_2.10-2.1.1.jar      # file: app/app-1.0-SNAPSHOT/lib/play.templates_2.10-2.1.1.jar     # owner: ben     # group: users     user::rw-     group::rwx          #effective:r--     group:app:rwx       #effective:r--     mask::r--     other::r--


title: What shells were used on early unix systems?

text: According to wikipedia, the Bourne shell was introduced in 1977 and C shell in 1978, but unix itself dates back to 1969. If you were using a unix system before 1977, what shell would you have been using?


title: Keeping my production webserver updated

text: I have a production webserver (CentOS 6.5) and I just wanted to know how do I keep this updated interms of security updates and stable. For example, is it safe interms of not breaking anything on the server if I run this command?               su -c '/sbin/chkconfig --level 345 yum on; /sbin/service yum start'      This apparently updates the server automatically every day. As CentOS is supported for 10 years, I will want to make use of this.


title: Can I disable unattended Debian package updates?

text: Does debian have some sort of automated package update process? Im using it on a set of fanless PCs and noted that one had become v slow recently. On inspection the network LED showed lots of activity. Eventually the system became non-responsive and required a cold start. After booting I looked in /var/log/syslog and found pages of entries like so: > Package: <some package name>   >  Auto-Installed: 1   >  Architecture: armel It appears to be enumerating installed packages. More than anything I'm wondering if it's some automated process that I can disable.


title: Fixed terminal status lineS instead of shell prompt?

text: It is common to cram useful information in the Unix shell prompt, but I have too many things I want to keep an eye on to fit it all in one prompt: current Gnu screen window, current directory, current time, hostname, current git branch, phase of the moon, you-name-it. It would be saner to have a _fixed status **region_** at the bottom (or top) of the terminal to show all this information, and leave the prompt alone. (I wrote "fixed status region" rather than "fixed status line" because I don't want to limit myself to one line.) (This region, of course, would not be affected by normal interactive output.) Is there a standard Unix to implement such a fixed status region, and would allow me to update it through the `precmd` function?


title: Difference Between cp -r and cp -R (copy command)

text: cp- r is meant to copy files recursively, and cp -R for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference actually?


title: USB copy hangs for a while when reach the 100%

text: When I copy files of a considerable size (for example right now one of 689MB) to a USB stick, the copy hangs at 100% for 5 min or more. I have tried both Nautilus and `rsync --progress`. With the former it seems that never ends and I have to kill nautilus. With the latter it ends, but as I said, 5 minutes or more after it has reached the 100%. I'm using Wheezy 64 bits and Gnome Shell. If I'm not mistaken, there is a reported bug about the Nautilus issue, but why is it happening with rsync too?


title: How can I switch between ttys without using screen?

text: So lets say you boot up your linux install all the way to the desktop. You start up a gnome-terminal/konsole/whatever so you have a tty to enter commands to. Now lets say I SSH into that same machine. It will bind me to another tty to enter commands to. Now lets say I want to "switch" my tty from my original SSH one to the gnome- terminal one started earlier. Basically I'm asking if there is anyway to do the same thing screen -x does but without screen? I know you can easily send output to the other tty simply by echoing something into the /dev file, but I dont know a way to 'view' whats in the tty... Any ideas?


title: how to make search a text on the terminal directly

text: I have a program that outputs some data to the terminal (via printf() ). Is it possible search a text on the outputed text on the terminal **directly**? It is possible to do search by directing the texts into a file then make search on it then output the result to the terminal, but it is not what I am asking. EDIT: what I meant by "search": I wonder if it is possible to search a text, for example how can I search `libgnome-desktop` on the below terminal output? ![enter image description here](http://i.stack.imgur.com/VcLPn.png)


title: Process movie intelligently

text: Let's say you like the jungle. You have a few Survivor episodes and Predator movies. You'd like to separate the jungle clips from clips involving humans. Maybe to play as a projector show at a party, or so. My first thought: many shows and movies are hysterically chopped up in shots. As such a shot shift is often dramatic in terms of on-screen data change, they could be detected, and then each shot saved as a separate file. This will take some time, but when it's done you could manually sort out the jungle. But, some jungle would be lost because some shots slide from jungle to human, or from human to jungle. Then I thought, some digital cameras are able to spot humans and instantaneously give them focus. If I had that, I could simply drop all frames with humans. Do you know of such software?


title: System too slow

text: My linux system is responding very slowly.I should wait to get the result of my command. How can i investigate to know the problem of his behavior?


title: Socket Connection Refused (raspbian) but ports are open for connections

text: I'd like to establish a connection between my client and raspbian. Within my network, I can connect to my service at any time without any problems. Now I want to connect to my service via the internet. This is unfortunately not working when I try to use my internet ip for the connection.               client = new MqttClient("tcp://77.777.77.77:1883", "SendingdLoop");                 client.connect();      My Java-Application tells me that the connection has been refused (so there is no timeout):                  Could not establish connection (32103) - java.net.ConnectException: Connection **refused**: connect          at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:75)             at org.eclipse.paho.client.mqttv3.internal.ClientComms$ConnectBG.run(ClientComms.java:538)             at java.lang.Thread.run(Thread.java:722)         Caused by: java.net.ConnectException: Connection refused: connect             at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)             at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)             at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)             at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)             at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)             at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)             at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)             at java.net.Socket.connect(Socket.java:579)             at org.eclipse.paho.client.mqttv3.internal.TCPNetworkModule.start(TCPNetworkModule.java:66)      I followed the official instructions to open the port: https://wiki.debian.org/iptables my entry looks like this:                -A INPUT -p tcp -m tcp --dport 1883 -j ACCEPT      When I check iptables,               iptables -L      ACCEPT tcp -- anywhere anywhere  tcp dpt: 1883      I can see the rule is active. Is there anything else I have to configure?


title: How can I configure a set of computers to netboot?

text: I have a number of machines which I'll be deploying in the near future. As suggested here, I could use network booting to get these computers online without even having a hard disk in them. According to user Caleb: > You can setup server with a netbook kernel available via TFTP and a file > system available via nfs. All your clients need to do is use a netboot > capable NIC to contact this server, download their kernel and go. No hard > drive involved! And easy maintenance. All the machines can potentially boot > the same image. This seems interesting, but here are the challenges:   1. These machines will each have a few differences in configuration. Hardware-wise and software-wise, they will be exactly the same, but they'll need to have two things that differ in configuration:      1. Each will have to have its own URL that it starts a browser with.     2. Each will have its own username and password for HTTP-Basic authentication to provide some measure of security.    2. These machines will each be in different locations, as well as they'll have one master server running in the cloud somewhere that they all connect to to netboot and for the filesystem. NFS isn't exactly the most secure thing in the world either, and security would be nice to say the least. Is there a way I could secure the filesystem and kernel?    3. How big a download is required for a netboot initially? These machines will barely be running anything at all, basically a kernel, X, a lightweight window manager, and a browser. I could run just about everything in RAM and that would be excellent. How much of a download is required for startup? I'm totally new to netboot, so how would I set that up?


title: Understand synopsis in manpage

text: I have not being able to understand the synopsis in manpage of a command. For example, let's see the manpage of `man` itself. By `man man`:               SYNOPSIS            man  [-C  file]  [-d]  [-D]  [--warnings[=warnings]]  [-R encoding] [-L            locale] [-m system[,...]] [-M path] [-S list]  [-e  extension]  [-i|-I]            [--regex|--wildcard]   [--names-only]  [-a]  [-u]  [--no-subpages]  [-P            pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justifi‐            cation]  [-p  string]  [-t]  [-T[device]]  [-H[browser]] [-X[dpi]] [-Z]            [[section] page ...] ...            man -k [apropos options] regexp ...            man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...            man -f [whatis options] page ...            man -l [-C file] [-d] [-D] [--warnings[=warnings]]  [-R  encoding]  [-L            locale]  [-P  pager]  [-r  prompt]  [-7] [-E encoding] [-p string] [-t]            [-T[device]] [-H[browser]] [-X[dpi]] [-Z] file ...            man -w|-W [-C file] [-d] [-D] page ...            man -c [-C file] [-d] [-D] page ...            man [-hV]        1. Is synopsis mean the prototype of usage of the command?   2. what do those `[...]`and `[...]` inside `[...]` mean? Do they mean something optional?   3. Does `|` mean OR?   4. What does `,` mean in `[-m system[,...]]`?   5. Are the rules for writing and reading synopsis similar to Regex? But I feel they are not quite the same.


title: How can I configure a reverse SSH connection to the connecting computer?

text: I'm going to be deploying a number of machines in the near future which will be behind routers. It won't be feasible to set up dynamic DNS on each router and port forwarding, so is there a way I can configure these machines to initiate a TCP connection to my computer and then have my computer initiate a SSH connection to the remote computer over that connection? IE:               COMPUTER A OPENS TCP CONNECTION TO COMPUTER B     COMPUTER B OPENS SSH CONNECTION OVER THE EXISTING TCP CONNECTION TO COMPUTER A     COMPUTER B NOW HAS SSH CONNECTION TO COMPUTER A      Is this possible, and if so, how can I do it?


title: Locking windows on desktop in Openbox

text: How can I protect a window from being hidden by the `ToggleShowDesktop` global action? I've found that Openbox 3.5 can do that trick only for windows with the desktop or dock type. For example, windows created by `trayer`, `conky` or IDesktop will not be hiden by the `ToggleShowDesktop` global action. But these programs create windows of desired type on startup. While I want to make this trick possible for any already created window. For example Chromium browser. Possible workarounds:   1. Protect desired window from hiding (Iconify/minimize).   2. Change type of desired window to `desktop` or `dock` by some script binded to hotkey. But the Openbox actions reference doesn't have such a command. And secondly, I'm not familiar with the Linux window system to write a script that will change the type of a window on the fly.