title: /usr/bin/ld: cannot find -ldb while compiling iproute2

text: I am trying to compile iproute2-3-12-0 on Fedora 19, I have BerkeleyDB installed, the command `ls -la /usr/lib/libdb*` gives following results:               -rwxr-xr-x 1 root root 1847852 May 16  2013 /usr/lib/libdb-5.3.so     lrwxrwxrwx 1 root root      12 Sep 18 20:15 /usr/lib/libdb-5.so -> libdb-5.3.so     lrwxrwxrwx 1 root root      18 Jan  4 12:57 /usr/lib/libdbus-1.so.3 -> libdbus-1.so.3.7.4     -rwxr-xr-x 1 root root  317720 Nov 11 19:24 /usr/lib/libdbus-1.so.3.7.4      I have newest version of Bison and Flex. I use kernel: 3.12.8-200.fc19.x86_64. I have ldb in `/usr/lib and /usr/lib64`. I did not find any `LDFLAGS` in `Makefile` though. I get an error:               ssfilter.y: conflicts: 27 shift/reduce     /usr/bin/ld: cannot find -ldb     collect2: error: ld returned 1 exit status     make[1]: *** [arpd] Error 1     make: *** [all] Error 2      A closer look at the end of make log reveals:                       make[1]: Entering directory `/root/Traffic_Shaping/iproute2-3.12.0/bridge'     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o bridge.o bridge.c     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o fdb.o fdb.c     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o monitor.o monitor.c     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o link.o link.c     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o mdb.o mdb.c     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o vlan.o vlan.c     gcc   bridge.o fdb.o monitor.o link.o mdb.o vlan.o ../lib/libnetlink.a ../lib/libutil.a  ../lib/libnetlink.a ../lib/libutil.a -o bridge     make[1]: Leaving directory `/root/Traffic_Shaping/iproute2-3.12.0/bridge'     make[1]: Entering directory `/root/Traffic_Shaping/iproute2-3.12.0/misc'     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o ss.o ss.c     bison ssfilter.y -o ssfilter.c     ssfilter.y: conflicts: 27 shift/reduce     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE   -c -o ssfilter.o ssfilter.c     gcc   ss.o ssfilter.o  ../lib/libnetlink.a ../lib/libutil.a -o ss     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE  -o nstat nstat.c -lm     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE  -o ifstat ifstat.c ../lib/libnetlink.a ../lib/libutil.a -lm     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE  -o rtacct rtacct.c ../lib/libnetlink.a ../lib/libutil.a -lm     gcc -Wall -Wstrict-prototypes  -Wmissing-prototypes -Wmissing-declarations -Wold-style-definition -O2 -I../include -DRESOLVE_HOSTNAMES -DLIBDIR=\"/usr/lib64\" -DCONFDIR=\"/etc/iproute2\" -D_GNU_SOURCE -I/usr/include/libdb4  -o arpd arpd.c ../lib/libnetlink.a ../lib/libutil.a -ldb -lpthread     /usr/bin/ld: cannot find -ldb     collect2: error: ld returned 1 exit status     make[1]: *** [arpd] Error 1     make[1]: Leaving directory `/root/Traffic_Shaping/iproute2-3.12.0/misc'     make: *** [all] Error 2      How can I get `ld` to find `libdb`?


title: using grep --perl-regexp

text: this is a sample output of `ls`               $ ls -lAF     -rw-------  1 martin martin  168 Jan 25 23:26 aaa     -rw-------  1 martin martin  168 Jan 25 23:26 bbb     -rw-------  1 martin martin  168 Jan 25 23:26 ccc      I would like to colorize the `user` and `group` entries. However, my syntax only colorizes `user`,but not the `group`:               ls -lAF | grep --color -P '^\S+\s+\S+\s+\K\S+'      I don't understand what the `\K` exactly means. How could I match both `martin martin` in my sample output?


title: Mysterious automated emails

text: I remember messing around with crontab and setting up email capabilities on a server many months back, and now all of a sudden I'm getting the following email: EMAIL HEADER:               from:    root <myemail@gmail.com>     to:  root     date:    Thu, Dec 5, 2013 at 6:48 AM     subject:     Cron <root@server-ip> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )     mailed-by:   gmail.com      BODY:               /etc/cron.daily/mlocate:     /usr/bin/updatedb.mlocate: `/var/lib/mlocate/mlocate.db' is locked (probably by an earlier updatedb)     run-parts: /etc/cron.daily/mlocate exited with return code 1


title: Local variables in zsh: what is the equivalent of bash's "export -n" in zsh

text: I'm trying to contain the scope of a variable to a shell, and not have children see it, in zsh. For example, I type this in .zshrc:               GREP_OPTIONS=--color=always      But if I run a shell script with the following:               #!/bin/bash     echo $GREP_OPTIONS      The output is:               --color=always      while I want it to be null (the shell script above should not see the GREP_OPTIONS variable at all). In bash, one can say: `export -n GREP_OPTIONS=--color=always`, which will prevent this from happening. How do I accomplish this in zsh?


title: Understanding /var/log/messages entries

text: 192.168.25.1 = router 192.168.10.1 = gateway/modem 192.168.25.144 = this pc (which is 'linuxpc' running fedora 17) What happened during these log entry events below? Specifically what do the last two log entries mean.               Oct 10 13:24:22 linuxpc dhclient[5779]: DHCPREQUEST on p14p1 to 192.168.25.1 port 67 (xid=0x466a6633)     Oct 10 13:24:22 linuxpc dhclient[5779]: DHCPACK from 192.168.25.1 (xid=0x466a6633)     Oct 10 13:24:22 linuxpc dhclient[5779]: bound to 192.168.25.144 -- renewal in 32701 seconds.     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info> (p14p1): DHCPv4 state changed renew -> renew     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info>   address 192.168.25.144     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info>   prefix 24 (255.255.255.0)     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info>   gateway 192.168.25.1     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info>   hostname 'linuxpc'     Oct 10 13:24:22 linuxpc NetworkManager[846]: <info>   nameserver '192.168.10.1'     Oct 10 13:24:22 linuxpc dbus[910]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)     Oct 10 13:24:22 linuxpc dbus-daemon[910]: dbus[910]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using     servicehelper)     Oct 10 13:24:22 linuxpc dbus-daemon[910]: dbus[910]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'     Oct 10 13:24:22 linuxpc dbus[910]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'     Oct 10 13:30:29 linuxpc dbus-daemon[910]: dbus[910]: [system] Rejected send message, 2 matched rules; type="method_return", sender=":1.2" (uid=0 pid=865 comm="/usr/lib/systemd/systemd-logind ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.36" (uid=1000 pid=1182 comm="gnome-session ")     Oct 10 13:30:29 linuxpc dbus[910]: [system] Rejected send message, 2 matched rules; type="method_return", sender=":1.2" (uid=0 pid=865 comm="/usr/lib/systemd/systemd-logind ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.36" (uid=1000 pid=1182 comm="gnome-session ")


title: Arch Linux slow shutdown

text: I'm suffering from a very slow shutdown/reboot with Arch Linux, so I followed the instructions given here to enable logging. So here is the log generated during (slow) reboot that unfortunatelly I can't analyze by myself. Can someone help me please to understand where the problem is? PS: According to that article I've also tried rebooting with `sync && reboot -f` and it goes super fast.


title: Error launching Safari with PlayOnLinux

text: I've installed PlayOnLinux with the following commands:               wget -q -O- http://deb.playonlinux.com/public.gpg | sudo apt-key add -     sudo wget http://deb.playonlinux.com/playonlinux_precise.list -O /etc/apt/sources.list.d/playonlinux.list     sudo apt-get update          # useful dependencies     sudo apt-get install -y curl p7zip-full          # install playonlinux          sudo apt-get install -y playonlinux      and then I've installed Safari from inside PlayOnLinux. It is correctly installed, but when I try to launch it I get the next errors:               [01/23/14 12:15:35] - Running wine-1.4.1 Safari.exe (Working directory : /home/manolo/.PlayOnLinux/wineprefix/Safari/drive_c/Program Files (x86)/Safari)     p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: no se puede abrir el archivo del objeto compartido: No exApplication tried to create a window, but no driver could be loaded.     Unknown error (127).     [01/23/14 12:15:47] - Running wine-1.4.1 Safari.exe (Working directory : /home/manolo/.PlayOnLinux/wineprefix/Safari/drive_c/Program Files (x86)/Safari)     err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": libSM.so.6: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio     err:module:load_builtin_dll failed to load .so lib for builtin L"winex11.drv": libSM.so.6: no se puede abrir el archivo del objeto compartido: No existe el archivo o el directorio     fixme:heap:HeapSetInformation (nil) 1 (nil) 0     err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: clase ELF errónea: ELFCLASS64     fixme:process:SetProcessDEPPolicy (1): stub     fixme:shell:SetCurrentProcessExplicitAppUserModelID L"Apple.Safari": stub     fixme:advapi:GetCurrentHwProfileA (0x32f9ec) semi-stub     fixme:dwmapi:DwmIsCompositionEnabled 0x32fb48     fixme:win:DisableProcessWindowsGhosting : stub     fixme:service:EnumServicesStatusW resume handle not supported     fixme:service:EnumServicesStatusW resume handle not supported     p11-kit: couldn't load module: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: no se puede abrir el archivo del objeto compartido: No exApplication tried to create a window, but no driver could be loaded.     Unknown error (127).     fixme:ntdll:NtLockFile I/O completion on lock not implemented yet     fixme:msg:pack_message msg 14 (WM_ERASEBKGND) not supported yet     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)     err:ole:RegisterDragDrop invalid hwnd (nil)      Any idea of what I am missing?


title: What is i915.modeset=1 for?

text: I'm running Ubuntu 13.10 and since I upgraded to kernel 3.12.8 (build from source, including ubuntu patches) on a ivybridge video, the boot spash screen was flickering and messing up. So I googled around and tried adding `i915.modeset=1` paramenter to grub (without really knowing what I was doing) and magically the spash screen was fixed and I also noticed a much smoother scrolling of window contents (e.g a web page in chrome). So I just would like to know more about `i915.modeset=1`.


title: How to configure FreeBSD to run headless without hitting high interrupt rates?

text: When running headless (without monitor, keyboard, mouse attached) FreeBSD versions 8.2, 8.3, 9.0 and NetBSD version 5.0 has known issues (FreeBSD PR 156596, NetBSD 46596) to generate extremely high interrupt rates. The issue is also known as an interrupt storm and happens when PCI interrupts are shared. Often EHCI is on the same interrupt (#16, irq16) as VGAPCI. Other users reported to have success by attaching a PS/2 keyboard. The Intel NUC DC3217BY BIOS has no option to disable the onboard video/GPU. We don't need VGA output (headless operation). We do need USB: the boot drive (SDHC card) is attached via a USB bridge. How can FreeBSD configured to not hit the high interrupts rates, or limit the interrupt rate on ehci0? For example how to **disable VGA irq assignment** in FreeBSD?


title: How can I save the positions of the icons in GNOME 2?

text: Using Centos 6.5 with GNOME 2. Puting the notebook on an external monitor always randomly puts the icons to different places. It would be a great thing if I can just set the position of them back with a script/click. **My question:** How can I save the positions of the icons on the desktop?


title: how to add command line calculator to bash that uses comma as decimal mark?

text: How can I add a command line calculator to my bash? I have found some, but all of them use the full stop as decimal mark, but I want to have it to use the **comma as decimal mark** as most of the world does, see picture: ![map of the world showing the use of decimal marks](http://i.stack.imgur.com/D4BqZ.png) (source wikipedia)   * blue: Full stop/Period (.)   * green: Comma (,)   * red: Momayyez (٫)   * gray: Data unavailable * * * The ones that I have found (all with full stop as decimal mark) are the following, where these lines have to be put into your `~/.bashrc` file:   1. Using bc, which has the advantage, that you can calculate ridiculously large numbers:              calc () {       bc -l <<< "$@"     }        2. With awk, where you have mnemonic names for trigonometric and other functions and you can use fractional exponents and you can give the exponent by the two chars `**` instead of the, on some keyboards difficult to type `^`:              calc () {       awk "BEGIN { print $* ; }"     }


title: renaming images to include creation date in name

text: When I look at the properties of an image, I can see the date the photo was taken in "Date Taken". When I edit the images (proprietary program) this data gets lost. How can I rename the image files before editing to include this date (preferably in ISO format for sorting by name).


title: Why 'echo $0' gives different result for two different terminals?

text: I opened a terminal on Ubuntu using `Ctrl`+`Alt`+`T` and a different terminal by going to a directory and then right clicking and choosing "Open in Terminal". I did an `echo $0` in both cases. In the first case:               $ echo $0     -bash      In the second case:               $ echo $0     /bin/bash      Why this difference?


title: Debian system: install specific packages from source automatically to boost the performance

text: On Debian /Ubuntu systems, how to set a list of packages which can be installed from sources automatically by apt-get or aptitude? The server is mainly for scientific computing and I would like to compile some specific packages with highly optimized flags such as `-O3 -march=native` to boost the performance. I know how to do this for one single package, however, I don't want to redo these when there comes an upgrade.


To install software on a Linux system, many tools like `yum`, `apt-get`, `rpm`, `dpkg` and so on are available to either fetch a package from a repository or install a downloaded package. Alternatively, it is possible to download a (typically) `.tar.gz2` archive of the source and compile manually using               ./configure     make     make install      or similar. My question is: When should one compile and install from source?


title: how to find the server key

text: When I run `openssl s_client -connect 0.0.0.0:8006` I get the Server certificate as: > \-----BEGIN CERTIFICATE-----   >  MIICSTCCAbKgAwIBAgIESfnb7zANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJJ ….   1. From which destination does the machine take the "CERTIFICATE" with running the command `openssl s_client -connect 0.0.0.0:8006`? How can I learn from that about the server key or how to create the server key?   2. There is a command that creates new CRT and KEY that after it the MD5 shows they FIT: `openssl req -new -x509 -nodes -out server.crt -keyout server.key` The question:there is a command who can convert server.crt file to server.key file ? because I know the "CERTIFICATE" and need to find his KEY (server.key). My default server key PATH: `/Apache/Apache/conf/ssl.key/server.key`


title: Where can I find Aptana error logs?

text: Where are Aptana error logs stored in fedora?I want them to see why Aptana crashes. Edit: According to Mat's answer I checked the .log file in .metadata directory but this is what Is added to file after crash, which doesn't contain any helpful information to find what's causing the crash.                    !SESSION 2011-10-07 15:03:51.721 -----------------------------------------------     eclipse.buildId=unknown     java.version=1.6.0_22     java.vendor=Sun Microsystems Inc.     BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US     Command-line arguments:  -os linux -ws gtk -arch x86          !ENTRY org.eclipse.core.resources 2 10035 2011-10-07 15:03:52.870     !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.


title: Reuse last line of output from shell command

text: I am compiling something and depending on success (last line of output contains "success"= I want to scp the binary to the target. I'd prefer a piped oneliner. Is there a way to do this?


title: Is it possible to kill another user's program? How?

text: `root` can kill any program run by any user. Is it possible for a user to kill another user's program without using `sudo`, etc.? Example: How can make user `foo` kill program `x` which is run by user `bar`?


title: Output of command when piped to another command

text: I am running a command which does a quick checksum of some file like so               find / -type f -ctime +30 -mtime +30 -atime +30 -exec md5sum {} \; | xargs -P 4      and I am trying to run it in parallel with               xargs -P 4      Now, when I run the find command, by itself, I see output as each file is being checksummed. But when I pipe it to xargs, I no longer see the output of the find command. Is there a way I could see the output of find when it is piped to another command?


title: How store in a variable a file list that includes the backslash when needed?

text: **Main question:** I am writing a script to perform a backup. I make a list of files in the following way:               LISTOFFILES=$(find ~ \( -name '*.[pP][dD][fF]' -o -name '*.[oO][dD][tT]' \))      The variable `LISTOFFILES` stores more or less something like:               /home/user/file1.pdf /home/user/file2.odt /home/user/Python Tutorial.pdf      My next step is:               tar cvf backup.tar $LISTOFFILES      Bash response is:               /home/user/file1.pdf     /home/user/file2.odt     /home/user/Python: Cannot stat: No such file or directory     tar: Tutorial.pdf      I understand that Bash assumes that `Python` and `Tutorial.pdf` are different files. Is there a way to do a list of files with backslash included with `find` or should I change to use `ls` with pipes? I'd like read your tips and advices. **My other question:** _The answer to this question is not really important, but one tip could help_ How to list files only with the file name without the file path? For example: `file` instead of `/home/user/file`. I've trying with `find` command with `prune` and `path` options, but I have not succeeded.


title: Avoid a trailing slash in bash when completing a directory name (like zsh)

text: I'm on a Mac and the cp and mv commands are killing me due to them copying the contents of a directory if a trailing slash is present. It has bitten me more than once when I use tab completion to specify the directory I want to copy. I have noticed zsh has a neat feature that removes the trailing slash if it's not needed after a space or enter key is pressed. Is there any way to have bash mimic this behavior?


title: Creating eth0 with consistent network device naming

text: From my understanding, Arch Linux uses Consistent Network Device Naming where the network devices are no longer named eth0, eth1, etc. I use the proprietary MATLAB software which requires a device eth0 for activation. As a work around they suggest turning off consistent network device naming here. I don't think this will work in Arch, but maybe I am wrong, and I am not sure that is a good idea even if it does work. Is it possible to create a dummy eth0 device to fool the MATLAB activation software. Note that this is not intended to, and I don't believe that it does, violate any licensing agreements with MATLAB/The MathWorks.


title: Counting lines without text in a file

text: I am using Ubuntu 13.10 for a while now, programming in C++ and Python. I have some question that I can solve by making a program, but maybe there are easier ways, so here is the first question. I can use `grep` to find lines with a word/pattern and then use `wc` to count them:               grep word somefile | wc -l      How do I count the lines that have no "text"? Those that are empty or have only spaces or tabs.


title: Parse/Manipulate in awk

text: I am new to `awk` programming. I have a question on manipulating text file, which is required to draw certain network based images in a visualization software (Circos http://circos.ca) I have input data for which I want to manipulate values using `awk/grep/sed`. There are 9 pairs (18 lines). 5 pairs (first 10 lines) are for "from=ABCB11", and 4 pairs (next 8 lines) are for "from =ABCC8". What I want is extract the value from the first line of the first pair and replace it in each alternate line of the rest of the other pairs. So value for group-2 is 9 10, which should replace all the occurrence of value in group2. The next value for group-2 is 28 29, which should be replaced by 9 10. The stop should be determined by "from=name" which is "from=ABCB11". It is not necessary that the rows that have to captured expression from and replace in its next occurrence will belong to group-2 as in this instance. It could be group-3 or group-4 until group-10. So second set ("from =ABCC8") could have been belonged to group-4/5/6 not necessary group-2. It is just a coincidence here, but all group-num's will be same for each "from=" alternate line.               group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-3 0 1 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-2 28 29 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM1,toid=114,use=1,z=1     group-5 0 1 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM1,toid=114,use=1,z=1     group-2 29 30 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM2,toid=115,use=1,z=1     group-5 1 2 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM2,toid=115,use=1,z=1     group-2 10 11 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=DRD2,toid=158,use=1,z=1     group-3 1 2 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=DRD2,toid=158,use=1,z=1     group-2 11 12 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=EGF,toid=164,use=1,z=1     group-3 2 3 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=EGF,toid=164,use=1,z=1     group-2 21 22 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-3 12 13 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-2 0 1 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1A,toid=21,use=1,z=1     group-1 0 1 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1A,toid=21,use=1,z=1     group-2 1 2 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1B,toid=22,use=1,z=1     group-1 1 2 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1B,toid=22,use=1,z=1     group-2 2 3 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1D,toid=23,use=1,z=1     group-1 2 3 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1D,toid=23,use=1,z=1      Below is the FINAL output,I am looking for:               group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-3 0 1 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM1,toid=114,use=1,z=1     group-5 0 1 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM1,toid=114,use=1,z=1     group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM2,toid=115,use=1,z=1     group-5 1 2 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=CHRM2,toid=115,use=1,z=1     group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=DRD2,toid=158,use=1,z=1     group-3 1 2 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=DRD2,toid=158,use=1,z=1     group-2 9 10 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=EGF,toid=164,use=1,z=1     group-3 2 3 text color=black,from=ABCB11,fromid=4,order=2,thickness=3,to=EGF,toid=164,use=1,z=1     group-2 21 22 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-3 12 13 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ACE,toid=11,use=1,z=1     group-2 21 22 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1A,toid=21,use=1,z=1     group-1 0 1 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1A,toid=21,use=1,z=1     group-2 21 22 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1B,toid=22,use=1,z=1     group-1 1 2 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1B,toid=22,use=1,z=1     group-2 21 22 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1D,toid=23,use=1,z=1     group-1 2 3 text color=black,from=ABCC8,fromid=5,order=2,thickness=3,to=ADRA1D,toid=23,use=1,z=1      Also,this is just a sample data. So many pairs would have group-1,group-4,group-5 up to group 10. Here, only pairs from lesser groups are mentioned. Basically, these are the modifications that should be seen while printing complete lines, until "from=ABCB11" ends, in each alternate line. Similarly for "from=ABCC8".               group-2 9 10     group-3 0 1     group-2 9 10     group-5 0 1     group-2 9 10     .........     .........     .........      Here is what I tried: I want to loop through the lines until the value in "from=name" remains same,so that I can change all occurrences in each alternate line.Code:               awk -F, 'NR%2==1 {split($2,a,"="); print a[2]}' file.txt      The above code is able to extract the alternate lines and the "name" in "from=name".


title: Disable "Recently used" in GTK file/directory selector

text: Can I completely disable "Recently Used" feature in GTK's file / directory selector? ![Recently Used](http://i.imgur.com/AuRhZon.png) Sometimes programs default to this but since it's not useful in my work-flow and with the way I organize my files, it only adds confusion:   * I usually just expect to start from my `$HOME`, so I get surprised by the list of folders   * Also in case of file saving, I'm annoyed by the fact that you can't just type in the name and hit Enter--you have to type a path or select one I'm using Xfce 4.8 on Debian Wheezy and this feature was not available in older Xfce (in Squeeze). I found a post on Xfce-users' mailing list regarding this feature, but without any useful output. Is it possible to simply turn this off and default to `$HOME`?


title: How do you compile your own kernel on a RHEL6 system?

text: In RHEL6, the kernel is 2.6.32. What is the procedure to compile your own kernel?


title: PGP keyserver and proxy firewall issues

text: I am not sure this is a Linux question directly ... I use Arch Linux which uses package signing. This requires me to download a set of pgp keys with the `pacman-key` program. This works off the presumably more general `gpg` program. If I can get `gpg` to work, I am guessing I can get `pacman-key` working. The error I am getting suggests that the firewall I am behind is blocking the port (or something isn't set correctly in my proxy). I am behind a pretty restrictive university firewall and proxy, but the ports for things like ssh, ftp, and http are open and working, but it appears port 11371 is closed. To debug my problem I tried going to http://pgp.mit.edu/, which works fine. When I try and download a key I get redirected to http://pgp.mit.edu:11371/ and then               HTTP Error Status: 403 Forbidden     Error Reason: Forbidden port      I think I am looking for a pgp keyserver that uses a port that might already be open in the firewall. Is there a different keyserver that I can use that works on a more "universal" port?


title: Mint 15 on Lenovo G700: wired internet not working (Atheros QCA8172)

text: Mint 15 doesn't see internet after installing it in dualboot with windows 8 (in Windows internet works well). My network card is Qualcomm Atheros QCA8172 Fast Ethernet (rev 10). What I did:   1. Install drivers from http://www.linuxfoundation.org/collaborate/workgroups/networking/alx   2. Update kernel to 3.11.6 But it didn't fix the problem. * * * Here some additional information. ### ifconfig               $ ifconfig     eth0      Link encap:Ethernet  HWaddr 00:11:d8:0c:73:68                 inet6 addr: fe80::211:d8ff:fe0c:7368/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:18           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:65536  Metric:1               RX packets:25 errors:0 dropped:0 overruns:0 frame:0               TX packets:25 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:2951 (2.9 KB)  TX bytes:2951 (2.9 KB)      ### interfaces               $ cat /etc/network/interfaces     # interfaces(5) file used by ifup(8) and ifdown(8)     auto lo     iface lo inet loopback      ### ip               $ ip link     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000         link/ether 00:11:d8:0c:73:68 brd ff:ff:ff:ff:ff:ff      ### iptables               $ sudo iptables -L -nv          Chain INPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination               ### iwconfig               $ iwconfig          eth0      no wireless extensions.     lo        no wireless extensions.      ### lsmod               $ lsmod          Module                  Size  Used by     iptable_filter         12810  0      ip_tables              27716  1 iptable_filter     x_tables               34194  2 ip_tables,iptable_filter     bnep                   23966  2      parport_pc             32866  0      rfcomm                 74589  0      bluetooth             391564  10 bnep,rfcomm     ppdev                  17711  0      binfmt_misc            17508  1      nls_iso8859_1          12713  1      ext2                   73792  1      joydev                 17613  0      snd_hda_codec_hdmi     41736  1      snd_hda_codec_idt      55053  1      snd_hda_intel          53038  3      snd_hda_codec         194727  3 snd_hda_codec_hdmi,snd_hda_codec_idt,snd_hda_intel     snd_hwdep              13613  1 snd_hda_codec     snd_pcm               107140  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         18798  2 snd_pcm,snd_hda_intel     snd_seq_midi           13324  0      snd_seq_midi_event     14899  1 snd_seq_midi     snd_rawmidi            30416  1 snd_seq_midi     snd_seq                66061  2 snd_seq_midi_event,snd_seq_midi     lpc_ich                21163  0      snd_seq_device         14497  3 snd_seq,snd_rawmidi,snd_seq_midi     snd_timer              29989  2 snd_pcm,snd_seq     uvcvideo               82247  0      snd                    69657  17 snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_hda_codec_idt,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_seq_midi     psmouse               104064  0      soundcore              12680  1 snd     ideapad_laptop         18596  0      videobuf2_vmalloc      13216  1 uvcvideo     sparse_keymap          13890  1 ideapad_laptop     videobuf2_memops       13362  1 videobuf2_vmalloc     videobuf2_core         40785  1 uvcvideo     mac_hid                13253  0      serio_raw              13413  0      dm_multipath           27371  0      lp                     17799  0      mei_me                 18418  0      scsi_dh                14873  1 dm_multipath     mei                    78448  1 mei_me     videodev              138443  2 uvcvideo,videobuf2_core     bcma                   47065  0      parport                42466  3 lp,ppdev,parport_pc     btrfs                 847481  0      xor                    21411  1 btrfs     zlib_deflate           27110  1 btrfs     raid6_pq               97812  1 btrfs     libcrc32c              12615  1 btrfs     hid_generic            12548  0      dm_mirror              22277  0      usbhid                 53329  0      dm_region_hash         20932  1 dm_mirror     dm_log                 18527  2 dm_region_hash,dm_mirror     hid                   106004  2 hid_generic,usbhid     usb_storage            66567  0      nouveau               979463  0      i915                  682899  3      mxm_wmi                13021  1 nouveau     video                  19574  2 i915,nouveau     i2c_algo_bit           13564  2 i915,nouveau     ttm                    84705  1 nouveau     drm_kms_helper         53178  2 i915,nouveau     alx                    32792  0      mdio                   13807  1 alx     wmi                    19256  2 mxm_wmi,nouveau     drm                   302332  6 ttm,i915,drm_kms_helper,nouveau     ahci                   30063  6      libahci                32088  1 ahci      ### lspci               $ lspci -v          00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0         Capabilities: <access denied>          00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=01, subordinate=06, sec-latency=0         I/O behind bridge: 00003000-00003fff         Memory behind bridge: d0000000-d0ffffff         Prefetchable memory behind bridge: 00000000a0000000-00000000bfffffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 43         Memory at d1000000 (64-bit, non-prefetchable) [size=4M]         Memory at c0000000 (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          00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04) (prog-if 30 [XHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 41         Memory at d1600000 (64-bit, non-prefetchable) [size=64K]         Capabilities: <access denied>         Kernel driver in use: xhci_hcd          00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 44         Memory at d1614000 (64-bit, non-prefetchable) [size=16]         Capabilities: <access denied>         Kernel driver in use: mei_me          00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 16         Memory at d1619000 (32-bit, non-prefetchable) [size=1K]         Capabilities: <access denied>         Kernel driver in use: ehci-pci          00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, fast devsel, latency 0, IRQ 45         Memory at d1610000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel          00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=07, subordinate=07, sec-latency=0         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=08, subordinate=08, sec-latency=0         Memory behind bridge: d1500000-d15fffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1c.2 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 3 (rev c4) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=09, subordinate=09, sec-latency=0         I/O behind bridge: 00002000-00002fff         Memory behind bridge: d1400000-d14fffff         Capabilities: <access denied>         Kernel driver in use: pcieport          00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0, IRQ 23         Memory at d1618000 (32-bit, non-prefetchable) [size=1K]         Capabilities: <access denied>         Kernel driver in use: ehci-pci          00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: bus master, medium devsel, latency 0         Capabilities: <access denied>         Kernel driver in use: lpc_ich          00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04) (prog-if 01 [AHCI 1.0])         Subsystem: Lenovo Device 3977         Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 42         I/O ports at 4088 [size=8]         I/O ports at 4094 [size=4]         I/O ports at 4080 [size=8]         I/O ports at 4090 [size=4]         I/O ports at 4060 [size=32]         Memory at d1617000 (32-bit, non-prefetchable) [size=2K]         Capabilities: <access denied>         Kernel driver in use: ahci          00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)         Subsystem: Lenovo Device 3977         Flags: medium devsel, IRQ 10         Memory at d1615000 (64-bit, non-prefetchable) [size=256]         I/O ports at 4040 [size=32]          01:00.0 3D controller: NVIDIA Corporation GF117M [GeForce 610M/710M / GT 620M/625M/630M/720M] (rev a1)         Subsystem: Lenovo Device 3910         Flags: fast devsel, IRQ 16         Memory at d0000000 (32-bit, non-prefetchable) [size=16M]         Memory at a0000000 (64-bit, prefetchable) [size=256M]         Memory at b0000000 (64-bit, prefetchable) [size=32M]         I/O ports at 3000 [size=128]         Expansion ROM at b2000000 [disabled] [size=512K]         Capabilities: <access denied>          08:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)         Subsystem: Lenovo Device 0611         Flags: bus master, fast devsel, latency 0, IRQ 17         Memory at d1500000 (64-bit, non-prefetchable) [size=32K]         Capabilities: <access denied>         Kernel driver in use: bcma-pci-bridge          09:00.0 Ethernet controller: Qualcomm Atheros QCA8172 Fast Ethernet (rev 10)         Subsystem: Lenovo Device 3803         Flags: bus master, fast devsel, latency 0, IRQ 46         Memory at d1400000 (64-bit, non-prefetchable) [size=256K]         I/O ports at 2000 [size=128]         Capabilities: <access denied>         Kernel driver in use: alx      ### rfkill               $ rfkill list all          0: ideapad_3g: Wireless WAN         Soft blocked: no         Hard blocked: no      ### dmesg https://docs.google.com/file/d/0Bz7Myw57yQvoVlZCLTNrUjdhNmc/edit?usp=sharing&pli=1


title: If /usr partition not specified, does it go on same partition as root by default?

text: I plan to install Fedora Linux on a machine with an SSD and an HDD. `/boot`, and the root will have their own partitions on the SSD. If I want `/usr` to be on same partition as `/`, will that occur by default if I set the root mountpoint on an SSD partition and don't specify anything with `/usr`?


title: Dual booting Debian and Windows 8?

text: My problem is a little weird (maybe to me only). Specification: Lenovo, Ideapad Z510. i7 intel core. 1920x1080. ISO: GNOME Debian 7.2.0 amd64. Bootable Device: Universal USB Installer. \---Process begins--- After making the bootable USB, I, in Windows 8, go to Settings -> Change PC Settings -> Update and Recovery -> ... -> Change UEFI Settings. In the UEFI settings, I directly make the boot method Legacy Boot with Legacy First enabled. I restart. As I expect, of course, the installation screen shows up. I hit Install, without DHCP network configured because my computer can only access a wireless network at the time. When dealing with the partitioning, I see that I have already had an ESP, so I only did two things: 1. Have a 4-GiB free space formatted to be the swap area; 2. Have a 100-GiB free space formatted to be the ex4 primary partition. Then I go on installing. The progress is fluid, and after finishing, I reboot it. Hooray! I see both Debian and Windows 8 on the GRUB menu (I am still in Legacy Boot method). Here come the problems: I hit "Debian..." on the GRUB menu, and I see this: "GNOME 3 failed to load... Unfortunately GNOME 3 failed to start properly and started in the fallback mode. This most likely means your system (graphics hardware or driver) is not capable of delivering the full GNOME 3 experience... Learn more about GNOME 3". I looked up the Internet and I found something about 3D acceleration, but it doesn't apply. How do I know it doesn't? I boot the GNOME Debian live CD 64-bit in VMWare Player with 3D Acceleration turned on, but the message still pops up. So here is the first problem I have. I hit "Windows 8" on the GRUB menu, and I see this: "Windows failed to start. A recent hardware or software change might have caused the issue...". Probably it's because I am using Legacy Boot. \--- Process stops --- The only way to dual-boot successfully is to make Debian boot under UEFI boot method with Secure Boot turned off and Fast Boot (in Power Options in Control Panel in Windows 8) turned off. In short, what I need is that Debian will boot normally without any form of errors (like the GNOME 3 message above) with UEFI Boot turned on and Secure Boot disabled. I first try to do this by getting in Debian. After opening a terminal with my mouse (Ctrl-Alt-T doesn't work and I haven't checked the keyboard shortcut yet.), I typed in "grub-install" but it complains "command not found"; thus I am not able to proceed. I checked the /boot directory but I didn't see the "efi" directory. I don't know why when there should be one since GRUB 2 can be for UEFI boot. By the way, during the installation I see the grub-install run without any warning or error so I am super confused right now. I try to use EasyBCD but Debian won't boot, but saying something similar to "Windows 8 failed to start...". I try different software for creating a bootable device including YUMI, Unetbootin, SARDU, but the problem is still not solved. I am almost desperate now; thus I post the problem here.


title: Pipe in a shell script

text: I have done this little script :               #! /bin/sh       path="foo"      while touch $path ; do          path=./${path}      done           echo "echec avec le nom $path qui fait"      echo $path|wc -c      echo "caracteres"      How can I print on the same line the 3 echo lines? Thank you in advance ;)


title: Specify identity file (id_rsa) with rsync

text: I need to make periodic backups of a directory on a remote server which is a virtual machine hosted by a research organisation. They mandate that access to VMs is through ssh keys, which is all good, except that I can't figure out how to point rsync to the ssh key for this server. Rsync has no problem if the key file is `~/.ssh/id_rsa`, but when it is something else I get `Permission denied (publickey)`. With ssh I can specify the identity file with `-i`, but rsync appears to have no such option. I have also tried temporarily moving the key on the local machine to `~/.ssh/id_rsa`, but that similarly does not work. **tl;dr** Can you specify an identity file with rsync?


title: Is the Tango project dead?

text: Is the Tango Desktop Project dead? It looks totally abandoned to me...


title: Multiple GUI windows in one (GUI applications windows multiplexer/wrapper)

text: I was wandering if there are some programs or methods, where I can do something similar like Terminal multiplexer - Wikipedia, the free encyclopedia \- except where each region of the "multiplexer" application is a GUI window of an application all its own. Here is an imaginary example - I'd, basically, like to write in terminal something like this (pseudocode):               $ gui-multiplexer-application --width 600 --height 600 \       --command "scite" --heightratio 60       --command "gnome-terminal -e 'PS1=\"$\"'" --heightratio rest      ... which would, in turn, start up something like this (that image I montaged manually in Gimp): ![gui-mplex](http://i.stack.imgur.com/bBPgz.png) I don't need any methods to specifically connect these applications (if a command can be started with arguments, then I could use that) - what I would like is that both windows are moved in sync when you drag the master ("gui- multiplexer-application") window title bar; and hopefully, that the horizontal separator line is draggable, so one can readjust the height that the inner windows take up respectively (readjusting the width through the master bounds goes without saying, I guess). Anything like this out there? (I'm on Ubuntu 11.04 with Gnome2; however, I imagine this kind of application would work on an X11 level, thus being hopefully portable between different DE/WM. ) EDIT: This is somewhat like a tiling window manager - however, a proper tiling window manager replaces the entire desktop; I instead would like a tiling window manager inside a window with a titlebar (which can appear in any other WM I may otherwise be using). In fact, one could use scripts like `awesome_test` in Using Xephyr - awesome, but they start a whole new X session, so there are interaction problems like grabbing keyboard inputs, and not being able to find the "regular" desktop environment styling. Which is why I'm looking for a similar functionality, but which works within a single application window. (Also possibly related: sticking stickies to windows - Unix & Linux Stack Exchange) (Backround: I like writing Latex in Scite; and while Scite does have a terminal window, on my version it is non-interactive - so if `latex` ends up with an error, I cannot issue a Ctrl-C or X or anything to have the process terminate; so I have to use a proper terminal anyways. Now, there is `geany` which actually does have a proper terminal, but I don't want to change text editors for this application (Latex writing). I'm sure there could the other situations where this "GUI window multiplexing" would be useful, though. )


title: How do I edit the hotspot configuration for Network Manager?

text: Running Arch/Linux with everything up-to-date and I use network manager's built-in hotspot function to share my Internet. I'm trying to edit the configuration (mostly the password, as I don't like the random password) for the "hotspot" connection. I've worked on both the network settings GUI and the config file under `/etc/NetworkManager/system- connections`. Somehow network manager doesn't like this configuration being edited. Every time I change anything and start hotspot again, the edited one will be abandoned, and NM will create a new hotspot connection with default settings and a new random password. How do I tell NM to accept what I've edited?


title: Best directory for shared scripts

text: What is the conventional directory to keep shared scripts that might be used by more than one user? I've read through this overview of the standard file system hierarchy, but it doesn't seem to recommend a location for storing shared scripts. Creating a /opt/scripts directory seems like a reasonable option, but I'd like to know if there is a standard UNIX convention for this.


title: GNU Guix usb-install freezes at GRUB after boot

text: I wanted to try out the GNU usb install that was released with Guix 0.7. The problem is that when I try to boot from the USB, it freezes, with the word GRUB and a flashing type line. I followed the instructions. First I downloaded the compressed file from `wget http://alpha.gnu.org/gnu/guix/gnu-usb- install-0.7.x86_64-linux.xz`, then I extracted it `xz gnu-usb- install-0.7.x86_64-linux.xz`, then I dd it onto my 64GB USB flash drive, which I formatted to FAT32 and added the boot flag prior to dd'ing it, as so `sudo dd if=gnu-usb-install-0.7.x86_64-linux of=/dev/sdb1`. And as I said before, when I go on the boot menu and choose to boot from the flash drive, it just shows `GRUB _`, and everytime I press a key it beeps.


title: how to put particular application on system startup in fedora 15?

text: How do I put particular application on system startup on my Fedora 15. For instance if I want to start my Firefox browser on system startup how do I achieve this? What have I done so far is, I just created a simple shell scrip and put the command of starting a Firefox browser in that and placed that shell script in `/etc/init.d/` directory.               #!/bin/bash     /usr/bin/firefox


title: How to change the username in Ubuntu 10.10?

text: I want to change a username. In the prompt, which says `abhishek@hello$`, I want to replace `abhishek` with `alok` (i.e. `alok@hello$`). Is it possible to do that without reinstalling Ubuntu?


title: How can I monitor all outgoing requests/connections from my machine?

text: My machine is a server so I want to ignore connections being made to my server (e.g. when someone visits my website). I want to see _only_ connections/requests being made by my server to other places. How do I see _only_ those outgoing connections? EDIT: I'm new to these type of things. What I'm trying to do is just see if anything from my server is being sent out other than data for my web apps. For example, if someone visits my websites, then obviously my server will send out data to the client's browser. But suppose there's also code somewhere in my web app's framework that sends statistical data to somewhere else I'm not aware of. I'd like to see those places my server is sending data to, if any. It's probably not likely, but suppose you decide to use a php or nodejs framework that you didn't write: there's a small chance it may send some type of data somewhere. If so, that's what I'd like to see.


title: What happens to a continuing operation if we do ssh and then disconnect?

text: I am moving one directory to another using mv command. However, I was forced to shut down my computer, which means losing connection to the server. What happen to the mv command? Note: After I relogin, I saw that all the files have been properly moved even though I was sure that it wasn't moved when I closed the connection. It seems that mv did continue running. This is me ssh to centosh machine in steadfast.net cloud server.


title: irc connection timeout problem

text: I am using tcpredir to connect to freenode server via port 6665 for some firewall difficulties:               server:~# redir --lport=6665 --cport=6665 --caddr=irc.freenode.net      and recently i faced a problem, i can not connect to irc i tried telnet to connect via telnet for test it seems connection established without problem               client:~$ telnet irc.myserver.com 6665     Trying x.x.x.x ...     Connected to irc.xamin.ir.     Escape character is '^]'.     :holmes.freenode.net NOTICE * :*** Looking up your hostname...     :holmes.freenode.net NOTICE * :*** Checking Ident     :holmes.freenode.net NOTICE * :*** Couldn't look up your hostname     :holmes.freenode.net NOTICE * :*** No Ident response          ERROR :Closing Link: 127.0.0.1 (Connection timed out)     Connection closed by foreign host.      netstat returns this:               server:~# netstat -ntlpa | grep 6665     tcp        0      0 0.0.0.0:6665            0.0.0.0:*               LISTEN      23741/redir          tcp        0      0 172.20.5.240:40263      83.170.73.249:6665      ESTABLISHED 30320/redir          tcp        0    264 172.20.5.240:6665       80.191.2.58:51948       ESTABLISHED 30320/redir      have you any idea on this,


title: Can we use Linux Mint ISO to repair Ubuntu's Grub?

text: A friend of mine is running Ubuntu and got `GRUB RESCUE`. Can they use Mint ISO to repair their Grub? As I don't have Ubuntu ISO?


title: How to get rid of the *Personal File Sharing* bar in Nautilus?

text: I just moved from Ubuntu to Debian Wheezy and I thought I'd be finally free of all the unnecessary clutter. I guess I was wrong. Here is the situation: In the `Downloads` folder, Nautilus displays the following message: > Personal File Sharing > > _You can receive files over Bluetooth into this folder_ ![enter image description here](http://i.stack.imgur.com/RHtf0.png) I'd really like that to go away. My PC is not bluetooth-enabled, and even if it were, I'd figure out a way to share my files without the constant reminder. But I digress. Here's what I've tried so far:   * The launch preferences dialog doesn't seem to make the notification go away, even when I enable sharing over the non-existent bluetooth device   * Nautilus' `Preferences` dialog doesn't present a relevant option   * Removing the `bluez` package via `synaptic` threatens to take the entire Gnome desktop with it. Same with trying to remove `gedit` or, indeed, `nautilus`. I feel like having Jules Winnfield over my head saying "I dare you. I _double_ dare you". In my previous Ubuntu installation I managed to remove bluetooth-related packages by switching to Thunar (and getting rid of the entire Unity family). This time I'd like to keep Nautilus if possible. The presence of a bluetooth package is something I can deal with later, what I'm worried about is the notification. Is there any way to make it go away? * * * ### Update: I decided to manually remove dependencies from the .deb files. Using this for guidance, I removed pretty much all but the most fundamental packages (such as X11 or sound packages) from `gnome`, `gnome-core` and `task-gnome-desktop`. I must have missed something though because removing unwanted packages such as bluetooth still wanted to take away Gnome. * * * ### Update 2: It turns out neither `gnome` nor `gnome-core` are essential to the system. In fact, from what I can tell, their only job is to provide dependencies and recommendations. I went ahead and purged them. This cased aptitude to see a bunch of useful packages as "no longer needed" and required to set the "manual install" flag on the ones I wanted - fair enough. A happy side-effect, bluetooth-related packages are gone. I did get rid of `nautilus-share` though as @grawity suggested. ~~This did not affect the notification at all. The problem remains~~. After a re-login, the offending area had vanished.


title: Change cursor theme with immediate effect

text: Is there a way to change the cursor theme with immediate effect in X, after it starts up? I've tried `xrdb -merge` which doesn't work (nothing happens).


title: Is there a way to change a device id in /dev/disk/by-id?

text: I have a S2 SAMSUNG 320GB USB-HDD which I use in both Ubuntu 13.10 (Kernel 3.11.0-17-generic) and Fedora 17. It works fine; I can read/write from/to them. Although, I am experiencing an issue with a software that deals with pen drive and other USB devices. This program tries to list the available devices by running the following:               ls -l /dev/disk/by-id/usb*      and returns nothing. So, I ran in terminal: `ls -l /dev/disk/by-id/*` and got this:               ata-hp_DVDRAM_GT30L_KZEA6810820     ata-SAMSUNG_HM321HX_C5733G82AB0BPW     ata-WDC_WD3200BEKT-60V5T1_WD-WX81A50J4370     wwn-0x50000f00ab0b000b     wwn-0x50014ee20495cc9f      in `/dev/disk/by-uuid`, my UBS-HDD is: 19ED-1878 -> `../../sdb` My external HD is, so, listed as "ata-SAMSUNG...." and can not be found as "usb*...". I googled a lot about that. Found that editing `/etc/fstab` or `/boot/grub/grub.conf` would help me (haven't found anything related to my USB dev in `grub.conf` nor `fstab`). Or something like ZFS, zpool.. and even a tool that deals (only?) with the UUID, tune2fs. But as a beginner-level Linux user, I don't know what to do. So, is it possible to change `/dev/disk/by-id/ata-SAMSUNG...` to `../../by- id/usb-SAMSUNG...`? And if so, how?


title: In bash script, how to capture stdout line by line

text: In a bash script, I would like to capture the standard output of a long command line by line, so that they can be analysed and reported while initial command is still running. This is the complicated way I can imagine of doing it:               # Start long command in a separated process and redirect stdout to temp file     longcommand > /tmp/tmp$$.out &          #loop until process completes     ps cax | grep longcommand > /dev/null     while [ $? -eq 0 ]     do         #capture the last lines in temp file and determine if there is new content to analyse         tail /tmp/tmp$$.out              # ...              sleep 1 s  # sleep in order not to clog cpu              ps cax | grep longcommand > /dev/null     done      I would like to know if there is a simpler way of doing so. EDIT: In order to clarify my question, I will add this. The `longcommand`displays its status line by line once per second. I would like to catch the output before the `longcommand`completes. This way, I can potentially kill the `longcommand` if it does not provide the results I expect. I have tried:               longcommand |       while IFS= read -r line       do         whatever "$line"       done      But `whatever` (e.g. `echo`) only executes after `longcommand` completes.


title: How to compile a Debian package from source?

text: Newbie Ubuntu user here... I use a tool called YUMI to create a USB boot device. Its Debian package and its source can be downloaded from http://www.pendrivelinux.com/yumi-multiboot-usb-creator/. I needed to change a file in source code to make the program fits my needs but now I don't how to compile it and install it afterwards. I tried with `dpkg` but with no experience and it didn't work. So, is there an easy way to compile and install a user-modified source code?


title: How to use sudo in Fedora?

text: I use to be a fans of Ubuntu, when I want to execute a command as root user, I do this `sudo blah_blah_blah`. But in Fedora 16, it doesn't seem recognize this command. Any clue on this?


title: Courier-imap with sendmail setup: why is my IMAP inbox empty?

text: I've successfully installed sendmail, but when I connect to the Courier IMAP server via Outlook, the Inbox is listed as empty. When I check the inbox with Alpine locally on the server, it has content though. Why? I do see files with content in /var/mail . Is that not where Courier-imap checks for mail? The setup is pretty clean - I run Ubuntu 12.04 on AWS, have installed sendmail and courier-imap. sendmail was configured with `sendmailconfigure` and it works well to both send and receive mail. The problem is with courier.


title: Is there a way track bandwidth over time like days, months?

text: I would like to know how much bandwidth is being used on my server. Not HTTP bandwidth, but all protocols. Basically iftop data over time continuously logged. Then I could write a simple python script to process it and provide aggregate info.


title: Replace yum with apt

text: I have used Ubuntu for like two years now. I am very comfortable with the aptitude package manager. I recently switched to Fedora(16)[I still have ubuntu on my other drive :) ] I am behind a university firewall (with all kind of data restrictions). In these circumstances I realized apt is better suited and effective when compared to yum. How can I replace yum with apt??


title: Is there an option to make sed fail if pattern not found?

text: I need to find and replace some patterns in some files, but I need it to return 1 or something if a pattern is not found. Can I do this with sed alone or do I need to check whether the pattern exists with another command? Any suggestions?


title: Replace all but a set of characters in a file with newline

text: how to delete all characters in file except numbers and "." , each word (numbers/dot) should be in new line in file see example2   * the solution can be with sed or awk or ksh syntax remark - the solution must be according to the example 2 example 1 file before edit                 192.0.22.1++0.1       e32)5.500.5.5*kjcdr       ##@$1.1.1.1+++jmjh       1.1.1.1333       33331.1.1.1       @5.5.5.??????       ~3de.ede5.5.5.5       1.1.1.13444r54       192.9.30.174       &&^#%5.5.5.5       :5.5.5.5@%%^^&*       :5.5.5.5:       **22.22.22.22       172.78.0.1()*5.4.3.277       3.3.3ki.3.      example 2 of file after delete all characters except numbers and "." charter , each new word will be in new line                 192.0.22.1       0.1       32 5.500.5.5       1.1.1.1       1.1.1.1333       33331.1.1.1       5.5.5.       .       5.5.5.5       1.1.1.13444       54       192.9.30.174       5.5.5.5       5.5.5.5       5.5.5.5       22.22.22.22       172.78.0.1        5.4.3.277       3.3.3 .3.


title: Startx Segmentation fault error after installing VirtualGuest Additions for Virtualbox

text: I have been using my backtrack version 5 on the Virtualbox for some time now but I had a resolution problem and after searching found out I better install VirtualGuest additions. However after installing it `startx` does not work anymore and gives me segmentation fault. as follows:               Segmentation fault at address 0x7f7b26129800     caught signal 11(segmentation fault). Server aborting     Please consult the http://wiki.x.org foundation support     Please check the log file at "var/log/Xorg.0.log" for additional information.     ddxSigGiveUp: closing log giving up. xinit: no such file or directory (errno 2). unable to connect to x server. xinit: no such process (errno 3). Server error.


title: How can I automate a task on a certain event?

text: Playonlinux and WINE are great. Finally I can have my favourite games and the joys of Linux without having dual-boot or filling my disk with Windows crap! But some are quite old, and only run on lower resolutions. Fortunately, I keep a terminal emulator open, and just do `xrandr -s 1366x768`. Sometimes it's hard though: on `800x600` I can't scroll down, nor see what I'm writing. And I know exactly the processes that change the resolution. That got me thinking: can I automate it? I know with `crontab` I can shedule tasks for certain hours, or on startup. But what about scheduling for when some specific script runs, or ends? Or even for when the system gets stuck, to kill the guilty process? How can I schedule tasks for any event? Do I need another program? Thank you in advance,


title: On Debian Testing: How to get a recent Iceweasel Release (non-ESR) version without updating to Unstable?

text: I'm on Debian Jessie / testing. It currently has Iceweasel 17, but I would rather like to use a more recent release (Mozilla "Release" or "Firefox" 'channel' - currently Iceweasel 25). http://mozilla.debian.net/ recommends: > You need to add the following entry in `/etc/apt/sources.list` or a new file > in `/etc/apt/sources.list.d/`: > > deb http://cdn.debian.net/debian unstable main > > You can install it with the following commands: >   >   >        $ apt-get update >        $ apt-get install -t unstable iceweasel >   That would at least give me Iceweasel 24, but then next time I run `apt-get dist-upgrade` I would update to Debian unstable and I don't want to do that. I only want a newer version of Iceweasel (latest version blessed "stable" by Mozilla, not ESR). So I could remove the unstable repository after installing Iceweasel, but then I wouldn't get security updates anymore and would have to manually stay on top of the latest security updates, and each time there is a security update I would have to:   * re-add the unstable repository   * upgrade iceweasel   * remove unstable repository.  That can't doesn't seem like it should be done like that? Seems inefficient and tedious. I could also install the unbranded "real" Firefox directly from Mozilla but then I also would have to manually update which is equally inconvenient. Seems like I'm looking for an `apt` repository maintaining Firefox or Iceweasel for Debian Jessie / testing? Does that exist? Other ideas?


title: How to permanently disable a network interface?

text: I've brought down a network interface with `ifconfig wlan0 down`, but every few hours or so, the `wlan0` interface comes back up and I can't figure out why. I don't restart the machine, never changed `/etc/network/interface`. I guess my question is, how would I go about just "permanently" disabling `wlan0`. Do I use `/etc/network/interface`? I already have `ifconfig wlan0 down` in my `rc.local`.


title: How can I reformat tabular data using AWK?

text: I have a file contain following output.               ora.abc.db           1        ONLINE  ONLINE       serverA              Open           2        ONLINE  ONLINE       serverB              Open     ora.xyz.db           1        ONLINE  ONLINE       serverA              Open           2        ONLINE  ONLINE       serverB              Open           2        ONLINE  ONLINE       serverC              Open      I want to format this file in following way, but i want to use `shell script` only, I believe we can use awk but i don't have logic               abc  abc1  ONLINE serverA     abc  abc2  ONLINE serverB     xyz  xyz1  ONLINE serverA     xyz  xyz2  ONLINE serverB     xyz  xyz3  ONLINE serverC


title: Cursor keys in bash in dtterm don't work as expected

text: I am trying to remap some of my keyboard shortcuts in bash. The problem is that when I try to display key code using `Ctrl-V`, not all keys work. For example, Typing `Ctrl-V`, then `Home` moves the terminal to the top, just as usual. Typing `Ctrl-V`, then `Ctrl` shows nothing. Typing `Ctrl-V`, then `left arrow` shows `^[OD`, typing `Ctrl-V`, then `Ctrl-left arrow` shows the same thing. I am trying to remap Home and End to move cursor to the beginning or end of line, and Ctrl-arrows to jump words. I am in Solaris, using DtTerm. SOLUTION: .Xdefaults:               Dtterm*DtTerm*Translations: #override \n\     <KeyPress>osfBeginLine: string("0x1B")string("[1~") \n\     <KeyPress>osfEndLine:   string("0x1B")string("[4~") \n\     Ctrl<KeyPress>osfLeft:  string("0x1B")string("OC") \n\     Ctrl<KeyPress>osfRight: string("0x1B")string("OD")      .inputrc:               "\e[1~": beginning-of-line     "\e[4~": end-of-line     "\eOD": forward-word     "\eOC": backward-word


title: wget: Retrieving a list of URLs when modifying input data file on the fly

text: This issue is currently driving me up the wall.   It just does not work as it should. I have a file **inp** with audio samples to download where I preserved the internal ID number by parsing some other location of the HTML source file to get rid of the internal (hex) filename, looking like this:               http://whatever.site/data/samples/hexfilename1.mp3 12345.mp3     http://whatever.site/data/samples/hexfilename2.mp3 12346.mp3     http://whatever.site/data/samples/hexfilename3.mp3 12347.mp3     http://whatever.site/data/samples/hexfilename4.mp3 12348.mp3      http://whatever.site/data/samples/hexfilename5.mp3 12349.mp3      As I only need the first part on each line, I've tried `awk` or alternatively `cut` to strip the rest, but on the fly:               $ wget -nc -i $(cut -f1 '-d ' inp)      respectively               $ wget -nc -i $(awk 'print $1' inp)      But it will download all the mp3 files, then grind for a short while, and something very strange will happen:               --2014-09-01 14:27:25--  http://whatever.site/data/samples/ID3%04      Ugh. It is exactly what you're thinking it is: indeed the first bytes of the binary mp3 file that `wget` is trying to download, after it is finished downloading the regular ones (and supposed to terminate). But why does it happen? If I go the clumsy way by creating a **inp2** temporary file for `wget` and using it with the `-i` parameter, it works:               $ cat inp | awk '{print $1}' > inp2      Why is there so much difference when _inp_ gets modified on the fly and passed directly to `wget`? The most interesting thing is that the on-the-fly variant won't work with either `awk` or `cut`, so neither of both tools are to blame.


title: Using cp to replace a directory of the same name

text: How can I make `cp` replace a directory of the same name without removing the existing directory first? `cp`'s default behaviour is to copy the source directory into the destination rather than replace it:               mkdir -p test/a     mkdir a     cp -a test/a a      `a` is now within `a`, it didn't replace `a`. How can I make `cp` replace directories? I want it to work the same way it does with files. I could of course delete the target first, but I don't want to have to run more than one command :)


title: Clicking on thunderbird notifications does not focus client

text: I get thunderbird popup notifications in Awesome Window Manager that when clicked, are supposed to focus the message to which the notification corresponds. However, this does not work in awesome when thunderbird is on another tag. So, to clarify, clicking on the T-bird notification should switch to the tag where T-bird is running, and focus T-bird. Anyone know if this can be made to work?               % awesome --version && thunderbird --version && cat /etc/issue 2>&1     awesome v3.5.1 (Ruby Tuesday)      • Build: Sep 12 2013 20:14:11 for x86_64 by gcc version 4.8.1 (nobody@)      • Compiled against Lua 5.2.2 (running with Lua 5.2)      • D-Bus support: ✔          Thunderbird 24.0     Arch Linux \r (\l)


title: How to copy a partition over network

text: I want to copy a Windows 7 partition that came installed on my laptop to my desktop computer. I've tried:               # bzip2 -c /dev/sda5 | nc 192.168.1.1 2222 # on laptop     # nc -l 2222 | bzip2 -d > /dev/sda1 # on desktop      But gparted tells me the partition is corrupted with a lot of error messages. I also tried:               # dd if=/dev/sda1 | gzip -1 - | ssh user@hostname dd of=image.gz # on laptop     # dd if=image.gz | gunzip -1 - | dd of=/dev/sda5 # on desktop      It worked for a small partition (35 Mb), but didn't for larger ones (18Gb and 120Gb). The ssh pipe keeps breaking and one attempt that completed gave errors in gparted. What would be a better way of copying the partitions?


title: Port fowarding and load balancer in ubuntu server 12.04

text: I am looking to create a load balancing server. Essentially here is what I want to do: I have a public IP address, lets say 1.1.1.1 I have a second public IP address, lets say 2.2.2.2. I have a website, www.f.com point to 1.1.1.1 via an A record. I want that Ubuntu server to forward traffic like this:   * Port 80 traffic is forwarded to 2.2.2.2 on port 60,000 and port 60,001.    * Port 443 traffic is forwaded to 2.2.2.2 on port 60,010 and port 60,011.    * Port 25 traffic is forwared to 2.2.2.2 on port 60,020 and port 60,021 The port forwarding is more important then being able to load balance. I look forward to some responses. Both server 1.1.1.1 and 2.2.2.2 are both running Ubuntu 12.04 server edition.


title: Is swapping the cause of high IO on my box?

text: I'm running a LAMP stack on an Amazon EC2 micro instance with 616 MB of memory. This seems sufficient to be able to run a few small websites with Apache, MySQL and PHP. I have one Wordpress site installed and anytime I interact with it I see huge amounts of disk reads and writes which Amazon tracks and charges for. There is one MySQL database that is 2MB in size so it should easily be able to keep that in memory. Running `free -t` shows:                            total       used       free     shared    buffers     cached     Mem:        616408     529360      87048          0       4572      88908     -/+ buffers/cache:     435880     180528     Swap:            0          0          0     Total:      616408     529360      87048      Does this mean there is no swap space allocated on my box? Running `iotop` for the last 24 hours the largest IO percent wise is kswapd0 which I've learned is the swap management process. The largest IO disk reads are from `named -u named` followed by `httpd` and `mysqld`. The largest IO disk writers are `[jbd2/xvda1-8]` followed by `mysqld`. What is going on here? Are the tens of thousands of IO requests coming from thrashing or is MySQL maybe not behaving correctly?


title: I need Control loop help -

text: this is what I figured out in sorting an Array that has already had it's elements declared type int               #!/bin/bash     #sorting an "predeclared" array            typeset -i store BigNum      let store=0 BigNum=0           number=([0]=11140344 [1]=3 [2]=0 [3]=2 [4]=11140345 )            for (( a=0; a <= 5 ; a++ ));        do         if (( number[a+1] < number[a] )); then                    store=number[$a]               number[$a]=number[$a+1]               number[$a+1]=$store               BigNum=$store           fi               # I think BIGNUM can be passed back in a function by writing       # return $BIGNUM its passing an array that is the BIG PROBLEM!!!!           echo $BigNum " BIG NUM always returns the biggest number"      done      this is the FOR LOOP I am working with, it is going way out of bounds.               x=0     while [[ $x -lt 1 ]]; do            # my main loop I am working with        # to get that greatest number       # out of the odd ball numbered       # element put it in order then        # get it LOOP       ########     for(( a=0; a<${#lostsongs[@]}; a++ ));     do                   if [[ ${lostsongs[a+1]}<${lostsongs[a]} ]]; then                  store="${lostsongs[a]}"             lostsongs[a]="${lostsongs[a+1]}"             lostsongs[a+1]=store             echo "$store val in if 1st for loop larger val"        fi            # echo $store " Larger Bigger number post if statement"        let x++        done      #################            let x++       done      this is the output from the good code from my first loop (with set -x).                echo 3 4 1 2 ' all of the array elements filled are in this order'      that is all I am wroking with four(4) elements. the out put from that loop is this                + echo 'store val in if 1st for loop larger val'      store val in if 1st for loop larger val      + let x++      + (( a++  ))      + (( a<1134 ))      + [[ '' < store ]]      + store=store      + lostsongs[a]=      + lostsongs[a+1]=store      + echo 'store val in if 1st for loop larger val'        store val in if 1st for loop larger val      my logical assumption is that               (( a<1134 ))      is my array.length when it should be 4, that BASH is seeing causing my for loop to over run and go crazy mad. All I would like is for someone to help me and write me a control loop to stop my FOR LOOP at the count of 4 as writing all these different types of loops in all the different ways they can be written to try and figure out how to control my FOR LOOP and stop it at 4 is doing noting by driving me loopy. it would be a great help so I can't quit practicing my arrow up last command Enter then Ctrl C reflexes, and writing every kind of loop known to mankind and get to more important things like learning how to write this BASH syntax in getting that FOR LOOP work too and all that. if that is not out of the question, hopefully it is not. ............................ ADDED DO TO A PERSON ASKING FOR MORE INFORMATION SO THIS IS EVERYTHING-- NOT yelling just caps so one will take notice with out having to add the word SEX. this first script works what I am working on I want to add it to this script up update the lostsongs array in the               #!/bin/bash     #     ########################################################################     ########################################################################     # for GNU/Linux                                                        #     # BASH Script                                                          #     #                                                                      #     # converts all the mp3 files in a directory from whatever bitrate to   #     # 128k bitrate.                                                        #     # Then adds an underscore between the artist_name_TITLE_ALBUM from the #     # metadata creates a new file of the same, and Directory and           #     # subdirectory in the same manner eleminating the need to use quotes to#     # malnipulate the data and directiories. then moves the new file into  #      # same directories and subdirectories. Then deletes the old file.      #     # ffmpeg only takes it to 192k.                                        #          # You can change it to any bitrate you want (WITHIN_SPECS) and even    #     # add the other -args to include the other features included           #     # with ffmpeg  --    works with version ffmpeg 0.8.9-6:0.8.9-1                         #     # put it in any directory then give it the path  you are working on then run it.     #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$                          #     #&  Written By: Mikie Heras Dec. 04, 2013                              #      #& FINISHED DEC. 5, 2013                    &                          #     #&##########################################&###########################     #&##########################################&###########################          typeset -i xf mf sn bn hn          let xf=1 mf=0 bn=5 hn=6          lostsongs[0]=4               #get MAX NUMBER -- mp3 files in folder     #MAXNUM="$(ls $PWD/*.mp3 | wc -l)"          #so it can sit in the home dir and search what ever folder     # I want            MAXNUM="$(find ~/music/ -type f -name *.mp3 | wc -l )"           mf=MAXNUM #set the count down number          echo ; echo ; echo ; echo ; echo     #inform the user how many files are in the folder          echo $MAXNUM " mp3's in folder MUSIC"     sleep 3     echo ; echo ; echo ; echo ; echo          #search out all the mp3 files in the directory     # set how many I want to convert at a time            find ~/music/ -type f -name "*.mp3" | while [ $xf  -le 100  ] ;      do read FILENAME;          #############################################################     #get the metadata tags off the mp3's using exiftool-perl     #################          ARTIST="`exiftool -Artist "$FILENAME" -p '$Artist'`"      TITLE="`exiftool -Title  "$FILENAME" -p '$Title'`"      ALBUM="`exiftool -Album  "$FILENAME" -p '$Album'`"           #replaces all the crap and the spaces       #between the names with an underscore      #"${x// /_}" meaning "${varName//search pattern/replace with}"          newArt="${ARTIST// /_}"     newTit="${TITLE// /_}"     newAlb="${ALBUM// /_}"          echo $newArt     echo $newTit         echo $newAlb         #just for good mesure let me see what's going         echo $FILENAME " before set stipping down.."         sleep 2              #strip the old file name off the path from FILENAME         #over kill but in good measure          c=$FILENAME         xpath=${c%/*}          xbase=${c##*/}         xfext=${xbase##*.}         xpref=${xbase%.*}         path=${xpath}         pref=${xpref}         ext=${xfext}              ##############################################################         # assign the file a new name         # if LOSTSONG no metadata then add a number to the array[0]          # 1st element [zero] then incurment hn by one 1 for checking to         # be sure that it is the right file in the MOVING FILES section         #          ######              if [[ ! -n "$newArt" && ! -n "$newTit" && ! -n "$newAlb" ]] ; then             echo "${lostsogns[0]} that is Lsogn num.. before going to sogn"           newFile="I_HAVE_NO_IDEA-WHO-I-AM-(Lost-Song-Number-("${lostsongs[0]}"))-192k.mp3"         (( lostsongs[0]++ ))              let hn++                  elif [[ -n "$newArt" && -n "newTit" && ! -n "$newAlb" ]] ; then                 newFile="Artist-${newArt}_Title-${newTit}_192k.mp3"               else                 newFile="Artist-${newArt}_Title-${newTit}_Album-${newAlb}_192k.mp3"       fi         echo $newFile "new file name ..."         sleep 3          ##############################################################     # convert the file to 128k using ffmpeg version 0.8.9-6:0.8.9-1      ###            ffmpeg  -b 128k -vol 425 -i "$FILENAME" "$newFile"          ##############################################################     # MAKE DIRs     #############          if [[ ! -d ~/music2 ]] ;then               mkdir ~/music2/     fi          if [[ ! -d ~/music2/"${newArt}" ]]; then              echo "making newDir $newArt  ..."             mkdir ~/music2/"${newArt}"/     fi          if  [[ -d ~/music2/"${newArt}" && \     ! -d ~/music2/"${newArt}"/"${newAlb}" ]] ; then         echo "making dir/sub $newArt / $newAlb .."         mkdir ~/music2/"${newArt}"/"${newAlb}"/     fi          if [[ ! -d ~/music2/lostsongs/ ]] ; then         mkdir ~/music2/lostsongs/         echo "making Lost Dir .."     fi              ##################################################################     #     ## MOVE THE FILES      #this siganls out the newfile uneekly     #if no counter movement then no lost song was found     #to insure that the $newFile is one that has a place in a diffetent     #folder named lostsongs "${foo[0]}" < c && a -gt b          ###################################################################              if [[ ! -n "$ARTIST" && ! -n "$TITLE" && ! -n "$ALBUM" ]] ; then       if [[ "${lostsongs[0]}" < bn && hn > bn   ]] ;        then         echo "Found a Lost Sogn Yo! .."          mv "${newFile}" ~/music2/lostsongs/         let bn++        fi             fi                         ## if the newAlb is asigned and not empty      # what to do to check it          if [[ -n "$newArt" && -n "${newAlb}" ]] ; then         echo "-n newAlb true -- moving file \          to $newAlb -- newAlnum $newArt "          mv -f "${newFile}" ~/music2/"${newArt}"/"${newAlb}"/     fi          if [[ ! -n "${newAlb}" ]] ; then         echo " -n $newAlb  newAlbum not present moveing to $newArt \          new artist.."         mv -f "${newFile}" ~/music2/"${newArt}"/     fi          ###############################################################     # getrid of the old file     ###############################          killfile="${pref}.${ext}"     mv "${path}/$killfile" "${killfile//*/killme}"      rm "killme"          ############     #     #Used for MAXNUM or checksum in loop to tell script how many files to convert      # in the run      #############     let xf++     let mf--    # lets the user know how many files left to do               echo ; echo ; echo ; echo ; echo ; echo "$mf ..... mp3/s left to do ..."     echo ; echo ; echo ; echo ; echo     done               # with this new code I am working on to update that lostsongs[0]     # I am having problems with this global asignment too. I googled how to     # make an array global and it seems I am not the only one that has this      # problem - I have yet to find the solution it seems that bash ver has     # a lot to do with it too.      # GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu)     #     # it is a string val 1 2 3 4 5 6 7 8 9 10 ......      #      # with this a=0 ; a < $num or ${array[@ ' num'] being a int? ; a++      #     # in C++ it easier all I got a do is, for ( int a ; a < whatever int ; a++ )     #     # if I write it ( $a ; .. to get to the valule inside that variable I get      # an error too then there is the adding inside the element itself [a+1]     # that I am not  sure if bash can do that even.      #      # when I check this array after I have filled it with just 4 elements      # (for test purposes) outside that first loop I get 0      # BASH don't have a strToint() and IntTostr() that I can find     # to make it easier      #                #!/bin/bash          set -x          typeset -i xf mf sn bn hn n  snewnum d  store          let xf=1 mf=0 bn=3 hn=4 n=1 snewnum=0  store=0 n=0          declare -gA lostsongs  # this does not even work          # declare -a lostsongs # this does not work       # no globalization of array achieved yet          lostnum="$(find /home/userx/testscripts/ -type f -name "*.mp3" | wc -l)"          ###################################################     #     # FOR updating the lost song files so as not to      # over write any     ####################################          find /home/userx/testscripts/ -type f -name "*.mp3" | while [[ $n -lt lostnum ]] ; do     read FILE;          #echo $FILE  "<-- that is file"     nstring=${FILE##*/} #gets just the file name     lstring=${nstring##I*"("} #chops off Lside to the ( leaving num     rstring=${lstring%%")"*} #chops off Rside to the ) leaving the num          snewnum=$rstring #holds the char of type num                lostsongs[$n]=$snewnum         echo "lostsongs[$n] = ${lostsongs[n]}  fill array"         echo ${lostsongs[*]} " all the shit"          let n++     done          echo     echo          echo ${#lostsongs[@]}     echo     echo     echo     echo ${lostsongs[*]}          #get the hightest number then pass it     #needs to be  array[0]=greatest number then reset count     #####################                    #for(( a=0; a<${#lostsongs[@]}; a++ ));     #this for does not work because of the -lt synax     #for (( a=0 ; a -lt ${#lostsongs[@]}; a++ ));          for (( a=0 ; a < 4 ; a++ )) ;       do           ## Move Larger Values to the right.      # this one don't work      # because there are no spaces around "<", [[ only sees one,       #non-empty, argument, and returns true every time.     # if [[ ${lostsongs[a+1]}<${lostsongs[a]} ]]; then           # this one works        if [[ ${lostsongs[$a+1]} -lt ${lostsongs[$a]} ]]; then          # if (( lostsongs[a+1] < lostsongs[a] )); then         store="${lostsongs[a]}"         lostsongs[a]="${lostsongs[$a+1]}"       echo ${lostsongs[a+1]}       echo "${lostsongs[a+1]}"          lostsongs[a+1]=$store          echo "$store val in if 1st for loop larger val"      fi      # echo $store " Larger Biger number post if statment"               done          ##     #with the way that the last "test script is written in this writting this      #is the out put      #     ###          userx@bw-crunchbang:~/testscripts$ ./testnum     + typeset -i xf mf a sn bn hn n snewnum d store     + store=0     + let xf=1 mf=0 bn=3 hn=4 n=1 snewnum=0     + n=0     + declare -gA lostsongs     ++ wc -l     ++ find /home/userx/testscripts/ -type f -name '*.mp3'     + lostnum=4     + [[ 0 -lt lostnum ]]     + read FILE     + find /home/userx/testscripts/ -type f -name '*.mp3'     + nstring='I_HAVE_NO_IDEA-WHO-I-AM-(Lost-Song-Number-(3))-192k.mp3'     + lstring='3))-192k.mp3'     + rstring=3     + snewnum=3     + lostsongs[$n]=3     + echo 'lostsongs[0] =   fill array'       lostsongs[0] =   fill array     + echo 3 ' all the shit'       3  all the shit     + let n++       ..............     + echo 'lostsongs[3] =   fill array'       lostsongs[3] =   fill array     + echo 3 4 1 2 ' all the shit'        3 4 1 2  all the shit     + let n++     + [[ 4 -lt lostnum ]]     + echo     + echo 0       0     + echo          + (( a=0  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     + [[ '' -lt '' ]]     + (( a++  ))     + (( a < 4  ))     userx@bw-crunchbang:~/testscripts$       therefore the first problem is to make that array Global somehow. as I have said Google is full of how do I make an array global with so far I have not found an answer to even the others that asked that question. the second is turning Char into Int values to work with 'I think that is the two problems I have other then does BASH allow Math in side the element? [a+1] [a*1] (times, x 1) [a/1] div and [a-1] even?


title: How can I resize my root partition in Debian?

text: I am trying to add space to my root partition and am really not sure the safest way to go about it. I have read this thread, Can I resize the root partition without uninstalling and reinstalling Linux (or losing data)? but I don't think the information lines up with my system. Any help would be througholy appreciated. Also, in that post, F1234K asked for recommendations on good reading to learn this stuff, but no one replied to it. I would also be very interested in some learning material on the subject. Thanks! edit: I should add that my goal is to take 20 gb from sdb6 and put it in sdb1. sdb6 is a logical volume of sdb2. sudo fdisk -l               Disk /dev/sdb: 750.2 GB, 750156374016 bytes     255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0000babf        Device     Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048    19531775     9764864   83  Linux     /dev/sdb2        19533822  1465147391   722806785    5  Extended     /dev/sdb5        19533824    76765183    28615680   82  Linux swap / Solaris     /dev/sdb6        76767232  1465147391   694190080   83  Linux          Disk /dev/sda: 1000.2 GB, 1000200658432 bytes     255 heads, 63 sectors/track, 121600 cylinders, total 1953516911 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000a9997          Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048  1953515519   976756736   83  Linux          Disk /dev/sdc: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x927a1713          Device Boot      Start         End      Blocks   Id  System     /dev/sdc1   *        2048      206847      102400    7  HPFS/NTFS/exFAT     /dev/sdc2          206848   976771071   488282112    7  HPFS/NTFS/exFAT          WARNING: GPT (GUID Partition Table) detected on '/dev/sdd'! The util fdisk doesn't support GPT. Use GNU Parted.               Disk /dev/sdd: 999.5 GB, 999501594624 bytes     256 heads, 63 sectors/track, 121041 cylinders, total 1952151552 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x809da6bc          Device Boot      Start         End      Blocks   Id  System     /dev/sdd1               1  4294967295  2147483647+  ee  GPT      df -h               Filesystem                                              Size  Used Avail Use% Mounted on     rootfs                                                  9.2G  8.8G     0 100% /     udev                                                     10M     0   10M   0% /dev     tmpfs                                                   2.4G  896K  2.4G   1% /run     /dev/disk/by-uuid/d7968f08-4108-4382-a585-0b4a3850ec63  9.2G  8.8G     0 100% /     tmpfs                                                   5.0M     0  5.0M   0% /run/lock     tmpfs                                                    11G  692K   11G   1% /run/shm     /dev/sdb6                                               652G  581G   39G  94% /home     /dev/sr0                                                4.4G  4.4G     0 100% /media/cdrom0     /dev/sr1                                                354M  354M     0 100% /media/cdrom1     /dev/sdd2                                               931G  759G  173G  82% /media/zacharydimaria      mount               sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=3091362,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=2474360k,mode=755)     /dev/disk/by-uuid/d7968f08-4108-4382-a585-0b4a3850ec63 on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=10671840k)     /dev/sdb6 on /home type ext4 (rw,relatime,user_xattr,barrier=1,data=ordered)     rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)     /dev/sr0 on /media/cdrom0 type udf (ro,nosuid,nodev,noexec,relatime,utf8,user=zachary)     /dev/sr1 on /media/cdrom1 type udf (ro,nosuid,nodev,noexec,relatime,utf8,user=zachary)     /dev/sdd2 on /media/zacharydimaria type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)      pvdisplay does not return anything. edit: cat etc/fstab               # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     # / was on /dev/sdb1 during installation     UUID=d7968f08-4108-4382-a585-0b4a3850ec63 /               ext4    errors=remount-ro 0       1     # /home was on /dev/sdb6 during installation     UUID=ec5e593e-a36f-4b88-b210-8666128b4bf1 /home           ext4    defaults        0       2     # swap was on /dev/sdb5 during installation     UUID=4525d76b-dd14-48e4-b60d-dffee5b08245 none            swap    sw              0       0     /dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0     /dev/sr1        /media/cdrom1   udf,iso9660 user,noauto     0       0


title: pptpd dead but subsys locked? on cent os

text: i install point to point tunnel (PPTP) in my VPS. (Cent OS 6 64 Bit) everything fine after reboot the PPTP not worked client side. the pptpd status shows " pptpd dead but subsys locked ". how to solve the problem. i removed the file present in the /var/lock/subsys/pptpd but still again same problem / pptp not connecting on client side. my iptables rules               [root@server2 ~]# iptables --list     Chain INPUT (policy ACCEPT)     target     prot opt source               destination     ACCEPT     gre  --  anywhere             anywhere          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     ACCEPT     all  --  anywhere             anywhere     ACCEPT     all  --  anywhere             anywhere          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination      in pptp config file("/etc/pptpd.conf") i used this unused IP:               localip 10.22.22.1     remoteip 10.22.22.22-222