title: Running multiple xserver displays "offscreen" or "headless"

text: I would like to run two or more displays, while I only have one GPU and one monitor. The second display does not have to display anything on the monitor, a dummy output would be ideal. I use startx to start a new display:               startx -- :1      so far so good, I can switch between the two displays on my computer using Ctrl+Alt+Fx (where x is a number, on my computer it is 7 or 8). Here's the problem, when both displays are available and I am currently on display 0 and I try to record display 1 I get a black screen in the recorded video. The main issue seems to be that the xserver is not refreshing when the tty is not active. I have confirmed that recording via. ffmpg's x11grab or using VLC works as intended. Other than this I have tried Xephyr, Xnest and Xvfb, while they do that I need, I am unable to use them because what I am running in display 1 is graphically very demanding (OpenGL) and I am also recording on top of that. I also tried using the xserver-xorg-video-dummy together with the Xdummy script to start the display, it works, but not with OpenGL applications. Any help with this issue is greatly appreciated!


title: Cron running job every 15 seconds

text: Could you advise me what to write in `crontab` so that it runs some job (for testing I will use `/usr/bin/chromium-browser`) every 15 seconds?


title: Is there a way to completely disable outbound opportunistic TLS support in SendMail?

text: CentOS 5.x SendMail 8.14.4 An overzealous network security feature is causing TLS negotiations to fail when my Sendmail server tries to talk to external hosts. This is causing sendmail to constantly requeue some messages because it won't fail over to unencrypted delivery. Is there a way to disable outbound TLS completely? I'm aware that I can add **Try_TLS:broken.server NO** entries for the individual mx records (or partial domains) but I'd prefer to just disable this entirely until the root cause gets resolved. As far as I can tell, there doesn't appear to be any way to tell SendMail to not use TLS whatsoever. I tried **Try_TLS:*** but that didn't work. I understand that the root cause is not my specific system but as I don't have control of the affected parts, I'd like to at least get mail flowing. Any ideas?


title: How to make ext4 filesystem sparse?

text: I am using Linux as guest OS in VirtualBox. I deleted huge number of files from its filesystem. Now i want to shrink the filesystem image file (vdi). The shrinking works by compressing filesystem image wherever it has "null" value in disk. It seems an application called zerofree can write "null" into free space of filesystem in such a way that it becomes sparse. But the instructions say it works only on ext2/ext3. I have ext4 on my guest OS.   1. Why won't it work on ext 4 (reason cited is "extents", but can someone shed more light on it) ?    2. Will it work, If i mount the **ext 4** as **ext 3** and then remount as **ext 4** ?   3. Any other tools that can do similiar thing as zerofree on ext ?


title: Recommended Linux distribution for statistics?

text: Given that **R** , **Python** and many other open source libraries used for stats have better support in Linux than Windows/OSX (rPy comes to mind), I find it odd that no one has asked this question before. So I do now: **What Linux distribution people doing stats/data analysis/Machine Learning prefer/recommend?** P.S.: I feel a bit embarrassed asking that, since by using Python's and R's inbuilt package management I should theoretically not be experiencing any conflicts with the base system. :P


title: How to diagnose a reliably unreliable connection?

text: Where I'm living now, the internet connection (wired) shows the following weird symptoms. They seem to be independent of whether I use host names or IP addresses.   * Pinging works   * Skype works   * Wget connects, but never receives a response. (Keeps waiting at "HTTP Request sent, awaiting response" until timeout.)      * Except for a small subset of domains, for which it works.    * ssh commands (`ssh host ls`) works.    * Interactive ssh works for a short while, but hangs quickly, e.g. during the first `ls` -- at the same point every time.   * Under Windows, everything works fine. What can I do to diagnose this further? So far, I've just been looking at the application layer. Since there is an apparent internet connection, there must be some way to tunnel Firefox, but I'd like to pin down the problem first. It is very likely related to large packets not making their way through. I've found out that there is an MTU, but setting it for eth0 does not solve my problem. I think that I'm behind PPPOE and a router. The external IPs are the same on Windows and Linux. Output of some commands: `ip link show`               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1024 qdisc mq state UP qlen 1000         link/ether 00:26:aa:aa:aa:61 brd ff:ff:ff:ff:ff:ff     3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000         link/ether c4:17:aa:aa:aa:ff brd ff:ff:ff:ff:ff:ff     4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN          link/ether 5e:49:aa:aa:aa:27 brd ff:ff:ff:ff:ff:ff      `ip route show`               192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4  metric 1      192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1      169.254.0.0/16 dev eth0  scope link  metric 1000      default via 192.168.1.1 dev eth0  proto static       `ip addr show`               1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo         inet6 ::1/128 scope host             valid_lft forever preferred_lft forever     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1024 qdisc mq state UP qlen 1000         link/ether 00:26:2d:78:ac:61 brd ff:ff:ff:ff:ff:ff         inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0     3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000         link/ether c4:17:fe:3b:56:ff brd ff:ff:ff:ff:ff:ff     4: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN          link/ether 5e:49:01:03:55:27 brd ff:ff:ff:ff:ff:ff         inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0         inet6 fe80::5c49:1ff:fe03:5527/64 scope link             valid_lft forever preferred_lft forever      I can send pings up to size 1468.               tim@milagros:/$ ping -M do -c 1 -s 1470 stackexchange.com     PING stackexchange.com (64.34.119.12) 1470(1498) bytes of data.        --- stackexchange.com ping statistics ---        1 packets transmitted, 0 received, 100% packet loss, time 0ms          tim@milagros:/$ ping -M do -c 1 -s 1468 stackexchange.com     PING stackexchange.com (64.34.119.12) 1468(1496) bytes of data.     1476 bytes from stackoverflow.com (64.34.119.12): icmp_seq=1 ttl=52 time=176 ms        --- stackexchange.com ping statistics ---        1 packets transmitted, 1 received, 0% packet loss, time 0ms        rtt min/avg/max/mdev = 176.539/176.539/176.539/0.000 ms                    tim@milagros:~/projekt/perl$ ifconfig eth0     eth0      Link encap:Ethernet  HWaddr 00:26:2d:78:ac:61                 inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:161 errors:0 dropped:0 overruns:0 frame:0               TX packets:194 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:143947 (143.9 KB)  TX bytes:67727 (67.7 KB)               Interrupt:16


title: How can I run `watch` as a background job?

text: When I run:               watch 'cmd >> output.txt' &      the job gets suspended by the system: > 3569 Stopped (tty output) Is there a workaround?


title: What are software and hardware interrupts, and how are they processed?

text: I am not sure if I understand the concept of hardware and software interrupts. If I understand correctly, the purpose of a hardware interrupt is to get some attention of the CPU, part of implementing CPU multitasking.   1. Then what issues a hardware interrupt? Is it the hardware driver process?   2. If yes, where is the hardware driver process running? If it is running on the CPU, then it won't have to get attention of the CPU by hardware interrupt, right? So is it running elsewhere?   3. Does a hardware interrupt interrupt the CPU directly, or does it first contact the kernel process and the kernel process then contacts/interrupts the CPU? * * * On the other hand, I think the purpose of a software interrupt is for a process currently running on a CPU to request some resources.   1. What are the resources? Are they all in the form of running processes? For example, do CPU driver process and memory driver processes represent CPU and memory resources? Do the driver process of the I/O devices represent I/O resources? Are other running processes that the process would like to communicate with also resources?   2. If yes, does a software interrupt contact the processes (which represent the resources) indirectly via the kernel process? Is it right that unlike a hardware interrupt, a software interrupt never directly interrupts the CPU, but instead, it interrupts/contacts the kernel process?


title: how to prevent alias expansion by `eval` to an arbitrary alias, and keep the endless loop protection on a function?

text: IMPORTANT: do not use eval! (I learned this later..) In a function, `eval` expands `sleep` to its alias, so I prevent the endless loop this way:               function FUNCexecEcho() {        echo "EXEC: $@";       shopt -u expand_aliases       eval "$@";       shopt -s expand_aliases     };     alias sleep='FUNCexecEcho sleep ';     sleep 10      But then, all other aliases will stop working...   How to prevent expansion only to one arbitrary alias inside this function? PS.: the endless loop only happens on the second time you execute `sleep 10`


title: How to start an xterm from Nautilus, running in the folder I'm viewing?

text: This was easy in Thunar, but now I'm on a machine where I'm trying to do everything in the Gnome desktop world. In Nautilus, I'm in some deep-down folder. How do I open an xterm (rxvt, aterm, gnome's terminal app, whichever) with its working directory already set to the location Nautilus is showing?


title: How can I make the TTY use the appropriate charset?

text: **Note:** forked of this per recommendation here. * * * While I got the X keyboard layout right on my own after I fixed that stupid typo, I still can't set the console charset, key map, font map, or whatever you want to call it; even considering all [info] [on] the Arch wiki. For example, if I click the key for `Ç` (c cedilla), I get a damn `Ä` (majuscule `A` with a trema), `Tab` completion also gives this **wrong** non ASCII character on a TTY. I know the keyboard is right, if I pipe correct UTF-8 characters to a TTY, I get them wrong, and if I do it the other way around, they become right (say, to `/dev/pts/0`). I heard the console only has support for 128 (or is it 256?) characters at a time, but those can be set. I tried setting `FONT_MAP` on `/etc/vconsole.conf`, with no results. The file is now:               KEYMAP=pt-latin9     FONT=Lat2-Terminus16     FONT_MAP=8859-2      I think would solve the problem are those `MAP` variables. The worst is that these variables are poorly documented, both in the Arch Wiki, and in the `vconsole.conf` manual pages:               FONT=, FONT_MAP=, FONT_UNIMAP=         Configures the console font, the console map and the unicode font map.      How can I set them? Regarding other methods, I'm a bit confused of how I can apply what is in some of the more advanced articles. So far, I have simply copied `/usr/share/kbd/keymaps/i386/qwerty/pt-latin9.map.gz` to `/usr/local/share/kbd/keymaps/`, `gunzip`ed it, and read it while scratching my head. I'm sorry, even though I've had this problem since I have Arch as my system, this is to hard for me to find the solution on my own; so I hope you can help me.


title: What is the best practice for adding disks in LVM

text: According to the Linux manpages you can add raw disks as well as partitions to a volume group. In other documentation (RedHat, CentOS or openSUSE), all examples refer to adding partitions to the VG instead of raw disks. What is common (best) practice?


title: debian security /etc permissions

text: I'm setting up a debian box with shared webhhosts. These users don't have ssh permissions, just ftp. The users are allowed to use PHP and I setup `suphp` for that so the php processes runs under their own user account, etc. I'm a little bit worried about the security of the system files, especially the `/etc` folder. I notice that most files in this directory have permissions like:                   drwxr-xr-x  2 root root    4096 Mar  4 20:00 pam.d         -rw-r--r--  1 root root    1358 Mar  5 00:48 passwd         -rw-------  1 root root    1358 Mar  5 00:48 passwd-         drwxr-xr-x  2 root root    4096 Feb 18 14:22 pear         drwxr-xr-x  4 root root    4096 Apr 29  2010 perl         drwxr-xr-x  6 root root    4096 Feb 18 14:22 php5         drwxr-xr-x  2 root root    4096 Mar  4 17:42 phpmyadmin      Are the read-world permissions which debian standard gives the files in `/etc` really needed? What's the best mask I can give those files? Are there any files in `/etc` that should be world readable?


title: Where does Kali Linux mount smb shares

text: In Ubuntu I've noticed that smb shares are stored in `/home/{user}/.gvfs` directory. But In Kali there is nothing in this folder. So where is the SMB share folder in Kali. I've searched possible places like `/mnt`, `/media`. But I haven't found it. Could you please help me out?


title: Log output of GNU screen in real time?

text: I'm trying to get the output of a GNU Screen to a log file in real time. I've tried using tee, but that appears to not work with screen. The log function for screen will not work for this as it is not in real time, I'm pretty sure. Any ideas?


title: How can I shorten my customized PS1 prompt?

text: I currently have my prompt as               durrantm@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_apps/linker (master)     $       which I really like as it shows my username, machine, directory and git branch! How can I shorten the machine part though? i.e. how could In have it be:               durrantm@Castle...:~/Dropnot/webs/rails_apps/linker (master)     $       I tried various combination of h:0:6 but had no luck getting a correct syntax that would work. My .bashrc uses this:               function parse_git_branch () {       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'     }          PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(parse_git_branch)\n\$ '


title: Help with using rsync or cpio to do an incremental backup

text: I'm trying to do an incremental backup of all files on my NAS box that where modified in the last 24 hours (or so, can be more flexible). I'm using PuTTY to connect through SSH to a ReadyNAS 102 which has BusyBox v1.20.2 and uses Bash. I origianlly used: `find . -mtime -2 | cpio -cm /media/USB_FLASH_2` And then tried: `find . -mtime -2 | cpio -o | { cd /media/USB_FLASH_2 && cpio -imd; }` which got me the error: BusyBox v1.20.2 (Debian 1:1.20.0-7) multi-call binary. Usage: cpio [-dmvu] [-F FILE] [-H newc] [-tio] [EXTR_FILE]... Extract or list files from a cpio archive, or create an archive using file list on stdin Main operation mode: -t List -i Extract EXTR_FILEs (or all) -o Create (requires -H newc) -d Make leading directories -m Preserve mtime -v Verbose -u Overwrite -F FILE Input (-t,-i,-p) or output (-o) file -H newc Archive format.


title: Can one copy a relpath in one command?

text: I find myself doing this often enough that I wonder if there's a standard Unix way to do it:               % mkdir -p /TARGETDIR/relative/path/to     % cp ./relative/path/to/somefile /TARGETDIR/relative/path/to      In other words, I don't want to just copy `somefile` to `/TARGETDIR`, but actually I want to copy its entire _relative path_. Is there a simpler way to do this than the two-liner above?


title: dd command: Finding read/write throughput of a flash/SD?

text: I am running petalinux from sd card. And trying to find data copying rate from Sd card and from QSPI flash that is there on the Xilinx Zynq board. As suggested here , I am doing like this:               root@Xilinx-ZC702-14_7:/dev# echo 1 > /proc/sys/vm/drop_caches     root@Xilinx-ZC702-14_7:/dev# dd if=/dev/mtd2 of=/dev/null bs=128k count=200     84+0 records in     84+0 records out      But as per the above link it should also print the following lines:               26214400 bytes (25.0MB) copied, 5.971374 seconds, 4.2MB/s      That gives an idea of rate at which flash working. Why is this line missing in my case? Is there any alterantive to know this rate ?


title: Files with empty names

text: I was writing a widget for displaying files in a given directory and I wondered whether I need to cover the case where a file has an empty name. Testing showed not obvious results, so I was wondering whether someone has definite information               $ touch ""     touch: cannot touch `': No such file or directory          $ echo > ""     bash: : No such file or directory


title: Remove soft link but not the target

text: I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this?               > mkdir rgac     > ln -s /actual_dir_with_data/ /rgac/


title: Show completions under the prompt in Fish

text: Is there a way I can get the ultra compact auto-complete function from Zsh in Fish, so If I press `Tab` it won't write me all the possibilities permanently into my terminal but underneath the prompt?


title: autoreconf fails with 'Can't exec "libtoolize"'

text: Now I wanted to learn about autotools so I just started watching some tutorials on youtube. I made a folder named `hello`, and then made a `configure.ac` file:               AC_INIT([hello],[.01])     AC_OUTPUT       saved it and then ran `autoreconf -i` , obviously it didn't work the first time because it was not installed , then I installed `autoconf` by the command `sudo apt-get install autoconf2.13` . Now after this I again ran `autoreconf -i` but now I am getting the error as show below:               Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf2.50 line 196.     Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf2.50 line 196.


title: Ubuntu load and hang on live USB

text: I seem to have run into some difficulties trying to install Linux alongside my USB. I made a bootable USB stick and done all the UEFI firmware settings from which I disabled fast boot. Now when I run my USB from the boot menu, the first screen shown is the options for Linux: "try it for free", "install Ubuntu" and so on. Regardless of the option I choose, the screen just goes blank and that's it. Does anyone have any suggestions?


title: How to set CONFIG_PREEMPT_NONE in RHEL 6.4 (linux)

text: I am trying to tune the RHEL6.4 Kernel to handle server style load for of my application. With RHEL 6 scheduler has been changed to CFS and with RHEL 5 my application works fine. I would like change the preemptive option of the kernel to none. I don't know if changing this value in `/boot/config-2.6.32-358.el6.x86_64` will work or not. In addition I want to set the value to set in the `kernel.sched_features` for disabling preempt using the `sysctl` command.


title: How to redirect stdout and stderr to a file and display stderr to console?

text: I know how to redirect to a file, and use tee; on a basic level. So               $ alias outanderr='bash -c "echo stdout >&1; echo stderr >&2"'     # A fake "application" displaying both output and error messages.          $ outanderr 1>file      # redirect stdout to a file, display stderr     stderr          $ outanderr 2>file      # redirect stderr to a file, display stdout     stdout          $ outanderr 1>file 2>&1 # redirect both to a file, display nothing          $ outanderr | tee file; echo "-- file contents --" && cat file     # redirect stdout to a file, display both (note: order is messed up)     stderr     stdout     -- file contents --     stdout          $ outanderr 2>&1 | tee file; echo "-- file contents --" && cat file     # redirect both to a file, display both     stdout     stderr     -- file contents --     stdout     stderr      **The question is: what to write in place of the questionmarks to get the output below:**               $ outanderr ???; echo "-- file contents --" && cat file     # redirect both to a file, display stderr     stderr     -- file contents --     stdout     stderr      _Constaints:_   * Assuming bash.   * The order should be kept in the file.   * stderr contents are displayed in real time line by line, i.e. no buffering.   * Separate script files can be used.   * Magic may be necessary.


title: How do I create a folder with a username and date as the folder name?

text: I need to write a backup script. I need to be able to run the script from any computer and have it pull the username and date as the directory name. Each computer has an admin account and a user account. How can I pull the user account from a script and use it to name the backed up directory?


title: How to change a font/background color in transparent windows?

text: When you select something, the color of the selection usually changes to the font color, and the font color is being set to backgroud color. So, if you have a black background in a terminal, and the font is orange, you will get an orange selection and a black font color. What would happen if you had a transparent window, and the transparency was set to 100%? Just take a look at the following pics. The one with a black background: ![pic](http://i.stack.imgur.com/iID4T.png) And the transparent one: ![pic](http://i.stack.imgur.com/JYIqN.png) Is there a way to change the font/background color of transparent windows?


title: Booting directly in debian linux without giving username and password

text: I would like to skip the username and password prompt at boot-up from debian linux. I want to boot directly to the system without giving username and password.


title: How to run a remote sed command through ssh if the data includes double quotes ("")?

text: I'm trying to run through a list of servers and run the next command:               itaig@itaig-lt:~$ ssh root@$srvname "sed -i 's/VNCSERVERARGS[6]="-geometry 1920x1080"/VNCSERVERARGS[6]="-geometry 1152x864"/g' /etc/sysconfig/vncservers"      I've tried like that as well:               itaig@itaig-lt:~$ ssh root@$srvname "sed -i 's/VNCSERVERARGS[6]=\"-geometry 1920x1080\"/VNCSERVERARGS[6]=\"-geometry 1152x864\"/g' /etc/sysconfig/vncservers"     itaig@itaig-lt:~$      Both tries gave me a fresh prompt line and when checking the file on the remote machine nothing has changed. Is that possible to run such a command?


title: Running a cron job from another shell

text: I would like `cron` to run a script from a specific shell (Zsh). I thought the following would work:               00 02 * * * exec zsh; /path/to/script.sh      but apparently it doesn't, why? This also made me wonder, how do I find out what **shell** and **init scripts** does `cron` run first prior to running the entry in crontab?


title: How can I reverse the first part of a sentence?

text: I know that I can reverse any sentence: `echo "a,b,c,d" | rev` but what if I want to reverse only the first part of a sentence, I have tried this: `echo "a,b,c,d Access" | rev` and I get this: `sseccA d,c,b,a`, and what I really want is: `d,c,b,a Access` How can I do this?


title: Why am I getting horizontal tearing no matter what graphics card/distro/compositor/monitor I use?

text: This is a problem that has haunted me for years, and as a remedy I originally resorted to just using my Windows 7 partition. I've been back to using Linux for a long time now and would like to continue using it on the same machine, but my original problem persists. Basically, I get some crazy horizontal tearing that I can't seem to get rid of; when there's quick motion in video or games, it's very irritating. Here are some solutions I've already tried( **please read this before commenting** ):   * Enable "sync to vblank" in Nvidia settings.   * Turn on compositing   * Turn off compositing   * Set the vsync frequency in the compositor to that of the refresh rate of the monitor   * Use the non-free graphics driver   * Use the free graphics driver(example: nouveau)   * Turn off PowerMizer (a pretty lousy solution, even if it worked)   * Buy a new monitor   * Reinstall Linux   * Use a different distro   * Remove all other components and see what happens This same phenomena happens on Ubuntu, Mint, and Crunchbang. None of these communities could provide a working answer. I would prefer to use Crunchbang, so anyone with an answer applicable to Debian can help with this. My Nvidia graphics card is a GeForce GTX 660. The other graphics cards I have tried are an Nvidia(don't know the chipset), and an AMD/ATI(also don't know). The AMD card has more serious tearing, whereas the Nvidia cards usually just have a single-line tear. I have tried different monitors. I can't remember my last monitor, but right now I'm using a Samsung monitor with HDMI. Can this problem be caused by my motherboard? What can cause this?


title: start-stop-daemon doesn't stop programs which redirect stdout/stderr

text: I just discovered, that `start-stop-daemon` doesn't work well with programs redirecting their `stdout`/`stderr`:               # cat /root/_/1.sh     #!/usr/bin/env bash     set -eu     cmd="~yuri/_/${2:-1}.sh"     if [ "${3:-}" = redirect ]; then         cmd="$cmd >~yuri/_/stdout.log 2>~yuri/_/stderr.log"     fi     case $1 in     start)         start-stop-daemon --pidfile /var/run/1.pid --startas /bin/bash --name bash --user yuri \             --chuid yuri --background --make-pidfile --start -- -c "$cmd"         ;;     stop)         start-stop-daemon --pidfile /var/run/1.pid --exec /bin/bash --name bash --user yuri \             --stop         ;;     status)         pid=$(pgrep -u yuri -P 1 -x bash)         ps -fp "$pid"         ;;     esac          $ cat ~yuri/_/1.sh     #!/usr/bin/env bash     set -eu     echo stdout     echo stderr >&2     sleep 60          $ cat ~yuri/_/2.sh     #!/usr/bin/env bash     set -eu     echo stdout >~/_/stdout.log     echo stderr >~/_/stderr.log     sleep 60          # /root/_/1.sh start && sleep 1 && /root/_/1.sh status && /root/_/1.sh stop && sleep 1 && /root/_/1.sh status     UID        PID  PPID  C STIME TTY          TIME CMD     yuri      8259     1  0 22:49 ?        00:00:00 bash /home/yuri/_/1.sh          # /root/_/1.sh start 1 redirect && sleep 1 && /root/_/1.sh status && /root/_/1.sh stop && sleep 1 && /root/_/1.sh status     UID        PID  PPID  C STIME TTY          TIME CMD     yuri      9304     1  0 22:53 ?        00:00:00 /bin/bash -c ~yuri/_/1.sh >~yuri/_/stdout.log 2>~yuri/_/stderr.log     UID        PID  PPID  C STIME TTY          TIME CMD     yuri      9306     1  0 22:53 ?        00:00:00 bash /home/yuri/_/1.sh          # /root/_/1.sh start 2 && sleep 1 && /root/_/1.sh status && /root/_/1.sh stop && sleep 1 && /root/_/1.sh status     UID        PID  PPID  C STIME TTY          TIME CMD     yuri      9218     1  0 22:52 ?        00:00:00 bash /home/yuri/_/2.sh      Namely, `start-stop-daemon --stop` **restarts** the program instead of stopping it. Or so it seems. Am I doing it wrong? As far as I can tell, it's `\--no-close` option, that is supposed to remedy this. But I'm running `debian 6`, so the best solution I can think of right now is to compile `dpkg` package from sources (without installing it).So I mainly concerned with what goes wrong with using `squeeze`'s version of `start-stop-daemon`.


title: How do you remember command options?

text: I am curious to know what trick you use to remember options for various commands? Looking up man pages all the time is time consuming and not so cool!


title: Working with screen and emacs

text: I'm working with emacs (on the terminal) and I use screen to switch between terminals. The key combination `Ctrl`+`A` is grabbed by screen. Is there a way to change screen key binding?


title: Hosting my website from home

text: I'm looking to host a personal website from home. I have a good computer/software background but only a basic idea of how to properly host a site. The goal for the web hosting is to make the site(s) public on the www. The site is built, using PHP/MySql, and I'm familiar with how to get that to run in a "LAMP" environment, what I'm not familiar with is making it accessible to the world and the correct/safe/reliable ways to do so. I've got a box that is running FreeNAS right now but I'd like to convert it to a Linux server flavour, I was thinking Ubuntu with the GUI so that I could still run some of the same software I have running on the FreeNAS now for the household, and have the web hosting services on it as well. So my question(s) are as follows:   * Which server OS would do what I want, but not be too complicated for a beginner   * What additional software, or services should I install (i.e. Apache, Mysql, PHP etc...)   * What would be best practices to ensure home network security, and home server "section" security?      * Should I be running a VPN for additional security? I'm aware of the myriad of benefits of the VPN in general, I'm wondering about specifically in relation to web hosting from home. I'm not looking for any hand holding by any means, but if anyone could point me in the right direction that would be much appreciated.


title: How to shift filename numbers without collisions?

text: Consider this list of files:               $ touch index-{1,2,3,4,5,6,7,8,9}.txt      If I want to shift them _down_ so they start at zero, it's relatively easy:               $ rename --verbose 's/^index-([1-9])\.txt$/$1/; $_="index-" . ($_ - 1) . ".txt"' index-*.txt      This works because `man bash` specifies that globs are alphabetically sorted, so it will rename `index-1.txt` to `index-0.txt` _before_ renaming `index-2.txt` to `index-1.txt`. This breaks down if you want to shift _up_ , or if the numbers have _different lengths_ :               $ touch index-{10,11}.txt     $ rename --verbose 's/^index-([0-9]+)\.txt$/$1/; $_="index-" . ($_ + 1) . ".txt"' index-*.txt     index-10.txt not renamed: index-11.txt already exists     index-11.txt renamed as index-12.txt     index-1.txt not renamed: index-2.txt already exists      Possible long-term fixes:   * A `rename` option to try to reorder operations until there are no collisions.   * A `rename` option to move the files to a temporary directory first, and then move them back with the new name.   * A `rename` option to rename files in two steps, using unique names in the first step which won't collide with the original or new names.   * A way to do natural sorting + reversal of Bash globs. Is there a simple way to get around this?


title: How to determine Linux kernel architecture?

text: `uname -m` gives i686 and `uname -m` gives i686 i386 output in Red Hat Enterprise Linux Server release 5.4 (Tikanga) machine. I need to install Oracle Database 10g Release 2 on that machine. So, how can I decide whether kernel architecture is 32bit or 64bit?


title: How to check LVM mirroring under Linux?

text: How can I check the LVM mirroring under Linux? E.g.: are there any mirrors on a given machine & some details about them, etc.


title: How to revert chown command?

text: If I run:               sudo chown -R user:user /      Can I revert it to what it was before I ran it?


title: Encrypt boot file system

text: I just tried to set up Debian in a VM (just testing, before installing it on a real system). I have set up 4 drives in total. 2 drives that simulate pen drives, on which I want to install the boot loader and boot file system later, and another 2 drives. Every drive is configured as encrypted RAID1 (md0_crypt and md1_crypt). However, I can't put the boot filesystem on my md0_crypt, because I get the warning that one `cannot store the /boot FS on an encrypted partition, because it needs to load the kernel and initrd`. So, do I stand correctly that I cannot encrypt my /boot FS? Is the boot FS only for the boot loader (grub) or is there anything else? I would like to have the scenario that if I unplug my pen drive that the system can't be started anymore, since the /boot FS is installed on the pen drive.


title: Why does passing a HEREDOC as a string to `ruby -e` not work?

text: For reasons I don't understand, it seems to be impossible to pass a heredoc as an expression to a Ruby interpreter:               $ ruby -e <<END     heredoc> puts 'hi'     heredoc> END          ruby: no code specified for -e (RuntimeError)      The same thing happens with Perl, to make it painfully obvious that it has nothing to do with Ruby.               $ perl -e<<END     heredoc> print 'hi'     heredoc> END     No code specified for -e.      And even with `sed`:               $ echo "blah" | sed -e <<END     pipe heredoc> s/.*/Hi/     pipe heredoc> END     sed: option requires an argument -- e     usage: sed script [-Ealn] [-i extension] [file ...]            sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]      How can I pass a heredoc as an expression to Ruby? (or Perl, or Sed...)


title: Good Bye lvreduce, hello lvresize?

text: I've found a couple of times that using lvreduce, (first unmounting, shrinking ext4 with resize2fs, and fsck'ing) ends in:               mount: wrong fs type, bad option, bad superblock on /dev/mapper/sergiovhg-lv2,            missing codepage or helper program, or other error                 In some cases useful info is found in syslog - try            dmesg | tail or so.      However using the resize2fs tool with option -r works fine, eg:               lvresize  -r  -L600M ser`giovhg/lv2      Does anyone else has this kind of issue? I've found that "-r" makes the magic through fsadmin... am I wrong if I say that lvreduce and resize2fs are prone to errors? Thanks in advance!


title: Print text from terminal

text: I would like to use a Linux distro without a desktop environment, but I need to print out homework that I type up. I could always email it to myself and print from another computer, but it would be nice if I could just do something like `print homework.txt` from a bash prompt. Does anyone have a way of doing this?


title: Are there any guides on how to create a GRUB2 theme?

text: I'm going to turn my new Surface Pro 3 into a dual boot linux/Win 8.1 machine by following these instructions I found over at askubuntu. At the bottom of those instructions, the author created a spiffy GRUB2 theme to use. I would like to do something similar, but with my own graphics and the proper icon for whatever distro I choose (likely Mint). I'm just not sure how to do it. Are there any readily available tutorials/wikis/walkthroughs on how to create or edit a GRUB2 theme? My google-fu has failed me so far.


title: Is there a mock program that uses the CPU on multiple cores?

text: I am playing around with `htop`, `gprof`, etc. I'd like a program that basically just runs on multiple cores so I can profile it and learn how to use these tools. I know I can write my own `c++` code with `-fopenmp` and run a useless loop, but I was hoping there's a stock unix command I can use? Basically I just want a program that uses 100% of however many cores I tell it, until I ask it to stop. Does this exist?


title: Dual boot Mint on a Surface Pro 3?

text: I have a shiny new SP3 and I'd like to dual boot Mint 17 on it. I'm familiar with creating a dual boot system in general, but since the SP3 is a UEFI device, I'm a bit gun shy in this particular instance. I found these instructions at askubuntu, but I'm not sure if they're still relevant, or if there are any differences between Ubuntu and Mint I should be aware of. So, I basically just want to know:   1. Are the instructions I linked to above sufficient?    2. If not, what different/additional steps I should take?


title: How do you move files into the in-memory file system mounted at /dev/shm

text: Someone recently told me about /dev/shm. You all helped refine my understanding of what /dev/shm is What dev folder allows you tell the OS to cache something? The person who told me about /dev/shm said that I could use it to, say, unzip a big file more quickly than in a regular file system. I'm trying to do that now on an OS X machine. I run               sudo cp /Volumes/USB/rcv1rcv2aminigoutte.tar.bz2 /dev/shm      and get               cp: /dev/shm: Operation not supported      How do I load a file from the regular file system into the in memory file system mounted at /dev/shm Thanks as always. I learn a ton from asking questions on this site.


title: How can I use avahi without a network connection?

text: How can I test software that uses avahi while my laptop is disconnected from any router? All of the services run on the same machine, so Avahi would be advertising an IP address of 127.0.0.1 for all of the services. As an example, I am using a file at `/etc/avahi/services/postgresql.service` to register a database:               $ cat /etc/avahi/services/postgresql.service     <?xml version="1.0" standalone="no"?><!--*-nxml-*-->     <!DOCTYPE service-group SYSTEM "avahi-service.dtd">     <service-group>       <name>my_database_name</name>       <service>         <type>_postgresql._tcp</type>         <port>5432</port>       </service>     </service-group>      When I am connected to the router, `avahi-browse` shows the service:               $ avahi-browse -a | grep my_database_name     +  wlan0 IPv6 my_database_name                              PostgreSQL Server    local     +  wlan0 IPv4 my_database_name                              PostgreSQL Server    local      When I am disconnected from the router, `avahi-browse` no longer shows any services and my software cannot find the database:               $ avahi-browse -a      Here is my interface information when I am disconnected:               $ ifconfig     eth0      Link encap:Ethernet  HWaddr f0:de:f1:ac:a6:37                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:20 Memory:f3900000-f3920000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:65536  Metric:1               RX packets:3637633 errors:0 dropped:0 overruns:0 frame:0               TX packets:3637633 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:1242209987 (1.2 GB)  TX bytes:1242209987 (1.2 GB)      I am running Ubuntu 14.04 but may need to do this on other distributions as well.


title: Pass a command to ROOT from a shell script and having it stay open

text: I am writing a bash script to perform some analysis using the program ROOT. I want to run some initial command to load the result of the analysis, then continue using ROOT interactively. The analysis part goes along well but the problem is that after `root` is executes my initial command, it closes immediately. So far I have tried the EOF (here-file) construct to pass my initial command and I am a bit unfamiliar with shell scripting so I would like to get your opinions on how to keep `ROOT` running after the execution of the script. That is I would like to see the ROOT prompt instead of the sytem prompt.               ./runReader.py SummerStd 140PU_NM1      root -l SummerStd_140PU_NM1_his.root << EOF     TBrowser a;     EOF      The above code executes the analysis then runs `root`; however, it immediately terminates and I have no time to inspect the TBrowser since I have the system prompt instead of the ROOT prompt. I would like control to stay at `root`'s command prompt after the script sends the `TBrowser` command to the program, so I can enter additional commands by hand.


title: How to use parameter substitution in glob pattern (zsh)

text: I want to process a bunch of files ending in some suffixes, so I wrote the following zsh script but it did not work.               EXT=(.jpg .png .gif)     EXT=${(j.|.)EXT}    # EXT becomes '.jpg|.png|.gif'     for f in *($EXT); do     # should become '*(.jpg|.png|.gif)' but failed         process-one-file $f     done      Why doesn't it work? How can I mix parameter substitution and glob pattern?


title: in which file is hostname alias persistent, if not /etc/hosts?

text: In order to have an alias for my server, which can be seen in a "hostname -a" command, I edited the /etc/hosts file to add the alias at the end of the entry containing the hostname. For example, my hostname is host1 and I want to have alias hostalias, I have below entry in /etc/hosts:                   192.168.0.1 host1 hostalias      With this change I am able to use "hostname -a" to see hostalias. However, I can change it only once! If I edit the file /etc/hosts again to something like this:                   192.168.0.1 host1 hostalias2      the output of "hostname -a" is still hostalias. Even after I remove the hostalias2 and reboot the server, it's still saying hostalias. BUT, if I change the alias the first time after reboot, it takes effect. So in fact I have two questions:   1. Where is the hostname alias persistent, if not /etc/hosts (so it can survive a reboot).   2. Why can it only be changed once per boot? More information: It is a RHEL 6.2 server.


title: audio recording - record two sources simultaneously, merge into a single 2-track recording

text: How can I record two audio sources at the same time and create a file where one source is the left channel and the other source is the right channel of a lossless stereo audio recording? My distro is Kubuntu 12.04 LTS. My audio source hardware is listed at bottom. Specifically, I believe the two sources I want to record at the same time are:   1. alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2: Monitor of Scarlett 2i2 USB Analog Stereo   2. alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3: Scarlett 2i2 USB Analog Stereo FYI, this question **_might_** be relevant (but I don't understand the command shown there): how to merge two audio input source using avconv EDIT: this definitely seems relevant, but I am struggling to understand it: http://ubuntuforums.org/showthread.php?t=1962947 My first **_guess_** about how to do this is this simple script:               #!/bin/bash     OUTPUT="audio_`date +%Y-%m-%d_%H%M`"     avconv \     -f alsa -ac 2 -i <alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor> \     -f alsa -ac 1 -i <alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo> \     -map 0:0 -map 1:0 \     -acodec flac \     -threads 0 \     -y $OUTPUT      I assume I need to replace what is in angle brackets with the correct notation. I have no idea if the rest of the above script is even close... Here's my hardware info:               $ pacmd list-cards       Welcome to PulseAudio! Use "help" for usage information.       >>> 3 card(s) available.       [snip other cards]     index: 2     name: <alsa_card.usb-Focusrite_Scarlett_2i2_USB-00-USB>     driver: <module-alsa-card.c>     owner module: 6     properties:             alsa.card = "1"             alsa.card_name = "Scarlett 2i2 USB"             alsa.long_card_name = "Focusrite Scarlett 2i2 USB at usb-0000:04:00.0-2, high speed"             alsa.driver_name = "snd_usb_audio"             device.bus_path = "pci-0000:04:00.0-usb-0:2:1.0"             sysfs.path = "/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/usb3/3-2/3-2:1.0/sound/card1"             udev.id = "usb-Focusrite_Scarlett_2i2_USB-00-USB"             device.bus = "usb"             device.vendor.id = "1235"             device.vendor.name = "Novation EMS"             device.product.id = "8006"             device.product.name = "Scarlett 2i2 USB"             device.serial = "Focusrite_Scarlett_2i2_USB"             device.string = "1"             device.description = "Scarlett 2i2 USB"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-usb"     profiles:             output:analog-stereo: Analog Stereo Output (priority 6000)             output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060)             output:analog-stereo+input:iec958-stereo: Analog Stereo Output + Digital Stereo (IEC958) Input (priority 6055)             output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500)             output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5560)             output:iec958-stereo+input:iec958-stereo: Digital Stereo Duplex (IEC958) (priority 5555)             input:analog-stereo: Analog Stereo Input (priority 60)             input:iec958-stereo: Digital Stereo (IEC958) Input (priority 55)             off: Off (priority 0)     active profile: <output:analog-stereo+input:analog-stereo>     sinks:             alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#1: Scarlett 2i2 USB Analog Stereo     sources:             alsa_output.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo.monitor/#2: Monitor of Scarlett 2i2 USB Analog Stereo             alsa_input.usb-Focusrite_Scarlett_2i2_USB-00-USB.analog-stereo/#3: Scarlett 2i2 USB Analog Stereo     ports:             analog-output: Analog Output (priority 9900, available: unknown)                     properties:                  analog-input: Analog Input (priority 10000, available: unknown)                     properties:                  iec958-stereo-input: iec958-stereo-input (priority 0, available: unknown)                     properties:                  iec958-stereo-output: Digital Output (S/PDIF) (priority 0, available: unknown)                     properties:      lsusb -v shows the Focusrite_Scarlett_2i2 as:               Bus 003 Device 002: ID 1235:8006 Novation EMS        idVendor           0x1235 Novation EMS       idProduct          0x8006       Here is more info on this hardware:               $ aplay -l     **** List of PLAYBACK Hardware Devices ****     [snip]     card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0          $ arecord -l     **** List of CAPTURE Hardware Devices ****     [snip]     card 1: USB [Scarlett 2i2 USB], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0


title: Home and End keys in a gnuplot interactive terminal do not move cursor

text: When working interactively with gnuplot, the home and end keys do not move the cursor to the beginning and end of a line, but instead produce the characters "OH" and "OF", respectively. What's the reason for this, and how can I get the cursor to move to the beginning and end of a command?


title: mailx change the direction of the mail

text: I use mailx to send mails from servers to me. The problem is that it comes as RTL and not LTR. How can I define it in the command? here is the command:               cat /tmp/monitor.log | mailx -s "Daily status of ${ihostname}" me@example.com


title: Regain control of an X Server

text: I have a Gnome session running on my server. I started it with tightvncserver. Now it wont let me in anymore because of > Too many authentication failures - client rejected This seems to be a known issue I don't want to kill the vncserver, as it probably will kill the current Gnome session. I have some rendering software running and don't want to lose the calculations. Any ideas how to get hold of the Gnome session again?


title: How to avoid cp -r ~/some/folder/ . copying all files to the current folder's top level?

text: ( **Update:** this happens on Mac OS X -- I am using Mountain Lion.) It sometimes happen that I use the `tab` key to complete the path, so my command may be:               cp -r ~/some/folder/ .      but it turns out that the line above has a different behavior from               cp -r ~/some/folder .      the second line will copy the folder into the current directory, as `folder`, but the first line will copy all 7 files, 6 subfolders into the current directory, contaminating the current directory. Since I don't do any source control using git or svn in that particular current directory, it actually has to be cleaned up manually, and it is quite a pain. Is there a way to prevent this from happening? Such as by making a function, alias, or Bash setting? I know I can remember this, but 2 months down the road, I can actually accidentally do the same thing again, so it is better to guard against this behavior. (I would rather needing to use `cp -r ~/some/folder/* .` and `cp -r ~/some/folder/.* .` if that is what I really want.)


title: Connecting 2 monitors to a laptop

text: I have a laptop running `Fedora 15`, `Gnome 3.0.1`, and `Mobile Intel® GM45 Express Chipset`. I have a VGA monitor connected to it, as well as a DisplayPort to DVI adapter to connect a second monitor. Both monitors are detected by the system and I can use them individually, but not both at the same time. Both monitors are the same. When I try to activate the second monitor using `System Settings -> Display` I've seen different behaviors.   * Either the images (from the 3 screens) get overlapped on the first 2 screens, jumbled up.    * Or one of the screens (laptop or monitor) stays active but becomes invisible. Meaning the screen is dark, but the mouse travels over there and there are windows over there.   * As well as this:  `xrandr --output VGA1 --mode 1680x1050 --rate 60`   `xrandr: cannot find crtc for output VGA1` Error which occurs with either of the inactive monitor. Here's the output of `xrand`:               xrandr      Screen 0: minimum 320 x 200, current 3120 x 1050, maximum 8192 x 8192     LVDS1 connected 1440x900+1680+0 (normal left inverted right x axis y axis) 303mm x 190mm        1440x900       60.0*+   40.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 433mm x 271mm        1680x1050      60.0*+        1280x1024      75.0     60.0          1280x960       60.0          1152x864       75.0          1024x768       75.1     70.1     60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          640x480        72.8     75.0     66.7     60.0          720x400        70.1       HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 connected (normal left inverted right x axis y axis)        1680x1050      60.0 +        1280x1024      75.0     60.0          1280x960       60.0          1152x864       75.0          1024x768       75.1     70.1     60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          640x480        72.8     75.0     66.7     60.0          720x400        70.1       HDMI2 disconnected (normal left inverted right x axis y axis)     DP2 disconnected (normal left inverted right x axis y axis)     DP3 disconnected (normal left inverted right x axis y axis)      What else should I try to have all 3 displays active at the same time? Is it possible?


title: Transferring XFCE customization from one system to another?

text: I configured XFCE on my desktop at home and wanted to setup my work system with the same configurations (figured it'd just be copying a few files) or even a script? In the past I used to just mark the changes on paper and have to repeat myself with what ever desktop env I used. Is there an easier way to replicate personalization changes from one system to the next?


title: How to setup SVN server securely?

text: I am a linux newbie but I need to setup a SVN server and have the following 2 requirements: 1) Users to be able to authenticate automatically (with ssh keys, with no password) 2) The repositories to be secure, meaning that they can't be destroyed by the above users I have read a lot about using svn+ssh but it turns out that it doesn't use svnserve and every user has physical access to the repo, which means it can delete is easily. It is unacceptable and I can't figure out what authentication method to use in order to fulfill the above 2 requirements. Can you help?


title: Bind9 -- How to find which programs are making which dns lookups?

text: Using bind9 on a laptop shows lots of nonsense domains when network connectivity is down:               Oct 18 19:56:18 lap3 named[1536]: error (network unreachable) resolving './NS/IN': 128.63.2.53#53     Oct 18 19:56:18 lap3 named[1536]: error (network unreachable) resolving 'drgvlofubl/A/IN': 128.63.2.53#53     Oct 18 19:56:18 lap3 named[1536]: error (network unreachable) resolving 'gjpszynvcz/A/IN': 128.63.2.53#53     Oct 18 19:56:19 lap3 named[1536]: error (network unreachable) resolving 'iqgwbuxrbt/A/IN': 192.5.5.241#53      How do I find out which program is making these queries? Adding 'debug' to /etc/resolv.conf doesn't appear to do anything (laptop is running Arch linux and seems not compiled w/ debug support?). Next step is to compile libresolv with debug enabled, unless there's something better to do.


title: Linux Distrib with build in Web filter solution

text: Is there any distribution with a built in solution for web content filtering for my network?


title: How to put fixed-width, vertically-oriented key-value pairs in a CSV file?

text: I have a text file with the following type of content: `OPERATION_CONTEXT VMD1HTE1A71_ns:.oc.GJ_OAD2 alarm_object 1130 On director: VMD1HTE1A71_ns:.temip.VMD1HTE1A71_director AT Fri 18 Oct 2013 06:56:39 All Attributes`                                        Identifier = 1130                                   State = Terminated                          Problem Status = Closed                   Clearance Report Flag = True                         Escalated Alarm = False                   Close User Identifier = "Auto-Clear"             Termination User Identifier = "Auto-Clear"                        Close Time Stamp = Fri 18 Oct 2013 05:01:46                  Termination Time Stamp = Fri 18 Oct 2013 05:01:46                      Creation Timestamp = Fri 18 Oct 2013 04:37:29                    Clearance Time Stamp = Fri 18 Oct 2013 05:01:40             Last Modification Timestamp = Fri 18 Oct 2013 05:01:46                          Previous State = Outstanding                          Managed Object = Alcatel_5529OAD VMD1HTE1A71_ns:.OAD2 MD "AMS" Node "INGJJMGRJMTSNB0001AG2OLT001"                         Target Entities = { Alcatel_5529OAD VMD1HTE1A71_ns:.OAD2 MD "AMS" Node "INGJJMGRJMTSNB0001AG2OLT001" }                              Alarm Type = CommunicationsAlarm                              Event Time = Fri 18 Oct 2013 05:01:40                          Probable Cause = Unknown                       Specific Problems = {  }                 Notification Identifier = 160315                                  Domain = Domain VMD1HTE1A71_ns:.dm.GJ_OAD2                            Alarm Origin = IncomingAlarm                      Perceived Severity = Major                         Additional Text = "                                                                       nativeProbableCause: Attempt Threshold Crossed                                                                       osTime: 20131018163727.250+0530                                                                       neTime: 20131011174021.0+0530                                                                       notificationId: AMS:160315                                                                       portNumber:                                                                       ftpNumber:                                                                       meNm: INGJJMGRJMTSNB0001AG2OLT001                                                                       mdNm: AMS                                                                       objectType: OT_MANAGED_ELEMENT                                                                       aliasValue: MGMT Security                                           Access:INGJJMGRJMTSNB0001AG2OLT001:IP10.70.6.6.T0.S841 "                       Original Severity = Major                     Original Event Time = Fri 11 Oct 2013 05:40:21      I want to create a CSV file from this text file with Column headers as the values before = in each line like Identifier, State, Problem Status and all the next lines containing the values under each Column header like 1130, Terminated, Closed etc. Apart from the lines with "=" i don't want anything else to be extracted into the CSV file. Another complication i faced in this is, some fields have a new line character like Additional Text. I want to get all the value for Additional Text in one column under Additional Text Column. Since i am new to Linux/Unix, i am not able to find a way to do this. What is the best way to do this?


title: Emacs create cursor

text: Is there a way to create an additional "dummy" cursor in Emacs (preferably multiple)? Ideally I'd like to be able to set its color separately from the original cursor and set its position. Then I'd have the regular cursor that behaves normally, and I'd have multiple extra cursors whose position has to be set by some other means.


title: Adding another linux system to grub 2

text: As far as I can gather from the fedora website, I need to edit the `/etc/grub.d/40_custom` script to read:               menuentry "Arch Linux" {             set root=(hd0,5)             linux /boot/vmlinuz-linux             initrd /PATH_TO_initramfs??         }      How do I finish this, and what else do I need to modify such that I can boot into both OSes from my Fedora grub installation? EDIT: now that I got this working, I thing it is important to note that `grub2-mkconfig` must be run (or it may be named `grub-mkconfig`) in order for the changes to such scripts as the one mentioned above to take effect.


title: tmux exits abruptly right after loading

text: I just compiled my own version of `tmux` with `libevent`. Whenever I run tmux from zsh, tmux starts, but exits quickly returning `[exited]`. I read here that the problem could be my configuration for `default-command`, `default- shell`, but I don't have a `.tmux.conf` file on my home directory, and as far as I know there is no version of tmux installed on the system. Interestingly though, tmux runs correctly with:               tmux new $SHELL      I have also tried creating an empty `.tmux.conf` with no luck, and `tmux -v` does not output anything else. any thoughts? ## Additional Info 1/3: Below are the last few lines from `strace -f tmux`               [pid 30927] writev(6, [{"\33[?1049h\33(B\33[m\33[?1l\33>\33[H\33[2J\33[?1"..., 976}, {"                                "..., 195}], 2)   = 8     [pid 30927] close(6)                    = 0     [pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0     [pid 30927] epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0     [pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0     [pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599513697}) = 0     [pid 30927] gettimeofday({1361992488, 675759}, NULL) = 0     [pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599693697}) = 0     [pid 30927] gettimeofday({1361992488, 675933}, NULL) = 0     [pid 30927] epoll_wait(3, {{EPOLLOUT, {u32=8, u64=8}}}, 32, 692) = 1     [pid 30927] clock_gettime(CLOCK_MONOTONIC, {3625108, 599962697}) = 0     [pid 30927] gettimeofday({1361992488, 676202}, NULL) = 0     [pid 30927] epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN|EPOLLOUT, {u32=8, u64=8}}) = 0     [pid 30927] sendmsg(8, {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377", 16}], msg_controllen=0, msg_flags=0}, 0) = 16     [pid 30909] <... epoll_wait resumed> {{EPOLLIN, {u32=7, u64=7}}}, 32, 4294967295) = 1     [pid 30927] epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}} <unfinished ...>     [pid 30909] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>     [pid 30927] <... epoll_ctl resumed> )   = 0     [pid 30909] <... clock_gettime resumed> {3625108, 600611697}) = 0     [pid 30927] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>     [pid 30909] gettimeofday( <unfinished ...>     [pid 30927] <... clock_gettime resumed> {3625108, 600777697}) = 0     [pid 30909] <... gettimeofday resumed> {1361992488, 676953}, NULL) = 0     [pid 30927] gettimeofday( <unfinished ...>     [pid 30909] epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLIN, {u32=7, u64=7}} <unfinished ...>     [pid 30927] <... gettimeofday resumed> {1361992488, 677094}, NULL) = 0     [pid 30909] <... epoll_ctl resumed> )   = 0     [pid 30927] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>     [pid 30909] recvmsg(7,  <unfinished ...>     [pid 30927] <... clock_gettime resumed> {3625108, 601290697}) = 0     [pid 30927] gettimeofday( <unfinished ...>     [pid 30909] <... recvmsg resumed> {msg_name(0)=NULL, msg_iov(1)=[{"\4\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65535}], msg_controllen=0, msg_flags=0}, 0) = 16     [pid 30927] <... gettimeofday resumed> {1361992488, 677801}, NULL) = 0     [pid 30909] epoll_wait(3,  <unfinished ...>     [pid 30927] epoll_wait(3,  <unfinished ...>     [pid 30909] <... epoll_wait resumed> {}, 32, 0) = 0     [pid 30909] clock_gettime(CLOCK_MONOTONIC, {3625108, 601921697}) = 0     [pid 30909] gettimeofday({1361992488, 678171}, NULL) = 0     [pid 30909] fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 14), ...}) = 0     [pid 30909] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b4474914000     [pid 30909] write(1, "[exited]\n", 9[exited]     )   = 9     [pid 30909] getppid()                   = 30904     [pid 30909] fcntl(0, F_GETFL)           = 0x8002 (flags O_RDWR|O_LARGEFILE)     [pid 30909] fcntl(0, F_SETFL, O_RDWR|O_LARGEFILE) = 0     [pid 30909] exit_group(0)               = ?     <... epoll_wait resumed> {{EPOLLIN|EPOLLHUP, {u32=8, u64=8}}}, 32, 691) = 1     clock_gettime(CLOCK_MONOTONIC, {3625108, 604208697}) = 0     gettimeofday({1361992488, 680447}, NULL) = 0     epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN, {u32=8, u64=8}}) = 0     recvmsg(8, {msg_name(0)=NULL, msg_iov(1)=[{"\5\0\0\0\20\0\0\0\7\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\177\0\0"..., 65535}], msg_controllen=0, msg_flags=0}, 0) = 0     close(8)                                = 0     close(9)                                = 0     close(10)                               = 0     close(11)                               = 0     close(12)                               = 0     close(13)                               = 0     close(14)                               = 0     close(15)                               = 0     epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLIN, {u32=7, u64=7}}) = 0     epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0     stat("/tmp/tmux-4887/default", {st_mode=S_IFSOCK|0770, st_size=0, ...}) = 0     chmod("/tmp/tmux-4887/default", 0140660) = 0     exit_group(0)                           = ?     Process 30927 detached      ## Additional Info 2/3: Below is the output of `cat tmux-server-23582.log` from `tmux -v`:               > cat tmux-server-23590.log      server started, pid 23590     socket path /tmp/tmux-4887/default     new client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 14 from client 8     got 6 from client 8     got 0 from client 8     new term: xterm-256color     xterm-256color override: colors 256     xterm-256color override: XT      xterm-256color override: Ms ]52;%p1%s;%p2%s     xterm-256color override: Cc      xterm-256color override: Cr ]112     xterm-256color override: Cs [%p1%d q     xterm-256color override: Csr [2 q     new key Oo: 0x1021 (KP/)     new key Oj: 0x1022 (KP*)     new key Om: 0x1023 (KP-)     new key Ow: 0x1024 (KP7)     new key Ox: 0x1025 (KP8)     new key Oy: 0x1026 (KP9)     new key Ok: 0x1027 (KP+)     new key Ot: 0x1028 (KP4)     new key Ou: 0x1029 (KP5)     new key Ov: 0x102a (KP6)     new key Oq: 0x102b (KP1)     new key Or: 0x102c (KP2)     new key Os: 0x102d (KP3)     new key OM: 0x102e (KPEnter)     new key Op: 0x102f (KP0)     new key On: 0x1030 (KP.)     new key OA: 0x101d (Up)     new key OB: 0x101e (Down)     new key OC: 0x1020 (Right)     new key OD: 0x101f (Left)     new key [A: 0x101d (Up)     new key [B: 0x101e (Down)     new key [C: 0x1020 (Right)     new key [D: 0x101f (Left)     new key Oa: 0x501d (C-Up)     new key Ob: 0x501e (C-Down)     new key Oc: 0x5020 (C-Right)     new key Od: 0x501f (C-Left)     new key [a: 0x901d (S-Up)     new key [b: 0x901e (S-Down)     new key [c: 0x9020 (S-Right)     new key [d: 0x901f (S-Left)     new key [11^: 0x5002 (C-F1)     new key [12^: 0x5003 (C-F2)     new key [13^: 0x5004 (C-F3)     new key [14^: 0x5005 (C-F4)     new key [15^: 0x5006 (C-F5)     new key [17^: 0x5007 (C-F6)     new key [18^: 0x5008 (C-F7)     new key [19^: 0x5009 (C-F8)     new key [20^: 0x500a (C-F9)     new key [21^: 0x500b (C-F10)     new key [23^: 0x500c (C-F11)     new key [24^: 0x500d (C-F12)     new key [25^: 0x500e (C-F13)     new key [26^: 0x500f (C-F14)     new key [28^: 0x5010 (C-F15)     new key [29^: 0x5011 (C-F16)     new key [31^: 0x5012 (C-F17)     new key [32^: 0x5013 (C-F18)     new key [33^: 0x5014 (C-F19)     new key [34^: 0x5015 (C-F20)     new key [2^: 0x5016 (C-IC)     new key [3^: 0x5017 (C-DC)     new key [7^: 0x5018 (C-Home)     new key [8^: 0x5019 (C-End)     new key [6^: 0x501a (C-NPage)     new key [5^: 0x501b (C-PPage)     new key [11$: 0x9002 (S-F1)     new key [12$: 0x9003 (S-F2)     new key [13$: 0x9004 (S-F3)     new key [14$: 0x9005 (S-F4)     new key [15$: 0x9006 (S-F5)     new key [17$: 0x9007 (S-F6)     new key [18$: 0x9008 (S-F7)     new key [19$: 0x9009 (S-F8)     new key [20$: 0x900a (S-F9)     new key [21$: 0x900b (S-F10)     new key [23$: 0x900c (S-F11)     new key [24$: 0x900d (S-F12)     new key [25$: 0x900e (S-F13)     new key [26$: 0x900f (S-F14)     new key [28$: 0x9010 (S-F15)     new key [29$: 0x9011 (S-F16)     new key [31$: 0x9012 (S-F17)     new key [32$: 0x9013 (S-F18)     new key [33$: 0x9014 (S-F19)     new key [34$: 0x9015 (S-F20)     new key [2$: 0x9016 (S-IC)     new key [3$: 0x9017 (S-DC)     new key [7$: 0x9018 (S-Home)     new key [8$: 0x9019 (S-End)     new key [6$: 0x901a (S-NPage)     new key [5$: 0x901b (S-PPage)     new key [11@: 0xd002 (C-S-F1)     new key [12@: 0xd003 (C-S-F2)     new key [13@: 0xd004 (C-S-F3)     new key [14@: 0xd005 (C-S-F4)     new key [15@: 0xd006 (C-S-F5)     new key [17@: 0xd007 (C-S-F6)     new key [18@: 0xd008 (C-S-F7)     new key [19@: 0xd009 (C-S-F8)     new key [20@: 0xd00a (C-S-F9)     new key [21@: 0xd00b (C-S-F10)     new key [23@: 0xd00c (C-S-F11)     new key [24@: 0xd00d (C-S-F12)     new key [25@: 0xd00e (C-S-F13)     new key [26@: 0xd00f (C-S-F14)     new key [28@: 0xd010 (C-S-F15)     new key [29@: 0xd011 (C-S-F16)     new key [31@: 0xd012 (C-S-F17)     new key [32@: 0xd013 (C-S-F18)     new key [33@: 0xd014 (C-S-F19)     new key [34@: 0xd015 (C-S-F20)     new key [2@: 0xd016 (C-S-IC)     new key [3@: 0xd017 (C-S-DC)     new key [7@: 0xd018 (C-S-Home)     new key [8@: 0xd019 (C-S-End)     new key [6@: 0xd01a (C-S-NPage)     new key [5@: 0xd01b (C-S-PPage)     new key OP: 0x1002 (F1)     new key OQ: 0x1003 (F2)     new key OR: 0x1004 (F3)     new key OS: 0x1005 (F4)     new key [15~: 0x1006 (F5)     new key [17~: 0x1007 (F6)     new key [18~: 0x1008 (F7)     new key [19~: 0x1009 (F8)     new key [20~: 0x100a (F9)     new key [21~: 0x100b (F10)     new key [23~: 0x100c (F11)     new key [24~: 0x100d (F12)     new key O2P: 0x100e (F13)     new key O2Q: 0x100f (F14)     new key O2R: 0x1010 (F15)     new key O2S: 0x1011 (F16)     new key [15;2~: 0x1012 (F17)     new key [17;2~: 0x1013 (F18)     new key [18;2~: 0x1014 (F19)     new key [19;2~: 0x1015 (F20)     new key [2~: 0x1016 (IC)     new key [3~: 0x1017 (DC)     new key OH: 0x1018 (Home)     new key OF: 0x1019 (End)     new key [6~: 0x101a (NPage)     new key [5~: 0x101b (PPage)     new key [Z: 0x101c (BTab)     replacing key OA: 0x101d (Up)     replacing key OB: 0x101e (Down)     replacing key OD: 0x101f (Left)     replacing key OC: 0x1020 (Right)     new key [3;2~: 0x9017 (S-DC)     new key [1;2B: 0x901e (S-Down)     new key [1;5B: 0x501e (C-Down)     new key [1;6B: 0xd01e (C-S-Down)     new key [1;2F: 0x9019 (S-End)     new key [1;2H: 0x9018 (S-Home)     new key [2;2~: 0x9016 (S-IC)     new key [1;2D: 0x901f (S-Left)     new key [1;5D: 0x501f (C-Left)     new key [1;6D: 0xd01f (C-S-Left)     new key [6;2~: 0x901a (S-NPage)     new key [5;2~: 0x901b (S-PPage)     new key [1;2C: 0x9020 (S-Right)     new key [1;5C: 0x5020 (C-Right)     new key [1;6C: 0xd020 (C-S-Right)     new key [1;2A: 0x901d (S-Up)     new key [1;5A: 0x501d (C-Up)     new key [1;6A: 0xd01d (C-S-Up)     session 0 created     writing 8 to client 8     keys are 12 ([>1;3400;0c)     received xterm version 3400     input_parse: '/' ground     input_parse: 'h' ground     input_parse: 'o' ground     input_parse: 'm' ground     input_parse: 'e' ground     input_parse: '/' ground     input_parse: 'j' ground     input_parse: 'o' ground     input_parse: 'h' ground     input_parse: 'n' ground     input_parse: '/' ground     input_parse: '.' ground     input_parse: 'z' ground     input_parse: 'p' ground     input_parse: 'r' ground     input_parse: 'o' ground     input_parse: 'f' ground     input_parse: 'i' ground     input_parse: 'l' ground     input_parse: 'e' ground     input_parse: ':' ground     input_parse: '2' ground     input_parse: ':' ground     input_parse: ' ' ground     input_parse: 'n' ground     input_parse: 'o' ground     input_parse: ' ' ground     input_parse: 's' ground     input_parse: 'u' ground     input_parse: 'c' ground     input_parse: 'h' ground     input_parse: ' ' ground     input_parse: 'f' ground     input_parse: 'i' ground     input_parse: 'l' ground     input_parse: 'e' ground     input_parse: ' ' ground     input_parse: 'o' ground     input_parse: 'r' ground     input_parse: ' ' ground     input_parse: 'd' ground     input_parse: 'i' ground     input_parse: 'r' ground     input_parse: 'e' ground     input_parse: 'c' ground     input_parse: 't' ground     input_parse: 'o' ground     input_parse: 'r' ground     input_parse: 'y' ground     input_parse: ':' ground     input_parse: ' ' ground     input_parse: '/' ground     input_parse: 'n' ground     input_parse: '/' ground     input_parse: 's' ground     input_parse: 'w' ground     input_parse: '/' ground     input_parse: 'z' ground     input_parse: 's' ground     input_parse: 'h' ground     input_parse: '-' ground     input_parse: '4' ground     input_parse: '.' ground     input_parse: '3' ground     input_parse: '.' ground     input_parse: '1' ground     input_parse: '4' ground     input_parse: '/' ground     input_parse: 'b' ground     input_parse: 'i' ground     input_parse: 'n' ground     input_parse: '/' ground     input_parse: 'z' ground     input_parse: 's' ground     input_parse: 'h' ground     ' groundrse: '     input_c0_dispatch: '     input_parse: '     ' ground     input_c0_dispatch: '          session 0 destroyed     writing 3 to client 8     got 5 from client 8     writing 4 to client 8     lost client 8      ## Additional Info 3/3: And below is the output of `cat tmux-client-23582.log` from `tmux -v`: > cat tmux-client-23582.log got 8 from server got 3 from server got 4 from > server


title: Grep patterns in selected lines

text: How to keep rows containing `pattern 1` only if the next line contains `pattern 2` and starts with `pattern 3` ? Exemple: keep line starting with an `A` only if the next line starts with a `B` and contains the pattern `B1` Input file               A   item1A     B   item1B2     A   item2A     A   item3A     B   item3B1     B   item3CB1     B   item3B2     A   item5A     B   item5B1     A   item6A      Expected output:               A   item3A     B   item3B1     B   item3CB1     A   item5A     B   item5B1      ( I'm currently trying with `grep -e ^A -e B1` but the side effect is that all `A` s lines are kept )


title: How to debug random reboots, with no kernel panic, of an embedded system?

text: I have two aValue RPC-10W1 embedded systems that reboots by themselves after 1-2 hours. Facts:   * The board will reboot within a time span of 1 to 2½ hours.   * The issue is present on two identical systems.   * The issue is present using aValue's own Linux firmware (Ubuntu 10.04).   * The issue is present with nothing other than power supply connected.   * The board is using Linux kernel 2.6.35.3.   * No kernel panic is shown in terminal. The Linux terminal is directed to a serial port at bootup.   * No warnings or errors are shown from `dmesg`. Things I've tried:   * Different root file systems:      * Stock Ubuntu 10.04 from aValue.     * Custom minimal file system created using LTIB. In aValue's user manual they describe how to use LTIB for their board.   * Compile my own kernel using the kernel sources supplied from aValue (came on a CD). Things I haven't tried:   * Check if the issue is present on their Android or WinCE releases. I've compared the Linux kernel source I received from aValue with the Freescale kernel source and they are the same + a huge single patch file from aValue. How can I proceed to determine what is causing these reboots?


title: Add <script> to the bottom of a html file?

text: I have a bunch of HTML files, and I need to add `<script src="ga.js"></script>` before each search instance of "`</body></html>`". How would I add that to the bottom of all these files?


title: RIPEMD-160 file digest

text: How can I make a file digest under Linux with the RIPEMD-160 hash function, from the command line?


title: How can I verify SSL certificates on the command line?

text: I'm trying to validate/verify that the rsa key, ca-bundle, and certificate stored here are ok. They are not being served by a webserver. How can I verify them?


title: Problem with java3d

text: I want to play this java simulation: http://www.compadre.org/OSP/items/detail.cfm?ID=9640 in java 3d mode on a linux (ubuntu) system. But it doesn't work. If I switch to java 3d-mode it complains that java 3d is not installed. `sudo aptitude install libjava3d-java` didn't help. Then I did a right click in this java app and selected Diagnostics-> About Java 3D. Then I get the message: > Java 3D was not found in: > /usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext:/usr/java/packages/lib/ext Then I tried               cp /usr/share/java/*3d* \         /usr/lib/jvm/java-6-openjdk-i386/jre/lib/ext`      but I get the same error message again. I start the java app like this:               java -jar ejs_astronomy_SolarLunarEclipse.jar      I tried this on two systems, one freshly installed and also switched from openjdk to sun-jdk temporarily without any effect. Any idea how I can get this work?


title: How do I know which files will be included in a linux kernel before I build it?

text: I am working on a project that includes building an old kernel version of linux. This is fine, but I still need to patch the kernel of all previously found security vulnerabilities based on CVEs. I have the CVEs and have extracted the names of the vulnerable files mentioned in them, along with the kernel versions it affects. So far, I have found about 150 **potential** vulnerabilities that could affect my build, but obviously some of them affect files relevant to graphics drivers that I don't use. So far, I have just gone through the list manually, checking if the files are included by using `make menuconfig`, and cating `Kconfig` in relevant folders. This has worked alright so far, but these methods don't show the actual file names (e.g. ipc/sem.c) so it takes more work than necessary. Ideally, I would like to somehow print a list of all the files that will be included in my build, and then just write a script to check if vulnerable files are included. How can I find the names of ever source file (e.g. ipc/sem.c) that will be included in my build?


title: Insert Lines after Multi-Line Regex Match

text: I've got an XML file I need to append to after a specific set of tags. Basically the file structure looks like this:               <key>servers</key>     <dict>     ... Server Details ...     </dict>      I would like to match on the lines:               <key>servers</key>     <dict>      and append a block of XML specifying a server connection immediately after `<dict>`. I've got the new XML block in its own text file as it's quite long. I've looked at `sed` and `awk` to do this but I've come up against a wall. I've also seen examples of using `perl` to accomplish this but I'm not so familiar with Perl. From what I understand though, `sed` and `awk` aren't great at multiline matching. The reason I need to do multiline matching is because the `<dict>` tag is used frequently within the XML file and I need to append a block into the `<key>servers</key>` section, as opposed to replacing its entire contents.


title: Linux File Versioning?

text: We are migrating from A VMS environment to a Linux environment for some old alpha servers we are decommissioning. The one challenge I have not been able to overcome is file versioning. VMS keeps multiple copies of the same file by using a version flag. I have found multiple options on source forge however I have not found anyone who has experience with any of these in a major production environment. the reson this is needed is because the feeds from other systems do not take unique file names into account. We are trying to keep our scope as light as possible. Any help is greatly appreciated. The 2 main ones that appear to be available are:   * Wayback   * EtcKeeper - not sure If you can apply it to only one directory or multiple.  Has anyone used these in an enterprise environment? Are there other options I should be considering?


title: Books that explain Linux Ubuntu in detail?

text: I've got a lot of problems with Linux . I currently downloaded Ubuntu. I really wonder what does 0.0 mean, how to combine command like `ls -alh` ( which one should come first), what is the command short for (eg. wc). Any books that tell us all these little things?


title: Symlink everywhere

text: Is there any way for me to symlink a particular file so that it appears in every directory on the system? So if I symlink `/tmp/scratch` No matter where I am I can type `vi scratch`?


title: How to fake a filesystem that cannot be mounted by others

text: I'm currently working on a project. There's an Ubuntu Linux system installed on a disk, DA, mounting the other disk, DB. What it requires is that DB can be only mounted by DA in order to prevent data stealing. I planned to use encryption tools provided by Ubuntu to encrypt the whole disk DB. Other Linux won't be able to mount DB since they don't have the right key. However, my colleague told me it is possible to modify the kernel to make a "fake" new filesystem, say, ext9, and this new filesystem is actually `ext3` or `ext4`. Since only the new kernel knows this "new" filesystem, other Linux would never get it mounted. And since it in fact is `ext3`, software like Apache or MySQL could run normally. Is this possible or not.


title: syntax highlighting in bash (in terminal)

text: Is there a way to make `bash` shell in a terminal use syntax highlighting? There are few related questions on Stack exchange, but with no clear conclusion. What I am looking for is to have `bash` keywords highlighted as I type commands in my terminal I am using `terminator` as my terminal emulator


title: Run a Shell script and read the output in a variable and run another script based on output

text: I am a novice to Linux system. My requirement is to run a Linux status script which echos a message (message is either "App is running" or "App is not running"). If the message is "App is running" then run another shell script to stop the App. Then run the status shell script again after a few seconds. When I read "App is not running", then run Deploy script to deploy new application. The status script is written in Bash:               if [ "$(ps -ef | grep -i cat ${TPSHUB_HOME}/current.pid             | grep -v grep|awk '{ print $2 }')" ];then         echo "TpsHub is RUNNING"      else          echo "TpsHub is NOT running"      fi      exit


title: Qt Application Disobeying Xmodmap

text: A long while ago, I created a `~/.Xmodmap` reversing the `4` and `5` to create "natural scrolling":               pointer = 1 2 3 5 4 7 6 8 9 10 11 12      I source `.Xmodmap` in `.xinitrc` in the standard fashion (`xmodmap $HOME/.Xmodmap &`). This has worked for years without issues. I just recently installed an application called `cockatrice`. I have no other issues with the program, except that, for some reason, when I scroll inside the program, my scrolling direction is not "natural" (i.e., it is as if my `.Xmodmap` is not being obeyed by only this application). At first, I thought it was an issue with my Qt input module, but I realized that I have correctly declared `QT_IM_MODULE` to `xim` in my `.xinitrc`, and I've never had this issue with any other application. Is this an application-specific issue, or is this Qt-specific? What should I try to further troubleshoot this (or solve it)? Attempting to set this universally through `xinput` fails:               $ xinput list      ⎡ Virtual core pointer                          id=2    [master pointer  (3)]     ⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]     ⎜   ↳ SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]     ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]     # unneeded information regarding my keyboard     $ xinput set-prop 2 "Evdev Scrolling Distance" -1 -1 -1     property 'Evdev Scrolling Distance' doesn't exist, you need to specify its type and format


title: Backup remote management protocol in case of faulty SSH server

text: I have a remote computer which I currently cannot access with SSH. The computer responds to ping but SSH gives connection refused, so I suspect the ssh-server is not working for some reason. What would be a reasonable alternative if something goes wrong with SSH in general? I had a weird idea that would allow me to perform commands on the remote computer without SSH. I could have a bash script on my http-server that the remote machine would periodically download, say once a minute with cron, and always run this script. The file would be empty normally. The resulting output could be uploaded to the same server if needed. But is there an easier way? NOTE: I'm looking for a software solution compatible with Ubuntu 12.04.


title: Print text between (and including) two delimiters on a line

text: What's the best way to print the text between (and including) the first pattern ("SELECT" or "SSELECT") and a second pattern ("[") using a command- line took (e.g. cut, sed, awk)? For example, given the following:                54001744  KB035928      20  /dev/pts/8      SELECT PRINTER.LOCS WITH SHIP.TICK.BR = "15" [ INP @ 0x67E ]      26083642  RV091101      25  /dev/pts/14     SSELECT PRODUCT BY STK.LN.SEQ [ MENU.SELECT @ 0x10C ]      57082018  hajohug     0xACEBF1C1  SELECT ORDER.QUEUE WITH &INDEX&.STATUS = "S~S]" "H~S]" "A~S]" "M~S]" AND WITH &INDEX&.SBR "51 17~]" [ SOE.PH.ORDER.PRINT @ 0x384 ]      50266386  hajohug     0xACEBF2F0  SSELECT UD.VIEWS WITH &INDEX& = "ORDERENTRY.ORDERENTRY~0" [ SOCKET.READ @ 0x168 ]      The result should be:               SELECT PRINTER.LOCS WITH SHIP.TICK.BR = "15"     SSELECT PRODUCT BY STK.LN.SEQ     SELECT ORDER.QUEUE WITH &INDEX&.STATUS = "S~S]" "H~S]" "A~S]" "M~S]" AND WITH &INDEX&.SBR "51 17~]"     SSELECT UD.VIEWS WITH &INDEX& = "ORDERENTRY.ORDERENTRY~0"      I've tried using cut, but I haven't been able to get things looking right.


title: Installation of my custom debian iso failed

text: I followed this tutorial to create my custom debian CD with build-simple-cdd but I get always an error even I use the basic config. The ISO file is created (named debian-7.3-amd64-CD-1.iso) but when I try to install it I get the following error:               Avertissement: Failure trying to run: chroot /target dpkg --force-depends --install  /var/cache/apt/archives/base-files_7.1wheezy4_amd64.deb /var/cache/apt/archives/base-passwd_3.5.26_amd64.deb      `cat package-list |grep base acpi-support-base install alsa-base install base- files install base-passwd install desktop-base install dnsmasq-base install exim4-base install gcc-4.7-base:amd64 install geoip-database install gettext- base install gir1.2-gst-plugins-base-0.10 install groff-base install gstreamer0.10-plugins-base:amd64 install libfile-basedir-perl install libgstreamer-plugins-base0.10-0:amd64 install libilmbase6 install libreoffice- base install libreoffice-base-core install libsnmp-base install libxml-sax- base-perl install linux-base install lsb-base install ncurses-base install netbase install perl-base install powermgmt-base install sgml-base install xfonts-base install` Error on virtual terminal (alt-F4): ![enter image description here](http://i.stack.imgur.com/0q1nm.png)


title: Getting the value of the clipboard

text: Is there a command to output the current value of the clipboard? Example (this command doesn't exists, it's just an example of what I'm looking for:               cat clipboard     > Hello world!      Also, if the clipboard is stored somewhere, where is it located?


title: Can Start Service With init.d script, however doing service <SERVICE_NAME> start does not work

text: I am running CentOS 6 and I am trying to get my Oracle database to run at startup. I have been following these steps: http://www.oracle-base.com/articles/linux/automating-database-startup-and- shutdown-on-linux.php (Oracle 11gR2 portion at bottom) I have created this script and it is saved as /etc/init.d/dbora:               #!/bin/bash     # chkconfig: 345 99 10     # description: Oracle auto start-stop script.     #      # Set ORA_OWNER to the user id of the owner of the     # Oracle database software.          ORA_OWNER=oracle          case "$1" in         'start')         # Start the Oracle databases:         # The following command assumes that the oracle login         # will not prompt the user for any values         # Remove "&" if you don't want startup as a background process.         su $ORA_OWNER -c "/home/oracle/scripts/startup.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1" &              touch /var/lock/subsys/dbora         ;;     'stop')         # Stop the Oracle databases:         # The following command assumes that the oracle login         # will not prompt the user for any values         su $ORA_OWNER -c "/home/oracle/scripts/shutdown.sh >> /home/oracle/scripts/startup_shutdown.log 2>&1"         rm -f /var/lock/subsys/dbora         ;;     esac      Next, I ran:               chmod 750 /etc/init.d/dbora      As per the instructions. Finally, I added the script using chkconfig.               chkconfig --add dbora      I also added the scripts that the dbora file calls. I am able to start the database using:               /etc/init.d/dbora start      However,               service dbora start      does not work. Any ideas?


title: Gnome 3 with multiple X Screens

text: ## Background I'm running Gnome 3 with three separate X Screens using the proprietary NVIDIA driver with Xinerama disabled in xorg.conf. (because Eclipse works better with it disabled) There is only one gnome-shell process running and two of the three X-screens are black. (if I login with fluxbox, I'm able to use all three screens) The non-black screen seems to be working fine, though. If I run `DISPLAY=:0.1 gnome-shell --replace`, I can start a second instance on one of other screens. I suppose I could have the system run the command on startup for each of my additional monitors. ## Question Should Gnome 3 automatically start a separate instance of gnome-shell for each X screen? **If yes:** Any suggestions for why this might not be working on CentOS 7? **If no:** What's the best way to work around this problem? If I start extra instances with the command I mentioned above, I can't move my cursor down from my upper display. (but I can move it up from the lower)


title: How to replace a custom date string in a text file

text: I've looked through several tutorials and a couple of StackOverflow posts, but I've not seen any examples using sed or awk which use dates. I have a text file that contains this as the first line, I need to replace the date with the current date and time via script; what is the easiest way to do this in Linux?               TS: 2014-03-31 13:56:01      I can use any tool available in a standard Ubuntu install such as sed or awk.


title: Can sed and awk take in multiple files?

text: grep can search in multiple files, including those files recursively under a specified directory. This makes grep able to find which file contains a pattern. Can awk and sed also? It seems that they can only process one file? Thanks.


title: How can I get this proprietary low-vision camera working in Linux?

text: I am a visually impaired Computer Science student, and use a special USB camera to zoom in on the board/projector during lectures. The camera only officially supports Windows, and I've been using it for about 2 years. I really enjoy using Linux though, and this one aspect is really preventing me from switching completely (I have a dual boot setup currently with Ubuntu 14.04, and have to reboot for most lectures). I tried setting it up with VirtualBox with a Windows guest, and while the camera drivers and software install fine, the image is just black. I would love to be able to find some method of using it without rebooting, whether that be somehow getting the virtual machine to work, using another camera driver to interface with it as a webcam type device, or writing a new driver. Does anyone have any suggestions on how to get this to work? The camera is a SmartView Graduate by HumanWare. I believe it's discontinued now, but here is the support page (with a link to the Windows software:   http://support.humanware.com/en-usa/support/smartview_graduate_support P.S. Sorry if this is not quite in the scope of Unix/Linux, but I felt that it would be in the case that I'd need to write a driver. I can also provide a .pcat file to load into Wireshark if it's helpful. I tried looking at the packets but really had no clue what to do with them. EDIT: I've uploaded the output of lsusb for the camera to pastebin at http://pastebin.com/8dieAAuk Also, here's the output of dmesg:               [  720.831143] usb 2-1.1: new high-speed USB device number 7 using ehci-pci     [  720.930297] usb 2-1.1: New USB device found, idVendor=0b06, idProduct=a513     [  720.930309] usb 2-1.1: New USB device strings: Mfr=0, Product=1, SerialNumber=2     [  720.930316] usb 2-1.1: Product: \xffffffcc\xffffff8c\xffffff8cSV Graduat