title: linux + lib/ld-linux.so.2: bad ELF interpreter + cisco VPN client

text: I have Linux red-hat machine - kernel 2.6.32 64 BIT I installed the Cisco VPNC client on my Linux machine according to the instruction in the following site: http://wiki.deimos.fr/Cisco_VPN_Client_:_Installation_sur_une_Red_Hat_6 Installation ended without error except single warning about WARNING: could not find /etc/opt/vpnclient/.libdriver64.so.cmd for /etc/opt/vpnclient/libdriver64.so finally installation ended and I run the vpnclient connect ... ( with the following errors )                   bash: ./vpnclient: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory      please advice how to solve the problem what is missing here?   * short details about my installation: first I download the --> vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz                  tar -xzvf vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz        cd vpnclient       .                patch < vpnclient-linux-4.8.02-64bit.patch       patch < vpnclient-linux-2.6.31-final.diff       .                 sed -i 's/^CFLAGS/EXTRA_CFLAGS/' Makefile       sed -i 's/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/' `find /usr/src -name netdevice.h`       .               ./vpn_install      .                vpnclient connect .....              bash: ./vpnclient: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory


title: Setting up init.d service daemon priority (with or without monit)

text: Does anyone know how to change the process priority with monit? I want a high one. Monit config file for my service so far:               check process RPiQuadroServer pidfile /var/run/RPiQuadroServer.pid       start program = "/etc/init.d/RPiQuadroServer.sh start"       stop program = "/etc/init.d/RPiQuadroServer.sh stop"       Daemon:               #!/bin/bash          ### BEGIN INIT INFO     # Provides:          RPiQuadroServer     # Required-Start:    $remote_fs $syslog     # Required-Stop:     $remote_fs $syslog     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Put a short description of the service here     # Description:       Put a long description of the service here     ### END INIT INFO          WORK_DIR="/var/lib/RPiQuadroServer"     DAEMON="/usr/bin/python"     ARGS="/usr/local/bin/RPiQuadroServer.py"     PIDFILE="/var/run/RPiQuadroServer.pid"     USER="root"          . /lib/lsb/init-functions          do_start() {       log_daemon_msg "Starting system $DAEMON $ARGS daemon"       mkdir -p "$WORK_DIR"       /sbin/start-stop-daemon --start --pidfile $PIDFILE \         --user $USER --group $USER \         -b --make-pidfile \         --chuid $USER \         --exec $DAEMON $ARGS       log_end_msg $?     }          do_stop() {       log_daemon_msg "Stopping system $DAEMON $ARGS daemon"       /sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose       log_end_msg $?     }          case "$1" in       start)         do_start         ;;       stop)         log_daemon_msg "Stopping system $DAEMON $ARGS daemon"         do_stop         ;;       restart|reload|force-reload)         do_stop         do_start         ;;       status)         status_of_proc "$DAEMON $ARGS" "$DAEMON $ARGS" && exit 0 || exit $?         ;;       *)         echo "Usage: /etc/init.d/$USER {start|stop|restart|status}"         exit 1         ;;     esac


title: Deciphering sed commands

text: I just run across the following `sed` command:               sed "s|^/samba|\\|;s|/|\\|g"      I have seen `sed` substitute commands before. I also know sed allows the usage of any character as a delimeter (`|` in this case) and that `g` means global substitution. However, I am not sure what the rest of the command does. Perhaps more generally, how can I **quickly** find information on what a `sed` pattern like the one above does? (other than obviously reading the documentation, which is always recommended)


title: How to get CPU Percentage as a Counter?

text: I would like to monitor total CPU utilization percentage as a counter. The reason I would like it as a counter is that data won't be lost between samples (and I can have the graphing side calculate the rate). My initial approach was to use `/proc/uptime` with the formula `(uptime-(idle_time/num_core))*100`. This generally seems to be accurate across a large number of servers (something like 98% of the time), but sometimes I seem to get erroneous results. For example the following seems to suggest that there was negative CPU usage, which doesn't really make sense:               [root@ny-lb05 ~]# echo -e "scale=10\n ($(cut -f1 -d' ' /proc/uptime)-($(cut -f2 -d' ' /proc/uptime)/16))*100" | bc     5646895.3750000000     [root@ny-lb05 ~]# echo -e "scale=10\n ($(cut -f1 -d' ' /proc/uptime)-($(cut -f2 -d' ' /proc/uptime)/16))*100" | bc     5646891.5625000000      On this server I'm running: `Linux ny-lb05.ds.stackexchange.com 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux` Does someone see an error in this method of calculation? Is there a better way to get CPU utilization as a counter? **Update:**   So what I'm after is the total utilization time as a monotonically increasing counter. I would expect that total utilization should never _decrease_. But that seems to be the case with the following: ` [root@ny-lb05 ~]# read uptime idle </proc/uptime; echo -e "scale=1000\n ($uptime*16-($idle))" | bc 903874.23 [root@ny-lb05 ~]# read uptime idle </proc/uptime; echo -e "scale=1000\n ($uptime*16-($idle))" | bc 903870.29 ` Also, according to /proc/cpuinfo, cores=siblings so I believe HT is not enabled. **Update 2:**   TLDR; /proc/uptime is bugged, use /proc/stat instead.


title: How to make a bitmap font for *nix environments?

text: I have been softy on windows as a font tool to make a bitmap font, it's essentially a modified version of profont I keep using, mostly because the original version is not perfect to me. I also made a proportional narrower version of profont, which I find extremely readable. I want to do the same for my Mac and I also want it to work on any *nix, so I'm opting for a way to make it work for *nix first. I can't understand why fontforge only allows you to make vectorized fonts, I want to make it pixel by pixel...


title: Using qemu to boot OpenSUSE (or any other OS) with custom kernel

text: I want to run OpenSUSE as guest with a custom kernel image which is on my host machine. I'm trying:               $ qemu-system-x86_64 -hda opensuse.img -m 512 -kernel \         ~/kernel/linux-git/arch/x86_64/boot/bzImage -initrd \         ~/kernel/linux-git/arch/x86_64/boot/initrd.img -boot c      But it boots into BusyBox instead. Using `uname -a` shows `Linux (none)`. How do I tell the kernel image to boot with OpenSUSE? I have OpenSUSE installed into`opensuse.img`, and:               $ qemu-system-x86_64 -hda opensuse.img -m 512 -boot c       boots it with the stock kernel.


title: Behavior of ping with partial packet loss on Ubuntu

text: I am specifically looking on the return variables of running ping on my Ubuntu server, the variables I am looking for is: error status, output on stdout, output on stderr. When pinging a host the following three scenarios can happen:   1. The host answers on ALL packets (No error)   2. The host answers on ZERO packets (Error)   3. The host answers on SOME packets (Unspecified behavior) I have read through `man ping`, a couple of times and can't seem to find what I should expect in that situation. I have no way to test this, the only machines I have access to is a Linode virtual server running Ubuntu, and my Macbook running Snow Leopard (Probably not with the same PING program as my server) What should I expect as return variables from the third scenario?


title: How to start graphical interface before login?

text: I've installed Oracle Linux 6.4 (x86_64) on a server as a database server, the packages installed by default didn't include the graphical interface. Following this article, I installed the referred packages and thereafter I could launch the graphical interface using `startx` **after** login. Can I make the server start the graphical server before login and actually login using a graphical greeter (if the term was correct!), or I have to log in first then `startx` after (automatically or manually)?


title: Preventing deletion of system/shell aliased folders

text: Is there a way to prevent deletion of system/shell aliased folders? I want these commands to fail. My shell is bash. Such as:               $rm -rf .     $rm -rf ..     $rm -rf ~     $rm -rf *


title: Running a Script as Soon as a Network Interface is Detected as Active

text: I was just wondering if it was possible to run a script as soon as a test to see if a network interface is up (like a `ping` or something)? I think it would be pretty awesome to update my `yum` when I login, but I want to make sure that I have internet access first. Any ideas?


title: Permissions of webserver's root directory

text: I've had this issue on several setups, and I'm unsure of how to handle it. At first, all of `/var` is owned by `root:root`. Clearly I don't want the web directory to be owned by root, so I do `chown apache:apache /var/www`. However, when someone is `ssh`'d in as root, if they do something like an `svn update` or edit a file, it's going to change the ownership back to root. Is there any way to fix this? I've heard of using something with suPhp, but I'm unsure if it's necessary.


title: Duplicity and GPG: charset conversion

text: I'm using duplicity on OS X Mavericks. If I run my duplicity command, I get the following error:               ===== Begin GnuPG log =====     gpg: conversion from `US-ASCII' to `utf-8' failed: Illegal byte sequence     gpg: “0DB243EE”: skipped: public key not found     gpg: [stdin]: encryption failed: public key not found     ===== End GnuPG log =====      The strange thing is that the backup command worked until recently. How can I fix this?


title: Screen - inherit current window's environment

text: In GNU Screen, how can I create a new window whose shell inherits the environment of the shell in the current window? The usual `Ctrl`+`A` `C` doesn't seem to do this.


title: Cron task in graphic interface

text: I need to open one (or more) browser tab periodically and I decided to use cron. The command in the shell (bash) that correctly executes this task is `chromium-browser http://mysite.com`. If I type it, the browser opens the site in a tab. But the same command inserted as a task in the crontable doesn't work. If I redirect the output of other simple commands in the crontable in a file they work correctly, say               echo "hello world" > /home/user/file      So, shall I redirect the output of the command `chromium-browser http://mysite.com` to my graphic interface? If yes, which would be the device?


title: iKVM: return to graphic mode

text: In iKVM (Supermicro) I have switched to text console mode using `<Ctrl>+<Alt>+<F1>`. How I can switch again to graphic mode? (the same keyshortcut pressing again doesn't do anything).


title: Script to find files with a specific extension but NOT containing specific text

text: I am trying to write a script that basically searches recursively using find (or another method to) to find all files ending with *.p or *.w but does not contain sysvars.i or preprocess.i I am new to scripting and welcome any help, is find the best command to use etc?


title: xorg.conf XkbOption ignored for terminate:ctrl_alt_bksp to restart X

text: I want Ctrl+Alt+Bksp to restart X, so I created an xorg.conf rule: /usr/share/X11/xorg.conf.d/53-zap.conf:               Section "ServerFlags"         Option "DontZap" "false"     EndSection          Section "InputClass"         Identifier      "Keyboard Defaults"         MatchIsKeyboard "yes"         Option          "XkbOptions" "terminate:ctrl_alt_bksp"     EndSection      And checking /var/log/Xorg.0.log:               [  1023.598] (II) XINPUT: Adding extended input device "Asus WMI hotkeys" (type: KEYBOARD, id 11)     [  1023.598] (**) Option "xkb_rules" "evdev"     [  1023.598] (**) Option "xkb_model" "pc105"     [  1023.598] (**) Option "xkb_layout" "us"     [  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"     [  1023.598] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event3)     [  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"     [  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "Keyboard Defaults"     [  1023.598] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard'     [  1023.598] (**) AT Translated Set 2 keyboard: always reports core events     [  1023.598] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event3"     [  1023.598] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1     [  1023.598] (--) evdev: AT Translated Set 2 keyboard: Found keys     [  1023.598] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard     [  1023.598] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input3/event3"     [  1023.598] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id      12)     [  1023.598] (**) Option "xkb_rules" "evdev"     [  1023.598] (**) Option "xkb_model" "pc105"     [  1023.598] (**) Option "xkb_layout" "us"     [  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"      The last line shows that it sees the directive. And yet, when I open a terminal and type `setxkbmap -print -verbose 10`               Setting verbose level to 10     locale is C     Trying to load rules file ./rules/evdev...     Trying to load rules file /usr/share/X11/xkb/rules/evdev...     Success.     Applied rules from evdev:     rules:      evdev     model:      pc105     layout:     us     Trying to build keymap using the following components:     keycodes:   evdev+aliases(qwerty)     types:      complete     compat:     complete     symbols:    pc+us+inet(evdev)     geometry:   pc(pc105)     xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us+inet(evdev)" };         xkb_geometry  { include "pc(pc105)" };     };      I _can_ force the option, `setxkbmap -option terminate:ctrl_alt_bksp`, giving me:               ...     model:      pc105     layout:     us     options:    terminate:ctrl_alt_bksp     Trying to build keymap using the following components:     ...      And I test it and it restarts X correctly. I don't understand. I had this working last week, but now it doesn't load the XkbOption from the xorg.conf file. Is there another layer that sets XKB settings that I don't know about? I'm using Ubuntu 13.10, but with xmonad. I load some gnome utilities (gnome- panel, gnome-screensaver, gnome-keyring-demon), but not gnome-settings-daemon.


title: what does it mean by cold cache and warm cache concept?

text: I read a paper and it used terms “cold cache” and “warm cache”. What does it mean by cold cache and warm cache concept? I visit this but I need something more.


title: What's the difference between shells and xshells?

text: In the KDE menu in Knoppix live CD I saw there is a submenu somewhere with the title 'shells' and another with the title 'xshells'. So seemed to me they are two seperate family of shells. What is the difference between them?


title: Autostart all LightDM seats and show one as default

text: I configured a media-center server running Debian with LightDM, Leapcast and Plex. What I want to accomplish is the following. There should be three LightDM seats, one default seat on which I can login; one seat that runs Leapcast (Chromecast emulator); and one seat that runs Plex Media Center. The last seat should show up as default. Below you can find the relevant part of my lightdm.conf:               [Seat:0]     vt=7          [Seat:1]     allow-guests=false     autologin-user=media-center     autologin-timeout=0     greeter-hide-users=true     session-setup-script=start-chromecast     vt=8          [Seat:2]     allow-guests=false     autologin-user=media-center     autologin-timeout=0     greeter-hide-users=true     session-setup-script=start-media-center     vt=9      This configuration file enables the three seats, as intended. The problem I am facing now is that the default seat (the seat that is shown after booting) seems to be random, sometimes `tty7` show up at boot time (showing the login screen) and sometimes `tty8` shows up (which auto-logins and runs Leapcast). Another problem is that when `tty7` shows up as default, `tty8` is not started automatically. So what I want is   1. to be able to choose the default virtual terminal and   2. make virtual terminal 8 and 9 (Leapcast and Plex) start automatically.


title: How to monitor directory/file changes to rebuild index?

text: Just moved to Ubuntu 12.04 from Windows 7. Under Win 7 I use "Everything" to search files and directories, it can build the index database and update it once any file or directory changes. I'm very used to it so I want know if there is something similar under Ubuntu 12.04. Now my workaround is `updatedb` and `locate`, but I have to `updatedb` every time I want to search something. Also, the results are the absolute file paths, what if I want to know the details of the files?（Say, what should I do if I want to sort the results by created_time?） Is there any way that `updatedb` is automatically executed once I added a file on my disk? If not, are there any tools that can function like "Everything"?


title: Changing the disk scheduler on the fly

text: Can the Linux disk scheduler be changed on the fly by writing to `/sys/block/sda/queue/scheduler`? Should applications (e.g. Mysql) be stopped / started when changing?


title: How to directly read keyboard input in real-time?

text: I am not certain if this is ultimately the correct place to ask this but I am developing a program which requires real-time input from the user. That is; it needs to be able to read the keys being pressed(and optionally held down and released) in real time. What makes this issue a bit troublesome is that I absolutely can not use any kinds of libraries for this; not even the standard C library. So this needs to be handled with raw kernel syscalls and `int 0x80`. I thought I would set stdin to non-blocking mode with `fcntl` and `O_NONBLOCK` and then read the input data from stdin. However, to my surprise my code seems not to be working correctly. Right now it seems that the input gets to be read from stdin _after_ the Enter key is being pressed. The tricky part is that I am finding it troublesome to figure out whether it is the fault of:   * My code not behaving right(most probable)   * My terminal/user/process(whatever handles it?) not having non-blocking write access to stdin(not probable).    * Me assuming wrongly that I can read direct keyboard input from stdin. So my question is that what is the best/usual way of reading direct keyboard interaction **if not** by setting the stdin to non-blocking mode and reading the keyboard input data from there? Or am I correct and should just fix my code? :) (And for the curious, no, it's not a keylogger. It is for a very size limited(executable size <= 256 bytes) demoscene product which requires user to be able to ESC out from the intro.)


title: How do I find out what file Apache is serving when a port is hit?

text: I'm working on a server someone else set up. The server is CentOS 4.6 running Apache/2.0.59 (httpd). They have an update service setup on port 8443. I know it is working but I need to find out what files Apache is serving when someone hits that port. I looked in the httpd.conf file to see if there was anything in there but there was nothing there. I tried using `nmap` too but that only showed me which ports are currently open. If it helps the output of `nmap` was:               8443/tcp open https-alt      So how can I find out what files are served when someone connects to that port?


title: Unprettyfied SSL error message?

text: I am trying to **authenticate** using my **USB smartcard reader** to a website. I am running **Ubuntu 10.04 LTS** , with its most up to date **Firefox browser 3.6.24**. I get the following error message: > Secure Connection Failed > > An error occurred during a connection to www.socialsecurity.be. > > SSL peer was **unable to negotiate** an acceptable set of security > parameters. > > (Error code: **ssl_error_handshake_failure_alert** ) > >   * The page you are trying to view can not be shown because the > **authenticity** of the received data **could not be verified**. >   * Please contact the web site owners to inform them of this problem. > Alternatively, use the command found in the help menu to report this broken > site. > FUBAR Now of course there are multiple potential problems, so I looked them up to try different configurations and settings (at a certain point SSL was modified due to a previously unknown attack) Note that the error message seems selfcontradicting: either there was a mismatch between security parameters acceptable to the server and those acceptable to my setup, or data was sent but I miss a certificate or data was corrupted such that the hash is not the same as the one in the signature,... Is it possible to **display the mismatch** of security parrameters? Is it possible to **display the signature and the entity it refers to** such that I can check if I have the certificate or if there's a new one or ...? In theory I could start to debug mozilla, but I am not in the mood to start debugging a huge complex software like mozilla if somebody else can give me a tip on how to identify the real problem (other than that the error message has been standardized and **prettyfied beyond all recognition** ). Authentication is supposed to rely on the **Belgian eID add-on (1.0.14)** for FireFox. I have **openjre** and **icedtea**. Since this is more of a question about mozilla firefox I thought unix/linux was more suitable than Ubuntu, mod's feel free to move if necessary.


title: Thread id on different linux distros

text: We have a server application which runs fine on ubuntu and the old Mandrake linux, but it consistently fails on Redhat Enterprise Linux (to be precise RHEL 4 Update 8, kernel 2.6.9-89). On RHEL the server usually runs for 40 or more days and after that it stops responding to the incoming connections. We've noticed that on ubuntu for about 5000 incoming connections the server creates only about 50 unique thread ids. At the same time on RHEL for the same amount of incoming connections there are thousands of thread ids. I think that this might be a reason behinds these server hangs. Is there any way that i can check if this is the reason? Maybe some tool which can show the number of "free" threads in the system or a tool which can show "thread leak" in the server? Is there a system setting that controls how threads are allocated and freed? Maybe there's some setting which "bind" a particular thread to an incoming TCP connection and this works differently in ubuntu and RHEL? **PS** I forgot to mention that on RHEL a thread id usually looks like this xxxx004 or xxxx005, where x is some hex digit, e.g. 1E8004 and 750005, and they are always increasing over time.


title: Sort in Linux for column, keeping other values intact

text: NODE_154_length  847 2997     NODE_154_length 3283    4509     NODE_154_length 4672    5715     NODE_154_length 6977    7768     NODE_29_length  3790    4317     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_29_length  158 319     NODE_29_length  1   97     NODE_29_length  1   96 I want the output like:               NODE_154_length  847 2997     NODE_154_length 3283    4509     NODE_154_length 4672    5715     NODE_154_length 6977    7768     NODE_29_length  1   97     NODE_29_length  1   96     NODE_29_length  158 319     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_29_length  3790    4317 **OR**               NODE_29_length   1   97     NODE_29_length  1   96     NODE_29_length  158 319     NODE_154_length 847 2997     NODE_154_length 3283    4509     NODE_29_length  3790    4317     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_154_length 4672    5715     NODE_154_length 6977    7768 `sort -k2,2 file` This sorts all column 2 and gives:               NODE_100_length_46867_cov_66.420166  1   50     NODE_104_length_141_cov_120.127663  1   210     NODE_104_length_141_cov_120.127663  1   210     NODE_104_length_141_cov_120.127663  1   225 This disturbs the complete coordinates for each node. If I try `sort -k2 file` This again gives me weird output, not in sorted manner. I am not able to understand how to use -k option in Linux. I am using bash, Linux 13.10


title: Trigger job only once and only when load is low

text: I'd like have automatic update of my gtags, but only when the system is idle. To achieve this, I'm using `iupdate` to watch over the interesting parts of my source folder. But I have a problem with the "idle" part: I know that the `batch` command can run jobs when the load drops below 1.5 (or a configured value). But it may happen that `iupdate` runs `batch` multiple times before the job is executed which would lead to multiple gtags updates. Of course I could create some lockfile and start `batch` only if it wasn't called before. But is there some more standard method? I'm hoping for something like `batch_only_once` ...


title: ssh login in Bash script

text: I've been working on a series of scripts to perform tasks on my remote server, but have gotten stuck at how to log in via ssh mid script, as I cannot enter the password automatically. Is there a way to do so? echo "logging in.. \n" ssh username@IP somehow hardcode in password nextCommand


title: How to generate just a key with openssl

text: I run this command to generate a CSR and a new key with openssl:               openssl req -new -nodes -days 9000 -config /etc/ssl/openssl.cnf -out /etc/ssl/certs/mycompany.com.csr -keyout /etc/ssl/private/mycompany.com.key      I can't figure out what command I can run to generate just the key and not the CSR?


title: Time out logs in apache

text: Can anyone please help me in debugging the below logs from apache mainly timeout error. I have configured self signed ssl certificate for my abc.com website. But I am getting below logs in my sslerror log file.               [Thu May 15 12:54:21.769257 2014] [ssl:info] [pid 21027:tid 139646052787968] (70007)The timeout specified has expired: [client 192.168.0.136:51377] AH01991: SSL input filter read failed.     [Thu May 15 12:54:21.769332 2014] [ssl:debug] [pid 21027:tid 139646052787968] ssl_engine_io.c(988): [remote 192.168.0.136:51377] AH02001: Connection closed to child 148 with standard shutdown (server xplic8.com:443)     [Thu May 15 12:54:32.971133 2014] [ssl:info] [pid 21027:tid 139646042298112] [client 192.168.0.136:51390] AH01964: Connection to child 149 established (server xplic8.com:443)     [Thu May 15 12:54:32.971399 2014] [ssl:debug] [pid 21027:tid 139646042298112] ssl_engine_kernel.c(1966): [client 192.168.0.136:51390] AH02043: SSL virtual host for servername xplic8.com found     [Thu May 15 12:54:32.973733 2014] [ssl:debug] [pid 21027:tid 139646042298112] ssl_engine_kernel.c(1899): [client 192.168.0.136:51390] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)     [Thu May 15 12:54:32.973834 2014] [ssl:info] [pid 21027:tid 139646042298112] (70014)End of file found: [client 192.168.0.136:51390] AH01991: SSL input filter read failed.


title: Installing iPython3 Fedora 20

text: It was very easy to install `ipython` and upgrade it to the newest version (2.0) using pip. However, I want to set up `ipython3`, which uses Python 3, and found it more difficult. I finally installed it using `yum`, but I can't figure out how to upgrade to the recent version. Any advice? I am not completely proficient with Linux by the way. I read about pip3 being used but couldn't figure out how to use that.


title: system monitoring tools

text: What command line utilities come standard with sunos to do system monitoring? I've been able to find `prstat`, but I would like something that will tell me memory usage and IOWAIT as well. It looks like this particular machine uses sunos 5.8


title: Debian Wheezy and perl modules installed into /root not system

text: I have small problem cause everytime i issue               cpan YAML      or try to install any perl module it install's it inito `/root/perl5` and with this any other user cannot use modules that I've installed as a root. Even if I do               rm -frv /root/perl5 /root/.cpan      and rerun `cpan YAML` it still installs into root home dir. How can i change this ?


title: Which is a better way to search- find with regex or find with grep?

text: Of these two ways of searching a file recursively in all the subdirectories, which is faster / better ?               find . -regex ".*/.*abc.*"      or               find . | grep ".*abc.*"


title: On Ubuntu Linux, is it normal for mandb to run continuously (apparently in the background)?

text: I have access to a Ubuntu Linux node at my institution. The nodes are shared among the group, but typically I am the only person who uses this particular node. I am running a calculation in parallel on all 8 CPUs on this node. My calculation runs, but when I view the active processes using `top`, I see an additional process that says user `man` and command `mandb`. This `mandb` command seems to be running every time I look at `top`, and it appears to take up a fairly appreciable amount of CPU power (`6 %CPU`) and memory (`2.5 %MEM`), according to `top`. When I look around on the internet, it seems that: > `mandb` is used to initialise or manually update index database caches that > are usually maintained by man. Why, then, does `mandb` run all the time on this node? (I don't have this problem on other nodes within my institution's cluster, according to `top` on other nodes.) Why would `mandb` need to run all the time, since I am _not_ currently looking at manuals? Is this process likely to be a phantom process that I can safely terminate using `kill`?


title: Are there any source APT repositories for Debian Lenny?

text: Debian Lenny, the current oldstable, ceased receiving security updates early in February, and now seems to no longer be hosted at the usual FTP mirrors (see, e.g., `curl http://ftp.nl.debian.org/debian/dists/lenny/ | less`). Are there any surviving FTP repositories of Lenny that can be used via APT?


title: How to find out why a Java process died without a trace in Linux

text: A java process running in our SUSE Linux machine died without leaving a trace as to why it died. If it was killed with kill , it would have been logged and we would have known because the process intercepts that signal. If it crashed, we would have seen a core dump. If it died due to an exception, we would have known due to exception logging. However, the process simply disappeared. I know it was running and then it was not running. I have checked the bash history of all users, and there is no indication of a `kill -KILL` being performed (this is the only way I can think of that this process can die without a trace). I suspect that `kill -KILL` or `kill -9` caused the process to die without a trace. My questions:   1. Is there any way that Linux would kill a process silently?    2. Is there any way to figure out if a process died in the past with a kill -KILL?


title: How to tell which files have been created by an application?

text: I want to find out what files an application has created or modified. In the old days it was easy. `cc foo.c` created `a.out`, `cc -o foo foo.c` created foo, `cc -c foo.x` created `foo.o`. Now applications create files in `/var`, in `/tmp`, in some dotted directory in your home folder... At last count I have more then 1.6 million files on my computer, so I can't just go searching for the files. So is there a way to find out. Assuming you want to know before running an application. **PS** It looks like writing a ( hopefully ) small program using ptrace to trap the calls to write comes close. I would have to figure out the filename given the handle, which I can do. But before I can do that I must figure out a way whether a handle is associated with "a real file" or a system artifact such as a socket.


title: `ls` command does not list latest directory contents

text: The Linux shell does not print up-to-date information when it comes to ls. For example I use my other processes (IDEs etc) to create some directories. However when I run an ls command I don't see these directories. It normally takes a few seconds sometimes minutes for that directory to appear in the ls output. What is happening? Can I force a refresh? Ideally when I say "ls" I want to see the status when I typed the command not some cached result. The file system is not an NFS share. The only other thing I can think of is the directory was created by a program when run from Eclipse (and the display was routed to my local windows box) I don't know how this can affect things though?


title: I want to install a library which requires a python version and, having two installed, finds the wrong one

text: I want to install a library on my debian machine and it requires a python version above 2.6.6-7. The machine had installed the version 2.5.2-3, so I installed python 2.7. When I run python -V, the output is "Python 2.7", but when I try to install the library, it outputs "Version of python on system is 2.5.2-3.". How can I solve this? The library I'm using is paramiko, in order to use ssh communication. If, instead of solving the above, you could suggest another library which works with python 2.5, it would be apreciated as well. Thanks


title: CONFIG_PPP_MPPE=m vs CONFIG_PPP_MPPE=y

text: What is the difference between 'm' and 'y'? I am reading a guide, and the first step is to make sure that my kernel supports PPP and MPPE. It should be:               # cat /boot/config-`uname -r` | grep G_PPP=     CONFIG_PPP=y     # cat /boot/config-`uname -r` | grep MPPE     CONFIG_PPP_MPPE=y      I get:               root@N550JV:~# cat /boot/config-`uname -r` | grep G_PPP=     CONFIG_PPP=y     root@N550JV:~# cat /boot/config-`uname -r` | grep MPPE     CONFIG_PPP_MPPE=m     root@N550JV:~#       My `uname -r`:               3.8.0-39-generic


title: Iinstallation of Kali linux under dual boot in Win-7

text: I am completely new to Linux and its related distributions and I am trying to install the Kali-Linux in Wind 7 64 bit OS through dual boot option. I have downloaded the kali-64 bit mini.iso and after a restart my latop shows the installation progress and later displays the Installation box with several options to install(graphics, network,language etc.). Now my problem is after selecting the default and the secondary language gives me a dialog box with network configuration . For which when I click configure it takes a while and later it says network configuration not completed. I tried different options but stuck at the same network configuration option . For which I finally removed the installer. I am ready to start from scratch. A step by step help guide would be helpful.


title: truecrypt 1: Syntax error: “(” unexpected

text: I want to use truecrypt on a Linux machine. It is CLI mode only. So I downloaded the x64 and x86 and tried or run the extracted executable file for each version (x64 & x86), but it doesn't work. It gives me:               ./truecrypt          ./truecrypt: 1: Syntax error: "(" unexpected      I'm running MontaVista Linux Professional Edition 4.0 (0501140) `Linux/armv5tejl 2.6.10_mvl401-davinci_102_mw`. It's 2.6.10 kernel. Truecrypt supports 2.6 kernels. So what is wrong here?


title: Domain has exceeded the max defers and failures per hour - No Cpanel

text: I am receiving the following error with for most emails that are sent:               Domain *** has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded.      I am using PHPMailer to send emails and my software is sending quite a lot of emails per hour. I have read about changing settings in cpanel to fix this but I do not have cpanel installed on this box. Is there a way of editing the deferred/failed settings without cpanel? I am running CentOS 6.4 x32_64 and php v5.3.3


title: How to embed a shell command into a sed expression?

text: I have a text file with the following format:               keyword value     keyword value     ...      Where keyword is a single word and value is everything else until the end of line. I want to read the file from a shell script, in a way that the values (but not the keywords) undergo shell expansion. With sed it's easy to match the keywords and value parts               input='     keyword value value     keyword "value  value"     keyword `uname`     '          echo "$input"|sed -e 's/^\([^[:space:]]*\)[[:space:]]\(.*\)$/k=<\1> v=<\2>/'      which produces               k=<keyword> v=<value value>     k=<keyword> v=<"value  value">     k=<keyword> v=<`uname`>      but then the question is how can I embed a shell command into the replacement part of the sed expression. In this case I would like the replacement to be `\1 `echo \2``.


title: Hotplug area too small error

text: I have VM running under RHEL6, which is running under HyperV. It has a lot of important soft installed, but does not have suffocating workload (~10% CPU is used). It's been really unstable recently unexpectedly showing different I/O errors:               ps aux | grep httpd     -bash: /bin/ps: Input/output error     -bash: /bin/grep: Input/output error      I tried to fix drives by running `fsck`, but I've got following error:               /dev/mapper/vg_vm-lv_root: recovering journal     fsck.ext4: Bad magic number in super-block while trying to re-opoen /dev/mapper/vg_vm-lv_root     Warning... fsck.ext4 for device /dev/mapper/vg_vm-lv_root exited with signal 11.      And now it's being rebooted unexpectedly showing following error:               SRAT: Hotplug area too small offline device     ..MP-BIOS bug: 8254 timer not connected to IO-APIC     Kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic=debug and send a report. Then try booting with the 'noapic' option.      I made snapshots, but rolling back to any of them does not help. As it turns out, this problem existed all the time, but it has become apparent only recently with more frequent rebooting and I/O errors. I do not have official Red Hat support as it is the evaluation installation - I wanted to see how it works, test it and prove management I really need this OS. But all I want now is to save configuration of installed software in order to be able to move all data to another server. I cannot do this now - server is being rebooted 2 minutes after is has been started. No chance to export any data. It seems that I'm stuck, I can't figure out what is the problem. Can someone explain what is happening? Maybe it was not configured properly on the HyperV virtual server? Can I fix it without OS reinstallation?


title: show filesystem instead of "places" in gtk file chooser

text: In almost any program, when I click on `open`, a file chooser dialog opens as shown below. This dialog shows `recently used` files `Desktop` and so on. ![file chooser](http://i.stack.imgur.com/8pMij.png) This is extremely annoying. I would like to see my directory tree instead. I know I can get the directory tree when I click on `File System`, but I would like to have that selected by default. I understand this is a `gtk2` issue and there are several questions on stack regarding this problem. But I have found no real solution. I am not asking how to disable the `recently used` files. I have already done that. The list is empty, but `recently used` still shows in the file chooser window. I am using `LXDE` desktop environment on Debian Wheezy.


title: What's the difference between Linux and Linux LVM?

text: If I want to install new hard drive should I make the file system Linux or Linux LVM? Also after that I've got to format again with `mkfs.ext4`. Actually what are we doing? The first one is formatting and the second one is formatting again? Why doesn't Windows have this issue?


title: configure allowed_tcp_congestion_control via config files in linux kernel

text: I am trying to come up with a custom set of TCP congestion control variants as part of the `tcp_allowed_congestion_control`. I do have multiple variants on my `tcp_available_congestion_control` list but not sure how I would add some of them to my allowed list. I am aware we are able to change it in our installed kernel via `echo variant1 variant2 > /proc/sys/net/ipv4/tcp_allowed_congestion_control` but is there a way I could directly change this via the config files in the linux kernel source code.


title: Error while installing perl-DBD-mysql

text: When I want to install perl-DBD-MySQL I get this error: `yum install perl-DBD-MySQL.x86_64`               Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed     --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Finished Dependency Resolution     Error: Package: perl-DBD-MySQL-4.013-3.el6.x86_64 (base)                Requires: libmysqlclient.so.16()(64bit)     Error: Package: perl-DBD-MySQL-4.013-3.el6.x86_64 (base)                Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest      Using `--skip-broken` :               Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed     --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Finished Dependency Resolution          Packages skipped because of dependency problems:         perl-DBD-MySQL-4.013-3.el6.x86_64 from base      What package should I install?


title: Can I setup a loopback audio device?

text: If I can send audio to the output devices, then I can record the same audio as a wave. With filesystems, you can just setup a loopback filesystem and write binary data on a file instead of a device. My question is: Can I send the audio signal to a (for instance) WAV file instead of my audio devices? How?


title: Keychain SSH Key Manager prevents SFTP login on CentOS

text: I installed `keychain` and added this to my `.bashrc` in CentOs to help manage my SSH Keys:               /usr/bin/keychain --clear $HOME/.ssh/id_rsa     source $HOME/.keychain/$HOSTNAME-sh      So on SSH login I am prompted to enter the key's password which will endure until reboot or session termination. While this is enabled any SFTP login attempts are then halted at authentication. How can I leave keychain support enabled while disregarding for SFTP logins? Is this possible? I don't want to have to enable/disable when I need to do things.


title: /dev/tcp listen instead of nc listen

text: With a netcat listener like:               nc -l <port> < ~/.bashrc      I can grab my .bashrc on a new machine (doesn't have `nc` or LDAP) with:               cat < /dev/tcp/<ip>/<port> > ~/.bashrc      My question is: Is there a way to mimic the capabilities of `nc -l <port>` in my first line with /dev/tcp instead of `nc`? The machines I'm working on are extremely hardened lab/sandbox environment RHEL (no ssh, no nc, no LDAP, no yum, I cant install new software, and they are not connected to the internet)


title: Configure Client Computers to Transfer Data Through a Proxy Server

text: what is the equal of below text in linux. i read that doesn't have registry. please asnwer only if you know not for post growth. Start the Windows Registry Editor on the local mode client system. expand the registry path.Processor Description 64-bit HKEY_LOCAL_MACHINE, SOFTWARE, Wow6432Node, VMware Inc., VMware VDM 32-bit HKEY_LOCAL_MACHINE, SOFTWARE, VMware Inc., VMware VDM Edit > New > String Value and type useProxyForTransfer in the new value entry. Right-click the useProxyForTransfer entry, click Modify, type true, and click OK. Thank you very much.


title: Remove BS and ESC from Log files

text: Whenever I use the `script` command to record the keys I type or when I activate the logging mode in `screen`, all BS (Backspace) and ESC (Escape) key presses are also included in the file. e.g: `cd ~/foo/tpBSBStmp`. Is there a way to auto remove the BS or the ESC from the file so the final recorded command included in the file would be `cd ~/foo/tmp`? Btw, this also happens in the logging feature of Putty. I'm open to any scripts that remove the unwanted characters or even another commands that do the same job


title: ext4 formatting weirdness

text: Just got a new 2TB hardrive for my Debian Squeeze Box. Trying to format it in ext4 after creating a Primary partition using cfdisk. I just did this exact process with a 120GB drive on the same system with no problems. After searching for the returned error on Google, it seems that it usually comes up when people are trying to format an Extended partition, not a Primary. Mine is a primary and is still showing the error. See my shell output below for the details. Any idea why this is giving so much trouble? Output of `fdisk -l`:               Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes       255 heads, 63 sectors/track, 243201 cylinders       Units = cylinders of 16065 * 512 = 8225280 bytes       Sector size (logical/physical): 512 bytes / 512 bytes       I/O size (minimum/optimal): 512 bytes / 512 bytes       Disk identifier: 0x00000000                    Device Boot      Start         End      Blocks   Id  System       /dev/sdb1               1      243201  1953512001   83  Linux      And then:               :~# mkfs.ext4 /dev/sdb1       mke2fs 1.41.12 (17-May-2010)       **mkfs.ext4: inode_size (128) * inodes_count (0) too big for a               filesystem with 0 blocks, specify higher inode_ratio (-i)               or lower inode count (-N).**      tried again using `/dev/sdb`:               :~# mkfs.ext4 /dev/sdb       mke2fs 1.41.12 (17-May-2010)       /dev/sdb is entire device, not just one partition!       Proceed anyway? (y,n) y       /dev/sdb is apparently in use by the system; will not make a filesystem here!       :~#


title: How would I use sed to detect a certain amount of numbers before it inserts a character? ###-###-####

text: I need to format phone numbers in a text file. They appear as (example) `8014516912` How would I format it so that I can insert a `-` after the first 3 numbers, and then another `-` after another 3 numbers, so it would appear as `801-451-6912` How would I do this for all lines that contain a phone number? Keep in mind that the phone numbers are between text, so the numbers aren't always at the same index. For example it can be like:               atewfnwieug 8204919561     adw 8915617141


title: How would I use sed to insert a character at a certain character position on only ONE line?

text: I am aware that this will do what I want on all lines:               sed 's/^\(.\{4\}\)/\1-/' textFile      But how would I enter a - after the 4th character slot on ONLY the 5th line? Or even better, on a range of lines, like from 5-7?


title: Fix for: /usr/lib/libnssutil3.so: undefined reference to `PL_ClearArenaPool'

text: Error occurs during attempt to make via:               cc -m32 -s -o ford_check_password ford_check_pws.o wsl4_cookie_auth.o fds_auth.o -L. -L/ford/thishost/proj/dmadmin/ford/lib -lcrypto -lldap50 -lssldap50 -lprldap50 -lnss3 -lssl3 -lnspr4 -lvalidate4          Error:  /usr/lib/libnssutil3.so: undefined reference to `PL_ClearArenaPool'


title: How Do I Set Up Multiple NIS Servers For CentOS 6 Clients?

text: What is the correct `/etc/yp.conf` format for indicating a NIS domain has more than one NIS server available to it? Also, how does the client decide to look for another server? I've tried this:               domain NIS server nis1     domain NIS server nis2      ...but everything binds to nis1. If I reboot nis1, everything just hangs until nis1 comes back, I don't see them seeking new servers. For security reasons, broadcast definitions are not acceptable. **Edit:** perhaps I'm unclear. My question is: I have two nis servers, one master and one slave. How do I configure CentOS client X such that it has access to both nis servers?


title: Is fsck -N mounted file system dangerous

text: I've read to never run fsck when the file system is mounted. What about running fsck -N to only identify but not repair the file system when mounted? Is that dangerous? Is fsck -N known to overload a system and slow it down?


title: GTK Icons for special files

text: Does named pipe for instance have it's icon, I have a theme for GTK and when I've create named pipe it give icon from `gtk-file.svg` file or symlinks that point to that:   * application-x-empty.svg   * empty.svg   * gnome-fs-regular.svg Is there a place where I can find a list of those types? I can't find them in `/usr/share/mime`. I found this 2 links:   * https://developer.gnome.org/icon-naming-spec/   * http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html but there is no `gnome-fs`


title: What would stop a task from being run in the background?

text: I have a script I'm trying to launch with               php ./Script.php &      The task goes into the background but it is stopped. When I try to run it with bg it simply stays stopped.               $ jobs     [1]+  Stopped                 php ./Script.php     $ bg     [1]+ php ./Script.php &          [1]+  Stopped                 php ./Script.php     $      ps shows the job state as T               $ ps ax | grep Script     951 pts/5    T      0:00 php ./Script.php      cat /proc/PID/wchan shows "pipe_wait" Update: This happens with any PHP script, even `<?php sleep(1000)`; Update: Thanks for all the great answers and comments. I understand why this is happening on a technical level now, but I'm not sure what about some versions of PHP are causing this. But, that is not a *nix question.


title: How can I make chrome (stop asking to be) the default browser?

text: I am running Linux Mint Debian edition (essentially Debian testing) and the Cinnamon desktop environment. Every time I launch `google-chrome` it asks to become the default browser. I have told it to do so in all ways I can think of but I still get this pop-up: ![enter image description here](http://i.stack.imgur.com/OUO8V.png) What I have tried:   * Clicking on "Set as default" in the pop-up.   * Making chrome the default in it's settings: ![enter image description here](http://i.stack.imgur.com/mvQfu.png)   * Using my desktop environment's (cinnamon) settings app to set it as default: ![enter image description here](http://i.stack.imgur.com/SOHtK.png)   * Associating it with all relevant mimetypes in the various ways and files where such things are defined:              $ xdg-mime query default text/html      chrome.desktop          $ grep chrome .local/share/applications/mimeapps.list     text/html=chrome.desktop     x-scheme-handler/http=chrome.desktop     x-scheme-handler/https=chrome.desktop     x-scheme-handler/about=google-chrome.desktop     x-scheme-handler/about=google-chrome.desktop;     text/html=emacs.desktop;google-chrome.desktop;firefox.desktop;     x-scheme-handler/http=chrome.desktop;          $ grep chrome /usr/share/applications/defaults.list     application/xhtml+xml=google-chrome.desktop     text/html=google-chrome.desktop     text/xml=gedit.desktop;pluma.desktop;google-chrome.desktop     x-scheme-handler/http=google-chrome.desktop     x-scheme-handler/https=google-chrome.desktop      In those files, I replaced all occurrences of `firefox` (my previus default) with `google-chrome`. No other browsers are defined anywhere in the file:              $ grep -E 'firefox|opera|chromium' /usr/share/applications/defaults.list \         .local/share/applications/mimeapps.list     $         * Launching chrome as root in case that helps but it won't let me: ![enter image description here](http://i.stack.imgur.com/3kTWZ.png)   * Using Debian's alternatives system to set it as default:              $ sudo update-alternatives --install /usr/bin/www-browser www-browser /usr/bin/google-chrome 1080     update-alternatives: using /usr/bin/google-chrome to provide /usr/bin/www-browser (www-browser) in auto mode          $ ls -l /etc/alternatives/www-browser     lrwxrwxrwx 1 root root 22 Jan 23 17:03 /etc/alternatives/www-browser -> /usr/bin/google-chrome      None of these seem to have any effect. Will no one rid me of this turbulent pop-up?


title: convert display to monochorme

text: My Asus netbook has Debian Wheezy. I came across a weird idea. How would it look if my display screen is monochrome. Is it possible to configure X11 to make the display monochrome?


title: /etc/environment not working

text: I am using Ubuntu 12.04. Recently, I accidentatlly removed `python`, causing a huge number of packages to be uninstalled. I reinstalled them, but now I am having problems.               $ echo $PATH     /home/paul/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/paul/.rvm/bin      Note that there is no `/sbin` or `/usr/local/sbin`! I have no idea how that happened! Thus,               $ sudo apt-get autoremove -y     ...     dpkg: warning: 'ldconfig' not found in PATH or not executable     ...     $ sudo shutdown now     sudo: shutdown: command not found.      I've gone looking. `/etc/environment` (which I have not touched) has               $ cat /etc/environment     PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"      I've rebooted (a couple times). Why doesn't my path have `/sbin`? **UPDATE** I tried creating a new user               $ sudo adduser paul-test     $ su -- paul-test     $ echo $PATH     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      Also,               $ sudo su     $ echo $PATH     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      So something is killing `/sbin` for me. I've checked `.bashrc`.               PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting      And .profile               PATH="$HOME/bin:$PATH"      There is no `~/.bash_profile` or `~/.bash_login`. **FYI** This the same problem described here and here and many other places. They treat the symptom of `apt-get` not working, rather than correcting the real problem of no `/sbin`.


title: Changing text color in c-shell

text: I can change the text color in the terminal permanently by adding this:               export PS1="\e[0;31m[\u@\h \W]\$ \e[m"      to the `.bashrc` file. Now I have to go into cshell, what is the corresponding way?


title: Working with rar files

text: I have a directory full of rar files, with extensions ranging from `.r00` to `.r30`. It also has one file with `.rar` extension. From all of this must come a video file. How do I do it?


title: Compatible Wireless Router?

text: I'm looking for a wireless router for personal use. I have a small apartment and need the router primarily for my android phone connection. I might need it for streaming video as well. I'm running Kubuntu on a ThinkPad T61p. My wireless card is: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) I'm looking for a reasonably feature-rich router that I will not have to change in the next 2-3 years. Some of the brands I've been recommended so far are: NetGear such as WNR3500L or 3500 D-Link such as DIR 655 Linksys Any ideas? Or any up2date list?


title: vim -N mode: where to use it?

text: I am following the Peepcode screencasts to learn vim. The presenter mentions about the `-N` mode but doesn't elaborate it much and says that it should be the default mode. My questions:   * What is the `-N` mode?   * Should I always use it?    * If yes, how do I configure it in the `.vimrc`? EDIT: The author does mention that it should always be used, but doesn't elaborate why and how. Thanks for your time.


title: running kernel on QEMU

text: I face this message:               Failed to execute /initKernel panic - not syncing: no init found.      Try passing init=option to kernel.      I am using this command line:               qemu-system-x86_64 -hda disk.img -kernel /home/marssonubuntu/linux_qemu/linux-3.3.3/arch/x86/boot/bzImage -initrd my-initramfs.cpio -append "root=/dev/sda rdinit=/sbin/init"      on qemu, the full message is:               Failed to execute /sbin/init Kernel panic - not syncing: No init found.      Try passing init= option to kernel. see Linux Documentation/init.txt for guidance.      Pid: 1, comm: swapper Not tainted 3.3.3 #1      Call Trace:      [<ffffffff811d78b4>] ? panic+0xa9/0x197     [<ffffffff811d6927>] ? init_post+0xb2/0xb2     [<ffffffff812aad96>] ? kernel_init+0xff/0xff     [<ffffffff811dcd44>] ? kernel_thread_helper+0x4/0x10     [<ffffffff812aac97>] ? do_one_initcall+0x121/0x121     [<ffffffff811dcd40>] ? gs_change+0xb/0xb


title: removing spaces from first column

text: My input file has positions in first column with different number of spaces (or no space)               16504   16516                1650811   16520            1651   16524             16516111   16528             165204   16532             I need to get an output file where fist column has no spaces at all, while keeping second column as it is.               16504   16516            16508   16520          16512   16524           16516   16528            16520   16532


title: NAS device failed and I am attempting to get data back - HELP!

text: Not a Linux guy!~ Tried on windows pc and failed. Put the Nas device hard drive is in an older pc with Kali in forensic mode because device failed and all no longer allowed access to data on hard drive Kali shows the Hitachi drive but states "unallocated". To my knowledge all data was on when failure occurred. This drive has all data for 12 years of kids, family, etc. Tried fdisk and cannot get access either, also tried mounting several ways to no avail. All help is appreciated


title: Centos : yum errors : dependencies conflict

text: On Centos 5, for installing some program, i need to upgrade libxml2. But i can't because of another package (libxml2-python) that seems needing my current obsolete version of libxml2 Can you help me to solve this?               [root] # yum install libxml2 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Excluding Packages from CentOS-5 - Plus Finished Excluding Packages from CentOS-5 - Updates Finished Setting up Install Process Resolving Dependencies     --> Running transaction check     ---> Package libxml2.i386 0:2.6.26-2.1.21.el5_9.3 set to be updated     --> Finished Dependency Resolution          Dependencies Resolved          ==========================================================================================================================================================  Package                           Arch                           Version                                            Repository          Size     ========================================================================================================================================================== Installing:  libxml2                           i386                        2.6.26-2.1.21.el5_9.3                              base                           799 k          Transaction Summary     ========================================================================================================================================================== Install       1 Package(s) Upgrade       0 Package(s)          Total size: 799 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug ERROR with rpm_check_debug vs depsolve: libxml2 is needed by (installed) libxml2-python-2.6.32-1.i686 Complete! (1, [u'Please report this error in https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=yum'])


title: Virtual machine hangs when trying to login after beeing idle for som time

text: I'm using _Microsoft Virtual PC 2007_ to run a linux virtual machine, but after some time I can't login to it -- not from the instance on the localmachine or ssh in to the machine. Both give the same response. The login process doesn't finshf, the image shows where it stops: ![enter image description here](http://i.stack.imgur.com/VtNMU.png) This only happens when the vm has been running for some days, if I reboot it works fine again for some time before it locks up like this again. Does anyone have an idea of why this is happening? **Edit:** Here are the files. `ls -l /var/pam.d/`:               -rw-r--r--  1 root root 1208 2011-01-20 09:17 common-account     -rw-r--r--  1 root root 1260 2011-01-20 09:17 common-auth     -rw-r--r--  1 root root 1509 2011-01-20 09:17 common-password     -rw-r--r--  1 root root 1201 2011-01-20 09:17 common-session     -rw-r--r--  1 root root  182 2009-04-17 09:53 atd     -rw-r--r--  1 root root  384 2009-04-04 07:42 chfn     -rw-r--r--  1 root root  581 2009-04-04 07:42 chsh     -rw-r--r--  1 root root 3592 2009-04-04 07:42 login     -rw-r--r--  1 root root   92 2009-04-04 07:42 passwd     -rw-r--r--  1 root root 2305 2009-04-04 07:42 su     -rw-r--r--  1 root root   69 2009-03-27 17:18 samba     -rw-r--r--  1 root root  520 2009-03-21 10:28 other     -rw-r--r--  1 root root  168 2009-02-20 18:24 ppp     -rw-r--r--  1 root root  119 2009-02-17 04:22 sudo     -rw-r--r--  1 root root 1272 2009-01-28 21:58 sshd     -rw-r--r--  1 root root  289 2008-11-12 16:47 cron      `/etc/pam-.d/login`: (comments removed)               auth       optional   pam_faildelay.so  delay=3000000     auth       [success=ok ignore=ignore user_unknown=ignore default=die]  pam_securetty.so     auth       requisite  pam_nologin.so     session    required   pam_selinux.so close     session       required   pam_env.so readenv=1     session       required   pam_env.so readenv=1 envfile=/etc/default/locale          @include common-auth          auth       optional   pam_group.so     session    required   pam_limits.so     session    optional   pam_lastlog.so     session    optional   pam_motd.so     session    optional   pam_mail.so standard          @include common-account     @include common-session     @include common-password          session required pam_selinux.so open      `/etc/pam.d/common-account`:               account[success=1 new_authtok_reqd=done default=ignore]pam_unix.so      accountrequisitepam_deny.so     accountrequiredpam_permit.so      `/etc/pam.d/common-account`: common-auth               auth[success=1 default=ignore]pam_unix.so nullok_secure     authrequisitepam_deny.so     authrequiredpam_permit.so     authoptionalpam_smbpass.so migrate      `/etc/pam.d/common-auth session`: session               session[default=1]pam_permit.so     sessionrequisitepam_deny.so     sessionrequiredpam_permit.so     sessionrequiredpam_unix.so      sessionoptionalpam_ck_connector.so nox11      `auth.log`: (15:36 is problably when I tryed to ssh to the vm, and I got the fault and did a reboot.)               Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session opened for user root by (uid=0)     Jun 30 14:17:01 us CRON[1435]: pam_unix(cron:session): session closed for user root     Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session opened for user root by (uid=0)     Jun 30 14:20:01 us CRON[1458]: pam_unix(cron:session): session closed for user root     Jul  4 15:36:35 us sshd[1945]: Server listening on 0.0.0.0 port 22.     Jul  4 15:36:35 us sshd[1945]: Server listening on :: port 22.     Jul  4 15:36:37 us sshd[1945]: Received signal 15; terminating.     Jul  4 15:36:37 us sshd[2052]: Server listening on 0.0.0.0 port 22.     Jul  4 15:36:37 us sshd[2052]: Server listening on :: port 22.     Jul  4 15:39:01 us CRON[2478]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:39:01 us CRON[2478]: pam_unix(cron:session): session closed for user root     Jul  4 15:40:02 us CRON[2565]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:40:08 us CRON[2565]: pam_unix(cron:session): session closed for user root     Jul  4 15:42:29 us login[2451]: pam_unix(login:session): session opened for user glennwiz by LOGIN(uid=0)     Jul  4 15:50:01 us CRON[2677]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 15:50:02 us CRON[2677]: pam_unix(cron:session): session closed for user root     Jul  4 16:00:01 us CRON[2754]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 16:00:01 us CRON[2756]: pam_unix(cron:session): session opened for user root by (uid=0)     Jul  4 16:00:02 us CRON[2756]: pam_unix(cron:session): session closed for user root     Jul  4 16:00:02 us CRON[2754]: pam_unix(cron:session): session closed for user root     Jul  4 16:03:37 us sshd[2799]: Accepted password for glennwiz from 148.140.26.150 port 51330 ssh2     Jul  4 16:03:37 us sshd[2799]: pam_unix(sshd:session): session opened for user glennwiz by (uid=0)


title: Emacs temp dot hash file don't exist

text: I use `find | xargs grep` a lot when working on large source code and when I didn't save a file in Emacs it creates `.#SomeFile` and grep give error that there's not such file (I'm not including because it's localized) The same when I run:               ls -A dir/ | grep '^\.#' | xargs file      I've got:               .#SomeFile: ERROR: cannot open `.#SomeFile' (No such file or directory)      Why is that?


title: Weird control-d behavior

text: I can use `cat` as a very simple text editor by doing `cat > foo.txt`.   If I then type:               bar     baz      and then press `ctrl`+`D`, it now looks like this:               $ cat > foo.txt     bar     baz^D      with the cursor at the `^`. If I then press it once more the file will get saved. However if I press anything (okay maybe not anything, but mostly anything) else, I just continue to edit the file. Is this normal behavior?


title: Automatically rename files when they are placed in a specific directory

text: Is it possible to automatically rename a file when it's placed in a specific directory? For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should rename to "file1_{current timestamp}"


title: How to create a permanent alias without resourcing the .bashrc-like file?

text: I really like bash aliases, it annoys me that every time I want to add a new alias I have type two commands:               echo "alias \"short-cmd\"='long-command'" >> ~/.bash_aliases     source ~/.bash_aliases      Any way I can create an alias permanently with a single command?


title: How to set CST timezone w/o daylight period?

text: I want to configure linux box to use CST w/o daylight. My first idea was using the `UTC-06` zone file, but for some weird reason it provides UTC+6, not UTC-6 time! After that I read the List of tz database timezones article on Wikipedia, and copied the `America/Costa_Rica` zonefile to `/etc/localtime`. Now the timezone seems OK, but what if sometime Costa Rika goverment will decide to to to daylight? What is the correct way to set UTC-6 for Linux?


title: What commands in virsh corresponds to "Force Off" button in virt-manager?

text: I'm trying to find the corresponding command to the buttons in virt-manager, I read about `virsh help domain` and I found start, shutdown and reset etc. But the one for `Force Off` is missing. Anyone know what that is?


title: How to choose which bittorrent client is called when clicking downloaded torrent file in chromium?

text: When I was using squeeze, Qbittorrent was the only bittorrent client installed (I think). Once I had downloaded a torrent file using Chromium it would download to a bar at the bottom of the window, and on clicking it would bring up Qbittorrent. Now I am using wheezy. I have other bittorrent clients installed, including Transmission and Deluge. Now, when I click a torrent file at the bottom of the Chromium window, it brings up Transmission. How can I configure Chromium to bring up whatever bittorrent client I wish? I assume Debian has some internal preference system for which bittorrent client is chosen, but I have not found any documentation about this. NOTE: The question Set Transmission as default program when opening magnet links is very similar.


title: heuristically find how different a set of files are

text: I am having a large number of output files produced by repeated runs of a test suite and would like to see, approximately, how different they are. Ideally they should all be identical (indicating a fully reproducible test) or nearly identical (e.g. if timestamps are present). So I am looking for a script like:               show-greatest-diff /path/to/files/*.out      So, if 100 *.out files are present the script should `diff` them all against each other and perhaps produce the maximum number of lines / characters that any pair amongst them differ (and maybe identify the most different pair) or just print the `diff` output of the pair that differs the most or produce some other heuristically helpful output. The solution suggested here is not appropriate for my use case due to the large number of files.


title: What are the implications of setting LC_ALL on Solaris

text: To support an application we just installed, I've been asked to add this command to the `/etc/profile` file on our Solaris 10 UNIX server:               LC_ALL=en_US.UTF-8; export LC_ALL      The effect of this changes the "locale" on the server, which is currently not defined (defaulting to "C"). My question: is there any reason I should not make this change? As an alternative, I can imagine writing a script that exports that variable, runs the application and then "unsets" it again. I don't mind doing that but I really don't know very much about the impact of making a change like this. I also understand that the same change can be made to the `/etc/default/init` file. Would that be a better solution?


title: Hibernate not working in Linux Mint 14 KDE after nvidia driver update

text: I've had some problems with the X server ramping up CPU usage, so I wanted to check if it goes away to a new Nvidia driver. I was at 304.xx and jumped to 319.49. Now, every time I try to hibernate, I just get thrown back to the login screen (identical to a X restart). After examining `/var/log/pm-suspend.log` from today and the days before i've noticed that the the **before** logs ended with something like:               Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:     /usr/lib/pm-utils/sleep.d/99video hibernate hibernate: success.     Running hook /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate:     /etc/pm/sleep.d/novatel_3g_suspend hibernate hibernate: success.     Mon Aug 26 23:56:43 CEST 2013: performing hibernate      And the new ones end with just the first line of that:               Running hook /usr/lib/pm-utils/sleep.d/99video hibernate hibernate:      Things to keep in mind:   * Before I could get things going I had to cleanup on old versions of the driver because it complained of incopatibilities between these driver and kernel modules. I did a `apt-get remove --purge nvidia*' and then blacklisted nouveau in grub.   * I tried `sudo apt-get update;sudo apt-get upgrade` and there is nothing new. Any ideas?


title: How to boot Linux Mint Debian with nomodeset?

text: On almost all the distros that I use I have to use `nomodeset`, but there's something I don't understand about Linux Mint Debian Cinnamon 64 bit. I edit boot menu, to look like so `...nosplash nomodeset...` it doesn't work. I edit it to look like so `quite splash nomodeset` doesn't work. I tried to boot without editing anything, doesn't work My Xubuntu grub file. Note that Xubuntu and Manjaro are probably the only two distros that boot on my PC without `nomodeset` option, so it's not the same as Linux Mint


title: Parsing complex text file using Unix commands

text: I have the following text structure which I would like to parse:               >Cluster 423     0   56aa, >HWI-ST1448:257:C3V2HACXX:1:1106:19087:2550.1... at 92.86%     1   64aa, >HWI-ST1448:257:C3V2HACXX:1:1106:15943:81371.1... *     2   41aa, >HWI-ST1448:257:C3V2HACXX:1:1106:12438:91360.3... at 90.24%     3   45aa, >HWI-ST1448:257:C3V2HACXX:1:1108:13046:13861.1... at 91.11%     4   52aa, >HWI-ST1448:257:C3V2HACXX:1:1110:12260:2424.2... at 90.38%     >Cluster 434     0   64aa, >HWI-ST1448:257:C3V2HACXX:1:1106:15723:89894.1... *     1   46aa, >HWI-ST1448:257:C3V2HACXX:2:1312:1967:40935.2... at 97.83%      Basically, the identifier is marked with a `*` at the end and the group size is the last group number +1. The output I want to produce would be (please note the group size at the end):               HWI-ST1448:257:C3V2HACXX:1:1106:15943:81371.1      5     HWI-ST1448:257:C3V2HACXX:1:1106:15723:89894.1      2      Any ideas?


title: What Causes Mutt To Fail In This Way

text: When sending an email, the authentication and uploading stages exit successfully. After a long period with the message `Connecting to gmail.com`, the error message `Could not connect to gmail.com (No route to host).` occurs and the email is not sent. What causes this error and how might I fix it? I do have my `smtp_url` set to port `587` of my stmp account URI.


title: Unable to generate ssh public key when installing Redmine

text: I am trying to set up a Redmine on my server, and I am following THIS setup guide. I have used this guide before on my VPS and it worked perfectly however on this server I get following error when I try to generate public key.               aristotle:~# sudo su - redmine     No directory, logging in with HOME=/     redmine@aristotle:/$ ssh-keygen -t rsa -N '' -f ~/.ssh/gitolite_admin_id_rsa     Generating public/private rsa key pair.     open //.ssh/gitolite_admin_id_rsa failed: No such file or directory.     Saving the key failed: //.ssh/gitolite_admin_id_rsa.     redmine@aristotle:/$


title: how many password generators are there in debian and how to know which are good

text: I know of two password generators in Debian. The first one which I have used is apg and it seems to generate some good passwords.               $ apg -m 15 -M SNCL     RefGav:quedTut7     {Shtetmigdybig1     vojkewth3OdTuv<     2quacyodoobEst+     pedBoyggyu2guv/     suj?Quonvewv7Om      I also tried pwgen similarly               $ pwgen -1csy 15     q#n?PPWEWp8+])'      OR               $ pwgen -1sy 15     rE'AmK8=n;s9Bv3      Now I have two questions instead of one, are there any shell/command-line based password generators known either in Debian or in the more wider GNU/Linux world (perhaps not packaged.)? The other query is has there been any sort of comparisons made on the two password generators either on basis of their algorithm or the password- generating speed or something else entirely? Looking forward to know.


title: Get KERN_DEBUG messages into syslog on rhel7/centos7?

text: I've been trying to get KERN_DEBUG messages logged to a file in centos7, but have had no luck. I can get them just fine from "dmesg," but not /var/log/messages or /var/log/dmesg Here's a MWE kernel module that I can use to test:               #include <linux/module.h>     #include <linux/kernel.h>          int init_module(void) {         printk(KERN_DEBUG "Hello world!\n");         return 0;     }          void cleanup_module(void) {     }      And corresponding Makefile:               obj-m += hello.o     all:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules     clean:         make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean      I tried adding another log file by modifying the rsyslog configuration:               [root@centos7 ]# cat /etc/rsyslog.d/kern.conf      kern.*      /var/log/kern.log      But even after restarting rsyslogd, it wouldn't populate. I have SELinux set to enforcing, so just for kicks I touched that file and copied the context from /var/log/messages:               [root@centos7 mwe]# ls -lZ /var/log/kern.log      -rw-r--r--. root root system_u:object_r:var_log_t:s0   /var/log/kern.log      Of course I never had any SELinux errors, that's just more of a knee-jerk reaction from running in enforcing Has anyone configured this successfully?


title: Prompt when copying multiple files?

text: When copying multiple files from one directory to another is there a way to get bash to run through each file and ask for y/n? I vaguely remember adding something to the end of my command like 'ok?' to make it do this, but I can't find it anywhere!


title: bash: /etc/bash.bashrc: Permission denied whenever I open a terminal

text: On Ubuntu 13.10, when I open a new terminal, I sometimes get the following output on the terminal:               bash: /etc/bash.bashrc: Permission denied      However, the permissions should be fine:               >ls -l /etc/bash.bashrc     -rwxr-xr-x 1 root root 2177 Mär 30  2013 /etc/bash.bashrc*      What is the problem? How can I fix it? What is the purpose of the file `/etc/bash.bashrc` and where exactly does it gets called? Content of this file:               # System-wide .bashrc file for interactive bash(1) shells.          # To enable the settings / commands in this file for login shells as well,     # this file has to be sourced in /etc/profile.          # If not running interactively, don't do anything     [ -z "$PS1" ] && return          # check the window size after each command and, if necessary,     # update the values of LINES and COLUMNS.     shopt -s checkwinsize          # set variable identifying the chroot you work in (used in the prompt below)     if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then         debian_chroot=$(cat /etc/debian_chroot)     fi          # set a fancy prompt (non-color, overwrite the one in /etc/profile)     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '          # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.     # If this is an xterm set the title to user@host:dir     #case "$TERM" in     #xterm*|rxvt*)     #    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'     #    ;;     #*)     #    ;;     #esac          # enable bash completion in interactive shells     #if ! shopt -oq posix; then     #  if [ -f /usr/share/bash-completion/bash_completion ]; then     #    . /usr/share/bash-completion/bash_completion     #  elif [ -f /etc/bash_completion ]; then     #    . /etc/bash_completion     #  fi     #fi          # sudo hint     if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then         case " $(groups) " in *\ admin\ *)         if [ -x /usr/bin/sudo ]; then         cat <<-EOF         To run a command as administrator (user "root"), use "sudo <command>".         See "man sudo_root" for details.              EOF         fi         esac     fi          # if the command-not-found package is installed, use it     if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then         function command_not_found_handle {                 # check because c-n-f could've been removed in the meantime                     if [ -x /usr/lib/command-not-found ]; then                /usr/lib/command-not-found -- "$1"                        return $?                     elif [ -x /usr/share/command-not-found/command-not-found ]; then                /usr/share/command-not-found/command-not-found -- "$1"                        return $?             else                printf "%s: command not found\n" "$1" >&2                return 127             fi         }     fi


title: scp between two servers with different pem files

text: I'm following the answer on How to scp from server to server with different public keys? but I'm getting a connection error:               # start the agent and capture its environment in the current shell     eval `ssh-agent`          # add keys needed to connect to the different accounts     ssh-add /path/to/first/ssh/key     ssh-add /path/to/second/ssh/key          # do the copying          $ scp -r user@server1:/images user@server2:/images     ssh: connect to host server2 port 22: Connection timed out     lost connection      It works if I use my machine as an explicit intermediary:               $ scp -r user@server1:/images /images     $ scp -r /images user@server2:/images      Any clues on why it's failing to do the copy in one step?


title: Global IP on DomU in XEN, using Ubuntu

text: Can a DomU have a global IP in Xen? I see that DomU's are connected to Dom0 and then physical ethernet using xenbridges, so is it technically possible in Xen to assign global IPs to DomU so it can be pinged/accessed by the outside world? Is there any config changes in Xen that I need to do? Can `network-route` be of some help if used in place of `network-bridge`?


title: Getting the line count and storing in a result set

text: Need to calculate the number of lines in a file and store it in a resultset. I'm sure Im wrong in this line -num_of_lines=wc -l "$file" but how can I get the executed result set?               for file in *.csv     do       num_of_lines=wc -l "$file"       split -n 5 -d -a 2  "$file" "$file"     done


title: Software for image files analysis

text: I'd like to ask if there is some program to analyze files, especially image files, for linux, with functionality similar to hex editors, which will show what bytes changed after I paint some area of the image and etc.


title: Change some ASP code to PHP code in all files

text: I'm migrating a directory of files containing fairly simple ASP code over to a PHP server and I need to modify the contents of all the files with a find and replace mechanism. I'm not great with regular expressions, but I've used this to change a few things already:               find . -name "*.php" -print0 | xargs -0 -n 1 sed -i -e 's/oldstring/newstring/g'      I have some complex strings I need to replace though. See the following: FROM:               <% if request("page") = "" then %>      TO:               <?php if(!isset($_GET['page']) || !$_GET['page']){ ?>      This one, the * can be any number, then keep that number where the * is on the "TO". FROM:               <% elseif request("page") = "*" then %>      TO:               <?php } elseif($_GET['page'] == '*'){ ?>      And the last one is pretty simple. FROM:               <% end if %>      TO:               <?php } ?>      If I can run this in bulk, recursively in a directory, this will fix 98% of all the ASP code in these files. I've tried to escape these strings in several ways, but cannot figure out how to get it to run. Any help is appreciated!


title: Is there a way in vim to know I am in the left most split?

text: I want to detect whether or not I am in the right most (or left, top, bottommost) split. In other words, when `ctrl-w h` would do nothing. Is there a way to do that?


title: H.264 support in Firefox (Iceweasel) 24

text: I am using `Firefox (Iceweasel) 24` in `Debian Wheezy`. When I go to https://www.youtube.com/html5 it shows me that my browser does not support `H.264` When I go to the same URL with `Chrome`, it shows `H.264` is supported After googling, I found few debian bug reports about this. Seems that `H.264` is disabled deliberately. Indeed when I go to `about:buildconfig` in Firefox, I see it has been compiled with `--disable-gstreamer` I am confused why this is disabled. Is this a technical reason, or a "license/free software" issue Is there any simple way to enable `H.264` in my browser (short of recompiling my own iceweasel package) ? Can somebody please explain the situation and why it arose ? # EDIT: I have all necessary packages installed:               gstreamer0.10-ffmpeg     libx264-123     libavutil51     libavformat53     libavcodec53     gstreamer0.10-plugins-good     chromium-browser


title: grep: Find all lines that contain Japanese kanjis

text: In a huge UTF-8 text file, I want to show all lines that contains Japanese kanjis.   What `grep` (or other) expression does this? If I am not mistaken, kanjis are the characters between `\u4e00` and `\u4dbf`. I don't need to show kanas, but showing them too would not be a big problem.


title: Possible to download these webpages as a book?

text: I would like to download a SQL tutorial here http://www.w3schools.com/sql/default.asp, as a book with all linked SQL related sections. Here is my command               wget -r -np -nH  -p -k  http://www.w3schools.com/sql/default.asp      Under the downloaded `sql` directory, I get some asp files, which I don't know how to open in Chrome. Did I download the webpages correctly? How shall I do? Thanks!


title: kill xterm process in a bash

text: I would like to kill the xterm process I started this way in a script:               #!/bin/bash          echo "#!/bin/bash" > /tmp/test0     grep file | awk '{print "xterm -hold -e echo",$1,"sleep 10" && pid=$!}' >> /tmp/test0     echo "exit" >> /tmp/test0     chmod 700 /tmp/test0     bash /tmp/test0&     sleep 5     kill $pid  ---> does not work     exit      now let's say, I have got several xterm launched this way in the same bash (test0), is there a way to store their corresponding pid in an array and call them back when it's time to kill them? Furthermore, when storing these values, is there a way to associate them with another value (in this example with $1) to make it easier to call back. nb: $1 = text thank you very much !


title: redirect and log script output

text: I am trying to tidy up the following snippets, design goals are to log all output from a script, and should not be a wrapper. Less lines are better. I don't care about user inputs (at this stage), target scripts are run non- interactively. The snippet needs to   * output stdout to log, and always echo to console   * output stderr to log, and echo to console iff debugging is enabled   * stderr messages should be prefixed with time stamps and other usefulness At the moment I have the following which only tests out under recent versions of bash (4.2+?) like in Ubuntu precise, but misbehaves on CentOS6.               DEBUG_LOG="${0##*/}.log"          # copy stdout to log always and echo to console     exec >  >(tee -a ${DEBUG_LOG})                     # copy stderr to log only, unless debugging is enabled     [ $DEBUG_TEST = "true" ] \       && exec 2> >(tee -a ${DEBUG_LOG} >&2) \       || exec 2>> ${DEBUG_LOG}      Then this...               # Expand escaped characters, wrap at 70 chars on spaces,      # and indent wrapped lines     msg_log() {        echo -e "$(date +%T) ${0##*/}: $1" \         | fold -w70 -s | sed '2~1s/^/  /' >&2;      }     msg_con() {        if [ "${DEBUG_TEST}" = "true" ]; then          msg_log "$1"       else         echo -e "$1" | fold -w70 -s | sed '2~1s/^/  /';        fi     }      Instead of `echo` I can call one of those msg procedures, e.g., `msg_con "hello world"`.   Also script output will then go to stderr by setting as an environment variable at call time, e.g., `DEBUG_TEST=true myscript`. I have read that exec may not work in some shells such as busybox. There is a mkfifo and fork combination at http://stackoverflow.com/a/5200754 that does something similar but I'd rather not use fork unless absolutely needful. Prefer bash examples please, but something that works under sh or is more portable would be nice. Any ideas?


title: Equivalent command line call for airplane mode

text: Can someone suggest how to turn on airplane mode from command line instead of using the GUI? Also can someone list what all are turned off by enabling airplane mode or how to turn off all radios including bluetooth and wifi? Is there a difference between hardware shutdown and device driver shutdown?


title: How far can you go with rm -rf / as root

text: If you are root, and you issue               rm -rf /       Then how far can the command go? Can you recover data from this kind of an action? Even after the binaries are gone, would the running processes still be active? What would it take to make the same physical machine boot again? What files would you need to restore to make this happen? I could try this on a VM and see, but I want to know the rationale behind what to expect if I do this.


title: How to "mute" ls command?

text: Suppose I do a recursive `ls`               $ ls -R       on the root directory. I get a lot of messages like these -               ls: cannot open directory ./var/lib/sendmail: Permission denied     ls: cannot open directory ./var/lib/sudo: Permission denied     ...      Is there a way to avoid displaying the above "`cannot open directory`" messages?