title: How do I store long hostnames list for SSH quick usage?

text: I have an SSH access to a lot of servers. And all that hostnames (and sometimes usernames) are long and hard to remember. Also even if I tweak my Terminal to keep eternal bash history, the using of `history | grep ssh` everytime doesn't seem to be cool.   1. How to config my bash or ssh to store user/host to be usable via smth like autocomplete?   2. Is there any recommendation specific to Mac OS X (Snow Leopard)?


title: Tracking down "missing" memory usage in linux

text: On an Arch 3.6.7 x86_64 kernel I am trying to account for the memory usage of the system, which the more I look at it, the more there appears to be a hole (in the accounting of used memory, a non-hole in the usage of). This is a freshly booted system. With not much running other than systemd and sshd to keep it simple               $ ps aux | sort -n -k6     ...     root       316  0.0  0.0   7884   812 tty1     Ss+  14:37   0:00 /sbin/agetty --noclear tty1 38400     matt       682  0.0  0.0  24528   820 pts/0    S+   15:09   0:00 sort -n -k6     dbus       309  0.0  0.0  17280  1284 ?        Ss   14:37   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation     matt       681  0.0  0.0  10808  1364 pts/0    R+   15:09   0:00 ps aux     root       308  0.0  0.0  26060  1516 ?        Ss   14:37   0:00 /usr/lib/systemd/systemd-logind     root       148  0.0  0.0  25972  1692 ?        Ss   14:37   0:00 /usr/lib/systemd/systemd-udevd     matt       451  0.0  0.0  78180  2008 ?        S    14:37   0:00 sshd: matt@pts/0     root       288  0.0  0.0  39612  2708 ?        Ss   14:37   0:00 /usr/sbin/sshd -D     matt       452  0.0  0.0  16452  3248 pts/0    Ss   14:37   0:00 -bash     root         1  0.0  0.0  32572  3268 ?        Ss   14:37   0:00 /sbin/init     root       299  0.0  0.0  69352  3604 ?        Ss   14:37   0:00 /usr/sbin/syslog-ng -F     root       449  0.0  0.0  78040  3800 ?        Ss   14:37   0:00 sshd: matt [priv]     root       161  0.0  0.0 358384  9656 ?        Ss   14:37   0:00 /usr/lib/systemd/systemd-journald      The most detailed memory info I can find is this from 2007 which appears to have resulted in the addition of the Pss field to general kernel accounting for a process but their python code is for older kernels and unfortunately some of the /proc/k* files have disappeared since then. The /proc/meminfo documentation is also helpful but aging a bit too. So, a demonstration of what I'm seeing.               # cat /proc/meminfo     MemTotal:       16345780 kB     MemFree:        16129940 kB     Buffers:           10360 kB     Cached:            48444 kB     SwapCached:            0 kB     Active:            24108 kB     Inactive:          46724 kB     Active(anon):      12104 kB     Inactive(anon):     3616 kB     Active(file):      12004 kB     Inactive(file):    43108 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:                 0 kB     Writeback:             0 kB     AnonPages:         11996 kB     Mapped:            16372 kB     Shmem:              3696 kB     Slab:              25092 kB     SReclaimable:      11716 kB     SUnreclaim:        13376 kB     KernelStack:         928 kB     PageTables:         2428 kB     NFS_Unstable:          0 kB     Bounce:                0 kB     WritebackTmp:          0 kB     CommitLimit:     8172888 kB     Committed_AS:      34304 kB     VmallocTotal:   34359738367 kB     VmallocUsed:      372788 kB     VmallocChunk:   34359362043 kB     HardwareCorrupted:     0 kB     AnonHugePages:         0 kB     HugePages_Total:       0     HugePages_Free:        0     HugePages_Rsvd:        0     HugePages_Surp:        0     Hugepagesize:       2048 kB     DirectMap4k:       12288 kB     DirectMap2M:    16680960 kB          MemTotal - MemFree - Buffers - Cached = Used     16345780 - 16129940 - 10360 - 48444 = 157036      All the Active*/Inactive* seem to be counters applied over some pages (not all) so could duplicate what is counted elsewhere.               Active + Inactive = Used     46724  + 24108    = 70832 (not quite)      Commited_AS here seems to track closely to the sum of userspace private/shared memory discounting shared files from /proc/*/smaps. taking PSS into account also lines up. (Out of interest I get a much, much larger Commited_AS on a 32bit debian 2.6.32-5-686)               AnonPages + Mapped + Commited_AS = Userspace?     11996     + 16372  + 34304       = 62672      Slab is inline with /proc/slabinfo               Slab +  Shmem + KernelStack + PageTables = Kernelspace?     25092 + 3696  + 928         + 2428       = 32144          Userspace? + Kernelspace? = Used?     62672      + 32144        = 94816      So ~ 63M short. It strikes me that the kernel and all the modules loaded are lacking some MB's. The slab seems to cover a lot though, so if there is any missing I'm not sure if that would equate to ~ 60Mb? 63 is kinda close to the Active+Inactive figure but that doesn't feel right. So does anyone know the magic formula?? Otherwise if the figure's I am looking at are the right ones what are the grey areas in the memory allocation that I can poke about in? It appears linux ate my ram! Albeit a smaller portion than normally accused of =) **edit** Commited_AS is a guesstimate from the kernel of how much memory it would need to cover 99.9% of what it has committed, so isn't a real allocated number. AnonPages+Mapped is a component of it, so that leaves a larger hole, about 100MB now.               User + Kernel     28368 + 32144 = 60512 != 157036      AnonPages and Mapped mostly track with anon/mapped info from /proc/[0-9]*/smaps wgen taking PSS/Shared into account. The reserved areas appear to all fit into the chunk taken off total memory: Total `free` memory is 16345032Kb   Total system memory is 16777216Kb   PCI 'hole' - `lspci -v` 266520K = 16510696K   Bios Reserved - `dmesg` 92793K = 16417903K **edit2** I noticed this extra memory usage wasn't on the VM's running inside the original box the `/proc/meminfo` was from. So I started poking around seeing what was different between the two. Eventually found that an increase in total physical memory available coincided with the increase in the used memory.               phys 16GB used>144508     vm>50692      user>21500      kern>26428      u+ktot>47928     vm   64MB used>24612      vm>31140      user>14956      kern>14440      u+ktot>29396     vm  256MB used>26316      vm>35260      user>14752      kern>14780      u+ktot>29532     vm    1GB used>33644      vm>35224      user>14936      kern>14772      u+ktot>29708     vm    2GB used>41592      vm>35048      user>14736      kern>15056      u+ktot>29792     vm    4GB used>57820      vm>35232      user>14780      kern>14952      u+ktot>29732     vm    8GB used>82932      vm>36912      user>15700      kern>15388      u+ktot>31088     vm   12GB used>110072     vm>35248      user>14812      kern>15624      u+ktot>30436     vm   15GB used>122012     vm>35424      user>14832      kern>15824      u+ktot>30656      That works out to be ~ 8Mb allocated for every 1GB of memory. Might be a memory map in the kernel... but I thought that would only grow as memory is allocated rather than be setup at boot. Would be interesting to see if anyone has access to any bigmem machines if the trend continues?


title: Installing IE under linux Ubuntu 10.10

text: I want to install IE browser in ubuntu 10.10. I have done it using wine but its not working. Is there any possibility to install IE?


title: In Xorg, why do I lose my text selection in one window when I select in another window?

text: This has been bugging me for a while now, and I just figured out what conditions cause it, but I don't know why, and if there is a (desired) workaround. The cause is quite obvious when there are two windows side by side... Select text in one window, and the other window's selection becomes unselected... I _always_ work at full-screen (17" monitor), so I was a bit slow on the uptake. I assume that this has something to do with the _primary selection_ mode of X, but I don't understand, why each window can't at least keep its text _highlighted_ even it it isn't actually in the _primary_ buffer (or is the primary buffer actually the highlighted text itself?)... Programs such as Firefox manage to maintain the current "selection" under similar conditions, so it _is_ possible. Why does this behaviour of de- selection exist (at all) ? I find the primary selection to be useful, but I do use the clipboard more often (probably, because of issues like this), I wonder: is there some way to disable the X's _primary selection_ mode--if that is the only workaround.. It may be too drastic, but I'd like to try it, if it's the only way.


title: Behavior of while loop and for loop in unix script

text: I am trying to read user and server details from file `tempo.txt` and then check the disk space usage of the file system on that unix account using another script `server_disk_space.sh`.But I am not able to figure out why while loop is only working for first line and for loop is working fine.Please help me understand this. * * * Using while loop               #!/usr/bin/ksh     while read line     do     r1=`echo $line | cut -d"#" -f1`;     r2=`echo $line | cut -d"#" -f2`;     apx_server_disk_space.sh $r2 $r1     done<tempo.txt      Output               8      * * * Using for loop               #!/usr/bin/ksh     for line in $(cat tempo.txt)     do     r1=`echo $line | cut -d"#" -f1`;     r2=`echo $line | cut -d"#" -f2`;     apx_server_disk_space.sh $r2 $r1     done      Output               8     23     54     89     12      * * * Contents of `server_disk_space.sh`               #!/usr/bin/ksh     user=$1     server=$2     count=`ssh ${user}@${server} "df -h ."`     echo ${count} | awk '{print $12}' | tr -d %      Above script outputs the value of `Use percentage` of Disk Usage on any server . * * * Contents of `tempo.txt`               abclin542#abcwrk47#     abclin540#abcwrk1#     abclin541#abcwrk2#     abclin543#abcwrk3#     abclin544#abcwrk33#


title: Can i update my commands( like awk,sed) to the latest release in solaris?

text: bash-3.00# awk '{print NR}' f1.txt      1      2      3      4      but FNR does not print anything.               awk '{print FNR}' f1.txt      the above line does not gives me any output,seems that the awk that i am having in my sun os does not have FNR variable. so can i do something about it to standardize it. also, can i get a library of all latest commands and install/update my current commands like sed,sort etc. **SunOS unknown 5.10 Generic_142910-17 i86pc i386 i86pc**


title: emacs --daemon crashing after closing emacsclient -c

text: I start emacs daemon with the following commnad.               $ emacs --daemon      This seems to work. After this I start emacs client as follows               $ emacsclient -c      Whenever I close the emacsclient, the server also stops with the following error.               X protocol error: BadWindow (invalid Window parameter) on protocol request 42     When compiled with GTK, Emacs cannot recover from X disconnects.     This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715     For details, see etc/PROBLEMS.     Fatal error (6)zsh: abort        I have not found any information about this problem. Is there a way around this?


title: How to change Chrome icon in the Message Tray

text: I want the Chrome icon in the message tray to be bigger. Where is the icon file located?


title: SCP file between 2 servers that go through few servers

text: I want to copy a file from server-a to server-d but I can access server-d only from server-b and then to server-c. server-a can only access server-b, server-b can only access server-c, server-c can only access server-d.. Currently I do it like this:               server-a> scp /tmp/file.txt user@server-b     server-a> ssh user@server-b     server-b> scp /tmp/file.txt user@server-c     server-b> ssh user@server-c     server-c> scp /tmp/file.txt user@server-d      This could be through 5,6,7,.. servers Can I do this is one command?


title: Sudoedit Vim force write (update) without quit

text: I'm doing some scripting with Vim and I've just started using `sudoedit`. Problem is, when I `:w` it writes to the temp file, so any testing of the script can't happen unless I quit the editor. How can I force an update of the original, or am I missing the point of `sudoedit`?


title: Installing Firefox add-on globally without extracting the .xpi archive

text: Since the great `-install-global-extension` option was removed in Gecko 1.9.2 (for no obvious reason, as usual), copying the extension (as `root`) to `/usr/lib/iceweasel/extensions/<appid>` is now the only way out to avoid the cumbersome Windows-ish "File-Open..." procedure (which requires that `Firefox`/ `Iceweasel` is running, too)   But I want to install my extension(s) without launching the browser first. So this is the steps I did (or better, I was forced to do)   * have `myapp.xpi` ready on my storage media   * extract `install.rdf` with `unzip` and `cat` it to retrieve app ID Lastly, I do a               sudo unzip /media/wherever/myapp.xpi -d /usr/lib/iceweasel/extensions/<appid>      The `-d` option will specify the directory where to extract to (if it does not exist yet, the directory will be created). OK, **that method actually works**. But I thought this is a bit stone-age, perhaps? I _actually_ expected to only copy the `*.xpi` to the `extensions` directory and let `Firefox`/`Iceweasel` unpack it by itself. However, this does not work. I tried all of the following four variants to no avail:   * copy `myapp.xpi` to `/usr/lib/iceweasel/extensions` as-is   * copy `myapp.xpi` to `/usr/lib/iceweasel/extensions/<appid>/` as-is   * copy `myapp.xpi` to `/usr/lib/iceweasel/extensions` and rename it to `{appid}.xpi`   * copy `myapp.xpi` to `/usr/lib/iceweasel/extensions/<appid>/` and rename it to `{appid}.xpi` However, neither of said methods made the extension show up in Add-On Manager. Maybe the unpacking is mandatory under Linux? I also consulted the official "documentation", which, TBH, is abysmal. It only gives an example for Mac OS X, but not for Linux. Plus,the wording is fairly incomprehensible. Check yourself:   https://developer.mozilla.org/en-US/docs/Installing_extensions So how am I supposed to perform this installation under Linux (Debian here) _without_ unpacking the extension by hand?


title: "grep -r foo *" vs "grep -r foo ."

text: When using grep -r you could search in all files with either * or . and it seems to return the same thing but is it really the same? Let's say I search for "foo", then I could write               grep -r foo *      or               grep -r foo .      Would anyone try to explain the difference between . and *?


title: What is the use of literal command in ftp?

text: Browsing through FTP help (i.e. `ftp> ?`), showed me a command name `literal`, description of which is               ftp> ? literal     literal         Send arbitrary ftp command      I tried to do some trial and error, and following is the terminal output. All returned `500 Unknown command.`               ftp> literal check     500 Unknown command.     ftp> literal bye     500 Unknown command.     ftp> literal     Command line to send check     500 Unknown command.     ftp> literal     Command line to send ascii     500 Unknown command.      I would like to know more about this `literal` command and in what scenarios is it helpful? ### Edit Note: I am connecting a unix machine from windows 7 command prompt. And I see both `literal` and `quote` in ftp help.


title: Jump between the "if" and "fi" in vim, while editing a bash script?

text: Just like you could jump between pairs, i.e `()`, can I extend this feature to jump between beginning tags and ending tags? i.e in bash, jump between `if` and `fi`


title: How to run parallel processes and combine outputs when both finished

text: I have a bash shell script in which I pipe some data through about 5 or 6 different programs then the final results into a tab delimited file. I then do the same again for a separate similar dataset and output to a second file. Then both files are input into another program for comparative analysis. e.g. to simplify               Data1 | this | that |theother | grep |sed | awk |whatever > Data1Res.csv     Data2 | this | that |theother | grep |sed | awk |whatever > Data2Res.csv     AnalysisProg -i Data1res.csv Data2res.csv      My question is : how can I make step1 and step2 run at the same time (e.g. using &) but only launch step3 (AnalysisProg) when both are complete? thx ps AnalysisProg will not work on a stream or fifo.


title: Regex not matching

text: why this does not match..?               sed -e '/--Updated?[[:space:]]+Date/d' inputfile      this..:               --Updated Date: 2013-11-06 15:32:13      `d?` is because sometimes I have `Update Date`, and sometimes `Updated Date`. for removal? I have tried with `\s` too, not working.


title: Disable yum presto / deltarpms on a per-repository basis

text: I have a local mirror of the `fedora` and `fedora-updates` repositories, but I also use other repos such as `rpmsphere` and `rpmfusion`. For the local mirrors, my bandwidth is so fast, the deltarpms feature of yum becomes a disadvantage. So I have disabled it, but it seems to be a global setting. Is there any way to configure it on a per-repository basis?


title: Join every other column with sed or awk

text: I have a large text file (666000 colums) in the format               A B C D E F      Desired output               AB CD EF      How can we do it in `sed` or `awk`. I have tried a couple of things but nothing seems to be working. Please suggest something.


title: SSH Command behaves differently in Expect Script

text: I'm using this command on Server1               ~# ssh root@Server2 /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys      to append the contents of Server2's `id_rsa.pub` to the `authorized_keys` of Server1. It works if I do it manually but when I do it in an expect script:               #!/usr/bin/expect          set timeout 60          spawn ssh root@[lindex $argv 0] cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys          expect "yes/no" { send "yes\r"      expect "*?assword" { send "[lindex $argv 1]\r" }         } "*?assword" { send "[lindex $argv 1]\r" }     interact      What happens when I use the script is that the `id_rsa.pub` of Server2 is appended over the `authorized_keys` of Server2. What would be the correct syntax?


title: Alsa not detecting USB microphone on system boot

text: I have a USB microphone that works fine, up until I reboot my system. After that, it doesn't work at all until I unplug it and replug it. Based on my (limited) understanding of the components involved, I think that ALSA isn't detecting the mic on boot (possibly because the appropriate module hasn't been loaded during the USB scan at system boot). So, my question is, How can I either,   1. Configure ALSA to look for USB devices when it gets initialized,   2. Manually trigger ALSA to check for USB devices in a script I can run at boot, or   3. Make sure snd-usb-audio is loaded before the initial scan for devices? I'm running a modified RHEL4 distribution, if that matters. If there's more information you need, ask and I'll add it. From looking at `/var/log/messages`, here's what I see at boot with the mic plugged in:               Mar 28 08:19:04 foobar kernel: usb 6-2: new full speed USB device using uhci_hcd and address 3     Mar 28 08:19:04 foobar kernel: usb 6-2: New USB device found, idVendor=08bb, idProduct=2912     Mar 28 08:19:04 foobar kernel: usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Mar 28 08:19:04 foobar kernel: usb 6-2: Product: USB audio CODEC     Mar 28 08:19:04 foobar kernel: usb 6-2: Manufacturer: Burr-Brown from TI     Mar 28 08:19:04 foobar kernel: usb 6-2: configuration #1 chosen from 1 choice      If I later unplug the mic, I get a single line in messages:               Mar 28 15:10:52 foobar kernel: usb 6-2: USB disconnect, address 3      After boot, when I plug in the mic, I get the same output as above, but with one additional line:               Mar 28 15:11:12 foobar kernel: usb 6-2: new full speed USB device using uhci_hcd and address 4     Mar 28 15:11:12 foobar kernel: usb 6-2: New USB device found, idVendor=08bb, idProduct=2912     Mar 28 15:11:12 foobar kernel: usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Mar 28 15:11:12 foobar kernel: usb 6-2: Product: USB audio CODEC     Mar 28 15:11:12 foobar kernel: usb 6-2: Manufacturer: Burr-Brown from TI     Mar 28 15:11:12 foobar kernel: usb 6-2: configuration #1 chosen from 1 choice     Mar 28 15:11:12 foobar kernel: usbcore: registered new interface driver snd-usb-audio


title: Hosting Multiple Websites on Webmin

text: I set up a couple of Virtual Servers (websites). The problem is, does not matter what URL I use, I will always be redirected to the first one Virtual server I created. Here is the redirective text for the second website that is not working: It is the same as the first one except for the paths...               DocumentRoot /home/maoz/www     ServerName michelleandomer.com     <Directory /home/maoz/www>     allow from all     Options +Indexes     </Directory>     ServerPath /home/maoz/www      Can you guys refer me to a manual that explain what do to in order to solve this issue?


title: Ruby update not working using two methods

text: I tried to install ruby version 1.9.3 with this on my mac 10.6.8:               $ \curl -L https://get.rvm.io | bash -s stable --ruby          Oskar-Niburskis-MacBook-Pro:~ oskarniburski$ rvm install ruby-1.9.3-p362     Searching for binary rubies, this might take some time.     No binary rubies available for: osx/10.6/i386/ruby-1.9.3-p362.     Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.     Checking requirements for osx.     Installing requirements for osx.     Updating system.............................................     Installing required packages: autoconf, automake, libtool, pkgconfig, libiconv, libyaml, libffi, readline, libksba, openssl, curl-ca-bundle, sqlite3, zlib, gdbm, ncurses...     Error running 'requirements_osx_port_libs_install autoconf automake libtool pkgconfig libiconv libyaml libffi readline libksba openssl curl-ca-bundle sqlite3 zlib gdbm ncurses',     please read /Users/oskarniburski/.rvm/log/1380238189_ruby-1.9.3-p362/package_install_autoconf_automake_libtool_pkgconfig_libiconv_libyaml_libffi_readline_libksba_openssl_curl-ca-bundle_sqlite3_zlib_gdbm_ncurses.log     Requirements installation failed with status: 1.      My version:               Oskar-Niburskis-MacBook-Pro:~ oskarniburski$ ruby --version     ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin10.0]      Output of log file:               Oskar-Niburskis-MacBook-Pro:~ oskarniburski$ cat /Users/oskarniburski/.rvm/log/1380238189_ruby-1.9.3-p362/package_install_autoconf_automake_libtool_pkgconfig_libiconv_libyaml_libffi_readline_libksba_openssl_curl-ca-bundle_sqlite3_zlib_gdbm_ncurses.log     [2013-09-26 19:30:17] requirements_osx_port_libs_install     requirements_osx_port_libs_install ()      {          __rvm_try_sudo port install "$@" || {              typeset ret=$?;             rvm_warn "There were package installation errors, make sure to read the log.";             return $ret         }     }     current path: /Users/oskarniburski     command(16): requirements_osx_port_libs_install autoconf automake libtool pkgconfig libiconv libyaml libffi readline libksba openssl curl-ca-bundle sqlite3 zlib gdbm ncurses     Warning: Xcode does not appear to be installed; most ports will likely fail to build.     --->  Computing dependencies for autoconfError: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?     There were package installation errors, make sure to read the log.      And then tried to install using MacPorts, but it also did not work again. Any ideas?               Oskar-Niburskis-MacBook-Pro:~ oskarniburski$ sudo port install ruby19     Warning: Xcode does not appear to be installed; most ports will likely fail to build.     --->  Computing dependencies for ruby19Error: Unable to execute port: can't read "build.cmd": Failed to locate 'make' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?      Here is my path right now: > > /opt/local/bin:/opt/local/sbin:/usr/local/git/bin:/usr/X11/bin:/Users/oskarniburski/.rvm/bin:/usr/X11R6/bin:/Library/Frameworks/Python.framework/Versions/3.3/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Users/oskarniburski/.rvm/bin Neither of the 'which -a make' nor locate -b '\make'. The first has which command not found, and the for the latter locate:illegal option --b


title: Compiling drivers for armada 370

text: I am trying to compile usb_serial drivers for a Mirabox with armada 370. I first tried as followes :   1. Install linux source for 3.2 (running kernel is 3.2.36)   2. Install linux headers for 3.2   3. Edit the makefiles, version = 3, patchlevel = 2, subversion was 0, i edited it to 36.   4. I copyied the files from linux-headers-3.2.0-4-common to linux-headers-3.2.0.4   5. Then I copyied the usb-serial.c, options.c, qcserial.c, and serial.h, and usb_wwan.c to a subdirectory in linux-headers-3.2.0-4. Subdirectory is drivers/usb/serial   6. The makefile already exists there   7. I now cd to the linux-source-3.2, and run `make oldconfig` , followed my `make prepare`, `make scripts`, and finally `make distclean`   8. Then I come back to the header directory, and run `make M=drivers/usb/serial` However, I am being greeted with the message, that include/generated/autoconf.h or include/linux/auto.conf does not exist. So I checked, the first exists, the later does not. How can I get auto.conf to exist? Should I copy it form somewhere? The header files specially in a ffolder called linux-headers-3.2.0-4-omap has this. Please help. PS : build essencials, automake, etc already installed. Seemingly, autocong should be generated in a compilation step. which one?


title: Using localectl on Arch, Failed to issue method call: Invalid Locale data

text: Using Arch.               $ localectl status     System Locale: n/a          VC Keymap: n/a     X11 Layout: n/a      Okay cool, so I just do set locale, right?                $ localectl list-locales      en_US.utf8      ...cool, I'll use en_US.utf8                localectl set-locale en_US.utf8      Failed to issue method call: Invalid Locale data...


title: Debian Wheezy on Samsung NP900X3A some Fn Keys don't work

text: I've gone through all questions and tutorials on how to solve this problem. They weren't meant for my Laptop version but "close enough". Unfortunately they didn't help. This is the case.               # /lib/udev/keymaps/samsung-900x3a     0xCE prog1              # FN+F1 System Settings(doesn't work)     0x89 brightnessdown     # FN+F2 Brightness down     0x88 brightnessup       # FN+F3 Brightness up     0x82 switchvideomode    # FN+F4 Switch video mode     0xF9 f23                # FN+F5 Turn touchpad off     0xA0 silentmode         # FN+F6 Silentmode(doesn't work)     0xAE kbdillumdown       # FN+F7 Keyboard backlight down(doesn't work)     0xB0 kbdillumup         # FN+F8 Keyboard backlight up(doesn't work)         0x97 mute               # FN+F9 Mute     0x96 volumedown         # FN+F10 Volume down     0xB3 volumeup           # FN+F11 Volume up     0xD5 wlan               # FN+F12 WiFi(doesn't work)      * * *               # /lib/udev/keymaps/force-release/samsung-900x3a     0xCE # FN+F1 System Settings     0x89 # FN+F2 Brightness down     0x88 # FN+F3 Brightness up     0x82 # FN+F4 Switch video mode     0xF9 # FN+F5 Turn touchpad off     0xA0 # FN+F6 Silentmode     0xAE # FN+F7 Keyboard backlight down     0xB0 # FN+F8 Keyboard backlight up     0x97 # FN+F9 Mute     0x96 # FN+F10 Volume down     0xB3 # FN+F11 Volume up     0xD5 # FN+F12 WiFi      * * *               # /lib/udev/rules.d/95-keymap.rules     [...]     ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*",  ATTR{[dmi/id]product_name}=="900X3A*", RUN+="keyboard-force-release.sh $devpath samsung-900x3a"     [...]      I even copied the first 2 files to already existing ones, but it still doesn't work. Any ideas?


title: fdisk, dd, and the Rapsberry pi

text: I was trying to wipe my 4GB SD card which acts as the hard drive for the Raspberry Pi, so I went into Mac OS X Disk Utility* and `Erase`d the entire disk, and specified that the whole disk be one big FAT-32 partition. The output of `fdisk /dev/disk2`:               Disk: /dev/disk2    geometry: 975/128/63 [7866368 sectors]     Signature: 0xAA55              Starting       Ending      #: id  cyl  hd sec -  cyl  hd sec [     start -       size]     ------------------------------------------------------------------------      1: 0B 1023 254  63 - 1023 254  63 [      8192 -    7858176] Win95 FAT-32      2: 00    0   0   0 -    0   0   0 [         0 -          0] unused      3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      My question is, **why does the first partition start at 8192 sectors** , and not right after the boot sector? * _Forgive me. My`fdisk` abilities are not exactly guru-level._


title: cat echoes to serial port

text: Connecting my Windows PC to a Linux system (Wheezy) via the serial port (RS232) basically works except one problem when sending a message from the the PC terminal the Linux system. The reception of that message can be observed on the linux system using               cat /dev/ttyO1      But then that same message is echoed back to the PC terminal. I've verified that this is not due to some setting of the terminal. Also when the `cat` is aborted the messages are not echoed back any more. Could anyone give an explanation and tell me how to stop the Linux system from relaying received messages? * * * I found a solution to this by disabling the echo:               stty -F /dev/ttyO1 -echo


title: Multi Pointer Window Manager

text: I test Multi Pointer X (MPX) and I read that there is Multi Pointer Window Manager (MPWM) which has additional fetures to support MPX. The problem is that I can not find MPWM. I googled it and there are only this and Mutli- Cursor Window Manager in the search results. Where can I download MPWM?


title: How to set a ldflag for a library in home folder

text: I followed the following manual http://photivo.org/photivo/download_and_setup/linux how to compile Photivo on Sabayon: graphicsmagick 16 bit                   wget -c http://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.18/GraphicsMagick-1.3.18.tar.gz         tar xfvz GraphicsMagick-1.3.18.tar.gz         ./configure --prefix=/home/mictadlo/apps/ --with-quantum-depth=16 --enable-shared --without-lcms         make          make install      Photivo                   sudo equo install mercurial         hg clone https://code.google.com/p/photivo         qmake PREFIX=~/apps/ CONFIG+=WithGimp         make          make install      Error:                   $ photivo         Photivo version 2013-03-17 (rev 57519a52a791)         Fontconfig error: Cannot load config file "infinality/conf.d"         Fatal error: Wrong GraphicsMagick quantum depth!         Found quantum depth 8. Photivo needs at least 16.      What did I do wrong? Thank you in advance Mic


title: Editing RTF files in text mode

text: I have a bunch of CLI-only computers (I have not bothered to set up a GUI yet). I'm comfortable enough in the CLI to not NEED a GUI for most things. However, as a student, turning in Plain-Text documents really doesn't cut it. Is there a way to edit Rich Text Format (.rtf) files from a CLI without popping into a GUI? I'd just need justification (Right, Left, Center), bolding, italics, and a bit of fonts (Sometimes I need to pad my Times New Roman font to a full 13 points to reach a page limit). Heck, it could all be done manually in HTML, with a web-browser engine, and saving to the interesting .rtf font symbols instead of HTML tags. Anybody know a way for me to do this?


title: Install linux from USB without bios support

text: I have an old PC where I want to install Debian from "smaller CD" (up to 40mb, rest will be downloaded). I have made a bootable usb from this Debian. The problem is, my computer is so old that it (bios) doesn't support booting from USB.   1. **I have** some **debian CD** where I can run (rescue) shell from, but it's corrupted and I'm unable to install the whole Debian from it (fails on copying base system).    2. **I have** also **hiren's cd 14.0** which includes Parted Magic live linux with shell and other utilities    3. I am **not able to burn** any other CD/DVD. **How can** I run shell from any of these CDs and then **boot usb to run installation from it?**


title: Tmux viewport caused by multiple concurrent sessions

text: When attaching to the same tmux sessions from multiple computers using ssh and `tmux attach`, my screen looks like:               -------------------------     $>              |........                     |........                     |........                     |........                     |........     -----------------........     .........................     .........................      I was wondering if there is a command to get rid of the viewport


title: How many types of architectures and OSes

text: I am trying to write a script python script that is supposed to run across all linux based OSes. The python script invokes executables of few existing tools(for example pathload and iperf) that I have compiled and included with the script. For this purpose, I need to compile the executables to be run across all linux OSes and architectures. I have currently compiled it for 32bit and 64bit Ubuntu but it does not run on redhat system(dependency issues). Can someone give me a clue on what all popular OS types (debian based, redhat based, archlinux based and any others?) are present, so that I can compile the executables for them? Also, is there any better way of achieving this task? Let me know if I need to reword the question.


title: Perform an action when a wireless keyboard is connected

text: I need to perform a command when I connect a bluetooth keyboard. How can I 'listen' this event?


title: Is there a way to determine what services use  a specific syslog facility on RHEL?

text: I am currently logging all haproxy information to local0 and loca1 facilities (depending on message level). At the moment, logging gets properly routed to the haproxy logs 'err.log' and 'general.log', but duplicate entries also get placed in /var/log/messages I want to turn off local0.* and local1.* messages to the /var/log/messages file, but I want to make sure no other service uses these facilities. Is there a way find out which services use a specific facility on RHEL 5?


title: Script to prepend the files path to a file recursively

text: I work as a grader and files submitted to me end up in a folder named with the student's name which is itself inside a specific folder on my linux share. Currently I go through each source file and manually add a comment at the top of each file so that when I print them out I can know which files belong to which students. What I want to do is recursively go through the homework folder and as I drop down into each student folder add a comment to the top of each file in that folder using the student directory name to know what to put into the comment. This seems similar as far as adding comments at the top of the file but I'm not sure how to dynamically create the comment as I drop into each student folder. **Most recent update** Still doesn't work quite yet but here are the changes I made so you don't have to hunt for them. I made some changes:   * Single quotes in the printf statement are now double quotes since the `'` in `isn't` was terminating it early.    * Changed `-writable` to `-perm 664` writable threw an error and all the files I'm trying to change are set at 644 when they get uploaded. If you know of a better way than that let me know.   * If I understand exec correctly now $1 is undeclared (adding `echo $1` in the exec argument confirmed this) so I added `_filepath={}` and removed the `{}` at the end of the exec argument.   * Initialize `_dirname` with `_filepath`   * In the two lines using regex to isolate the directory name the double quotes weren't closed. Now the _dirname successfully holds just the name of the directory afterwards   * Now invokes ed with `_filepath` I'm pretty sure the reason it doesn't work is because of single quotes in the line invoking ed are closing the exec argument. current code:               student_head_action() {        # We can't use parameter expansion on $PWD because of recursion        local _dirname="${1%/*}"        _dirname="${_dirname##*/}"             [[ -d $1 ]] && return 0        if ! [[ -w $1 && -f $1 ]]; then           printf '%s\n' "$1 does not exist or is not writeable, skipping"           return 1        fi        ed -s "$1" <<< $'0a\n'"//${_dirname}"$'\n.\n,s/\r//g\nw'     }          student_head() {        local _file        if (( $# )); then           for _file; do              student_head_action "${_file}" || _retval=1           done        else           if shopt -qs globstar; then              for _file in **/*; do                 student_head_action "${_file}" || _retval=1              done              shopt -u globstar           else              printf "%s\n" "Globstar isn't available, attempting to use GNU find ..."              find . -type f -perm 644 -exec bash -c '                 _filepath={}                 _dirname=$_filepath                 _dirname="${_dirname%/*}"                 _dirname="${_dirname##*/}"                 echo $_dirname                 ed -s "$_filepath" <<< '"$'0a\n'"'"//${_dirname}"'"$'\n.\n,s/\r//g\nw'" \;           fi        fi        return "${_retvalue-0}"


title: Unable to connect FTP: 530 Login incorrect

text: My account has been created on a LINUX server and I am able to login through putty. I have changed my password also. But, to move a file there, I tried to connect that server through FTP client. I used **Winscp** as well as **Fireftp** both. But, there is no luck. I provided information like below"               Hostname:myhost.example.com     username:myusername     password:mynewpassword     Mode: passive     Port: 21      When I checked the port, I found that Port 21 is open on that server. Please help me about how to connect FTP successfully on this LINUX server. Where I am making mistake?


title: Free way to get financial data as Bloomberg terminal

text: I was wondering if there are some free ways (applications or programming) to get financial data (either live data, historical data or both), achieving similar function as Bloomberg terminal? Thanks and regards!


title: debug a program causing a crash gnome

text: I've found a bug when running from a browser to a page like the picture below I run into ![enter image description here](http://i.stack.imgur.com/a8hR9.jpg) And as you can see I have no choice but to logout The ability to set logging on the switch I used gdb logging.. But that gives me log This is:               Loaded symbols for /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so          0xb7719424 in __kernel_vsyscall ()     Continuing.     [New Thread 0xa751db70 (LWP 2067)]     [New Thread 0xa6d1cb70 (LWP 2068)]     [Thread 0xa6d1cb70 (LWP 2068) exited]     [Thread 0xb18feb70 (LWP 2049) exited]     [Thread 0xb07dcb70 (LWP 2053) exited]     [Thread 0xa751db70 (LWP 2067) exited]     [Thread 0xb2a65b70 (LWP 2047) exited]     [Thread 0xb20ffb70 (LWP 2048) exited]     [Thread 0xb10fdb70 (LWP 2050) exited]     [Thread 0xa8196b70 (LWP 2054) exited]     [Inferior 1 (process 2044) exited normally]      But I need to know the status registers and ... Do you have another suggestion? Hw to fix this or cause? I'm sorry for my bad English


title: Restoring a big partition to a smaller partition with Clonezilla

text: Some time ago I created a backup of an EXT4 partition with Clonezilla. Now the HDD crashed and I lost some important data. The size of the image of the partition is 50GB. I tried to restore this image to a 200GB HDD but it turned out that the size of the original partition was 500GB. Since I don't have a 500GB HDD for dumping available I figured out how to force Clonezilla to ignore it by passing `-C` to partclone. But while recovering it stopped with the error `target seek ERROR:Invalid argument`. I could imagine that the data on the partition is fragmented so that the actual bitmap doesn't fit. Is there a workaround for this? I have a HDD with about 600GB available but I don't like touching the partition table or such. Ideally would be a way to restore it to a mountable image. (ISO or such)


title: How to tell package manager that dependencies are already installed?

text: I'm running Arch Linux, and I have texlive 2013 installed from CTAN, not from repositories. Now when I try to install lilypond via pacman, it wants texlive- bin-2013.30973-7 and texlive-core-2013.31589-1 as dependencies. I guess there must be a way to point to my existing texlive, but what is it exactly? These threads ("Installing from source. How to resolve dependencies without destroying the package manager.", "Package installation and dependancies - how to prevent installation of existing libraries?") don't seem to answer my question. Do I need to involve into something like "Link a dependency in Synaptic to the one already installed from source"?


title: When does a shell get executed during the linux startup process

text: I do not understand when does a shell, lets say bash, get executed, which program runs bash initially first.


title: Looking for a yum package repository containing apache subversion

text: I'd like to be able to install Apache Subversion on Red Hat with yum. Can anyone recommend a package repository?


title: Remove directory without `rm -r`

text: How to remove non-empty directory without using `rm -r` or `find -delete` ? I think it is related `to unlink`, `perl` or `inode`


title: Imagemagick segmentation-fault

text: I statically compiled Imagemagick. Converting images works well so far. But when I run `identify -list delegate` it shows my delegates, but then exits with "Aborted (core dumped)". Here is the `strace -f` https://gist.github.com/kvz/9385813 What could I have done wrong?


title: How do I establish what IP address has been established for my server

text: For school I have to set up an Ubuntu server, I didn't have a clue as to how to go about it, so I followed a guide (video). The problem is that during the guide they demonstrated accessing it using an IP-address with a browser, they used 10.0.2.15, but that address doesn't work for me, so how do I establish what my server's IP address is, so that I can access it via a browser ?


title: What is the best way to detect (from a script) whether software is installed?

text: I've been frustrated before with differences in output from the `which` command across different platforms (Linux vs. Solaris vx. OS X), with different shells possibly playing into the matter as well. `type` has been suggested as a better alternative, but how portable would that be? In the past I've written functions which parse the output of `which` and handle the different use cases I've run into. They work across the machines I use, and so are okay for my personal scripts, but this seems terribly unreliable for software that I'm going to post somewhere for others to use. To take just one possible example, suppose I have to detect from a script whether bash and zsh are available on a machine, and then run a command with zsh if it is present, and with bash if zsh is not and bash is of a sufficient version to not have a particular bug. Most of the rest of the script could be Bourne shell or Ruby or anything else, but this one particular thing must be done (AFAIK) with either zsh or a recent version of bash. Can I count on `type` being available across platforms? Is there some other alternative to `which` which can easily and consistently answer the question of whether a particular piece of software is installed? (If you want to also give ideas specifically related to the example I gave, that's great, but I'm mainly just asking about the general case: what is the most reliable way to find out if a particular thing is installed on a given machine?)


title: Oracle 11g database startup automation on Fedora 15

text: I successfully installed Oracle 11g on a Fedora 15 system using this guide. Unfortunately, unlike when I'm using Windows, it seems I need to restart the database every single time I reboot my machine (it's a development machine, not a server). I'm not sure this is the intended behavior or if I messed up something while installing the database. Anyway, every single I reboot the machine I need to:   * Use `su` to change the current user to the `oracle` user.   * Use `sqplus` to startup the database. Like this:               (oracle@machine)$ sqplus / as sysdba     SQL> startup     SQL> (Ctrl+D)        * Then I need to start the listener using `lsnrctl`. Once more:               (oracle@machine)$ lsnrctl start         * And now the Enterprise Manager should also be started. At least:               (oracle@machine)$ emctl start dbconsole      I've taken those instructions from here. I'm sorry if this quite noobish, I usually have a DBA or a sysadmin to setup an environment for me but I'm doing this at home, where I have no help (maybe I'm becoming quite spoiled as a developer :)). I wonder if it's possible to automate this on Fedora 15 using a shell script. After automating, I'd like to hook this on the init system, so it's performed every time I start the machine.


title: Redirect both stderr and stdout to /dev/null with /bin/sh

text: Tried all sorts of ways to redirect both `stdout` and `stderr` to `/dev/null` without any success. I have almost my entire life run bash which i've never had this issue with but for once in BSD i'm stuck with `/bin/sh`. What i've tried:               if ls ./python* 2> /dev/null; then         echo found Python     fi      Which works, if Python is not present it will mute the error messages from ls. However, if `python.tgz` is present a line with be outputted which looks like this:               # ./test.sh     ./python-2.7.3p1.tgz      And i've tried:               if ls ./python* &> /dev/null; then         echo found Python     fi      and               if ls ./python* 2>1 > /dev/null; then         echo found Python     fi      and               if ls ./python* > /dev/null; then         echo found Python     fi      Nothing really works. I can only redirect one of the outputs, not both at the same time.


title: Copy input to clipboard over SSH?

text: Here's my usage case:   * I'm often connected to other computers over SSH for work and I often need to copy and paste documents/text from the server to locally running editors for writing examples and sharing text.    * Often, if the text is small enough, I'll simply copy the output from my terminal program (gnome-terminal at the moment) and paste it.   * However, when it comes to entire documents, my options are quite limited. I can either copy the document chunk-by-chunk, or `scp` it to the local machine. Is there a way to use a program such as `xclip` which will allow me to copy remote `stdin` to the local X server's clipboard? Something to the effect of:               cat myconffile.conf | sed {...} | copy-over-ssh-to-local-clipboard      would be awesome. Does something exist to make this possible?


title: Are environment variables visible to unprivileged users on Linux?

text: I'm trying to determine if, in Linux, environment variables for a process are observable by other (non-root) users. The immediate use case is putting secrets into environment variables. This is discussed in many places throughout the web as being insecure, but I haven't been able to zero in on the exact exposure point in Linux. Note that I am **not** talking about putting cleartext secrets into files. Also note that I am **not** talking about exposure to the root account (I view attempting to hide secrets from an adversary with root as a nonstarter). This question appears to address mine, with comments that classify environment variables as being completely without security, or only simply being obfuscated, but how does one access them? In my tests one unprivileged user can't observe environment variables for another user through the process table ('ps auxwwe'). The commands that set environment variables (e.g. export) are shell builtins which don't make it onto the process table and by extension aren't in /proc/$pid/cmdline. /proc/$pid/environ is only readable by the UID of the process owner. Perhaps the confusion is between different operating systems or versions. Various (recent) sources across the web decry the insecurity of environment variables, but my spot-checking of different linux versions seems to indicate that this isn't possible going back at least to 2007 (probably further but I don't have boxes on hand to test). In Linux, how can a non-privileged user observe environment variables for another's processes?


title: Changing file name from dbf to ods problem?

text: I was trying to change the file name from gdf to csv in the folder using `$for i in *.dbf; do mv $i ${i%.dbf}.ods; done` script. The code changed all the gdf to csv, but the content of the new files is diffenet from the orginal gdf file. Here are the sample files below. The file has two columns. 1_CopyRow.dbf               time,N,19,11    prec,N,13,11     19710101.00000000000    0.02072840000     19710102.00000000000    0.42218300000     19710103.00000000000    0.17756100000     19710104.00000000000    0.33698200000     19710105.00000000000    0.11057700000     19710106.00000000000    0.02841580000     19710107.00000000000    0.00000000000     19710108.00000000000    0.00000000000     19710109.00000000000    0.00000000000      the result from above code is 1_CopyRow.ods   * rma!WtimeFprecF  1.97101010000e+007 2.07284e-002 1.97101020000e+007 4.22183e-001 1.97101030000e+007 1.77561e-001 1.97101040000e+007 3.36982e-001 1.97101050000e+007 1.10577e-001 1.97101060000e+007 I want the output be file be the same as the input. I couldn't figure out how to fix the problem. Any suggestions?


title: Why do 'man' pages have many extra lines?

text: When I run the command:               man fork      There is a highlight line at the bottom that reads: > Manual page fork(2) line 52/99 (END) But when I navigate to line 53 and up to 99, these are just blank lines. Why does Linux system have these extra lines? What are their main purpose?


I muffed up my graphics card driver and/or xconfig files and decided to just reinstall Debian Linux (squeeze 6.0.6) last night. Part way through installing the base system, it failed. Sorry, I didn't write down the exact error message at that point. The last line on console 4 was > debootstrap: unknown user 'root' in state override file What do I need to do to get the installation to complete successfully? Or what resources should I look out to figure it out? Doing some research, I found this bug report ticket which looks like a very similar issue. I am installing from a CD using the graphical installer and followed all the steps up to installing the base system. I configured the mount points for my HDD partitions as follows: > sda1 - /   >  sda5 - /usr   >  sda6 - /var   >  sda7 - swap   >  sda8 - /tmp   >  sda9 - /home These are the partitions from my original installation. I only formatted sda1 during the installation. I know the information I have available is quite sparse. I'm posting this from another computer. When I have some more time, I'll get some more info from my machine. What other data do I need to diagnose the problem?


title: Ubuntu: Restore not printed document from browser cache

text: I was at work today faced with a situation where I have to prove that I did not make a mistake. Without going into detail, yesterday I generated an important document which was to be printed. For reasons of organizational oversights, I did not have access to the corporate printer, so the document was printed by another person. Before printing this document, I flashed a preview in a browser window, which now I have to get back to have proof that the document has been generated with the correct data. I have my entire operating system with all the files on my private pendrive (today got my work machine, so I worked on Ubuntu installed directly on the stick). Browser which I used was Google Chrome in the latest stable version OR Firefox available in the official repositories of Ubuntu 14.04. The document was a PDF. I made a search for all files with this type (find ~ -exec file {} \; | grep 'PDF') in my home directory, but none was found, except few unimportant documents in Downloads folder. Is there any chance to recover this document? It seems to me that the browser should keep this file somewhere in cache.


title: bmake error on Mandrive: "bmake: no system rules (sys.mk)"

text: I'm trying to use bmake to build OS161 on Mandriva. When I try to run bmake, I get the following error:               bmake: no system rules (sys.mk)      I get the same error, even when I run               bmake -m /usr/local/share/mk/sys.mk      I've checked, and the path I listed above exists, but regardless of what path I give it, even if I give it a garbage path, I get the same error. This happens no matter what directory I run bmake in, so it's definitely not an OS161 problem. Does anybody know how to fix this?


title: Can anybody help me with MYSQL not starting

text: Here is a my error log file               [localhost:local/mysql-5.5.15-osx10.6-x86_64/data] root# sudo localhost.err localhost1.err     130911 14:16:24 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data     130911 14:16:25 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive     130911 14:16:25 [Note] Plugin 'FEDERATED' is disabled.     130911 14:16:25 InnoDB: The InnoDB memory heap is disabled     130911 14:16:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins     130911 14:16:25 InnoDB: Compressed tables use zlib 1.2.3     130911 14:16:25 InnoDB: Initializing buffer pool, size = 128.0M     130911 14:16:25 InnoDB: Completed initialization of buffer pool     130911 14:16:25 InnoDB: highest supported file format is Barracuda.     InnoDB: Log scan progressed past the checkpoint lsn 6489730180     130911 14:16:25  InnoDB: Database was not shut down normally!     InnoDB: Starting crash recovery.     InnoDB: Reading tablespace information from the .ibd files...     InnoDB: Restoring possible half-written data pages from the doublewrite     InnoDB: buffer...     InnoDB: Doing recovery: scanned up to log sequence number 6489785073     130911 14:16:25  InnoDB: Starting an apply batch of log records to the database...     InnoDB: Progress in percents: 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 130911 14:16:25 - mysqld got signal 11 ;     This could be because you hit a bug. It is also possible that this binary     or one of the libraries it was linked against is corrupt, improperly built,     or misconfigured. This error can also be caused by malfunctioning hardware.     We will try our best to scrape up some info that will hopefully help diagnose     the problem, but since we have already crashed, something is definitely wrong     and this may fail.          key_buffer_size=16384     read_buffer_size=262144     max_used_connections=0


title: Does a bad sector indicate a failing disk?

text: My Ubuntu 13.10 system has been performing very poorly over the last day or so. Looking at the kernel logs, it appears that the <1yr old 3TB SATA disk is having issues with a particular sector:               Nov  4 20:54:04 mediaserver kernel: [10893.039180] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0     Nov  4 20:54:04 mediaserver kernel: [10893.039187] ata4.01: BMDMA stat 0x65     Nov  4 20:54:04 mediaserver kernel: [10893.039193] ata4.01: failed command: READ DMA EXT     Nov  4 20:54:04 mediaserver kernel: [10893.039202] ata4.01: cmd 25/00:08:f8:3f:83/00:00:af:00:00/f0 tag 0 dma 4096 in     Nov  4 20:54:04 mediaserver kernel: [10893.039202]          res 51/40:00:f8:3f:83/40:00:af:00:00/10 Emask 0x9 (media error)     Nov  4 20:54:04 mediaserver kernel: [10893.039207] ata4.01: status: { DRDY ERR }     Nov  4 20:54:04 mediaserver kernel: [10893.039211] ata4.01: error: { UNC }     Nov  4 20:54:04 mediaserver kernel: [10893.148527] ata4.00: configured for UDMA/133     Nov  4 20:54:04 mediaserver kernel: [10893.180322] ata4.01: configured for UDMA/133     Nov  4 20:54:04 mediaserver kernel: [10893.180345] sd 3:0:1:0: [sdc] Unhandled sense code     Nov  4 20:54:04 mediaserver kernel: [10893.180349] sd 3:0:1:0: [sdc]     Nov  4 20:54:04 mediaserver kernel: [10893.180353] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     Nov  4 20:54:04 mediaserver kernel: [10893.180356] sd 3:0:1:0: [sdc]     Nov  4 20:54:04 mediaserver kernel: [10893.180359] Sense Key : Medium Error [current] [descriptor]     Nov  4 20:54:04 mediaserver kernel: [10893.180371] Descriptor sense data with sense descriptors (in hex):     Nov  4 20:54:04 mediaserver kernel: [10893.180373]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00     Nov  4 20:54:04 mediaserver kernel: [10893.180384]         af 83 3f f8     Nov  4 20:54:04 mediaserver kernel: [10893.180389] sd 3:0:1:0: [sdc]     Nov  4 20:54:04 mediaserver kernel: [10893.180393] Add. Sense: Unrecovered read error - auto reallocate failed     Nov  4 20:54:04 mediaserver kernel: [10893.180396] sd 3:0:1:0: [sdc] CDB:     Nov  4 20:54:04 mediaserver kernel: [10893.180398] Read(16): 88 00 00 00 00 00 af 83 3f f8 00 00 00 08 00 00     Nov  4 20:54:04 mediaserver kernel: [10893.180412] end_request: I/O error, dev sdc, sector 2944614392     Nov  4 20:54:04 mediaserver kernel: [10893.180431] ata4: EH complete      The `kern.log` file is around 33MB mostly full of the above error repeated and the sector doesn't appear to be any different in the repeated messages. I'm currently running the following command on the now unmounted disk to test and attempt to sort out any issues the disk might have. I'm around 12hrs in and expect it to take another 24/48 hours as the disk is so large:               e2fsck -c -c -p -v /dev/sdc1      My question is: Is this drive failing, or am I looking at a common issue here? I'm wondering if there is any point to me to repairing or ignoring bad sectors and whether I should replace the disk under warranty whilst it's still covered. My knowledge of the above command is somewhat lacking, so I'm sceptical as to wether it'll help or not. **Quick update!** `e2fsck` finally finished after 2 days with lots of 'multiply-claimed block(s) in inode'. Trying to mount the filesystem resulted in an error, forcing it to drop back to read-only:               Nov 11 08:29:05 mediaserver kernel: [211822.287758] EXT4-fs (sdc1): warning: mounting fs with errors, running e2fsck is recommended     Nov 11 08:29:05 mediaserver kernel: [211822.301699] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: errors=remount-ro      Trying to read the sector manually:               sudo dd count=1 if=/dev/sdc of=/dev/null skip=2944614392     dd: reading ‘/dev/sdc’: Input/output error     0+0 records in     0+0 records out     0 bytes (0 B) copied, 5.73077 s, 0.0 kB/s      Trying to write to it:               sudo dd count=1 if=/dev/zero of=/dev/sdc seek=2944614392     dd: writing to ‘/dev/sdc’: Input/output error     1+0 records in     0+0 records out     0 bytes (0 B) copied, 2.87869 s, 0.0 kB/s      On both counts, the `Reallocated_Sector_Ct` remained 0. The drive does go into a sleep state quite often. I'm now thinking this could be a filesystem issue? I'm not 100%.


I keep getting this error, when trying to compile my `C` program in SCO (using `gcc`). I have had a look on Google, and found this other forum: Linux Questions, and that guy had the exact same issue as I am getting. So I tried his solution, which is adding a line at the top of the `program.c` file:               #include "err.h"      I tried compiling again, and now I get one line back:               program.c:5: err.h: No such file or directory        * Do I need to add / install to get that file?   * Where would this file be in my file-system? Thanks in advance. **EDIT** `vi hello.c`:               /* Hello World program */          #include<stdio.h>          main()     {         printf("Hello World");          }      `gcc -v hello.c`:               Reading specs from /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/specs     gcc version 2.95.2 19991024 (release)      /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Asystem(svr3) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__i386 -D__unix -D_SCO_DS=1 -D_M_I386 -D_M_XENIX -D_M_UNIX -D_STRICT_NAMES -D_SCO_XPG_VERS=4 -D_M_I86 -D_M_I86SM -D_M_INTERNAT -D_M_SDATA -D_M_STEXT -D_M_BITFIELDS -D_M_SYS5 -D_M_SYSV -D_M_SYSIII -D_M_WORDSWAP -Dunix -DM_I386 -DM_UNIX -DM_XENIX -D_SCO_ELF -D_SCO_C_DIALECT=1 hello.c /usr/tmp/cc1HX7yg.i     GNU CPP version 2.95.2 19991024 (release) (i386, SCO OpenServer 5 Syntax)     #include "..." search starts here:     #include <...> search starts here:      /usr/local/include      /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/../../../../i386-pc-sco3.2v5.0.5/include      /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/include      /usr/include     End of search list.     The following default directories have been omitted from the search path:      /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/../../../../include/g++-3     End of omitted list.      /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/cc1 /usr/tmp/cc1HX7yg.i -quiet -dumpbase hello.c -version -o /usr/tmp/cc4HAEHq.s     GNU C version 2.95.2 19991024 (release) (i386-pc-sco3.2v5.0.5) compiled by GNU C version  2.95.2 19991024 (release).     In file included from hello.c:3:      /usr/include/stdio.h:140: parse error before `__gnuc_va_list'      /usr/include/stdio.h:140: parse error before `__gnuc_va_list'      /usr/include/stdio.h:140: parse error before `__gnuc_va_list'


title: Mint 15 - Black Screen after GRUB w/ NVIDIA

text: Recently I bought a new PC(with Haswell i5, GTX 660). First I installed Windows on it (for dual booting) - everything works fine, then I installed Mint 15, which worked when I used it from LiveUSB, but then I rebooted to boot from my hard drive, but after I got to choose system from GRUB i just saw a black screen. I read that I could repair with adding `nomodeset` in GRUB options - I tried that only to get a bit further and see something which looked like an empty console window but I couldn't type anything in it. As I already mentioned I use Nvidia card which I connect to my monitor via HDMI (which works great on Windows). I tried booting into recovery mode to install nvidia-current, but had few problems which I've dealt with. Now I can't seem to get internet connection working in recovery mode to download those drivers(when I select an option for internet connection in the recovery mode menu it says a couple of times that it tries to open port something and after that it says "port something closed" and as a result I can't get my drivers -> can't use Linux :(. My PC's connected to the router via cable. Any solutions?


I've just started configuring Nagios from scratch, and I'm new at this. I've been getting this error after adding `objects/printer.cfg`               Error: Could not find any hostgroup matching 'allhosts'     (config file '/etc/nagios3/objects/printer.cfg', starting on line 1)         Error processing object config files!      And this is the content of the `printer.cfg`               define host{             use             generic-host            ; Inherit default values from a template                 host_name       Printer_klen    ; The name we're giving to this printer                 alias           Printer_klen    ; A longer name associated with the printer                 address         10.1.0.45       ; IP address of the printer                 hostgroups      allhosts        ; Host groups this printer is associated with                 }          define service{                 use                     generic-service         ; Inherit values from a template                 host_name               Printer_klen            ; The name of the host the service is associated with                 service_description     Printer Status          ; The service description                 check_command           check_Printer_klen!-C public    ; The command used to monitor the service                 normal_check_interval   10      ; Check the service every 10 minutes under normal conditions                 retry_check_interval    1       ; Re-check the service every minute until its final/hard state is determined                 }          define service{                 use                     generic-service                 host_name               Printer_klen                 service_description     PING                 check_command           check_ping!3000.0,80%!5000.0,100%                 normal_check_interval   10                 retry_check_interval    1                 }


title: Fedora primary monitor selection

text: I have machine with Fedora Linux (Schroedinger's cat) 19 with AMD Radeon HD 6800 graphic card. Now, I have monitor plugged in using DVI port and I have TV connected using HDMI port. When machine is booting, the TV is automatically selected as primary screen, but I would like to have my Monitor (DVI port) selected as primary screen and TV (HMDI port) as secondary screen. How do I tell that to Fedora?


title: Installing Chrome on 64bit Gentoo without Superuser Access

text: For a bit of background, I am trying to install Chrome (or Chromium) on to a gentoo user account at my university. We are allowed to install software as we like, however we lack superuser access meaning I cannot just run `emerge google-chrome`. Attempting to unpack the 64-bit .rpm provided by google and run it out of my user directory provided me with this:               $ ./chrome/google/chrome/google-chrome     ./chrome/google/chrome/google-chrome: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory      I don't have access to `rpm2cpio` (rendering the only other answer I could find less than helpful) but I do have access to `rpmunpack` and a whole host of `rpm2[insert archive type here]` commands.


title: Reading from a continuously changing logfile

text: There is `/location/of/thefile`, which is a continuously changing logfile. The average density of refreshes is 4 per minute, the possible maximal refresh rate could be 30-40 per minute. Every refresh adds 2-5 lines (average), but it could be hundreds in extreme cases. Every line begins with a `[YYYY-MM-DD HH:MM:SS]` timestamp followed by plaintext (100-200, max. a few hundred characters). My task is to construct a **simple command** which continuously watches this logfile, and sends to the stdout every lines that contain the `foo` _OR_ `bar` alphabetical strings. Before and after those (sub)strings there could be any characters (`\n` only after the (sub)string, of course), even `\0`. The capitalization of the words could be all of the possible variations. Well, my ideas for the solution always contain syscalls for the timing, but I shouldn't use them. Please construct me a **simple command**. Thanks a very lot!


title: How to copy between two remote hosts using tar piped into SSH from remote server when behind a firewall?

text: I'd like to transfer a directory between two servers, but compress the directory on the remote host before transfer, and then uncompress to another host. I'm sure it's possible to pipe everything all the way through and do it in a one liner. I realise it would be better of course if I could transfer between the hosts directly but that would involve transferring keys and what not, and I love Unix one line power tools. I'm sure people can come up with a few different ways to do this. I'm looking for the shortest syntax and most bandwidth conservative. To start off I have               ssh -n REMOTEHOST 'tar zcvf - DIRTOCOPY' | localZip.tar.gz


title: Timing out in a shell script

text: I have a **shell script** that's **reading from standard input**. In rare circumstances, there will be no one ready to provide input, and the script must **time out**. In case of timeout, the script must execute some cleanup code. What's the best way to do that? This script must be **very portable** , including to 20th century unix systems without a C compiler and to embedded devices running busybox, so Perl, bash, any compiled language, and even the full POSIX.2 can't be relied on. In particular, `$PPID`, `read -t` and perfectly POSIX-compliant traps are not available. Writing to a temporary file is also excluded; the script might run even if all filesystems are mounted read-only. Just to make things more difficult, I also want the script to be reasonably **fast** when it doesn't time out. In particular, I also use the script in Windows (mainly in Cygwin), where fork and exec are particularly low, so I want to keep their use to a minimum. In a nutshell, I have               trap cleanup 1 2 3 15     foo=`cat`      and I want to add a timeout. I can't replace `cat` with the `read` built-in. In case of timeout, I want to execute the `cleanup` function. * * * Background: this script is guessing the encoding of the terminal by printing some 8-bit characters and comparing the cursor position before and after. The beginning of the script tests that stdout is connected to a supported terminal, but sometimes the environment is lying (e.g. `plink` sets `TERM=xterm` even if it's called with `TERM=dumb`). The relevant part of the script looks like this:               text='Éé'  # UTF-8; shows up as ÃÃ© on a latin1 terminal     csi='␛['; dsr_cpr="${csi}6n"; dsr_ok="${csi}5n"  # ␛ is an escape character     stty_save=`stty -g`     cleanup () { stty "$stty_save"; }     trap 'cleanup; exit 120' 0 1 2 3 15     # cleanup code     stty eol 0 eof n -echo                # Input will end with `0n`     # echo-n is a function that outputs its argument without a newline     echo-n "$dsr_cpr$dsr_ok"              # Ask the terminal to report the cursor position     initial_report=`tr -dc \;0123456789`  # Expect ␛[42;10R␛[0n for y=42,x=10     echo-n "$text$dsr_cpr$dsr_ok"     final_report=`tr -dc \;0123456789`     cleanup     # Compute and return initial_x - final_x      How can I modify the script so that if `tr` hasn't read any input after 2 seconds, it is killed and the script executes the `cleanup` function?


title: Video Watermarking

text: I am looking for a solution in which I can add watermark to the given video at given frame. Is there any utility/tool to do so ?


title: Memory management principle used by Linux

text: Is memory management in the Linux Kernel done using paging or segmentation or both?


title: Escaping quotes in zsh alias

text: Following on from this question about stripping newlines out of text, I want to turn this into a zsh alias as follows:               alias striplines=' awk " /^$/ {print \"\n\"; } /./ {printf( \" %s \",$0);}"'      I've tried escaping the quotes inside the awk script, but I'm getting this error:               awk: (FILENAME=bspsrobustness FNR=1) fatal: division by zero attempted      (The file is called `bspsrobustness`) Is there a way to do what I want? I suppose I could turn this into an awk script rather than a zsh alias, is that my best option?


title: List optional dependencies with pacman on arch linux

text: I'm using arch linux. Is there a way to list optional dependencies of all installed packages? And if yes, can I filter this list to see only the missing (not installed) packages?


title: Avoid a prompt about change file mode in a Vim script

text: I'm trying to make every file that start with shebang to be executable by default, so I use the following line in my vimrc, `au BufWritePost * if getline(1) =~ "^#!" | silent !chmod a+x <afile>` VIM asks me if I want to reload everytime I write the file: ![enter image description here](http://i.stack.imgur.com/R8Xql.png) Any way to avoid that?


title: How to use `which` on an aliased command?

text: Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance,               alias vim='vim -X'     alias grep='grep -E'     alias ls='ls -G'      The problem is that if I want to use `which` to see where my `vim`/`grep`/`ls`/etc is coming from, the alias gets in the way:               $ which vim     vim: aliased to vim -X      This is useful output, but not what I'm looking for in this case; I know `vim` is aliased to `vim -X` but I want to know where _that_ `vim` is coming from. Short of temporarily un-defining the alias just so I can use `which` on it, is there an easy way to have `which` 'unwrap' the alias and run itself on that? **Edit:** It seems that `which` is a shell-builtin with different behaviors across different shells. In Bash, SiegeX's suggestion of the `\--skip-alias` flag works; however, I'm on Zsh. Does something similar exist there?


title: Find where a bash command is defined or sourced from?

text: Sometimes I want to know what a command I type into `bash` actually evaluates to. Usually I can figure out the location of the executable very easily with `which`.               $ which vim     /usr/bin/vim      But what if I've created an alias for `vim`?               $ alias vim="echo mwahaha"     $ which vim     /usr/bin/vim      Hmm, not good. If I suspect something and want to check if `vim` has been aliased, I know I can type               alias vim      ... but if I had an `alias vim='vim -p'`, I would never actually think to check `vim` aliases because it would still work just fine. How can I know exactly what a specific command in `bash` is being evaluated to?


title: Print/Tee to console without passing output to pipe

text: Is there a way to print or tee one thing to the console and still pass something else through to the next pipe? Something like:               echo dog | printOrWhatnot "PUTTING MY THING DOWN" | sed 's/dog/cat/g' | printOrWhatnot "FLIP IT"|rev      that would result in:               PUTTING MY THING DOWN     FLIP IT     tac      **EDIT:** This should also work with multiline input:               printOrWhatNot() {...}          seq 10 30 |printOrWhatNot searching for 3s | grep 3      would output               searching for 3s     13     23     30      Lars' answer seemed to only pass along the first input (here it would be `10`) Also ideally the output would come inline during processing which wasn't what I was seeing with Glen's answer. So               seq 10 30 |tee /dev/tty |printOrWhatNot searching for 3s | grep 3      would make for:               10     11     12     13     14     15     16     17     18     19     20     21     22     23     24     25     26     27     28     29     30     searching for 3s     13     23     30


title: Boot linux bootloader from Mac OSX

text: Recently I was running Fedora 17 on my computer which was an HP windows based machine. Unfortunately my computer has a malfunctioning motherboard and will no longer turn on. I removed the hard drive and using a hard drive enclosure I plugged into my backup machine ( Macbook Pro ) hoping I could boot the hard drive from it. Unfortunately the Mac's EFI does not recognize the hard drive as bootable. I'm no linux sysadmin or mac expert. Basically my question is, is there a way I can boot my hard drive which contains a Fedora 17 partition with Grub 2 as the bootloader and a few other linux distros from my MacBook Pro ?. Any help is greatly appreciated. Thanks.


title: How do you increase MAXSYMLINKS

text: In a python script, I am creating a bunch of symbolic links chained together. example: link1->link2->link3->.......->somefile.txt I was wondering how you can change the max number of symlinks to be greater than 20?


title: Does SELinux provide enough extra security to be worth the hassle of learning/setting it up?

text: I recently installed Fedora 14 on my home pc and have been working on setting up different server related features such as apache, mysql, ftp, vpn, ssh, etc. I ran extremely quickly in to a barrier it felt like when I discovered SELinux which I had not priorly heard of. After doing some research it seemed as though most people were of the opinion that you should just disable it and not deal with the hassle. Personally if it really does add more security I'm not opposed to dealing with the headaches of learning how to appropriately set it up. Eventually I plan on opening my network up so that this pc can be access remotely but I don't want to do that until such time as I'm confident that its secure (more or less... lol). If you have set it up and gotten it functioning correctly do you feel that it was worth the time and hassle? Is it really more secure? If you have opted out of using it was that decision founded on any research worth considering in my situation as well?


title: How to make scp respect umask

text: My `scp` doesn't respect **umask** setting of the user it's sending files to. Is there a setting somewhere or should I use a different solution?


title: How to send a prompt to a remote machine like the "you have mail", ie not using wall

text: I am currently using wall to show a message on a remote machine when an activity is started and finished. But this is intrusive, as it will write across an editor they might have open etc. What I like is the "you have unread mail message" that shows up on the next line if the user presses return on the terminal. What is this, and how can I interact with it remotely?


title: Can the shell warn me if a program is waiting for standard input?

text: Let's say I want to search for a string in a big file: `grep foo bar.txt | less`, but I actually type `grep foobar.txt | less`. Now, `grep` is waiting for me to type something on the terminal. It appears that the command is taking forever, until I notice my mistake. Can the shell (any shell, or perhaps tmux) detect that a command is waiting for console input, and warn me? **Edit:** It seems like each process has a standard input, and the shell has no way of knowing if it's actually waiting for something to arrive there. However, shells like `zsh` know the command line arguments for common commands like `grep` and could therefore warn me for the programs it knows. (`grep f``Tab` does not try to complete anything, `grep foo b``Tab` will try to complete the filename.)


title: File permissions when transferring to another server

text: If I was to `chmod 777 blah.sh` on server A and then move it to server B, would it retain the permissions, or would it default to some other permissions once it hit server B?


title: Create a series of increasingly larger files

text: I need to test an sftp host for its cutoff of file size upload limitation. I wanted to make a series of files that were of increasingly larger sizes, to try to upload them all and see where they failed. I was doing `for i in {10000..100000} ; do dd if=/dev/zero of=testfile$i bs=$i count=1 ; done ;` but that was taking too long, and the files I was getting were starting at 10K, going to 11K, 12K, etc. I want the size to jump in larger increments. How can a make a series of files that won't have such a fine-grained size difference? I'm thinking the limit is between 0 and 1 MB.


title: How to get back sudo on Ubuntu?

text: I have done this:               sudo chown -R myname /usr/      and now I can't use the `sudo` command because of this error: > sudo: must be setuid root And as I read this means that the owner of this file `/usr/bin/sudo` is not the root. It's my user now because of the chown on the `/usr` folder. On many forums and blogs people suggest to do this as root:               # chown root:root /usr/bin/sudo     # chmod 4111 /usr/bin/sudo      ...but the problem with this is that I need to log in as a root, but I can't because If I write `su` in the terminal the password is wrong (actually I use the password what I added to my user):               $ su     Password:     su: Authentication failure      So can I get back the `sudo` command? Edit: My Ubuntu is under Paralells on my Mac OS X.


title: Reduce redundant logfile

text: I often have longer redundant log files, redundant in the sense that blocks of text repeat with minor changes. The length of the files makes it difficult to spot the actual information. I had the idea to write a script which identifies recurrences and reduces the file by replacing each recurrence by the output of diff for consecutive blocks. Before I start I would like to know if such a tool (or maybe option to diff) already exists.


title: How to check if IPv6 is enabled on a Debian Linux?

text: Can one disable the IPv6 stack on Debian Linux, especially Wheezy? If so how do I know if it's disabled on a system?


title: Writing /dev/random to file?

text: If you ran the following, what would happen?               cat /dev/random > ~/randomFile # don't run      Would it be written until the drive runs out of space, or would the system see a problem with this and stop it (like with an infinite symlink loop)?


title: How can I manage an oversensitive touchpad?

text: For the most part, I love my new Dell Latitude E6510. However, the touch pad is driving me mad. It's so sensitive that it will respond to my hands being _near_ it, without actually touching it, if they are warm as when I come in from outside or finish doing dishes. Typing is very difficult because I keep sending the mouse off on unintentional clicks and movements. I tried disabling the touchpad entirely, but I don't always have a surface to mouse on, and the eraser mouse isn't doing it for me. I'd like to find a better way to deal with the problem -- possibly by decreasing touchpad sensitivity, having it turn off while typing and back on while not typing, or turning it on/off with a key combination. I'm open to other ideas, too, if I've overlooked something. I'm running Funtoo stable. My WM is XFCE4.


title: MATLAB install fails: Error extracting tbx.signal.common!

text: I'm trying to run MATLAB R2008b student on my Fedora Linux machine, but get the following after I run `/.install`:               Error extracting tbx.signal.common!!!      How can I solve this issue?


title: CentOS5, RHEL5, Java dependent Packages, Alternate JVM/JDK

text: Specifically regarding Java dependent packages, such as ant. Is it possible to install them via rpm, when using an alternate JVM/JDK? For example, If I install the Oracle JDK, can I use an ant package without installing OpenJDK? Is there anyway this can be done from an RPM? I know I can specify which JDK to use, by executing `update-alternatives --config java`. Additionally I'm specifying a JAVA_HOME, which works as expected. The only available choices seem to be, keeping 3 different JDK's installed, or installing everything manually.


title: Installed CentOS, Now There is No Windows 8 Options on Restart

text: I bought a new PC with Windows 8 and wanted to dual-boot linux. I shrank the partition by 50GB in windows, then installed CentOS from a live CD. CentOS is working fine, but I can't boot into Windows 8 any more. My Grub options are CentOS and "other" -- when I select "other" it basically says windows cannot boot properly. I don't believe anything has been overwritten on the Windows 8 partition, but the boot sequence is out of whack. How should I go about troubleshooting this?               [root@localhost]# parted -l     Model: ATA ST500DM002-1BD14 (scsi)     Disk /dev/sda: 500GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End     Size    File system  Name                          Flags      1      1049kB  525MB   524MB   fat32        EFI system partition          boot      2      525MB   567MB   41.9MB  fat32        Basic data partition          hidden      3      567MB   701MB   134MB                Microsoft reserved partition  msftres      4      701MB   1215MB  514MB   ntfs         Basic data partition          hidden, diag      5      1215MB  436GB   435GB   ntfs         Basic data partition      7      436GB   437GB   524MB   ext4                                       boot      8      437GB   488GB   51.0GB                                             lvm      6      488GB   500GB   12.6GB  ntfs         Microsoft recovery partition  hidden, diag               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/vg_centos6-lv_swap: 4027MB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End     Size    File system     Flags      1      0.00B  4027MB  4027MB  linux-swap(v1)               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/vg_centos6-lv_root: 47.0GB     Sector size (logical/physical): 512B/4096B     Partition Table: loop          Number  Start  End     Size    File system  Flags      1      0.00B  47.0GB  47.0GB  ext4


title: In bash, how can I convert a Unicode Codepoint [0-9A-F] into a printable character?

text: I have a list of Unicode codepoints, but I don't know of a "simple" way to convert these hex values into the actual characters they represent... I've heard that _zsh_ has `echo -e '\u0965'`, but I use _bash_ Is there something as simple as the zsh method, for bash?


title: light weight disk based backup solution

text: Currently I am using Dirvish to backup a handful remote machines, both Linux and Windows to local disks. But Dirvish hasn't seen any updates for many years and it has a couple of small annoyances (e.g. deleting the last successful backup when it expires by age). Dirvish features I currently use include (and thus require):   * pre-client - to dump databases to flat files on remote system   * post-server - for basic analysis of changed files in backup set   * connect to remote clients using rsync over ssh Are there any alternatives for Dirvish available that are actively being maintained? Now I did a Google search myself and I did find one alternative, but I am looking for your _experience_ ; does the package work for you and why?


title: Linux hardware: Apple Magic Track Pad Alternatives

text: I'm using Linux as my main OS for few years. Before month or so, i tested apple magic track pad and i loved it since i am using laptop touch pad more than a mouse, it requires less movement of hand and it replaces the mouse perfectly up the point you need to draw something. So i tried to find alternatives to it (dell or some other companies since apple production is overpriced), no luck. Any suggestions? My problems:   * I'm not sure if that hardware will work under Linux (Ubuntu, SuSE, Fedora, Arch, etc.).   * Will Linux have full support to that device (multi-touch, gestures, etc.).   * I don't want to use unknown/low quality hardware.   * I will probably need to ship it. There fore local shop-lists won't help. Since my _main_ concern is related to working under Linux and not enough data under such devices i posted this question here.


title: Installing Linux on an external hard drive and multibooting with Windows 7/8

text: I want to multi boot Linux (Fedora 19) with my two machines which use Windows 7 and 8. The Windows7 is a desktop, and the laptop is a Windows 8 machine. I used my desktop to install Fedora 19 on the external drive. I can boot Fedora from the desktop but not the other machine. To be clear the portable machine can boot from USB hard disk, I've checked the BIOS. I found that an easy way to boot Linux or any other OS is using an OS independent boot manager. I downloaded Boot-US and tried it out. However when I load it up and it shows the disks it says my desktops primary internal HDD is bootable. The other one, the external disk does not. I checked the help section for the program (specifically Linux Tip (2)) and it required that I edit Lilo. The problem is I am just a newbie to Linux. I know Fedora 19 uses Grub 2 in place of Lilo and I wouldn't know how to safely edit either boot loader anyway. Could somebody help me install this OS to my external Hard Disk and still be able to boot from that when on my desktop OR laptop? [edit] I have a UEFI BIOS on both the desktop and the laptop. I installed Fedora 19 to the external hard disk by use of a LiveDVD. To the contrary of what the comment below says Boot-US should be able to boot from almost anything. It recommends that you try your first boot from a diskette (something nobody uses anymore) or a CD. It can also be installed to the MBR on the Hard Disk but that could make the system impossible to boot if done wrong if I am correct in remembering.


title: Running Tomcat MySQL and Apache under a group

text: I am trying to set up a web server at home using Ubuntu, but prefer my bash scripts to be platform agnostic hence why I am asking here. I also dislike apt-get everything. I am trying to create a single bash script to quickly rebuild my server or possibly use with VM's It is my understanding that any services with open ports can pose security risks if run as 'root' to avoid this I have created a `serviceadmin` group and for each service I create a user similar to:               useradd lamppadmin -g servicepadmin -s /sbin/nologin         useradd tomcatadmin -g servicepadmin -s /sbin/nologin      I then install the needed services and restrict their permissions and files accordingly. Given that I am most likely to add more services to this group, I would like to know how one launches multiple service to "run as" group or each individual service as the appropriate user. I always symbolically link launch commands to `/usr/bin`so that I am able to run them from anywhere. So I am just looking for an example to target `lampp start` as an example where it needs to interact with files that belong to user `lamppadmin` or `serviceadmin` group


title: What does %F mean and how can I stop it meaning it?

text: On an rxvt-clone (I'm using `rxvt-unicode` but it seems to happen on plain, old `rxvt` as well), the sequence of characters `%F` seems to have some sort of special meaning (as do a few others, such as `%S`). In particular, I get the following:               % date +%F               38;5;0m2011-04-02     % date +%F--%H.%M.%S     38;5;0m--.Hostname.2011-04-02--22.25.59      with the text after the `m` being in some dark almost-black colour. Due to my colour scheme (mauve text on a dark blue polka dot background), this is almost unreadable. What is this, and more importantly, how do I get it to stop? To show why it is particularly annoying, my lecture documents have the date as part of their name. It is therefore quite convenient to be able to write:               xelatex lecture.beamer.$(date +%F).tex      since I can store that in my history and recall it with a few judicious TABs. However, the ensuing output is all the inverse of a whiter shade of pale, making it hard to see if there's an error. In case it makes a difference, my shell is `zsh`.


title: How to numerical sort by last column?

text: I have this input:               sdkxyosl 1     safkls 2     asdf--asdfasxy_asd 5     dkd8k  jasd 29     sdi44sw 43     asasd afsdfs 10     rklyasd 4      I need this output:               sdi44sw 43     dkd8k  jasd 29     asasd afsdfs 10     asdf--asdfasxy_asd 5     rklyasd 4     safkls 2     sdkxyosl 1      So i need to sort the lines by the last column. I don't know how many columns are in one line. I just can't figure it out, how to do it. I don't have "perl powers". I just have ~average scripting powers with sed, awk, cut, etc.. Does somebody know how to do it?


title: Mark occurrences of keyword with a different color

text: I have a program which spits out an output to `stdout` like:               [OK]      Something is ok     [OK]      Something else is also ok     [FAIL]    This does not look good     [FAIL]    Neither does this     [OK]      At least this is fine      To more easy spot the fails from the output I would like to mark the occurrences of the keyword `FAIL` with red _without_ discarding the other messages. It would be nice if I could also highlight the `OK` keywords with green :). Doing a pipe to `egrep --color FAIL` will only show the lines where the `FAIL` keyword is present.


title: Can't delete symbolic links, permission denied

text: I try to delete all symbolic links pointing to Python3.2 with               sudo ls -l . | grep '../Library/Frameworks/Python.framework/Versions/3.2' | awk '{print $9}' | xargs rm      This just gives               rm: 2to3: Permission denied     rm: 2to3-3.2: Permission denied     rm: idle3: Permission denied     rm: idle3.2: Permission denied     rm: pydoc3: Permission denied     rm: pydoc3.2: Permission denied     rm: python3: Permission denied     rm: python3-32: Permission denied     rm: python3-config: Permission denied     rm: python3.2: Permission denied     rm: python3.2-32: Permission denied     rm: python3.2-config: Permission denied     rm: python3.2m: Permission denied     rm: python3.2m-config: Permission denied     rm: pythonw3: Permission denied     rm: pythonw3-32: Permission denied     rm: pythonw3.2: Permission denied     rm: pythonw3.2-32: Permission denied      What gives? Ps. there are similar threads, but there the answer/solution is that the asker did not use sudo.


title: How to remove a USB drive without worry if its been unmounted?

text: Sometimes I unplug my usb drive only to find out files were not written to it. I suppose the only way to ensure files are written to it is to right click on the USB drive on the desktop and then select "un-mount", but sometimes I forget. What is the best way to ensure files are written to the USB drive instantly? This way I can remove the USB drive as soon as I notice the LED light on the USB drive stopped blinking. OS: CentOS 6


title: SNAT problem in iptables

text: I am trying to reroute traffic from specific devices in my house over openvpn. For this, I've created an OpenVPN tunnel between my house wifi router and my server. Here is my setup:               Wifi router's outgoing interface IP: 192.168.1.102     Wifi router's openvpn tun0: 10.8.0.2     Server's openvpn tun0: 10.8.0.1          My PC                   WiFi                                          Server                                   ,- 10.8.0.2(tun0)    10.8.0.1(tun0) --.                                  |                                      |  _      __  _                       '                 .-,(   ),-.          ' |-|     [__]|=|    wireless     ___|_      VPN      .-(           )-.   VPN   |=|     /::/|_|  <- - - - - >  [__...]  < - - - >  (    internet     ) < - >  |=|                               .                 '-(          ).-'         "^"                               |                    '-.(  ).-'                               `-- 192.168.1.102      Server's iptable configuration:               iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE     iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED, ESTABLISHED -j ACCEPT     iptables -A FORWARD -i tun0 -o eth2 -j ACCEPT      Wifi router's configuration (with a new routing table openvpn-route):               ip route add default via 10.8.0.1 dev tun0 table openvpn-route     ip rule add fwmark 0x1 table openvpn-route     iptables -t mangle -A PREROUTING -m mac --mac-source aa:aa:aa:aa:aa:aa -j MARK --set-mark 1     iptables -A POSTROUTING -t nat -o tun0 -p tcp --dport 80 -j SNAT --to 10.8.0.2      Now whenever I access sites from my laptop, I see traffic going to wifi router's tun device and from there to the server. However, the SRC IP address of the traffic is 192.168.1.102 (outgoing interface IP of the wifi router). Because of this, I think the server ignores this traffic. When I look at how many packets matched SNATing rule to change SRC IP to 10.8.0.2, I see that count as zero. So that rule is not getting matched for any packet. How can I fix this?


title: iptables change log

text: Somehow an iptables rule was added to one of my systems. Does (or can) iptables keep a log about when and (maybe) who made a rule change? If iptables itself can't, is there a wrapper that might do that? I know sudo logs commands, but once someone does "sudo su -", that is the end of that.


title: Gnome 3.6.1 doesn't work with startx anymore, only with gdm

text: I normally prefer my system to boot in text mode and manually start Gnome with startx but if I do that with Gnome 3.6.1, I get many errors and a basically unusable operating system. After installing gdm however, Gnome works perfectly fine again. Why is that and how can I return to my startx? Detailed explanation: I use archlinux and after a system update this morning (2012-11-1) with `pacman -Syu` which upgraded my Gnome to 3.6.1 I could not successfully boot Gnome 3 anymore. The graphical user interface was there but there was an error message like "There was an error, all extensions are deactivated" and I could not focus windows other then the first one created and the window title bars at the top were not there anymore. I changed my .xinitrc from `ck-launch- session gnome-session` to `exec gnome-session` because I've read somewhere that this is necessary now but I got exactly the same error. Only after installing gdm and I think enabling it with `systemctl enable gdm` does Gnome work correctly again.


title: Monitor history of USB flash drives

text: I have to setup a monitoring system for our internet server, to monitor which USB Flash Drives (Pen Drives) are mounted and unmounted and when.(This is to avoid misuse, and to capture which unauthorized device is/was connected.) Is there any method to monitor flash drive information such as : a) Serial Number, b) Make, c) Model, d) Capacity e) Label f) Time of mount/unmount etc., and store it, to view history about it? I know there are number of commands to monitor currently mounted USB devices. Like `lsusb`,`lshw`. But how do I store that information.