title: Need to ssh from one Amazon EC2 server into another one

text: Basically I need to be able to connect from one EC2 instance to another using SSH. I run the command `ssh -i path-to-pem-file ec2-user@dns-address-of- ec2-instance`, and it times out. I set my security group to allow SSH inbound from the public IP address of my second EC2 instance, but it still doesn't work. I know that everything should be fine because when I set my SSH inbound traffic to "allow from anywhere" I can connect with no problems. Also I can connect to the EC2 instance from a home machine (I added my IP address to the security group) without any problems. Obviously I can't leave my inbound traffic open to "allow from anywhere", but I can't seem to connect when I limit it to just the IP address of the second EC2 instance. Maybe the public IP address isn't what I should be putting into the security group? * * * I can't seem to ping it either; it just times out. Here is the result of `ssh -vv -i path-to-pem-file ec2-user@dns-address-of-ec2-instance`               OpenSSH_6.2p2, OpenSSL 1.0.1h-fips 5 Jun 2014     debug1: Reading configuration data /home/ec2-user/.ssh/config     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 50: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to dns-address [IP Address different from public ip] port 22.     debug1: connect to address [IP Address different from public ip] port 22: Connection timed out     ssh: connect to host dns-address port 22: Connection timed out


title: Apache Virtual Host Include Not Working

text: Attempting to get my domain to redirect to the associated vitual hosts, but the Include is not working as expected and displaying the proper htdocs directory. It is still displaying the default apache directory. I have added the following line to my httpd.conf file with no additional changes:               Include vhosts.d/*.conf      My httpd folder contains a "vhosts.d" directory containing the following file and content: **mysite.conf**               <VirtualHost *>         DocumentRoot "/srv/vhosts/mysite.com/htdocs"         ServerName mysite.com         <Directory "/srv/vhosts/mysite.com/htdocs">             allow from all             Options +Indexes         </Directory>     </VirtualHost>      CentOS release 6.5 (Final) Server version: Apache/2.2.15 (Unix) Server built: Apr 3 2014 23:56:16 httpd.conf file


title: Get bash DEBUG trap to execute only once for and/or lists?

text: Suppose I set a trap on `DEBUG` like so:               unset PROMPT_COMMAND # don't want $PROMPT_COMMAND triggering DEBUG trap     trap 'printf %s\\n "most recent history line: $(history 1)" >&2' DEBUG      If I do a simple command, then it prints my command to stderr:               $ echo foo     most recent history line:   483  echo foo      However, if I run an and/or list, the `DEBUG` trap is invoked multiple times, once per list command executed:               $ echo foo && echo bar     most recent history line:   483  echo foo && echo bar     foo     most recent history line:   483  echo foo && echo bar     bar      Is there a way I can get the `DEBUG` trap to execute only once per command (simple or otherwise) entered at the prompt? If not, what is the best way for my trap code to detect whether it has already executed since the last time the prompt was drawn?


title: Command line to return to the GUI after Ctrl-Alt-F1?

text: I'm unable to return to the GUI with `Ctrl-Alt-F7` (or any of the 12 function keys). I have some unsaved work and I don't want to lose them. **Are there any other key combinations that will allow me to switch back?** Here is what I did:   1. I pressed `Ctrl-Alt-F1` and it showed a text-based login screen as usual   2. Then I pressed `Ctrl-Alt-F7` and it showed a screen full of text (I can't remember what they were)   3. Then I pressed `Ctrl-Alt-F8` and it showed log messages that resembles `/var/log/messages`. Some entries are from `automount`, some from `sendmail`, and none are errors.   4. Pressing any of the `Ctrl-Alt-Fn` combinations now has no effect. The cap-lock and num-lock LED no longer respond to their corresponding keys. I can use the mouse to highlight the text on the screen, but nothing else. Any idea what happened? I can still login to the system via SSH. GUI applications that I was using (e.g. `opera`) are still running and consuming tiny amounts of CPU as usual, as reported by `top`. **Is it possible to switch back to the GUI via the command line?** If possible, I don't want to restart X, because doing so will kill all the GUI applications. System info:                Red Hat Enterprise Linux Client release 5.7      Linux 2.6.18-238.12.1.el5 SMP x86_64      gnome-desktop: 2.16.0-1.fc6      xorg-x11-server-Xorg: 1.1.1-48.76.el5_7.5      * * * Thanks to Shawn I was able to get back using `chvt 9`. Further experiments shows that if I go to the 8th virtual terminal (either by `Ctrl-Alt-F8` or `chvt 8`), I will not be able to switch to any other terminals using `Ctrl-Alt-Fx` keys. Now sure if this is a bug.


title: Kerberos authentication fails with forced password change

text: I have configured PAM authentication to use Kerberos and can authenticate correctly with my principals using their Kerberos credentials. I ran into trouble when I tried to create a principal with an expired password:               kadmin: addprinc +needchange test_principal      When I tried logging in (either from a VT or the graphical greeter), after correctly entering the password, I got the expected message that the password has expired and the system prompted me to create a new one. After I had done that, authentication failed with this error in the `kdc.log`:               krb5kdc[...](info): TGS_REQ (4 etypes {18 17 16 23}) 192.168.0.200: NO PREAUTH: authtime 0, test_principal@MY.REALM for host/server.my.realm@MY.REALM, Generic error (see e-text)      and the following (not so surprising) error in `/var/log/auth.log`:               pam_krb5(gdm3:auth): (user test_principal) credential verfication failed: KDC returned error string: NO PREAUTH      **Some notes**   * Listing the principal's attributes (via `getprinc` in `kadmin.local`) shows 0 failed log in attempts   * If I create the account without the `+needchange` flag, I am able to authenticate correctly.   * If I add the `+needchange` flag (via `modprinc` in `kadmin.local`) after the user has successfully authenticated once, I get the expected behavior; namely, the user is prompted to change their password and then their authentication succeeds.   * This principal has no equivalent entry in `/etc/passwd` but is backed up by an LDAP entry.   * As suggested elsewhere, I tried creating my principal like this:              kadmin: addprinc -requires_preauth +needchange test_principal      This made no difference. **My use case** I'm migrating from an old NIS system and I want to offer continuity to my users. I would like to have them enter their old passwords but then be forced to change them to conform to stricter password policy rules I intend to enforce through Kerberos. Please advise. I am running MIT Kerberos V on Debian Wheezy.


title: Why am I getting 'Name collision between ...' errors and how can I fix them?

text: Every time I try to launch `vim` or `emacs` or even `top` (I think it's actually any command that uses ncurses) in a unix terminal (on a cluster computer over ssh), I get a a continuous stream of 'Name collision between x x x' errors like this:               Name collision between dumb dumb     Name collision between unknown unknown     Name collision between lpr lpr     Name collision between glasstty glasstty     Name collision between vanilla vanilla     Name collision between ansi+local1 ansi+local1     Name collision between ansi+local ansi+local     ......     Name collision between terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200 terminet1200     Name collision between h19-a h19-a h19-a h19-a h19-a h19-a h19-a h19-a h19-a h19-a h19-a h19-a     Name collision between h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs h19-bs     Name collision between h19-us h19-us h19-us h19-us h19-us h19-us h19-us h19-us h19-us h19-us h19-us h19-us     Name collision between h19 h19 h19 h19 h19 h19 h19 h19 h19 h19 h19 h19     ......      According to some research I've done on the web this should be related to TERMCAP/TERMINFO, and I think this started happening after I used GNU screen. And in fact, when I am inside a GNU screen session, vim and emacs work fine (except some strange key mappings, for instance arrow keys don't work) I've tried to set the TERMCAP environment variable to a non-existing file, as I've read somewhere on the internet, and it caused vim to work (with different settings than my usual ones) but not emacs... Do you know what I can do to solve this problem?


title: Unable to add serialport (nodejs module) when generating filesystem and cross-compiling tools for an ARM processor

text: I am using buildroot (version 2013.08.1) to generate the filesystem and cross compiling tools to implement embedded linux on a i.MX233 processor (ARM architecture). I add the serialport module by running `make menuconfig` and then selecting:               Target Package -->          Interpreter languages and scripting -->              [*]nodejs                 [*] NPM for the target                 [*] Express web application framework                 [*] CoffeeScript                 (socket.io jade serialport) Additional modules      When running the Makefile, I get the following output regarding the serialport module:               node-pre-gyp http GET https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.11-linux-x64.tar.gz     node-pre-gyp http 200 https://node-serialport.s3.amazonaws.com/serialport/v1.4.0/Release/v8-3.11-linux-x64.tar.gz     node-pre-gyp ERR! UNCAUGHT EXCEPTION      node-pre-gyp ERR! stack Error: EPERM, chmod '/media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport/build/serialport/v1.4.0/Release/v8-3.11-linux-x64/serialport.node'     node-pre-gyp ERR! System Linux 3.13.0-24-generic     node-pre-gyp ERR! command "node" "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"     node-pre-gyp ERR! cwd /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/node_modules/serialport     node-pre-gyp ERR! node -v v0.8.22     node-pre-gyp ERR! node-pre-gyp -v v0.5.19     node-pre-gyp ERR! This is a bug in `node-pre-gyp`.     node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:     node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>     npm ERR! serialport@1.4.0 install: `node-pre-gyp install --fallback-to-build`     npm ERR! `sh "-c" "node-pre-gyp install --fallback-to-build"` failed with 7     npm ERR!      npm ERR! Failed at the serialport@1.4.0 install script.     npm ERR! This is most likely a problem with the serialport package,     npm ERR! not with npm itself.     npm ERR! Tell the author that this fails on your system:     npm ERR!     node-pre-gyp install --fallback-to-build     npm ERR! You can get their info via:     npm ERR!     npm owner ls serialport     npm ERR! There is likely additional logging output above.          npm ERR! System Linux 3.13.0-24-generic     npm ERR! command "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/host/usr/bin/node" "/media/d/Documents/b-tesis/buildroot-2013.08.1/output/host/usr/bin/npm" "install" "express" "coffee-script" "socket.io" "jade" "serialport"     npm ERR! cwd /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib     npm ERR! node -v v0.8.22     npm ERR! npm -v 1.2.14     npm ERR! code ELIFECYCLE     npm ERR!      npm ERR! Additional logging details can be found in:     npm ERR!     /media/d/Documents/b-tesis/buildroot-2013.08.1/output/target/usr/lib/npm-debug.log     npm ERR! not ok code 0     make: *** [/media/d/Documents/b-tesis/buildroot-2013.08.1/output/build/nodejs-0.8.22/.stamp_target_installed] Error 1      I have tried installing a different node version using `nvm`, but it does not work. I have not found any different solutions on Google. I am doing this process in a machine with Ubuntu 14.04 and kernel version 3.13.0-24-generic. I would appreciate any help with this issue.


title: gnu screen get user@host on hardline

text: I create screen session with               ssh user1@host1, user2@host1, ..., user5@host1.       On hardline I see only host1 five times. The same when I press `Ctrl`+`A`". How can I define a hardline to get `user1@host1, ..., user5@host1` on it?


title: What ghc package does cabal-install need?

text: I've just installed cabal to try and get http://dmwit.com/yeganesh/, but on running cabal-install it throws the error: > cabal: ghc version >=6.4 is required but it could not be found. Apt-cache searching ghc returns literally hundreds of packages, which one do I need?


title: Troubles with .desktop file

text: I've successfully installed `Internet Explorer 7` with `winetrick` in a clean prefix. I can successfully run it from terminal like this:               env WINEPREFIX=~/.wine32ie7 wine 'C:\\Program Files\\Internet Explorer\\iexplore'      Then I have created a .desktop entry to appear in gnome-shell menu:               .local/share/applications/wine/Programs/IE7/IE7.desktop      which looks like this:               #!/usr/bin/env xdg-open     [Desktop Entry]     Name=Microsoft Internet Explorer 7     Exec=env WINEPREFIX=~/.wine32ie7 wine 'C:\\Program Files\\Internet Explorer\\iexplore'     Type=Application     StartupNotify=true     Comment=Microsoft Internet Explorer 7 Web Browser.      I have restarted the shell and now my launcher appears but when I select it nothing happens other than the cursor turning in the rotating wheel for few seconds. I cannot even get debug message as can't find how to startup the .destkop launcher from terminal. Can someone help me please? **EDIT / SOLUTION:** Ok, sorry I've fond where the issue is:               Exec=env WINEPREFIX=~/.wine32ie7 wine 'C:\\Program Files\\Internet Explorer\\iexplore'      should be               Exec=env WINEPREFIX=/home/luca/.wine32ie7 wine 'C:\\Program Files\\Internet Explorer\\iexplore'      as `~` seems only having a value in a terminal environment.


title: Screen: How to send control commands using "screen -S"

text: screen -S works fine for sending shell commands. But how do I send screen control commands, like to split the window or source a .screenrc file?


title: Copy/paste does not always work from Firefox to terminal

text: Using st with dwm, depending on the way I select text (e.g. mouse vs keyboard), and where the text is (e.g. document body vs address bar), copying text from firefox and pasting it into st does not always work. Are there two different clipboards? Is there a way to unify them?


title: How to stop a bunch of processes on unix fast?

text: How to stop a bunch of processes on unix fast. I can use `ps`/`top`, `kill`. If the number of processes is very large, I use shell script. Are there other ways, only one or two unix commands can do it well ?


title: No usable clock interface found

text: I just finished installing a paravirtualized archlinux guest on xen. I get the following error when my guest boots: > [1.185226] i8042: No controller found [1.1247134] drivers/rtc/hctosys.c: > unable to open rtc device (rtc0) After it displays this the computer asks me to login as normal. Google told me this is the driver for the hardware clock so I tried the following:               [root@coronelaurelianobuendia ~]# hwclock --systohc --utc       hwclock: Cannot access the Hardware Clock via any known method.       hwclock: Use the --debug option to see the details of our search for an access     method.            [root@coronelaurelianobuendia ~]# hwclock --debug      hwclock from util-linux 2.24       hwclock: cannot open /dev/rtc: No such file or directory No usable clock      interface found.        hwclock: Cannot access the Hardware Clock via any known method.      Is this a problem with my `grub.cfg`? A problem with PV arch? Or a problem with my kernel?


title: Correctly parse arguments in script behaving like a shell called through SSH

text: I have a server with a very limited used whom I want to be able to run two very specific (and custom) instructions through SSH. In order to do that, I have set the shell for that limited user to be a custom BASH script that will only accept those two _"commands"_. This is the `/etc/passwd` for that user:               limited:x:1000:1000:,,,:/home/limited:/usr/sbin/limited_shell.bash      This is the `limited_shell.bash` script (well, what I have so far, which is not working properly):               #!/bin/bash          readonly RECORDER_SCRIPT="/usr/sbin/record.py"     echo "Verifying params: \$1: $1, \$2: $2"     shift          case $1 in       [0-9]*)         nc -z localhost $1 < /dev/null >/dev/null 2>&1         result=$?         if [[ $result -eq 0 ]]         then           echo "O"         else           echo "C"         fi         exit $result         ;;       record)         $RECORDER_SCRIPT ${*:3}         exit $?         ;;       *)         exit 0         ;;       esac     exit 0      As you might deduce from the script, the two commands I want `limited_shell.bash` to accept are: a number and a "record" string. When `limited_shell.bash` is called with a number, it will return whether it corresponds with an opened or closed local port. The other allowed command triggers a call to a python script (`/usr/sbin/record.py`) which then records some video from an input. This second command needs to be called with extra arguments, and that's where the problems start. When, in another machine I try to remotely execute the `record` command...               ssh limited@192.168.1.5 record -option1 foo -option2 bar      ... what actually arrives to `limited_shell.bash` is: `-c 'record -option1 foo -option2 bar'` (technically two arguments, one of them being `-c` and the second one being the whole string _command+args_ that I want to execute) I thought about shifting the first argument (the `-c`), and split the second argument (the actual `record` command with arguments) by space, but that is dirty and will give me a lot of troubles if one of the parameters I want to pass to the `record.py` script is an string containing an space. What is the right way of parsing the commands? I'm sure there has to be a better way than shifting and splitting.


title: CentOS boot time screen resolution

text: I'm trying to set the screen resolution in `/etc/grub.conf` using `vga=` on the kernel line:               vga=788      I'm using CentOS 6.4. That command should set the screen resolution to 16bit 800x600 according to antlinux's wiki. I removed `rhgb` from the `grub.conf` file so I can see the details of the boot instead of the progress bar. The problem is that the details on the screen are very small, using and old monitor like most of our customers and changing the VGA setting in `grub.conf` doesn't seem to change anything for these details being displayed on the screen or the login prompt at the console. Any ideas on what to change to modify the screen resolution for the details show on the console during boot and login prompt? Setting VGA in `grub.conf` just doesn't seem to do anything. ### /etc/grub.conf:               default=0     timeout=5     splashimage=(hd0,0)/grub/splash.xpm.gz     hiddenmenu     title CentOS (2.6.32-358.el6.i686)         root (hd0,0)         kernel /vmlinuz-2.6.32-358.el6.i686 ro root=UUID=8676c199-8498-4de4-8465-c87c2138560f         rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD          SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us         rd_NO_DM vga=788 quiet         initrd /initramfs-2.6.32-358.el6.i686.img      **UPDATE:** I'm seeing this in `/var/log/messages`:               Nov 18 16:01:34 localhost kernel: [drm] nouveau 0000:01:00.0: allocated 1024x768 fb: 0x48000, bo df82e400      I think this has something to do with my problem with the resolution changing on me..Still looking into it. Fixed it!! See fix it post below.


title: rsyncing from ext3 on mac: file has vanished

text: I am on Os X and I am rsyncing from a `ext3` volume (that I read with `osxfuse 2.6.2`) to a `HFS+` volume. The data I am backupping are ~ `500GB`. Sometimes `rsync` gives the following message:               file has vanished: '/path/to/file'      if I check the file path I find that the file is listed there but then `no such file or directory`. I would think this is a problem of osxfuse. Sometimes if I run rsync again some more files are transferred, but I always get the same warning regarding other files. I would think my backup is incomplete, how can I solve this?


title: Global keyboard shortcuts for Amarok

text: I'm using Linux Mint 16 Cinnamon x64. Amarok doesn't response to global keyboard shortcuts (Next media, Pause... etc) how can I make Amarok response to global keyboard shortcuts in Cinnamon just like in KDE? I tried to use:   * Gnome Multimedia Keys 2 but it didn't work!   * Defined global shortcuts from Amarok -> Configure shortcuts but they don't work whether Gnome Multimedia Keys 2 installed or not!


title: How to add a line from a list into another file when a specified line is found?

text: Basically I have 2 files. One has a list of router and switch login prompts, like this:               user@router1     user@router2     user@switch1     user@switch2      The other file has blocks of XML, like this:               <headTag>         <anotherTag1>         <anotherTag2>         </anotherTag2>         </anotherTag1>     </headTag>     <headTag>         <anotherTag1>         <anotherTag2>         </anotherTag2>         </anotherTag1>     </headTag>      So what I want to do is this, I need to loop though the XML file and each time it detects `<headTag>` place the next item on the router/switch list on the line above it, so the final output would end up like this:               user@router1     <headTag>         <anotherTag1>         <anotherTag2>         </anotherTag2>         </anotherTag1>     </headTag>     user@router2     <headTag>         <anotherTag1>         <anotherTag2>         </anotherTag2>         </anotherTag1>     </headTag>      How can I achieve this? I am using Red Hat Enterprise Linux Server and have approximately 800 items in the router/switch list and the same number of XML blocks.


title: How to use sed with round brackets?

text: I have a bunch of `.php` files that I wanted to replace all occurrences of a string.               find: jQuery(function     replace: head.ready(function      I thought I was doing it right by using:               find . -name '*.php' -exec sed -e 's/jQuery[(]function/head.ready[(]function/g' -i'.bak' {} \;      What ended up happening is it replaced `jQuery(function` with `head.ready[(]function` I was thinking I could escape the `(` by enclosing it in blocks `[]` but thats not the case. Does anybody have any suggestions?


title: virt-manager copy paste functionality to the vm

text: Anyone know how to get Virtual Manager to install copy-paste functionality to the Virtual Machine? Can't find anything on Google.


title: What are the chkconfig directives (classic style) into init.d scripts?

text: To ask my question, I must first clarify the context. Every init script in `/etc/init.d` (on RedHat and Centos distros) is prepared to be managed with the `chkconfig` command-line tool utility. This tool manages the symlinks in `/etc/rc[0-6].d`, understand runlevels and permit to add and remove init scripts from the set that is meant to run for every runlevel. (see man chkconfig). NOTE: it does **not** start **nor** stop the services / daemons but it permit a simpler management of what is "on" and what is "off" in every runlevel. According to man, to achieve this, every init script in `/etc/init.d` have to contain exactly two directives on a commended line (`chkconfig:` and `description:`, see manpage ) or a LSB-style init stanza. But let put aside for a moment this LSB-tyles stanzas (which have been introduced relatively recently) and are much more descriptive than the original chkconfig "format" (this topic can be good for other questions). Out of curiosity, I have run on my RedHat boxes (5.2 & 6.1) this command to examine the init scripts:               find /etc/init.d/ -ls -execdir head -n20 {} \;      and I have see other (possibly undocumented) directives:   * `# processname:`   * `# pidfile:`   * `# config:`   * `# Author:` These are in the comment lines and look the same as the official directives (`chkconfig:` and `description:`). Does anyone know if these are `chkconfig` directives or they are only some nice formatted comments? If these are directive too what do they mean? There are some reference? I wasn't able to find any.


title: Grep for range of numbers

text: How would you search a log file for a date range? Log file looks like this:               01/14 00:00:01  INFO:     received connect request from 10.10.10.10       I need to condense the log to 10 minutes starting at 8:25 and going until 8:35 When I use the following egrep I find too many results, such as`00:08:25` `01:08:25` ... `08:25:00`.. How can I just get `08:25:00` through `08:35:59` What I've tried               cat foo | egrep "08:2[5-9]|08:3[0-5]"     cat foo | egrep "08:2[5-9]:??|08:3[0-5]:??"     cat foo | egrep "08:2[5-9]:[0-9][0-9]|08:3[0-5]:[0-9][0-9]"


title: How do I create custom keybindings in Debian Jessie with GNOME Classic?

text: I'd like to be able to press `Ctrl+Alt+t` to open a terminal (or something along those lines, not really fussed about the exact combination). There's a guide for this which asks me to install and run `gconf-editor`, and to navigate to `apps->metacity`. However, I don't see the `metacity` tag. This person seems to have encountered a similar problem, albeit for `ubuntu`, but there is no answer to that question. I'm a bit stuck at this point! I found a very similar question on the debian.net forums but I wasn't able to find anything resembling `settings->Keyboard->Shortcuts`. I'm using `GNOME Classic` under `Jessie`, I figured maybe they're using something different?


title: create an RPM so that install will edit a config file using a shell command

text: I have a RPM spec file. How can I make it so that after the RPM installs, a random string is injected into one of the configuration files? For example: The RPM installs the binaries and config file to               /opt/bin/foo     /opt/bar.cfg      Inside the bar.cfg, I have the following configuration.               foo.bar = [             [                     clientId:"herp-derp",                     clientSecret:"<ENTER-CLIENTSECRET-HERE>",                     authorizedGrantTypes:["password"]             ]     ]      I want the RPM's that are distributed to replace `"<ENTER-CLIENTSECRET-HERE>"` with an actual random string. Here is how I am generating the random string echo `cat /dev/urandom | base64 | tr -dc "[:alnum:]" | head -c32` Since I have never worked much with RPM or spec files in the past, I'm not sure the appropriate way to go about this. Can I just add something like this to the spec file?               %post     RANDOM_STRING=`cat /dev/urandom | base64 | tr -dc "[:alnum:]" | head -c32`     sed -i.bak "s/clientSecret:\"<ENTER-CLIENTSECRET-HERE>\",/clientSecret:\"$RANDOM_STRING\",/g" /opt/bar.cfg


title: How does a parallelized Python program look with top command?

text: I work on a shared cluster. I've seen people run parallelized c code on this cluster which, when I use `top` to see what processes are running, are shown to be using (for example) 400% of the CPU, since they are using four processors for a single instance of their code. Now someone is running (what I hear to be) a parallelized Python code. However, instead of `top` showing the Python code to be using 400% of the CPU, it is being shown as four different processes, each using their own processor (at 100%). I am wondering, does Python (when parallelized) show with `top` as running as many different processes (as opposed to C) or is this Python code not actually running in parallel? I don't know if Stack Exchange would be a better place for this question. Since I am using `top` I figured this place would be better. Let me know if I should move it.


title: Deleting files on btrfs through smb

text: I have set up a btrfs multidisk which I mount and have shared on the network through smb. Whenever someone deletes a file on the share in windows, it seems to be rather slow. Any ideas/options I need to set in smb or btrfs which could speed that up?


title: Finding which cron jobs are scheduled to run at some future date/time X

text: Is there a way to "query" a crontab to find which cron jobs run at some arbitrary date/time, or during a certain range of times? For example, determine which will be run at sometime between 14:00 and 16:00 today, will run next Saturday at 10:00, or run every Sunday? There are a lot of jobs scheduled, so reading all the crontabs by hand isn't really an option.


title: DDNS (dynamic-dns) setup and adding a hostname to a device (to be visible on the network)

text: 1. How do I provide a fixed Hostname to my device so that a netscan can shows up the device name across all platforms?   2. How can I reach the device using the hostname/MAC-ID (something which is fixed) irrespective of the dynamically changing IP? For example, I have 2 Raspberry-Pi and I give them hostname as Pi-1 and Pi-2 respectively (visible across all platforms). Now my router gives away dynamic IPs, so the IPs keep changing. Now how do I do a simple `ping Pi-1` and get a reply? In short,how do I set up a **DDNS** (correct me if I am wrong) to map the Hostname/MAC-ID/URL against the updated IPs. I have an application which connects to the corresponding devices (over TCP or MQTT) and does xyz stuffs. But I don't have the luxury to lookup the current IP of my device and update my application with the same everytime I move the setup to a different network. So I will just make a hostname entry in the application saying connect to "Pi-1" and it should be able connect to Pi-1 irrespective of the ip/network/domain as long as all the allocated IPs are reachable by on another. **N.B** : I don't want to go for static IP or dhcp reserved IP and Open source packages (if required) are preferred.


title: How to permanently change both STDOUT and STDERR color to grey?

text: This question is similar to Can I configure my shell to print STDERR and STDOUT in different colors? But I am looking for a solution that will allow me to **change both STDOUT and STDERR to ONE color**. I am not trying to set different color for STDOUT and STDERR, as this is problematic and may create problems, mentioned in the answer from the link above. I apologize, as I don't know much about Unix and Linux. I am looking for a solution that can allow me to add couple lines to my `.bashrc` or `.bash_profile` and **permanently** change the color of STDOUT and STDERR.


title: Scripts cannot run simultaneously on startup

text: I want two scripts (`Server_drive`, `Server_video_boot`) running on startup, but there is conflict between them. Specifically, there is always running the script with the lower priority. I tried with many different priority numbers, but same result.               root@beagleboard:/etc/rc2.d# ls     S02dbus-1    S20ffserver  S20syslog        S50usb-gadget         S70lighttpd     S10dropbear  S20gpiolow   S20wlan8192cu    S59Server_drive       S99rmnologin     S20apmd      S20samba     S21avahi-daemon  S60Server_video_boot      _Server_video_boot:_               #!/bin/sh     cd /home/root/     ./Server_video.sh      _Server_drive:_               #!/bin/sh     cd /home/root/     ./test     // C executable      Any ideas why this happens? How can I fix this? _Info:_ _Angstrom distribution running on embedded device BeagleBoard-xM_


title: How to setup russian input method in Mint 14 xfce 64-bit?

text: I'm using Mint 14 XFCE, 64-bit. Struggling to setup cyrillic (Russian) input method. Can someone point me good web resources regarding this? Googling didn't help...


title: Cleaning voice recordings from command line?

text: I have used Audacity for removing noise from recordings before, however it has very limited command line usage. I have ~100 short lecture videos which I will be watching over the next few months and would like an easy way to clean them all at once or as needed before watching. Is there a command line tool or popular language library I can use to do this?


title: How can I trick a process into thinking a file doesn't exist?

text: I have a program that stores its settings in `~/.config/myprogram` that I use both interactively and with a batch queuing system. When running interactively, I want this program to use my configuration files (and it does). But when running in batch mode, the configuration files aren't necessary because I specify command-line options that overwrite all the relevant settings. Further, accessing the configuration files over the network increases the program's startup time by several seconds; if the files don't exist, the program launches much faster (as each job only takes about a minute, this has a significant impact on batch job throughput). But because I also use the program interactively, I don't want to be moving/deleting my configuration files all the time. Depending on when by batch jobs get scheduled on the cluster (based on other users' usage), I may want to use the program interactively and as part of a batch job at the same time. (Aside: that network file performance is so slow is probably a bug, but I'm just a user of the cluster, so I can only work around it, not fix it.) I could build a version of the program that doesn't read the configuration files (or has a command-line option not to) for batch use, but this program's build environment is poorly-engineered and difficult to set up. I'd much prefer to use the binaries installed through my system's package manager. How can I trick particular instances of this program into pretending my configuration files don't exist (without modifying the program)? I'm hoping for a wrapper of the form `pretendfiledoesntexist ~/.config/myprogram -- myprogram --various-options...`, but I'm open to other solutions.


title: How to install Node.js in CentOS 5.10 with Python 2.4?

text: I want to use Grunt on websites we have hosted on our WHM dedicated server. It is running CENTOS 5.10 x86_64 standard with WHM 11.42.1 (build 21). It is critical that things do not break, as we have over 20 domains running websites on this single server. I tried to build Node.js from source but it requires Python 2.6+, and we only have Python 2.4 installed. I read somewhere about installing Python 2.6 alongside 2.4 with alternative install but I don't know how to do this. I found this question that has a shell script that installs it for you, and Node.js did install, however it created a symlink in the folder I ran it from (bad) and also did not install npm for me. I am quite savvy but not an expert in Linux, especially CentOS, and cannot fathom how to get Node.js and npm to work on CentOS 5.10.


title: Unable to make sshd start at boot time on centos 6.4 . It starts ONLY after I login from console

text: I have installed centos 6.4 on a desktop and wanted to access it mostly remotely. For this, I tried http://www.serverschool.com/server- configuration/3-ways-to-configure-services-to-start-at-boot-in-centos-part-1/ That didn't work - so tried Start network service at boot time on CentOS because my desktop is also on wlan. That didn't work. So now I am stuck. Any inputs appreciated on how to troubleshoot this.


title: Why doesn't grep using pipe work here?

text: I have the following command:               find / -name libGL.so.1      Which returns lots of lines with "Permission denied". I want to exclude such lines, so I added the following:               find / -name libGL.so.1 | grep -v 'denied'      But the output is the same - my `grep -v 'denied'` is not filtering out the lines with `Permission denied`. I've tried many variations, looked over grep tutorials, but I cannot figure out the problem. Any suggestions?


title: Duplicate instances within Gnome menu

text: I'm running Fedora 18 with Gnome 3.6. I've installed Eclipse manually, and added the menu entry with alacarte. My problem is that even though I have "Favorite"'d the menu entry, it keeps duplicating the entry every time a new instance is launched. See screenshot for example: http://i.stack.imgur.com/rIZQ4.png Normally, it would group the new instances under one icon. For some reason my menu entry just won't match up. I have tried to rename the menu entry to what the application's title is when starting up but to no avail. I'm not quite sure what is causing this behavior, but would really love some assistance here.


title: How do I get GCC 4.7.1 with 64bit support installed for my user account only on Solaris x86

text: I have been put on a task to upgrade and build 32bit and 64bit libraries for software developers to use. I need to install GCC version 4.7.1 with 64bit support on the Solaris x86 machine I'm using for my user account only so as to not modify the system as a whole.


title: useradd command's argument issue

text: I am getting an issue regarding the `useradd` command's argument. I want to add a user with the `-p` option, and my process is getting an encrypted password with another process. I use the system command to invoke the `useradd` command with proper arguments but the password is not passed correct. Then I tried to run the `useradd` command manually and got the following error:               useradd -d /home -m -o -p "**\$1\$LmiSHTiI\$SVop.LoJGIkYQ6MdRSNW61**" -u 0 -g 0 cpu      I used the encrypted value of "cpu123". `strace` snapshot:               execve("/usr/sbin/useradd", ["useradd", "-d", "/home", "-m", "-o", "-p",            "**$1$LmiSHTiI$SVop.LoJGIkYQ6MdRSNW**", "-u", "0", "-g", "0", "cpu"],        [/* 36 vars */])      In the strace snapshot, I found that the last digits are not added using the `-p` option.


title: Debian wheezy using gnome classic requires root for system modifying changes

text: I am using Gnome classic on Debian Wheezy, and I sometimes get a popup for package updates. The UI prompts for a root password, and will only accept root. Is there some way for me to add my account to a root-like group so I can use my normal user account login, similar to a sudo invocation? I don't have root on the machine but have sudo privileges for pretty much everything. This happens for other GUI interactions like changing the system time for bug testing and changing network settings. This all can be done in the command line, but it is cumbersome.


title: Coloring output of forked processes

text: I have a runscript that starts some processes and sends them to the background               mongod       & pid_mongo=$!     redis-server & pid_redis=$!     # etc.      All these processes then output concurrently to the same standard output. My question: is it possible to color the output of each different forked process, so that - for example - one of them outputs in green and the other one in red ?


title: Perl find and replace is writing every file

text: Here's the test script I'm running               matt@server:~ $ cat test.sh     #!/bin/bash     mkdir test     cd test     echo "has the string foo" > yes.txt     echo "hasn't the string" > no.txt     ls -l --time-style=full-iso     cat *     perl -e 's/foo/bar/g;' -pi $(find -type f)     ls -l --time-style=full-iso     cat *     matt@server:~ $ ./test.sh     total 8     -rw-r--r-- 1 matt matt 18 2011-01-29 13:52:17.240316663 -0700 no.txt     -rw-r--r-- 1 matt matt 19 2011-01-29 13:52:17.240316663 -0700 yes.txt     hasn't the string     has the string foo     total 8     -rw-r--r-- 1 matt matt 18 2011-01-29 13:52:17.260317727 -0700 no.txt     -rw-r--r-- 1 matt matt 19 2011-01-29 13:52:17.260317727 -0700 yes.txt     hasn't the string     has the string bar      I need to figure out how to tweak this line:               perl -e 's/foo/bar/g;' -pi $(find -type f)      To not write every file it finds but to just write the files that need to be changed.


title: renaming files in sequential order

text: I have following files               SSt12.precip.374.sub.climatology.ctl     SSt12.precip.2874.sub.climatology.ctl     SSt12.precip.3764.sub.climatology.ctl     SSt12.precip.6774.sub.climatology.ctl      I want to rename as               SSt12.precip.1.sub.climatology.ctl     SSt12.precip.2.sub.climatology.ctl     SSt12.precip.3.sub.climatology.ctl     SSt12.precip.4.sub.climatology.ctl


title: Zorin OS 7 - Home button

text: What is the name of the command that invokes the home menu? I am using linux zorin os 7 ultimate. The home button (windows button) does not bring up the home menu. It does work, its not broken. I have Compiz installed, it came pre- installed. It says thats it is an advanced tool, so I want to make not to break anything. How do I enable it.


title: KEY_CONFIG pointing to the wrong version of openssl.cnf

text: I am trying to setup OpenVPN but I am getting this error:               #./build-ca     grep: /etc/openvpn/easy-rsa/2.0/openssl.cnf: No such file or directory     pkitool: KEY_CONFIG (set by the ./vars script) is pointing to the wrong     version of openssl.cnf: /etc/openvpn/easy-rsa/2.0/openssl.cnf     The correct version should have a comment that says: easy-rsa version 2.x      I have OpenSSL* installed. Do I need to set a location?


title: Apache2 virtual hosts not working

text: I use Debian 7 and have installed a virtual host with address sub.domain.com following this tutorial: http://www.debian-administration.org/articles/412 I have enabled it, rebooted the PC but still the subdomain opens /var/www Here is the file contents of the file named "sub.domain.com", located at /etc/apache2/sites-available/ :               <VirtualHost *>         ServerName sub.domain.com         DocumentRoot /usr/share/destfolder         ServerAdmin info@domain.com         ErrorLog /var/log/apache2/sub.domain.com-error_log         CustomLog /var/log/apache2/sub.domain.com-access_log common     </VirtualHost>      By the way when I reload apache's configuration, I get: `NameVirtualHost *:80 has no VirtualHosts` Any suggestions?


title: Shell script - syntax error near unexpected token `['

text: When I open my terminal I get the following error:               bash: /home/ai/.bashrc: line 75: syntax error near unexpected token `['     bash: /home/ai/.bashrc: line 75: `if [ -x /usr/bin/dircolors ]; then'      The relevant part of the bashrc file script starting with the comment is as follows:               # enable color support of ls and also add handy aliases          if [ -x /usr/bin/dircolors ]; then              test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"         alias ls='ls --color=auto'         #alias dir='dir --color=auto'         #alias vdir='vdir --color=auto'              alias grep='grep --color=auto'         alias fgrep='fgrep --color=auto'         alias egrep='egrep --color=auto'          fi      What am I doing wrong and how to correct this?


title: Permissions to change only directory content and not itself

text: We have a directory and want to protect that from remove and rename, but we need to be able to rename, remove and create contents. What we can do?


title: Why uninstalling openjdk automatically triggers an installation of the alternatives on zypper openSUSE?

text: I installed openSUSE 13.1 and I want to install Oracle jdk. What I intended was to first uninstall open_jdk/ice tea stuff as I won't be needing them anyway but it seems I cannot uninstall them without having other non-Oracle java packages installed.               us...r@linux-rvhj:/tmp/mc-junip> sudo zypper rm java-1_7*     Loading repository data...     Reading installed packages...     Resolving package dependencies...          The following 4 NEW packages are going to be installed:       gcc48-gij gcc-gij java-1_5_0-gcj-compat libgcj48           The following 3 packages are going to be REMOVED:       icedtea-web java-1_7_0-openjdk java-1_7_0-openjdk-headless           4 new packages to install, 3 to remove.     Overall download size: 9.3 MiB. After the operation, 25.8 MiB will be freed.     Continue? [y/n/p/? shows all options] (y):       How do I just uninstall packages without being forced any alternatives? And why zypper behaves like this? To prevent situation when dependencies of other packeges are removed?


title: automatic disconnection of RAID array

text: A RAID array connected to my system (Debian 7) via USB frequently disconnects itself for no apparent reason. Upon initial connection to the system, the device is detected, and the array can be initialized, mounted, read from, written to, and unmounted quite normally. However, invariably, after a short period of time (minutes to hours), the component disks disappear from `/dev` and from the listing of `fdisk -l`, and remain inaccessible until the device (i.e., RAID enclosure) is power cycled. Judging from the output of `/var/log/messages`, the problem appears to be resetting of the USB device. After the unprovoked reset, the system repeatedly attempts to reconnect the device, assigning a higher USB device number, eventually terminating after five reset attempts. What is responsible for the device resetting itself? I suspect the fault lies with the USB controller. How can the undesired auto-reset behavior be avoided? The following excerpts from `/var/log/messages` show the typical behavior of the array after initialization and subsequent reset: Initial connection:               Jun 19 19:38:51 hostname kernel: [406823.308418] usb 1-1.3: new high-speed USB device number 24 using ehci_hcd     Jun 19 19:38:51 hostname kernel: [406823.401317] usb 1-1.3: New USB device found, idVendor=152d, idProduct=2351     Jun 19 19:38:51 hostname kernel: [406823.401330] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5     Jun 19 19:38:51 hostname kernel: [406823.401338] usb 1-1.3: Product: USB to ATA/ATAPI Bridge     Jun 19 19:38:51 hostname kernel: [406823.401345] usb 1-1.3: Manufacturer: JMicron     Jun 19 19:38:51 hostname kernel: [406823.401350] usb 1-1.3: SerialNumber: DCC3..........     Jun 19 19:38:51 hostname kernel: [406823.402469] scsi16 : usb-storage 1-1.3:1.0     Jun 19 19:38:51 hostname mtp-probe: checking bus 1, device 24: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"     Jun 19 19:38:51 hostname mtp-probe: bus: 1, device: 24 was not an MTP device     Jun 19 19:38:52 hostname kernel: [406824.400835] scsi 16:0:0:0: Direct-Access     WDC WD20 EFRX-68AX9N0          PQ: 0 ANSI: 5     Jun 19 19:38:52 hostname kernel: [406824.401450] scsi 16:0:0:1: Direct-Access     WDC WD20 EFRX-68AX9N0          PQ: 0 ANSI: 5     Jun 19 19:38:52 hostname kernel: [406824.402433] sd 16:0:0:0: Attached scsi generic sg2 type 0     Jun 19 19:38:52 hostname kernel: [406824.402583] sd 16:0:0:1: Attached scsi generic sg3 type 0     Jun 19 19:38:52 hostname kernel: [406824.662288] sd 16:0:0:0: [sdd] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)     Jun 19 19:38:52 hostname kernel: [406824.662789] sd 16:0:0:1: [sde] 3907029168 512-byte logical blocks: (2.00 TB/1.81 TiB)     Jun 19 19:38:52 hostname kernel: [406824.663573] sd 16:0:0:0: [sdd] Write Protect is off     Jun 19 19:38:52 hostname kernel: [406824.664356] sd 16:0:0:1: [sde] Write Protect is off     Jun 19 19:38:52 hostname kernel: [406824.665087] sd 16:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA     Jun 19 19:38:52 hostname kernel: [406824.666295] sd 16:0:0:1: [sde] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA     Jun 19 19:38:52 hostname kernel: [406824.705355]  sdd: sdd1     Jun 19 19:38:52 hostname kernel: [406824.740148]  sde: sde1     Jun 19 19:38:52 hostname kernel: [406824.743667] sd 16:0:0:0: [sdd] Attached SCSI disk     Jun 19 19:38:52 hostname kernel: [406824.746756] sd 16:0:0:1: [sde] Attached SCSI disk      Upon reset:               Jun 19 20:05:25 hostname kernel: [408416.587392] usb 1-1.3: reset high-speed USB device number 24 using ehci_hcd     Jun 19 20:05:25 hostname kernel: [408416.679688] usb 1-1.3: device firmware changed     Jun 19 20:05:25 hostname kernel: [408416.679852] sd 16:0:0:0: Device offlined - not ready after error recovery     Jun 19 20:05:25 hostname kernel: [408416.679942] usb 1-1.3: USB disconnect, device number 24     Jun 19 20:05:25 hostname kernel: [408416.767366] usb 1-1.3: new high-speed USB device number 25 using ehci_hcd     Jun 19 20:05:25 hostname kernel: [408416.860214] usb 1-1.3: New USB device found, idVendor=152d, idProduct=2351     Jun 19 20:05:25 hostname kernel: [408416.860225] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5     Jun 19 20:05:25 hostname kernel: [408416.860232] usb 1-1.3: Product: USB to ATA/ATAPI Bridge     Jun 19 20:05:25 hostname kernel: [408416.860237] usb 1-1.3: Manufacturer: JMicron     Jun 19 20:05:25 hostname kernel: [408416.860241] usb 1-1.3: SerialNumber: 152D.............     Jun 19 20:05:25 hostname kernel: [408416.861634] scsi17 : usb-storage 1-1.3:1.0     Jun 19 20:05:25 hostname mtp-probe: checking bus 1, device 25: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"     Jun 19 20:05:25 hostname mtp-probe: bus: 1, device: 25 was not an MTP device     Jun 19 20:05:47 hostname kernel: [408438.591825] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:05:57 hostname kernel: [408448.750695] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:06:02 hostname kernel: [408453.911854] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:06:03 hostname kernel: [408454.359608] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:06:03 hostname kernel: [408454.807394] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:06:04 hostname kernel: [408455.295168] usb 1-1.3: reset high-speed USB device number 25 using ehci_hcd     Jun 19 20:06:04 hostname kernel: [408455.711201] scsi 17:0:0:0: Device offlined - not ready after error recovery     Jun 19 20:06:04 hostname kernel: [408455.711448] usb 1-1.3: USB disconnect, device number 25     Jun 19 20:06:04 hostname kernel: [408455.786917] usb 1-1.3: new high-speed USB device number 26 using ehci_hcd     Jun 19 20:06:05 hostname kernel: [408456.234679] usb 1-1.3: new high-speed USB device number 27 using ehci_hcd     Jun 19 20:06:05 hostname kernel: [408456.686418] usb 1-1.3: new high-speed USB device number 28 using ehci_hcd     Jun 19 20:06:06 hostname kernel: [408457.174018] usb 1-1.3: new high-speed USB device number 29 using ehci_hcd      Attempted assignment of USB device number 29 is the final attempt to revive the disk array. To reconnect the device at this point, power cycling of the RAID enclosure or disconnect/reconnect is mandatory. Update: Recently, the device appeared to reset shortly after a resync. I'm not sure if this is helpful, but the error messages contained in `/var/log/messages` are included below:                   Jul  5 02:55:02 hdac kernel: [135732.758796] md: md0: resync done.     Jul  5 03:12:04 hdac kernel: [136754.176970] usb 1-1.3: reset high-speed USB device number 10 using ehci_hcd     Jul  5 03:12:04 hdac kernel: [136754.269537] usb 1-1.3: device firmware changed     Jul  5 03:12:04 hdac kernel: [136754.269995] usb 1-1.3: USB disconnect, device number 10     Jul  5 03:12:04 hdac kernel: [136754.269998] sd 6:0:0:1: Device offlined - not ready after error recovery     Jul  5 03:12:04 hdac kernel: [136754.348882] usb 1-1.3: new high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:04 hdac kernel: [136754.442408] usb 1-1.3: New USB device found, idVendor=152d, idProduct=2351     Jul  5 03:12:04 hdac kernel: [136754.442419] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5     Jul  5 03:12:04 hdac kernel: [136754.442425] usb 1-1.3: Product: USB to ATA/ATAPI Bridge     Jul  5 03:12:04 hdac kernel: [136754.442430] usb 1-1.3: Manufacturer: JMicron     Jul  5 03:12:04 hdac kernel: [136754.442434] usb 1-1.3: SerialNumber: 152D....     Jul  5 03:12:04 hdac kernel: [136754.443581] scsi7 : usb-storage 1-1.3:1.0     Jul  5 03:12:04 hdac mtp-probe: checking bus 1, device 11: "/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.3"     Jul  5 03:12:04 hdac mtp-probe: bus: 1, device: 11 was not an MTP device     Jul  5 03:12:26 hdac kernel: [136776.197464] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:36 hdac kernel: [136786.356068] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:41 hdac kernel: [136791.517429] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:42 hdac kernel: [136791.965221] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:42 hdac kernel: [136792.412974] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:43 hdac kernel: [136792.900701] usb 1-1.3: reset high-speed USB device number 11 using ehci_hcd     Jul  5 03:12:43 hdac kernel: [136793.316865] scsi 7:0:0:0: Device offlined - not ready after error recovery     Jul  5 03:12:43 hdac kernel: [136793.317120] usb 1-1.3: USB disconnect, device number 11     Jul  5 03:12:43 hdac kernel: [136793.388401] usb 1-1.3: new high-speed USB device number 12 using ehci_hcd     Jul  5 03:12:44 hdac kernel: [136793.836359] usb 1-1.3: new high-speed USB device number 13 using ehci_hcd     Jul  5 03:12:44 hdac kernel: [136794.283982] usb 1-1.3: new high-speed USB device number 14 using ehci_hcd     Jul  5 03:12:45 hdac kernel: [136794.776418] usb 1-1.3: new high-speed USB device number 15 using ehci_hcd     Jul  5 07:46:51 hdac rsyslogd: [origin software="rsyslogd" swVersion="5.8.11" x-pid="2234" x-info="http://www.rsyslog.com"] rsyslogd was HUPed     Jul  5 07:46:51 hdac kernel: [153233.051604] md: super_written gets error=-19, uptodate=0     Jul  5 07:46:51 hdac kernel: [153233.080561] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.082218] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.088909] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.088972] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089030] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089084] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089139] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089193] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089247] lost page write due to I/O error on md0     Jul  5 07:46:51 hdac kernel: [153233.089300] lost page write due to I/O error on md0     Jul  5 07:46:52 hdac kernel: [153233.308299] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:02 hdac kernel: [179450.340233] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:02 hdac kernel: [179450.340549] quiet_error: 101 callbacks suppressed     Jul  5 15:04:02 hdac kernel: [179450.340566] lost page write due to I/O error on md0     Jul  5 15:04:02 hdac kernel: [179450.340774] lost page write due to I/O error on md0     Jul  5 15:04:03 hdac kernel: [179450.541182] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:08 hdac kernel: [179455.698562] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:08 hdac kernel: [179455.699059] lost page write due to I/O error on md0     Jul  5 15:04:08 hdac kernel: [179455.902387] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:32 hdac kernel: [179479.848336] md: super_written gets error=-19, uptodate=0     Jul  5 15:04:32 hdac kernel: [179479.848803] lost page write due to I/O error on md0     Jul  5 15:04:32 hdac kernel: [179479.848832] lost page write due to I/O error on md0     Jul  5 15:04:32 hdac kernel: [179480.049689] md: super_written gets error=-19, uptodate=0     Jul  5 15:20:11 hdac kernel: [180418.849041] md: super_written gets error=-19, uptodate=0     Jul  5 15:20:11 hdac kernel: [180418.852710] lost page write due to I/O error on md0     Jul  5 15:20:12 hdac kernel: [180419.056405] md: super_written gets error=-19, uptodate=0


title: Generating grub.cfg without Linux installed

text: My dual boot machine went haywire yesterday, and seriously corrupted the Linux partition.   Among the corrupted files were:   1. The entire `/boot` directory   2. Quite a few stuff in `/bin` _"No problem"_ , I thought to myself. I haven't been using that Linux partition anymore (it's my gaming PC), so I'll just rebuild the boot directory and leave it at that. _Problem is:_ due to corruption of the bin directory, I can't `chroot` into the system. And since `grub-mkconfig` (or `update-grub`) can't be run from a live USB, I have no way of generating the `grub.cfg` file. The live USBs I have here (Arch Linux and gparted) both have scripts inside grub.d/ for detecting OS's.   In gparted, `grub-mkconfig` fails to run entirely. While in arch linux it runs but detects nothing. **Is there a way of generating grub.cfg without a working Linux installation?**


title: How to find and replace a field column value in UNIX

text: I have file with the value say which is delimited with `|`               123-|aaa|bbb|123|123.0|123-|123.01-|-123.02|123.03-|aaa|bbb|123-|aaa-|-bbb|cc-cc|123.04-|aa123-|123.05-      I need to pick the column values which end with `-`, the column picked up should be a numeric value and then move the `-` to start of the value.


title: Using a unix filesystem on an external hard drive?

text: After repeated trouble with my NTFS formatted backup/media hard drive (undeletable files, etc.), I decided to reformat it with a unix file system (ext4 preferred). I do not intend to use it from a Windows machine, but it should be accessible from other Linux systems (e.g. live cd, after system reinstallation or change of computer). Could I run into trouble because of user/group permissions? Is there a way to minimize these (e.g. by chosing a more appropriate file system than ext4 or parameters in `/etc/fstab`)? Recursive chowns do not seem very elegant or efficient to me.


title: ssh with for loop - parentheses problem

text: I have the following script:               while [ "$1" != "" ]     do     case "$1" in         -h) HOST="$2"; shift 2;;     esac     done          if test -z "$HOST"     then         [...]     else         TODAY=$(date +'%Y-%m-%d')          configs=("/etc/inittab" "/etc/default/cron" "/etc/default/login" "/etc/default/su" "/etc/group" "/etc/inet/inetd.conf" "/etc/mnttab" "/etc/netmasks" "/etc/nsswitch.conf" "/etc/protocols" "/etc/services" "/etc/syslog.conf" "/var/sadm/install/contents" "/etc/user_attr" "/etc/passwd")           ssh $HOST          for (i=0; i<${#configs[*]}; i++)          do              digest -v -a md5 ${configs[$i]} | awk '{print $2,$4}' | sed 's/) (/\n/;s/[()]//g';          done > /tmp/md5_config_$TODAY.txt     fi      If I execute the script with a hostname (scriptname.sh -h hostname) I get the error               line 97: syntax error near unexpected token `('     line 97: `for (i=0;i<${#configs[*]};i++;); '      Is there a way to solve it? I want to execute the "digest" command on the remote host with the filenames of the array "configs" Edit: Actual state               else         TODAY=$(date +'%Y-%m-%d')          configs=("/etc/inittab" "/etc/default/cron" "/etc/default/login" "/etc/default/su" "/etc/group" "/etc/inet/inetd.conf" "/etc/mnttab" "/etc/netmasks" "/etc/nsswitch.conf" "/etc/protocols" "/etc/services" "/etc/syslog.conf" "/var/sadm/install/contents" "/etc/user_attr" "/etc/passwd")           ssh $HOST          for ((i=0; i<${#configs[*]}; i++))          do              digest -v -a md5 ${configs[$i]} | awk '{print $2,$4}' | sed 's/) (/\n/;s/[()]//g';          done > /tmp/md5_config_$TODAY.txt     fi


title: How to make tree output only directories?

text: 150 directories I can handle but 900 files is too many for a review. I've no manual entry for `tree` so maybe I can ask you if you know how to output only directories since files get too detailed?               .     ├── agreement.htm     ├── appengine_admin     │   ├── admin_forms.py     │   ├── admin_forms.pyc     │   ├── admin_settings.py     │   ├── admin_settings.pyc     │   ├── admin_widgets.py     │   ├── admin_widgets.pyc     │   ├── authorized.py     │   ├── authorized.pyc     │   ├── db_extensions.py     │   ├── encoding.py     │   ├── __init__.py     │   ├── __init__.pyc     │   ├── media     │   │   ├── images     │   │   │   ├── default-bg.gif     │   │   │   ├── icon_calendar.gif     │   │   │   ├── icon_clock.gif     │   │   │   ├── nav-bg.gif     │   │   │   └── sidebar-li.png     │   │   ├── js     │   │   │   ├── calendar.js     │   │   │   ├── core.js     │   │   │   └── DateTimeShortcuts.js     │   │   └── style.css     │   ├── model_register.py     │   ├── model_register.pyc     │   ├── templates     │   │   ├── 404.html     │   │   ├── 500.html     │   │   ├── admin_base.html     │   │   ├── index.html     │   │   ├── model_item_edit.html     │   │   └── model_item_list.html     │   ├── utils.py     │   ├── utils.pyc     │   ├── views.py     │   └── views.pyc     ├── appengine_config.py     ├── appengine_config.py.bak     ├── appengine_config.pyc     ├── app.yaml     ├── br.py     ├── br.py.bak     ├── br.py.old     ├── captcha.py     ├── captcha.pyc     ├── common     │   ├── __init__.py     │   ├── __init__.pyc     │   ├── templatefilters.py     │   └── templatefilters.pyc     ├── conf     │   ├── __init__.py     │   ├── __init__.pyc     │   ├── locale     │   │   ├── ar     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── bg     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── en     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── es     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── fi     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── fr     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       ├── django.po     │   │   │       └── django.po~     │   │   ├── ja     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── pt     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       ├── django.po     │   │   │       └── django.po~     │   │   ├── ro     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── ru     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── sq     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── sv     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── tl     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   ├── tr     │   │   │   └── LC_MESSAGES     │   │   │       ├── django.mo     │   │   │       └── django.po     │   │   └── zh     │   │       └── LC_MESSAGES     │   │           ├── django.mo     │   │           └── django.po     │   └── settings.py     ├── credit     │   └── credit.html     ├── cron.yaml     ├── demjson.py     ├── demjson.pyc     ├── errorpages.py     ├── facebookapi.py     ├── facebookapi.py.bak     ├── facebookapi.pyc     ├── facebookconf.py     ├── facebookconf.pyc     ├── geo     │   ├── geocell.py     │   ├── geocell.pyc     │   ├── geocell_test.py     │   ├── geomath.py     │   ├── geomath.pyc     │   ├── geomath_test.py     │   ├── geomodel.py     │   ├── geomodel.pyc     │   ├── geotypes.py     │   ├── geotypes.pyc     │   ├── geotypes_test.py     │   ├── __init__.py     │   ├── __init__.pyc     │   ├── test_coverage.sh     │   ├── util.py     │   ├── util.pyc     │   └── util_test.py     ├── help.html     ├── i18n.py     ├── i18n.py.bak     ├── i18n.pyc     ├── index.yaml     ├── __init__.py     ├── in.old.py     ├── in.old.py.bak     ├── in.py     ├── in.py.bak     ├── in.tidy.py     ├── javascript.py     ├── js     │   ├── a.css     │   ├── b.css     │   ├── c.css     │   ├── d.css     │   ├── listcss.css     │   ├── load.js     │   ├── main.css     │   └── mycss.css     ├── jsmin.py     ├── json.py     ├── json.pyc     ├── listfiles.py     ├── login_required.py     ├── login_required.py.bak     ├── mailman.py     ├── main.old.py     ├── main.py     ├── main.py.bak     ├── main.pyc     ├── mapreduce     │   ├── base_handler.py     │   ├── base_handler.py.bak     │   ├── context.py     │   ├── context.py.bak     │   ├── control.py     │   ├── control.py.bak     │   ├── errors.py     │   ├── errors.py.bak     │   ├── handlers.py     │   ├── handlers.py.bak     │   ├── hooks.py     │   ├── hooks.py.bak     │   ├── __init__.py     │   ├── __init__.py.bak     │   ├── __init__.pyc     │   ├── input_readers.py     │   ├── input_readers.py.bak     │   ├── lib     │   │   ├── blobstore     │   │   ├── files     │   │   │   ├── blobstore.py     │   │   │   ├── crc32c.py     │   │   │   ├── file.py     │   │   │   ├── file_service_pb.py     │   │   │   ├── __init__.py     │   │   │   ├── records.py     │   │   │   └── testutil.py     │   │   ├── graphy     │   │   │   ├── backends     │   │   │   │   ├── google_chart_api     │   │   │   │   │   ├── encoders.py     │   │   │   │   │   ├── __init__.py     │   │   │   │   │   └── util.py     │   │   │   │   └── __init__.py     │   │   │   ├── bar_chart.py     │   │   │   ├── common.py     │   │   │   ├── formatters.py     │   │   │   ├── __init__.py     │   │   │   ├── line_chart.py     │   │   │   ├── pie_chart.py     │   │   │   ├── README     │   │   │   └── util.py     │   │   ├── __init__.py     │   │   ├── key_range     │   │   │   └── __init__.py     │   │   ├── pipeline     │   │   │   ├── common.py     │   │   │   ├── handlers.py     │   │   │   ├── __init__.py     │   │   │   ├── models.py     │   │   │   ├── pipeline.py     │   │   │   ├── simplejson     │   │   │   │   ├── decoder.py     │   │   │   │   ├── encoder.py     │   │   │   │   ├── __init__.py     │   │   │   │   ├── ordered_dict.py     │   │   │   │   ├── scanner.py     │   │   │   │   └── tool.py     │   │   │   ├── testutil.py     │   │   │   ├── ui     │   │   │   │   ├── common.css     │   │   │   │   ├── common.js     │   │   │   │   ├── images     │   │   │   │   │   ├── treeview-black.gif     │   │   │   │   │   ├── treeview-black-line.gif     │   │   │   │   │   ├── treeview-default.gif     │   │   │   │   │   └── treeview-default-line.gif     │   │   │   │   ├── jquery-1.4.2.min.js     │   │   │   │   ├── jquery.ba-hashchange.min.js     │   │   │   │   ├── jquery.cookie.js     │   │   │   │   ├── jquery.json.min.js     │   │   │   │   ├── jquery.timeago.js     │   │   │   │   ├── jquery.treeview.css     │   │   │   │   ├── jquery.treeview.min.js     │   │   │   │   ├── status.css     │   │   │   │   ├── status.html     │   │   │   │   └── status.js     │   │   │   └── util.py     │   │   └── simplejson     │   │       ├── decoder.py     │   │       ├── encoder.py     │   │       ├── __init__.py     │   │       ├── README     │   │       └── scanner.py     │   ├── main.py     │   ├── main.py.bak     │   ├── mapper_pipeline.py     │   ├── mapper_pipeline.py.bak     │   ├── mapreduce_pipeline.py     │   ├── mapreduce_pipeline.py.bak     │   ├── model.py     │   ├── model.py.bak     │   ├── namespace_range.py     │   ├── namespace_range.py.bak     │   ├── operation     │   │   ├── base.py     │   │   ├── base.pyc     │   │   ├── counters.py     │   │   ├── counters.pyc     │   │   ├── db.py     │   │   ├── db.pyc     │   │   ├── __init__.py     │   │   └── __init__.pyc     │   ├── output_writers.py     │   ├── output_writers.py.bak     │   ├── quota.py     │   ├── quota.py.bak     │   ├── shuffler.py     │   ├── shuffler.py.bak     │   ├── static     │   │   ├── base.css     │   │   ├── detail.html     │   │   ├── jquery-1.4.2.min.js     │   │   ├── overview.html     │   │   └── status.js     │   ├── status.py     │   ├── status.py.bak     │   ├── test_support.py     │   ├── test_support.py.bak     │   ├── util.py     │   └── util.py.bak     ├── mapreduce.yaml     ├── market     │   ├── categories.html     │   ├── credit.html     │   ├── __init__.py     │   ├── market_ad_detail.html     │   ├── market_ad_edit.html     │   ├── market_ad_newpasswd.html     │   ├── market_ad_pay.html     │   ├── market_ad_preview.html     │   ├── market_ad_remove.html     │   ├── market_ad_renew.html     │   ├── market_detail.html     │   ├── market_full.html     │   ├── market_list.html     │   ├── market_mailc2c.html     │   ├── market_search.html     │   ├── market_usersads_list.html     │   ├── models.py     │   ├── nav.html     │   └── publish.html     ├── onlinedebug     │   ├── codeinput.html     │   └── onlinedebug.py     ├── paginator.py     ├── paginator.pyc     ├── PythonTidy-1.20.py     ├── PythonTidy-1.20.py.bak     ├── reindent.py     ├── remote_api.py     ├── reports.py     ├── settings.py     ├── settings.pyc     ├── static     │   ├── base.css     │   ├── button-background.gif     │   ├── cancel.png     │   ├── challenge     │   ├── channel.html     │   ├── codebase     │   │   ├── dhtmlxcommon.js     │   │   ├── dhtmlxtree.css     │   │   ├── dhtmlxtree.js     │   │   └── imgs     │   │       ├── blank.gif     │   │       ├── but_cut.gif     │   │       ├── folderClosed.gif     │   │       ├── folderOpen.gif     │   │       ├── iconCheckAll.gif     │   │       ├── iconCheckDis.gif     │   │       ├── iconCheckGray.gif     │   │       ├── iconUncheckAll.gif     │   │       ├── iconUncheckDis.gif     │   │       ├── leaf.gif     │   │       ├── line1.gif     │   │       ├── line1_rtl.gif     │   │       ├── line2.gif     │   │       ├── line2_rtl.gif     │   │       ├── line3.gif     │   │       ├── line3_rtl.gif     │   │       ├── line4.gif     │   │       ├── line4_rtl.gif     │   │       ├── line.gif     │   │       ├── lock.gif     │   │       ├── minus2.gif     │   │       ├── minus2_rtl.gif     │   │       ├── minus3.gif     │   │       ├── minus3_rtl.gif     │   │       ├── minus4.gif     │   │       ├── minus4_rtl.gif     │   │       ├── minus5.gif     │   │       ├── minus5_rtl.gif     │   │       ├── minus_ar.gif     │   │       ├── minus.gif     │   │       ├── plus2.gif     │   │       ├── plus2_rtl.gif     │   │       ├── plus3.gif     │   │       ├── plus3_rtl.gif     │   │       ├── plus4.gif     │   │       ├── plus4_rtl.gif     │   │       ├── plus5.gif     │   │       ├── plus5_rtl.gif     │   │       ├── plus_ar.gif     │   │       ├── plus.gif     │   │       ├── radio_off.gif     │   │       ├── radio_on.gif     │   │       └── Thumbs.db     │   ├── comet-helper.js     │   ├── comet.js     │   ├── common.js     │   ├── credit.html     │   ├── crossajax.html     │   ├── css     │   │   ├── 960.css     │   │   ├── business.css     │   │   ├── montao.css     │   │   ├── openid.css     │   │   ├── reset.css     │   │   ├── style.css     │   │   ├── text.css     │   │   ├── uni-form.css     │   │   └── uni-form-generic.css     │   ├── extinfowindow.js     │   ├── failure.png     │   ├── favicon.ico     │   ├── favindex.ico     │   ├── fbjs.js     │   ├── feedicon.gif     │   ├── file.html     │   ├── for_sale_files     │   │   ├── 1x1_pages_li_c6_apuk_qh5569.gif     │   │   ├── all_pages.js     │   │   ├── arrays_v2.js     │   │   ├── bevakning_mini.gif     │   │   ├── common_in.css     │   │   ├── common.js     │   │   ├── ga.js     │   │   ├── generic.css     │   │   ├── jquery-1.js     │   │   ├── list.css     │   │   ├── searchbox.js     │   │   ├── thumb_extra_left_bottom.gif     │   │   ├── thumb_extra_right_bottom.gif     │   │   ├── thumb_extra_right_top.gif     │   │   ├── thumb_left_top.gif     │   │   ├── thumb_single_left_bottom.gif     │   │   ├── thumb_single_right_bottom.gif     │   │   ├── thumb_single_right_top.gif     │   │   ├── transparent.gif     │   │   └── xtcore.js     │   ├── frames.html     │   ├── ga.js     │   ├── geo.html     │   ├── googleb4b3b9748fe57cbf.html     │   ├── greybox.js     │   ├── iframe.js     │   ├── images     │   │   ├── 1.jpg     │   │   ├── 2.jpg     │   │   ├── 3.jpg     │   │   ├── dl.jpg     │   │   ├── go.jpg     │   │   ├── openid-providers-en.png     │   │   ├── openid-providers-ru.png     │   │   ├── openid-providers-uk.png     │   │   ├── p_debug1.JPG     │   │   ├── p_debug2.JPG     │   │   ├── p_debug3_1.JPG     │   │   ├── p_debug3_2.JPG     │   │   ├── p_debug3.JPG     │   │   ├── p_listfiles.JPG     │   │   ├── preview.jpg     │   │   ├── Thumbs.db     │   │   └── view.jpg     │   ├── images.large     │   │   ├── aol.gif     │   │   ├── facebook.gif     │   │   ├── google.gif     │   │   ├── myopenid.gif     │   │   ├── openid.gif     │   │   ├── rambler.gif     │   │   ├── verisign.gif     │   │   ├── yahoo.gif     │   │   └── yandex.gif     │   ├── images.small     │   │   ├── aol.ico     │   │   ├── aol.ico.gif     │   │   ├── aol.ico.png     │   │   ├── blogger.ico     │   │   ├── blogger.ico.gif     │   │   ├── blogger.ico.png     │   │   ├── claimid.ico     │   │   ├── claimid.ico.gif     │   │   ├── claimid.ico.png     │   │   ├── clickpass.ico     │   │   ├── clickpass.ico.gif     │   │   ├── clickpass.ico.png     │   │   ├── facebook.ico     │   │   ├── facebook.ico.gif     │   │   ├── facebook.ico.png     │   │   ├── flickr.ico     │   │   ├── flickr.ico.gif     │   │   ├── flickr.ico.png     │   │   ├── google.ico     │   │   ├── google.ico.gif     │   │   ├── google.ico.png     │   │   ├── google_profile.ico     │   │   ├── google_profile.ico.gif     │   │   ├── google_profile.ico.png     │   │   ├── launchpad.ico     │   │   ├── launchpad.ico.gif     │   │   ├── launchpad.ico.png     │   │   ├── linkedin.ico     │   │   ├── linkedin.ico.gif     │   │   ├── linkedin.ico.png     │   │   ├── livejournal.ico     │   │   ├── livejournal.ico.gif     │   │   ├── livejournal.ico.png     │   │   ├── myopenid.ico     │   │   ├── myopenid.ico.gif     │   │   ├── myopenid.ico.png     │   │   ├── openid.ico     │   │   ├── openid.ico.gif     │   │   ├── openid.ico.png     │   │   ├── rambler.ico     │   │   ├── rambler.ico.gif     │   │   ├── rambler.ico.png     │   │   ├── technorati.ico     │   │   ├── technorati.ico.gif     │   │   ├── technorati.ico.png     │   │   ├── twitter.ico     │   │   ├── twitter.ico.gif     │   │   ├── twitter.ico.png     │   │   ├── verisign.ico     │   │   ├── verisign.ico.gif     │   │   ├── verisign.ico.png     │   │   ├── vidoop.ico     │   │   ├── vidoop.ico.gif     │   │   ├── vidoop.ico.png     │   │   ├── wordpress.ico     │   │   ├── wordpress.ico.gif     │   │   ├── wordpress.ico.png     │   │   ├── yahoo.ico     │   │   ├── yahoo.ico.gif     │   │   ├── yahoo.ico.png     │   │   ├── yandex.ico     │   │   ├── yandex.ico.gif     │   │   └── yandex.ico.png     │   ├── img     │   │   ├── anuncio.gif     │   │   ├── facebook.gif     │   │   ├── facebook.png     │   │   ├── favicon.ico     │   │   ├── flerabildericon1.gif     │   │   ├── gratis.gif     │   │   ├── kamera.gif     │   │   ├── kool_business.png     │   │   ├── logo.gif     │   │   ├── mail.gif     │   │   ├── marketlogo.gif     │   │   ├── montao.gif     │   │   ├── montao_small.gif     │   │   ├── monton.gif     │   │   ├── sign-in-with-twitter-d.png     │   │   ├── sign-in-with-twitter-d-sm.png     │   │   ├── sign-in-with-twitter-l.png     │   │   ├── sign-in-with-twitter-l-sm.png     │   │   ├── tele.gif     │   │   ├── thumb_left_top.gif     │   │   ├── thumb_single_left_bottom.gif     │   │   ├── thumb_single_right_bottom.gif     │   │   ├── thumb_single_right_top.gif     │   │   └── twittericon.png     │   ├── jquery-1.js     │   ├── js     │   │   ├── jquery-1.2.6.min.js     │   │   ├── openid-jquery-en.js     │   │   ├── openid-jquery.js     │   │   ├── openid-jquery-ru.js     │   │   └── openid-jquery-uk.js     │   ├── json2.js     │   ├── labeledmarker.js     │   ├── listfileshelp.html     │   ├── login.js     │   ├── main.js     │   ├── mootools-1.js     │   ├── myfbjs2.js     │   ├── myfbjs3.js     │   ├── myfbjs.js     │   ├── obrigado.txt     │   ├── onlinedebughelp.html     │   ├── openid-icon.png     │   ├── openid-logo.png     │   ├── orbited.js     │   ├── plugin.js     │   ├── plugin_management.html     │   ├── plugin_management.js     │   ├── privacy.html     │   ├── recaptcha.js     │   ├── robots.txt     │   ├── round_bottom_left.png     │   ├── round_bottom_right.png     │   ├── round_top_left.png     │   ├── round_top_right.png     │   ├── search.html     │   ├── selectuser.js     │   ├── success.png     │   ├── terms.html     │   ├── Thumbs.db     │   ├── Transform.xls     │   ├── transparentpixel.gif     │   ├── tree.html     │   ├── wz_dragdrop.js     │   ├── xd_receiver.htm     │   ├── xd_receiver.html     │   └── yui     │       ├── assets     │       │   ├── bg_hd.gif     │       │   ├── dpSyntaxHighlighter.css     │       │   ├── dpSyntaxHighlighter.js     │       │   ├── example-hd-bg.gif     │       │   ├── Thumbs.db     │       │   ├── title_h_bg.gif     │       │   ├── yui-candy.jpg     │       │   ├── yui.css     │       │   ├── yuiDistribution.css      ...               153 directories, 890 files


title: Sender based redirection on Postfix

text: I'm running postfix on Debian, receiving email for `my.com`, and I would like all incoming emails from `sender.com` to be delivered to `jack@my.com`, regardless of the original recipient. Emails from other domains still need to go to the original recipient. Is this possible/easy to set up?


title: Compare versions of the same package in different repositories (i.e. stable vs backports) using apt-cache show

text: I'm trying to find out the version of a particular package available in the backports repo to compare it with the version available in the stable repo. But when I give               apt-cache show <package> | grep Version      I always get the same result as with               apt-cache -t wheezy-backports show <package> | grep Version      This seems to be the case no matter the package I'm searching. Am I doing something wrong?


title: How can I assign a keyboard shortcut to a specific application in Openbox?

text: I use the web browser Uzbl and the window manager Openbox, and I wondered if I could configure openbox to add a keyboard shortcut to minimize / maximize Uzbl's window ...


title: Windows Media Audio 9 player plugin- something for linux

text: I need something to play WMA radio. Do you know any way of doing this on linux?


title: Parse html on Linux

text:
I have a couple of hundred html source code files. I need to extract the contents of a particular `<div>` element from each of these file so I'm going to write a script to loop through each file. The element structure is like this:

Some content

      Can anyone suggest a method by which I can extract the div `the_div_id` and all the child elements and content from a file using the linux command line?


title: Read Apple nvram

text: On Mac OS X there is a tool called _nvram_ to get and set EFI properties. As I am now deploying GNU/Linux on Apple hardware, I'd like to have a similar tool that is able to talk to Apple's EFI implementation. Are there tools to achieve this?


title: How to get size of data that haven't been written to disk yet?

text: In some programs percentage of copying large files get to 100% very fast and then I'm waiting much more before it goes next step. It's caused by buffer. How to I see amount of data that are going to be written?


title: command line retrieve list of all valid kbd layouts, variants and toggle options (to use with setxkbmap)

text: Is there a way from command line to retrieve the list of all available keyboard layouts and relative variants? I need to list all the valid layout/variants choices to be used then from setxkbmap. Also about the layout toggle options, is there a way to retrieve a list of all available choices (e.g. grp:shift_caps_toggle , ...) I know that with               setxkbmap -query      I retrieve the list of my current ones, but I need the whole list of options. UPDATE: I've been told about the command               man xkeyboard-config      which provides all the info to the command line. Furthermore, using               man -P cat xkeyboard-config      the output goes to stdout and can be parsed with scripts or c code


title: Weird behaviour case insensitivity with bash on MacOS

text: ~/testing $ echo Hello > hello.txt     ~/testing $ echo Goodbye > goodbye.txt     ~/testing $ cat goodbye.txt hello.txt > HELLO.txt     ^C     ~/testing $ ls -l     total 9056     -rw-r--r--  1 user  user        8 25 Jul 16:21 goodbye.txt     -rw-r--r--  1 user  user  4631048 25 Jul 16:22 hello.txt     ~/testing $       Wha? I'm missing something here. Is there a destroy files insensitively option I'm missing? Why does this appear to loop?


title: Can directory listing be disabled for sftp?

text: A question arose in a group discussion: Can directory listing be disabled for sftp while still retaining read and write access? We are using openssh on ubuntu server 11.02 if that helps.


title: $PS1 on Ubuntu VM does not match actual prompt

text: I am running an Ubuntu VM out of `Virtual Box` and `Vagrant`:               vagrant@lucid64:~$ uname -a     Linux lucid64 2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 11:26:59 UTC 2012 x86_64 GNU/Linux      My $PS1 variable doesn't actually match the prompt and is far more complex:               vagrant@lucid64:~$ echo $PS1     \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$      I am looking for an explanation of the relationship between the $PS1 and my prompt, which is `$USER@$HOST:$PWD\$`, as can be seen above. E.g., on my regular laptop, which hosts this VM and is a Mac, it is clean and simple as follows:               ~@12:10:20>echo $PS1     \w@\t>


title: Installation problem linuxmint 13 Maya, invisible mouse

text: I was installed Linux Mint 13 maya to my mother's PC. Unfortunately the mouse is working "invisible mode", it works but I can't see the arrow. The problem is same when I boot from liveCD. This liveCD works perfect in my other computer.


title: How to set up a "child" proxy that doesn't need a "parent" proxy

text: I run Linux on a laptop that is sometimes on a corporate network which uses an NTLM proxy server, and thus I have cntlmd running on the laptop as a child proxy to connect to the parent (corporate) proxy server. Everything running on the laptop is configured to use localhost:3128 (the CNTLM proxy address) and then cntlmd handles the non-standard authentication with the NTLM proxy server. When I take the laptop off the corporate network, there are maybe a dozen different places things are configured to use localhost:3128, and it is a pain to disable and then later re-enable them. It is apparently not possible to configure cntlmd to not use a proxy when the one it is configured to use is unavailable. One option is to write a script that will automate all these changes for me, but it seems that it might be simpler to have a second child proxy that I can (automatically) start up when cntlm startup fails (it fails if it can't find the parent proxy). The second child proxy would just connect directly to the network, and so if it also listened on 3128 everything configured to hit 3128 could keep its configuration the same. What I can use to do this with? (Or is there a better way?)


title: modetest.c from libdrm tests lists no framebuffers

text: I wanted to play with KMS since it seems to be the preferred low-level graphics library on Linux. However, after compiling the appropriate modetest.c version (2.4.32, since that's the version of libdrm-dev I have), it shows no framebuffers when running.               $ ./modetest     trying to load module i915...success.     Encoders:     id  crtc    type    possible crtcs  possible clones      6   4   LVDS    0x00000002  0x00000001     12  0   DAC 0x00000003  0x00000002     14  0   TVDAC   0x00000003  0x00000004          Connectors:     id  encoder status      type    size (mm)   modes   encoders     5   6   connected   LVDS    330x210     1   6       modes:       name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)       1280x800 60 1280 1312 1344 1408 800 801 804 816       props:     11  0   disconnected    VGA 0x0     0   12     13  0   disconnected    s-video 0x0     0   14          CRTCs:     id  fb  pos size     3   0   (0,0)   (0x0)        0 0 0 0 0 0 0 0 0     4   30  (0,0)   (0x0)       1280x800 60 1280 1312 1344 1408 800 801 804 816          Frame buffers:     id  size    pitch          $      I want to know why no frame buffers are listed.


title: Javascript Adobe Reader problem in some linux distributions

text: Adobe Reader doesn't execute initial javascript code of 3D scene in pdf document. With friends we've tested several linux distributions, namely CentOS, Ubuntu, Arch Linux, Mandriva, OpenSUSE. Also several Adobe Reader versions like 9.4.6 or 9.1. No luck. For some reason though, it works fine in Fedora (with exactly the same Adobe Reader). Here is an example pdf for test: http://www.2shared.com/document/LIbyWm_l/mysterious_dice.html . Just open the mysterious_dice.pdf and you should see a rotating dice. If you dont, javascript wasn't executed properly (it should be easy to check in Windows 7/XP or Fedora). We thought that something is wrong in Reader settings (like disabled javascript), but javascript was always allowed. Then that maybe it is linux Adobe Reader bug, but again, why does it work in Fedora? So maybe some package(s) or something. Another example is the Asymptote application, which uses javascript at the beginning for some scene settings (lights, camera position, etc) and especially with orthographic projection this problem shows up. More about this here: http://sourceforge.net/projects/asymptote/forums/forum/409349/topic/4021157. Any idea what might be wrong with this? I will just add that javascript later on works, only the initial code is ignored. Thanks for any suggestion. :(


title: Uninstall Linux on an embedded board

text: I am using an embedded board, a FOX G20 V with an ATMEL AT91SAM9G20 processor. I would like to know first of all, which specific linux version I am using on this board, but also, how to remove it. What commands do I type through the terminal to do so? Also, once that is done and the linux is removed, I would like to install a compatible compiler with the processor. Does anyone know how I can go about in doing so? Or does anyone have any available links in how I can install a compatible compiler for this board? I'm very new to embedded development and I'm stuck on these two steps at the moment.


title: Help with lost software RAID5 on CentOS 6.5

text: I've been searching for hours and giving up / too scared to delete all my data. I have a file server running CentOS 6.5 which has 4 WD RED 2TB drives (all > 1 year old) in software raid 5 with `mdadm`, and some other drives (not important). I used LVM on top of the RAID5 for easy management and partitioned the volume group as ext4. All of this worked really well until I needed to reboot. Apparently I forgot to save the `mdadm` settings to `/etc/mdadm.conf` and because of this the RAID failed. It contained some info but I've accidentally deleted its contents by running some command I've found via Google. After hours of searching I tried to run `mdadm -assemble`, but this tells me no drive has an super block:               # mdadm --assemble /dev/md0 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1      mdadm: no recogniseable superblock on /dev/sdb1     mdadm: /dev/sdb1 has no superblock - assembly aborted      Also tried without the partition numbers (`/dev/sdb`) but get the same result. Then I came across this command:               # mdadm --assemble --scan --verbose     mdadm: looking for devices for further assembly     mdadm: no recogniseable superblock on /dev/dm-3     mdadm: no recogniseable superblock on /dev/dm-2     mdadm: no recogniseable superblock on /dev/dm-1     mdadm: no recogniseable superblock on /dev/dm-0     mdadm: no recogniseable superblock on /dev/sdg1     mdadm: Cannot assemble mbr metadata on /dev/sdg     mdadm: no recogniseable superblock on /dev/sda1     mdadm: Cannot assemble mbr metadata on /dev/sda     mdadm: no recogniseable superblock on /dev/sdf1     mdadm: Cannot assemble mbr metadata on /dev/sdf     mdadm: no recogniseable superblock on /dev/sdh1     mdadm: Cannot assemble mbr metadata on /dev/sdh     mdadm: Cannot assemble mbr metadata on /dev/sdc1     mdadm: Cannot assemble mbr metadata on /dev/sdc     mdadm: Cannot assemble mbr metadata on /dev/sdd1     mdadm: Cannot assemble mbr metadata on /dev/sdd     mdadm: no recogniseable superblock on /dev/sde1     mdadm: Cannot assemble mbr metadata on /dev/sde     mdadm: no recogniseable superblock on /dev/sdb1     mdadm: Cannot assemble mbr metadata on /dev/sdb     mdadm: no recogniseable superblock on /dev/sdk1     mdadm: Cannot assemble mbr metadata on /dev/sdk     mdadm: Cannot assemble mbr metadata on /dev/sdj2     mdadm: Cannot assemble mbr metadata on /dev/sdj1     mdadm: Cannot assemble mbr metadata on /dev/sdj     mdadm: no recogniseable superblock on /dev/sdi2     mdadm: no recogniseable superblock on /dev/sdi1     mdadm: Cannot assemble mbr metadata on /dev/sdi     mdadm: No arrays found in config file or automatically      The strange thing is if I run specific on the drives it gives me the info:               # mdadm --examine /dev/sdc1     /dev/sdc1:        MBR Magic : aa55     Partition[0] :    432871117 sectors at   3224498923 (type 07)     Partition[1] :   1953460034 sectors at   3272020941 (type 16)     Partition[3] :    924335794 sectors at     50200576 (type 00)      Same result on `sdd1`, but not on `sdb1` and on `sde1`, ie. the other 2 drives. At this point I've given up and don't want to break the RAID. It contains very important data which has no backups (I know really stupid, but I was working on a backup system). Does anyone know how to fix this or recommendation on what to do next? It is really important that I keep the data or can backup the data which is stored on the array. **UPDATE** Since i was to scared to touch it myself and risking completely losing the data. I hired someone from freelancer.com. I got the data back now and making backups of it. After this i will completely rebuild the array to prevent this from happening again. I will also ask him for the recovery process en post it here so other people with the same problem can try to recover there array.


title: Stuck pixel on X

text: Every couple of days, a pixel roughly in the center of my screen gets stuck on white. It can be unstuck by restarting X, or by logging out and back in. However it remains stuck when I call xrefresh. Is there any way of getting X to do a harder refresh than just calling xrefresh, but something short of restarting X (which kills all programs)? Or any ideas about the actual nature of the problem? This is xubuntu 14.04, video is Mobile Intel® GMA 4500MHD.