title: Where is the Ctrl+/ (^/) bash shortcut for undo defined?

text: I can not find the mapping in `bind -p` nor in `stty -a`. Also, it only works in the terminal emulators I've tried (xterm, konsole, gnome-terminal) and not in the linux system console. I think it's traditionally an emacs mapping. EDIT: When I enter `^V^/` bash prints `^_`, which is mapped to undo in bind. But where is `^/` mapped to `^_`?


title: What are other ways to share a tmux session between two users?

text: I'm looking for a clean and easy way to share a tmux session with another user on the same machine. I've tried the `-S socket-path` option, but it requires opening up all permissions of the socket-path before someone else can connect to the session. It works, but it's a little cumbersome. For example:               # Me     $ tmux -S /tmp/pair     $ chmod 777 /tmp/pair          # Another user     $ tmux -S /tmp/pair attach      This works, but both users now share the same tmux configuration (the configuration of the user who initiated the session). Is there a way to allow the two users to use their own tmux config and their own individual tmux key bindings? For bonus points, ideally, it would also be nice to give read-only access of the tmux session to other users.


title: How to detect the incoming httpd Connection Counts of each VHOSTS?

text: With RHEL and Apache (httpd), is there a way to:   * Detect which v.host (domain) is gaining how many incoming connections? Because in this few days, i got a lot of incoming connections on the Server being acknowledged by using:   * ps aux | grep httpd -c   734 That means i have `734` incoming connections currently being handled by Apache but the problem is i have (lets say) 10 Vhosts (domains).   * So which Domain is getting the high loads? Any sharp solutions please.


title: Automatic shut down of Ubuntu 13.04 along side Windows 8

text: Things with Ubuntu were working absolutely fine, but suddenly, the laptop started overheating whenever I logged into Ubuntu. And that lead to automatic shutdown. I realised that it was definitely due to heat. This overheat crossed a limit and it started affecting even when I logged into Windows. With appropriate service, the laptop fan was cleaned and things are absolutely back to normal in Windows 8. But, there are still problems with using Ubuntu.   1. After a while, it closes automatically. And, if the laptop is on battery, it doesn't switch on immediately, unless you connect to power. I tried without battery and the problem is still the same. So , battery problems are ruled out.   2. My laptop is HP- pavilion, g6-2313ax notebook. I would like to stress again, it was working really fine, but one fine day, this problem started to occur. When searchd over net, they said something about the kernel version and it being updated could be a reason.   3. I tried the one suggested in this link as well, but it did not work! link.   4. I got a small intuition as to the birth of this problem. I reinstalled Windows 8 once with ubuntu on it and thus it removed the grub. To retrieve it, I followed few online steps! link. Ever since the I got the grub back, I have been facing this issue. But I cleared my whole hard disk and properly installed Ubuntu and Windows again. Still, the problem exists. What can I do to solve this?


How can I set check interval for set autoread option in VIM? Is it possible?


title: shellcheck is advising not to use basename: why?

text: I am trying out shellcheck. I have something like that               basename "${OPENSSL}"       and I get the following suggestion               Use parameter expansion instead, such as ${var##*/}.      From the practical point of view I see no difference               $ export OPENSSL=/opt/local/bin/openssl     $ basename ${OPENSSL}     openssl     $ echo ${OPENSSL##*/}     openssl      Since `basename` is in the POSIX specs, I don't a reason why it should be best practice. Any hint?


title: Small inexpensive *nix box?

text: I'd like to learn more about Unix & Linux and would like to set up a little home test server/ headless box. (I'm thinking of compiling from scratch, to learn how that works; either Gentoo Stage II or Linux from scratch.) I'd likely only need a little bit of storage, a USB port, and a network connection. I've heard good things about the (no longer produced) NSLU2 and overheating issues with those "plug computers" made by Marvell and others. I'd like something low-powered and physically small, which is why I don't just buy/get an old box from craigslist, though I'm willing to be convinced that it's worth finding space next the couch and a few bucks more in electricity.


title: Getting all files that have been modified on a specific date

text: Is it possible to find all php files within a certain directory that have been modified on a certain date I'm using               find /var/www/html/dir/ -mtime -28 | grep '\.php'       to get files modified within the last 28 days, but I only need files that have been modified on the following date 2011-02-08


title: ffmpeg installation on Linux REHEL/CentOs 6.X

text: I had a static installation of `ffmpeg` but was running into trouble with config files not found so I have since just deleted it. Then I tried re- installing a more current static version just to see if it differs from first one I installed a week ago and it does. The first one had the `ffmpeg` script which I ended up placing in `/usr/bin` and a `ffmpeg-static` folder with `cache` in root. The latest static I just installed has no `static` folder and just two scripts, the `ffmpeg` and `ffprobe`. I have a few questions:   * Is it best to place these scripts in `usr/bin`, does it matter? Does `yum` update static versions?   * Is it much better practice to compile `ffmpeg` than use static versions?    * Has anyone tried this type of ffmpeg installation as stated in the following link?


title: How to write repeated free-form strings to a file, as fast as 'dd'?

text: `dd` can write repeating `\0` _bytes_ to a file very fast, but it can't write repeating arbitary strings.   Is there a _bash-shell_ method to write repeating arbitary **strings** equally as fast as 'dd' (including `\0` ) ? All the suggestions I've encountered in 6 months of linux are things like `printf "%${1}s" |sed -e "s/ /${2}/g"`, but this is painfully slow compared to `dd`, as shown bel402653184ow.. and `sed` crashes after approx 384 MB (on my box).. actually that's not bad for a single line-length :) but it did crash!   I suppose that wouldn't be an issue for 'sed', if the string contained a newline). Speed Comparison 'dd' vs 'printf+sed'                                           real        user        sys            WRITE 384 MB: 'dd'          0m03.833s   0m00.004s   0m00.548s     WRITE 384 MB: 'printf+sed'  1m39.551s   1m34.754s   0m02.968s          # the two commands used        dd if=/dev/zero bs=1024 count=$((1024*384))     printf "%$((1024*1024*384))s" |sed -e "s/ /x/g"      I have an idea how to do this in a _bash-shell_ script. but there's no point re-inventing the wheel :)


title: How can I use column to delimit on tabs and not spaces?

text: I'd like to use Unix `column` to format some text. I have fields delimited by tabs, but within each field there are also spaces. `column` delimits on white space (tabs and spaces). How can I make column only use tabs as the delimiter? I was trying to specify tab as the delimiter using:               cat myfile | column -t -s"\t"


title: Cannot understand chkrootkit's result

text: I couldn't understand the output of `chkrootkit` command:               $ chkrootkit -q -r /     /usr/lib/.libssl.so.10.hmac     /usr/lib/.libfipscheck.so.1.hmac     /usr/lib/firefox-3.6/.autoreg     /usr/lib/.libfipscheck.so.1.1.0.hmac     /usr/lib/.libssl.so.1.0.0d.hmac     /lib/.libcrypto.so.1.0.0d.hmac     /lib/.libgcrypt.so.11.hmac     /lib/.libcrypto.so.10.hmac     /proc/2980/fd/129: No such file or directory      What does this mean?


title: How to create a script, which runs another script in separate terminal window and does not wait?

text: I wrote the following               #!/bin/bash     cd ~/bin/red5-1.0.0     gnome-terminal --working-directory=. -x red5.sh      `red5.sh` is the script to run (this is java written media server). My script above opens new terminal but with error message               There was an error creating the child process for this terminal     Failed to execute child process "red5.sh" (No such file or directory)      What can be the cause? I am at Ubuntu 11.10


title: Replacement shortcuts for `screen`

text: Screen uses the shortcut `Ctrl``A` to activate. I find that this interferes with the Bash command for jumping to the start of the line, and the VIM command for incrementing an integer. Certainly I could just remap it, but I am interested to know how other screen users deal with the situation. I don't think that I use `Ctrl``Q` for anything. What drawbacks and gotchas have other screen users encountered when changing the default shortcut? Note that I was unsure if Unix.SE or SuperUser would be more appropriate a place to post this. This could be a "chatty, open-ended question" or it could be a very useful resource for other screen users who undoubtedly encounter this, depending on how disciplined the answers are. I suspect that other screen users will more likely stumble across the question on Unix.SE. If SuperUser is a more appropriate place then any mod is welcomed to move it. Thanks!


title: vim not shown in fuser

text: First use Vim to edit a file, say /tmp/A. Assuming that vim process is the only one that accesses /tmp/A, then use "ctrl+z" to suspend the process, and execute               fuser /tmp/A      Then you see nothing in the output. However, if you use "less" to open that file, you could see the pid of less in the fuser output. Is there anthing special about vim that makes this weird scenario?


title: Install Compiler, GCC, in SCO

text: I am having difficulty trying to install the GCC compiler in SCO, but can't get it to work. I have used an FTP to transfer some files (`.tar.gz`) to `/u/test/installgnu/` and I extracted the files, but that is really the furthest I got. I had a look at this post: How do I install GCC on a system with no compiler?, but that doesn't help as SCO is very different to linux (well it is to me). Here is the list of the files I downloaded from an FTP site: Skunkware/osr5/devtools/gcc/. So looking at those, I downloaded them all, and into the machine. But now I don't know where to go from here. I am running SCO OpenServer 5.0.7


title: Can't install uwsgi on ubuntu

text: root@ip-10-194-97-94:~# apt-get install uwsgi          Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:       uwsgi: Depends: uwsgi-python2.6 (>= 0.9.6.5-0ubuntu1~lucid1) or                       uwsgi-python3.1 (>= 0.9.6.5-0ubuntu1~lucid1)     E: Broken packages


title: Linux Mint 64-bit Kernel Panic on Boot

text: I'm trying to install 64-bit Maya on the new Macbook Pro with Retina Display using a Bootcamp partition. The trouble is that I get a kernel panic similar to the one below on live cd boot or usb boot. I did manage to get Maya to boot using "recovery mode". I even managed to install Maya however when I tried to boot from that partition, I got the same kernel panic. Does any one know whats going on? ![enter image description here](http://i.stack.imgur.com/sd3nY.png)


title: cat files with directory

text: Is there a command to show the directory/file name when cat files? For example: assume two files f1.txt and f2.txt are under ./tmp               ./tmp/f1.txt     ./tmp/f2.txt       Then when I do **cat ./tmp/*.txt** , only the content of files will be shown. But how to firstly show the file name, then the content?, e.g.:                (The needed command):      ./tmp/f1.txt:        This is from f1.txt      and so on      ./tmp/f1.txt:      This is from f2.txt ...      Is there a command to do it? (There seems to be no option for 'cat' to show the file names)


title: Preloading gnome-shell before getting login dialog from gdm, is it possible?

text: Is there anyway to (pre)load gnome-shell before getting user account login dialog from gdm? The problem is after login from gdm I have to wait for gnome-shell to be ready with non-responsive , no status feedback desktop background. I found that waiting for gdm to show-up during boot process is acceptable but I was expected to get a ready-to-use gnome-shell instantly after entering password to the login dialog instead of another waiting. I am using Fedora and Arch. PS. The graphical loading progress in KDE could provide better expif they shown before login dialog too.


title: Recover corrupted .tar salvaged from Android

text: I had an android phone that developed a fault in which it only persistently showed the boot logo. I sent it for Samsung for repair, who send it to a third-party company to be repaired. I was told that they are waiting for a part, for which they do not know when will be in stock and to avoid further delays would send me a replacement. That is good and all, but when I asked whether I could have my data, I was referred to the third-party company. They told me that because of certain protection laws they were not allowed to keep a backup of my data, even with my consent and that it has now been probably overwritten. Before, sending it to repair I managed to get some file structure into three separate tar files using adb, which in the end turned out to be corrupted.   * data.tar - 366,870,016 bytes   * system.tar - 285,983,232 bytes   * dbdata.tar - 6,245,888 bytes I used the tar command to create the tar archive, while excluding directories that made the whole thing halt. After the tar was completed I received an error message/warning? (not sure what this was now). This was backed up to an internal SD card. I had access to this via the computer and thus was able to copy it. I am not sure when exactly the corruption happened, but I am guessing that the tar command didn't execute properly. Running strings, just brings up random characters. tar tvf on data.tar & system.tar, shows nothing, on dbdata.jar:               tar: This does not look like a tar archive     tar: Skipping to next header     tar: Exiting with failure status due to previous errors      file tar on all of them says:               data.tar: data     dbdata.tar: data     system.tar: data      -               abc@xyz-virtual-machine:~/Downloads$ hd data.tar | head --lines=50     00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     06588000  2e 20 20 20 20 20 20 20  20 20 20 10 00 ab b0 06  |.          .....|     06588010  07 3f 07 3f 00 00 b1 06  07 3f 2e 00 00 00 00 00  |.?.?.....?......|     06588020  2e 2e 20 20 20 20 20 20  20 20 20 10 00 ab b0 06  |..         .....|     06588030  07 3f 07 3f 00 00 b1 06  07 3f 00 00 00 00 00 00  |.?.?.....?......|     06588040  e5 45 00 75 00 72 00 6f  00 70 00 0f 00 91 65 00  |.E.u.r.o.p....e.|     06588050  00 00 ff ff ff ff ff ff  ff ff 00 00 ff ff ff ff  |................|     06588060  e5 55 52 4f 50 45 20 20  20 20 20 10 00 ae b0 06  |.UROPE     .....|     06588070  07 3f 07 3f 00 00 b1 06  07 3f 31 00 00 80 00 00  |.?.?.....?1.....|     06588080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     06590000  2e 20 20 20 20 20 20 20  20 20 20 10 00 00 2b 80  |.          ...+.|     06590010  ce 3e ce 3e 00 00 2b 80  ce 3e 37 00 00 00 00 00  |.>.>..+..>7.....|     06590020  2e 2e 20 20 20 20 20 20  20 20 20 10 00 00 2b 80  |..         ...+.|     06590030  ce 3e ce 3e 00 00 2b 80  ce 3e 00 00 00 00 00 00  |.>.>..+..>......|     06590040  41 6d 00 65 00 74 00 61  00 00 00 0f 00 87 ff ff  |Am.e.t.a........|     06590050  ff ff ff ff ff ff ff ff  ff ff 00 00 ff ff ff ff  |................|     06590060  4d 45 54 41 20 20 20 20  20 20 20 10 00 00 20 18  |META       ... .|     06590070  38 40 38 40 00 00 27 18  38 40 42 00 00 00 00 00  |8@8@..'.8@B.....|     06590080  41 61 00 75 00 64 00 69  00 6f 00 0f 00 3d 00 00  |Aa.u.d.i.o...=..|     06590090  ff ff ff ff ff ff ff ff  ff ff 00 00 ff ff ff ff  |................|     065900a0  41 55 44 49 4f 20 20 20  20 20 20 10 00 00 30 80  |AUDIO      ...0.|     065900b0  ce 3e ce 3e 00 00 30 80  ce 3e 66 0b 00 00 00 00  |.>.>..0..>f.....|     065900c0  41 62 00 6f 00 6f 00 6b  00 6d 00 0f 00 91 61 00  |Ab.o.o.k.m....a.|     065900d0  72 00 6b 00 73 00 00 00  ff ff 00 00 ff ff ff ff  |r.k.s...........|     065900e0  42 4f 4f 4b 4d 41 7e 31  20 20 20 10 00 64 4a 19  |BOOKMA~1   ..dJ.|     065900f0  09 3f 09 3f 01 00 4a 19  09 3f de 01 00 00 00 00  |.?.?..J..?......|     06590100  41 61 00 75 00 64 00 69  00 6f 00 0f 00 e4 5f 00  |Aa.u.d.i.o...._.|     06590110  76 00 32 00 00 00 ff ff  ff ff 00 00 ff ff ff ff  |v.2.............|     06590120  41 55 44 49 4f 5f 56 32  20 20 20 10 00 64 a7 a6  |AUDIO_V2   ..d..|     06590130  b2 40 b2 40 02 00 a7 a6  b2 40 a9 28 00 00 00 00  |.@.@.....@.(....|     06590140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     06598000  2e 20 20 20 20 20 20 20  20 20 20 10 00 00 2b 80  |.          ...+.|     06598010  ce 3e ce 3e 00 00 2b 80  ce 3e 42 00 00 00 00 00  |.>.>..+..>B.....|     06598020  2e 2e 20 20 20 20 20 20  20 20 20 10 00 00 2b 80  |..         ...+.|     06598030  ce 3e ce 3e 00 00 2b 80  ce 3e 37 00 00 00 00 00  |.>.>..+..>7.....|     06598040  e5 6d 00 65 00 74 00 61  00 2e 00 0f 00 6e 67 00  |.m.e.t.a.....ng.|     06598050  7a 00 00 00 ff ff ff ff  ff ff 00 00 ff ff ff ff  |z...............|     06598060  e5 45 54 41 20 20 20 20  47 5a 20 20 00 00 20 18  |.ETA    GZ  .. .|     06598070  38 40 38 40 02 00 20 18  38 40 11 41 a4 dd 20 01  |8@8@.. .8@.A.. .|     06598080  e5 6d 00 65 00 74 00 61  00 2e 00 0f 00 d4 64 00  |.m.e.t.a......d.|     06598090  61 00 74 00 00 00 ff ff  ff ff 00 00 ff ff ff ff  |a.t.............|     065980a0  e5 45 54 41 20 20 20 20  44 41 54 20 00 00 27 18  |.ETA    DAT ..'.|     065980b0  38 40 38 40 02 00 27 18  38 40 eb 45 00 74 2c 03  |8@8@..'.8@.E.t,.|     065980c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     065a0000  3c 3f 78 6d 6c 20 76 65  72 73 69 6f 6e 3d 22 31  |<?xml version="1|     065a0010  2e 30 22 3f 3e 3c 61 64  65 70 74 3a 64 65 76 69  |.0"?><adept:devi|      I have tried to use Advanced TAR Repair (http://archive.org/details/tucows_326605_Advanced_TAR_Repair), but without any success. Is there any tool available which can scan each tar file carefully (it can be as slow as possible), and get as much file structure out as possible?


title: Running Linux virtual machine guest on Linux Host

text: I have a machine running Debian Linux (stable), but I'd also like a Debian unstable box to use as a sandbox to test and develop. Is there an easy way to create a virtualized Debian unstable machine on my Debian stable box?


title: Parse apache logs to exclude IP ranges

text: I need to look for some requests in a huge pile of apache logs. My only requirement is this: I need to only view the requests coming from any IP address that is NOT included in a list of 50 IP ranges I have. How can I make that happen using any combination of regexes awk grep or anything? Can't think of an easy way. The idea would be to get each line, get the first part (the IP address), match it to a file with all the ranges, and if its not there, then display it. No idea on how to go about doing this, so any help is welcome! Samples: a Typical http log line is               123.456.789.012 - - [22/Oct/2012:06:37:48 +0100] "GET /test/test HTTP/1.1" 302 224 "-" "some user agent/4.3.5"      A typical line out of my IP ranges file is               192.168.0.1 - 192.168.0.255      Of cours ethe IP ranges file could be converted to 192.168.0.1/24 notation if necessary. The good thing is that all the ranges are Class C (just noticed that), so I guess only the first 3 parts of the IP address could be matched and that should be good enough.


title: How do I get a list of all enabled media in Mageia via CLI?

text: I have read URPMI from Mageia wiki but there seems to be no mention of how I can check the currently enabled media using `urpmi` command. There is `urpmi.addmedia` and `urmpi.removemedia`. So I tried doing `urpmi.listmedia` but it obviously isn't an existing command. Any way I can check this? Do note that I don't have any `X Windows` installed so I need to do this via command line.


title: Bash programing. The difference between double-clicking a program and running the program under console

text: I wrote a script named vpn.sh.The contents is as follows:               #!/bin/sh          cd /etc/openvpn          sudo openvpn client.ovpn &      * * * when I am in konsole, ./vpn.sh runs well. But when I double click the vpn.sh file, it has no response. Can someone tell me the difference between the above two methods?


title: Two monitors and a single X-Screen: How to change "full screen" center and resolution

text: I have two monitors, both 1600 x 900, running as a single x-screen. When I try to run a full screen application (a game for example), the application full screens as though my two monitors were one monitor at 3200 x 900. The center is then of course the crack between my two real monitors. How can I run such applications so that they only use _one_ monitor, 1600x900, centered on one of the real monitors?


title: I want a static IP address for my (network? or computer?)

text: Me and two friends have been making a video game. We've thought about download hosting a bit, but found that Mediafire, Box, and those sorts of file-hosting sites' maximum free file-upload size is far too small for us. Because of this limitation I've written a short TCP client/server downloader so that we can host the client binary on Mediafire, and have that pull the actual game from our server side program running on Ubuntu Server. I think that the Ubuntu Server computer needs a static IP address, but my question is this: is having a static IP address like the one you turn out with from this tutorial going to make the local IP address of the Ubuntu Server computer static, or is it going to make the IP address that you can see from whatismyip.com static? Aren't they equally crucial to ensuring the client always attempts to connect to the same place? If my router is set to port-forward the Ubuntu Server computer's IP address but the IP address changes the download won't work. If my network's IP address (the one seen from WhatIsMyIP) changes the client program will attempt to connect to a completely incorrect place - how can I fix both?


title: Why does no one use the true Bourne shell as /bin/sh?

text: I've noticed that basically no system I've ever worked with has `/bin/sh` as a real executable. It's always a symlink to `dash`, `bash` in POSIX mode, or something similar. Why? What are the disadvantages of using the true, original `/bin/sh`? (Speed? Licensing?)


title: How to list RPM packages installed in order of installation date

text: I'd like to see a list of software installed in the order of the date they were installed. The order doesn't matter (newest to oldest & vice-versa) as long as they're arranged by date. I'm mainly interested in seeing what libraries I've installed. Since I've installed so many, I need to know what libraries were installed together so that I may recall what software required these, if I need to do a fresh installation. I'm using Fedora 16 w/ the yum.


title: Linux Mint 13 Mate: default to current username synaptic authentication

text: I have Linux Mint 13 Mate. There are 2 admin user accounts on my computer. Some programs like Synaptic and the Software manager ask me to select a user name before I type in the password ![enter image description here](http://i.stack.imgur.com/nTAkT.png). I would like these programs to default to the current username. By the way, some other programs like the Update manager and Samba Configuration directly ask me for the current user's password.


title: Any chance to fix dual boot not having to turn UEFI on and off to switch OS?

text: I had a single Linux hard drive with LUKS partitions. Linux was installed in legacy mode, but it worked with UEFI option turned on later. I decided to install a Windows 8 on a second hard drive. So I unplugged the Linux drive, plugged the other one, installed the Windows with UEFI on by default, booted, updated. Windows 8 was installed in UEFI mode w/o secure boot. Replugged back the Linux drive, and now I cannot get them both to work through GRUB without going into BIOS every time flipping UEFI. Both drives are in a PC. I can only boot Windows if UEFI is on or Linux if UEFI is off. Is there a way to fix the GRUB? UEFI menu entries?


title: Meaning of “Connection closed by xxx [preauth]” in sshd logs

text: We have a Windows batch script, which connects automatically to a linux server via PLINK (putty). There is NO public private key authentication, the user and the password are in the script. On our linux server we have several sshd log entries (/var/log/messages):               sshd[7645]: Connection closed by xxx [preauth]      What could be the cause for such a message?   "preauth" supposably means "pre authentication"? Sometimes in the entry, "closed by" has the ip address of the windows client, another time there is the ip address of the linux server in "closed by". Does anybody know the differency betweend client ip address and host ip address in the message?


title: Building a bootable USB stick - GRUB syntax help

text: So I have a usb stick that I've partitioned into 2 parts. The first part contains GRUB (Via grub-install) and some ISOs that I want to boot/install from. Rather than start the Linux kernel on these ISOs immediately I want to start their own "Menu" that usually has useful options on it. Is this menu actually inside Linux or is it external? (Logic says external since these menu items start Linux themselves) So far I've guessed that this is a correct `grub.cfg`, but I'd like a more experienced eye to take a peek before I go booting from it.               # Config for GNU GRand Unified Bootloader (GRUB)     # /boot/grub/grub.cfg          # Timeout for menu     set timeout=-1          menuentry "Debian mini.iso x86_64" {         loopback loop /boot/iso/debian-mini-x86_64-25.10.2013.iso         rootnoverify (loop)         chainloader +1         boot     }      Will this bring up the same menu as if I just booted from a disc with this image burned on it? Will this type of `menuentry` work for all images? **Edit:** So it looks like you can't chainload loopback devices (boo!) and I'll have to manually reconstruct all the boot entries from the isolinux settings files. Or something like that. Still need help with syntax for booting properly.


title: "command | less" vs "less <(command)"

text: A common "idiom" for viewing large amounts of command output is to pipe it to `less`, via `command | less`. However, it's also possible (perhaps only in `bash`, haven't tested in other shells) to use the `less <(command)` syntax, but `less` tends to complain `/dev/fd/63 is not a regular file`. After poking around in `/proc/*/fd`, I see that in both cases, it's reading from a pipe. The only difference is that in the first case, it's `stdin` being redirected. In the second case, it's getting `/dev/fd/63` as a file name. Does `less` somehow "ignore" the regular file check when reading from `stdin`? Also, how does it determine that `/dev/fd/63` isn't a regular file, even if the contents are text?


title: Awesome: Incorrect timezone

text: Typically, I set the timezone of my computer's clock by changing the .bashrc file, appending, say, `TZ='America/Los_Angeles'; export TZ` such that whenever `date` is invoked the right time in the right timezone is returned. However, after probing awesome, it seems that running `echo $TZ` in awesome returns something other than when I run `echo $TZ` in my own terminal. According to any instance of a lua repl, `echo $TZ` also appears to return the correct timezone (in accordance with the .bashrc). How would I go about synchronising the timezones across the programs?


title: Edit a command?

text: I'm using many basic commands of unix/linux. In Mac OS X Mavericks, I type cat for a file, but output was faulty. In example, content of the file named bar:               foo        bar      Then:               kaanklky-air:foo-folder kaanklky$ cat bar     foo     barkaanklky-air:foo-folder kaanklky$      `cat` command give last line of file with shell's last status, so I want edit `cat` command to fix it. How I can do it?


title: Why do hard links exist?

text: I know what hard links are, but why would I use them? What is the utility of a hard link?


title: Sensors showing bad values

text: I use Debian linux squeeze x64 now on gigabyte 970a-DS3. I installed this OS on motherboard which burned (from asus). And I've changed my motherboard to that gigabyte. After running back into linux, it shows I have only 13,9 °C temperatures and is it only 1 sensor (instead of about 3 or 4 sensors), which it has detected. it shows just:               Debx64>sensors     k10temp-pci-00c3     Adapter: PCI adapter     temp1:       +13.9°C  (high = +70.0°C, crit = +86.0°C)      I searched on google, but nothing there helping me. I was trying to reinstall lm_sensors, trying again sensors-detect |y and nothing was working. Why it doesn't show all of my sensors and why it shows only 1 sensors with totaly low temperature (13.9°C is epic fail...) What to do, to fix this problem? Is there anything how to tell linux "I want to search again all devices, which has any sensors"? I know this is unique problem, but I would like to know, how to solve this problem. Thank you, all for helping me


title: What chunk size for KVM under Debian linux is optimal with RAID 5?

text: I would like to know, how to set optimal chunk size for my debian squeeze in future. I Work with 3x WD RE4 500Gb 7200RPM in SW-RAID 5, under debian squeeze. (in the future maybe under wheezy) I Saw this test: http://alephnull.com/benchmarks/sata2012/chunk.html 1)Does it mean, when bigger chunk size is set, it will be faster with larger files,for example with KVM running VM? 2)What about MySQL? Would you recommend me bigger chunk size like 2048K or 4096K? (I have about 60 MySQL databases, some of them MYISAM, some of them innodb). Some of them has only 4 MB, maybe 5 or 10 of them have about 700MB, 10 about 120 Mb, the rest has under 20 MB, few of them have under 1 MB of size. 3)Is there any possibility how to change chunk size on running RAID 5? Is it possible to change it (chunk size) without rebuilding my raid? How? Thank you for answers


title: How to change Vim's command type mode programmatically?

text: Is there a simple way to switch from one command type mode to another without loosing the current command line? In my `~/.vimrc` file I remap the `<space>` and `<c-space>` character, coming from, to:   1. N,V,O => :   2. I => :   3. : => / => ? The code that accomplishes the above behavior is:               function! s:ModMapSpaceChar()       noremap <unique> <space> :       map <unique> <nul> <c-space>       map! <unique> <nul> <c-space>       noremap <unique> <c-space> /       inoremap <unique> <c-space> <c-o>:       cnoremap <unique> <c-space> <c-\>eg:ToggleCmdTypes()<cr><c-c>@"       let g:CmdTypes={':' : '/', '/' : '?', '?': ':'}       function! g:ToggleCmdTypes()         let a=getcmdtype()         let b=get(g:CmdTypes, a, a)         let c=getcmdline()         let @"=b . c         return ''       endfunction     endfunction          call s:ModMapSpaceChar()      What bothers me in my approach is the impure function `g:ToggleCmdTypes`. It should ideally return the command that it currently assigns to the `"` register. The resulting command shall then be executed.


title: Debian machine makes repeated requests to DNS for <gateway_ip>.in-addr.arpa

text: I recently forwarded all my router logs to my Debian machine. I noticed a repeated entry in the router logs. The entry is: > Sep 14 17:07:29 192.168.0.1 [Host 192.168.0.1] UDP 192.168.0.2,38048 --> > {ip_of_my_isp_dns_server},53 ALLOW: Outbound access request [DNS query for > 1.0.168.192.in-addr.arpa.] I have the following questions:   1. Is that normal? Why is the Debian machine trying to resolve its own ip in dns?   2. How can I figure out what application on my Debian machine sends these DNS requests?


title: Are changes in crontab applied when the file is saved, or when the editor is closed?

text: When I do `crontab -e`, are the changes applied immediately when I save the file, or do I have to exit vim for it to be applied?


title: alias or bash function does not work

text: When I create               alias wd='ps -ef | grep java | awk {'print $2 " " $9'} | egrep "(A|B|C|D)"'      or               function wd () {         ps -ef | grep java | awk '{print $2}' ...     }      in my .bashrc file, I get errors. Interestingly, if I source my .bashrc file with the function, it 'compiles', but when executing, gives me:                context is          >>> \ <<< {\print         missing }      Can someone help me with this, and also answer when its better to put something in a function versus in an alias?


title: Using empty line as context "group-separator" for grep

text: I need grep output with context, in color, and blank lines as group separator. In this question, I learned how to define custom `group-separator`, and I have constructed my grep command like this:               grep --group-separator="" --color=always -A5      but the group separator is actually not empty, instead it still contains the color code (i.e. `[[36m[[K[[m[[K`). This is because I am using `\--color=always`. But I need color in my grep command, and I need separator to be blank line (for further processing) How can I combine these two conditions?


title: SElinux config file missing

text: Trying to set up mail I found out I have important file missing or it seems I do. First of all I have no selinux in `/etc/sysconfig` and in `/etc/selinux` there is folder `mls` and files `restorecond.conf` `restorecond_user.conf` `semanage.conf` but no general conf file. On command `sestatus` it says disabled. On command `yum provides /etc/selinux/config`               Loaded plugins: fastestmirror, refresh-packagekit     Loading mirror speeds from cached hostfile     * epel: mirror.optus.net     selinux-policy-3.7.19-231.el6_5.1.noarch : SELinux policy configuration     Repo        : updates     Matched from:     Filename    : /etc/selinux/config                    selinux-policy-3.7.19-231.el6.noarch : SELinux policy configuration     Repo        : base     Matched from:     Filename    : /etc/selinux/config                    selinux-policy-3.7.19-231.el6_5.3.noarch : SELinux policy configuration     Repo        : updates     Matched from:     Filename    : /etc/selinux/config      On reboot it remains disabled after command `echo 1 > /selinux/enforce` before reboot. I am on centos 6.5 and don't know how to check if SElinux is corrupted or not. I don't think it exists in full:               -bash-4.1#  rpm -qa | grep selinux     libselinux-python-2.0.94-5.3.el6_4.1.i686     libselinux-utils-2.0.94-5.3.el6_4.1.i686     libselinux-2.0.94-5.3.el6_4.1.i686     -bash-4.1# rpm -q policycoreutils     policycoreutils-2.0.83-19.39.el6.i686     -bash-4.1# rpm -qa | grep setroubleshoot     -bash-4.1# semanage login -l      -bash: semanage: command not found          CONFIG_SECURITY_SELINUX=y     CONFIG_SECURITY_SELINUX_BOOTPARAM=y     CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1     CONFIG_SECURITY_SELINUX_DISABLE=y     CONFIG_SECURITY_SELINUX_DEVELOP=y     CONFIG_SECURITY_SELINUX_AVC_STATS=y     CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1     # CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set


title: Using LDAP for authentication, how can I safely disable/deactivate an account without deleting it?

text: We use LDAP for authentication for thousands of users. The primary tactic we have been employing to make a user unable to login, without removing their account, is to change the LDAP attribute "loginShell" to something like "None" or "NA", as opposed to "/bin/bash". What this does is upon login attempt throw the user "Permission Denied." I'm not sure if this setup with LDAP and the "loginShell" is a unix standard, or specific just to our environment here. My question is, is this a sufficient measure for disabling an account, making a user unable to log in? Are there any holes or workarounds in which a user could still log in? Are there any other steps we can take to disable an account?


title: Privoxy/VPN/remote proxy

text: On Privoxy, my current config involves this. (forwarding all requests to netshade proxy):               forward   /      nl1.netshade.net:350      Now, I would like to use a VPN on top of this config while keeping my current forwarding. If my understanding is correct, would I need to amend the "listen- address" or play with "forward-socks"? If so, how to. I don't know how to setup this up properly.


title: Can't pipe into diff?

text: I wanted to be clever and compare a remote file to a local file without downloading it. I can get the contents of the remote file by               ssh user@remote-host "cat path/file.name"      However, piping that to `diff`               ssh user@remote-host "cat path/file.name" | diff path/file.name      gives me this:               diff: missing operand after `path/file.nae'     diff: Try `diff --help' for more information.      I have ssh keys set up, so it's not prompting me for a password. What's a workaround for this?


title: What are you going to do with your OpenSolaris machines?

text: I have a file server running OpenSolaris (mainly for ZFS, which I really love), but since Oracle has abandoned it, I'm starting to think about what I'm going to do with the OS on that machine. Assuming you have a machine like this and you're in a similar situation, what are your plans? Switching to FreeBSD? Holding out to see if Illumos takes off? Nexenta? I'm curious what other people are thinking on this.


title: How to log Serial data with time stamp?

text: I have an Arduino sending serial data to the computer. I'm able to view the data using a Serial console. But, I want to be able to log it with time stamp. I want a ready made script or program that logs serial data with time-stamp automatically without me having to change much or mess with code.


title: How does udev get device numbers for the devices it creates?

text: Spun off from a small exchange in chat. One of the primary advantages of udev is that you don't have to worry about major and minor device number exhaustion anymore. But the devices created by udev still have these numbers associated with them. How does udev cooperate with the kernel to create device files with the proper major and minor device numbers?


title: Intersection of two arrays in BASH

text: I have two arrays like this:               A=(vol-175a3b54 vol-382c477b vol-8c027acf vol-93d6fed0 vol-71600106 vol-79f7970e vol-e3d6a894 vol-d9d6a8ae vol-8dbbc2fa vol-98c2bbef vol-ae7ed9e3 vol-5540e618 vol-9e3bbed3 vol-993bbed4 vol-a83bbee5 vol-ff52deb2)     B=(vol-175a3b54 vol-e38d0c94 vol-2a19386a vol-b846c5cf vol-98c2bbef vol-7320102b vol-8f6226cc vol-27991850 vol-71600106 vol-615e1222)      The arrays are not sorted and might possibly even contain duplicated elements.   1. I would like to make the intersection of these two arrays and store the elements in another array. How would I do that?   2. Also, how would I get the list of elements that appear in B and are not available in A?


title: Fake linux as android device

text: How can I let my GNU/linux completely mimic an android device when connecting to a wireless Access Point? I explain: I moved to another location and it seems that my android phone and tablet have a wireless internet connection of more than **20mbps**. However, this does not happen with my main computer, which for some reason is restricted to 0.5 mbps at best, and usually around **0.2 mbps** , using exactly the same wireless connection as my phone. This is not a GNU/Linux-side problem, because it works perfectly with any other wireless AP. I suspect it's some sort of network restriction and I would like to find out more about it, because this is the first time I encounter it. Tethering does not work on my android devices. Is this restriction a common practice by network administrators? With the help of the commentators I have tried:   * Changing hostname to something like `android-713d51a9d238cfcb`   * Changing MAC address   * Changing program that I use for downloads (`wget`)   * My mobile device has user agent `"Mozilla/5.0 (Linux; Android 4.4.4; Nexus 4 Build/KTU84P) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/33.0.0.0 Mobile Safari/537.36"`. I tried the same with `wget` and chrome but nothing works. I note that `ping` appears to have the same performance between computer and android device. Any ideas? * * * **EDIT:** I posted the results from the script on pastebin (please click this link) and I will certainly change the title of my question when we seem to arrive at some conclusion. To my surprise after running the wireless-script I also did a speedtest. My Computer had ~3.5Mbps Download and ~20Mbps Upload, while my android ~20Mbps for Download and ~20Mbps Upload.


title: Replace "o" with "0" in large wordlist and save the original word?

text: I have a large text file with words. Every word is on a single line (typical wordlist). I want to replace all characters "o" with the number "0" in every word, and the new formed word to be pasted on the next line after the original word. For example, if we have this two in the list:               dog     someone      After the manipulation, our file should looks like this:               dog     d0g     someone     s0me0ne      How this can be done with GNU tools like `sed` or `awk`?


title: How can I check if two gzipped files are equal?

text: I am trying to save space while doing a "dumb" backup by simply dumping data into a text file. My backup script is executed daily and looks like this:   1. Create a directory named after the backup date.   2. Dump some data into a text file `"$name"`.   3. If the file is valid, gzip it: `gzip "$name"`. Otherwise, `rm "$name"`. Now I want to add an additional step to remove a file if the same data was also available in the day before (and create symlink or hardlink). At first I thought of using `md5sum "$name"`, but this does not work because I also store the filename and creation date. Does `gzip` have an option to compare two gzipped files and tell me whether they are equal or not? If `gzip` does not have such an option, is there another way to achieve my goal?


title: What is a "theme" in Xfce?

text: I have only used LXDE and Xfce. While in LXDE windows styles (decorations) and general appearance themes ("Widgets" in LXDE) can be clearly differentiated when searched on the internet, for Xfce they are found together (http://xfce- look.org and other sites like that) and cannot be known as what they really are until installed. For example, in a player in Xfce: ![enter image description here](http://i.stack.imgur.com/0aBI8.png) the window "theme" is responsible only for a small part of the appearance, namely the upper buttons, while the rest (excepting icons) is determined by a different package that is also called "theme", and which changes also the appearance of the panel. What is the proper name to use for one and the other? Is there a website where these two a clearly differentiated? I'm tired of searching for a good Xfce (general appearance) theme only to find it under "Window manager".


title: Server Not accepting TCP/IP Connections

text: I have a Wt application running in a CentOS server machine(Machine A) in the port number 9798. Application is up and I could view the web page with the URL,               http://localhost:9798      But application is not loading up in another machine(Machine B) in the same network with the URL,               http://<ip of server>:9798      The port is open and listening. Same thing happens with the PostgreSQL which is running in the server machine. I'm unable to connect to PostgreSQL from other machine through PgAdmin III. But reverse is happening, I am able to connect to the Application and PostgreSQL from Machine A to Machine B. I double checked the running ports, PostgreSQL settings, etc., but could not figure out why is this happening. Why is this happening, what should I try now to explore? Machine A = CentOS 6.4 server,   Machine B = Ubuntu 12.04 Desktop


title: apt-get install packages for python2.7

text: Whenever I install a package for python it only installs for Python2.6 which came with the Debian 6. I am wondering how do I install for python2.7 with apt-get. Presently I am downloading the tarballs and installing manually


title: Rearrange UIDs in GPG

text: In GPG, it possible to move a UID up or down in the list of UIDs in a PGP key? I realize it is a purely cosmetic thing, but I may want to use this to show priority among my addresses, which one should be used first if possible.               pub   4096R/0xAABBD62D0BA66C66 2014-09-02     uid                 [ultimate] Mr. Foo Bar <fourth@example.com>     uid                 [ultimate] Mr. Foo Bar <first@example.com>     uid                 [ultimate] Mr. Foo Bar <third@example.com>     uid                 [ultimate] Mr. Foo Bar <second@example.com>


title: Location of the kernel binary (when not in /boot)?

text: I failed to find the kernel binary in the standard location in `/boot`. I've also searched the whole file system for `vmlinux` or `bzimage`               find / -iname vmlin*     find / -iname bzimage      However, this is an embedded device not a standard desktop. Is it possible that the kernel binary is located on a different storage location which isn't mounted. Example: `/` is mounted on the SD card and the kernel is written on flash? If not, what are the options for locating the kernel binary?


title: In Centos, where is the default or global tmux configuration files stored?

text: I haven't used tmux in awhile and I forgot where is this installed. how can I find out where this is installed and which default / global configuration file is being loaded?


title: How to start GUI application with upstart?

text: I have struggled with this problem for three days and I have tried many ways to solve it but not successful yet. I hope you guys can help me... I have an GUI application. I want to start this application automatically. And when it goes down or closed unexpectedly, I want to reopen this application. I tried to use upstart script, however although there is no problem about services with upstart, GUI application is not starting with upstart script. It says cannot connect X server.. Should I add or change some settings to open with upstart or is there any way to open GUI application automatically when unexpected exit or shut down occurs (not just once after login I mean not with Startup) ? **EDIT : Here is my current step for upstart:** I am trying to start GUI application with upstart script on CentOS. I have test script located /etc/init/ folder.               start on desktop-session-start     stop on desktop-shutdown          respawn          script     export DISPLAY=:0     sleep 5     exec /.1/Projects/UpstartTest/start.sh &          end script      start.sh scripts is running binary files for GUI application. After reboot my computer. When I typed:               [root@mg-CentOS ~]# initctl status test     test stop/waiting      So my upstart is not runnig. When i type               initctl start test      manually it works fine without any problem. How can I run this upstart script after user login (desktop started) ? I am trying to find detailed documents for CentOS for upstart but there is no. Could you please kindly help me how to solve this issue. I am working on it 3 days :( :( :(


title: Magic trackpad natural scrolling interruption

text: I have my Apple Magic Trackpad connected to my Ubuntu 12.04 distro and it's working great with a custom xorg configuration file at `/etc/X11/xorg.conf.d/60-apple-wireless-trackpad.conf`:               # Configuration for fine-tuning only the Apple Magic Trackpad.     Section "InputClass"         Identifier "Apple Magic Trackpad"         Driver "synaptics"              # Match only the Apple Magic Trackpad         MatchUSBID "05ac:030e"         MatchIsTouchpad "on"              # Set resolution tweaks for better response         Option "VertResolution" "75"         Option "HorizResolution" "75"              # Set a timeout for multi finger click so accidental double-clicks don't         # happen when right clicking and other gestures         Option "EmulateMidButtonTime" "100"              # Increase sensitivity         Option "MinSpeed" "1.75"         Option "MaxSpeed" "1.85"         Option "AccelFactor" "0.05"              # Scrolling            Option "VertScrollDelta" "-100"         Option "HorizScrollDelta" "-100"     EndSection      The negative scroll delta gives me "natural scrolling," ie reverse scrolling. The problem I'm having is that as I scroll, it will often "jump." This is what happens:   1. I two-finger drag to scroll down or up to a certain point.   2. I then do the same action again quickly to continue scrolling   3. The content jumps in the opposite direction of which I'm scrolling. I've done a screen capture here. Watch it in full screen and pay attention to the scroll bar at left.


title: denyhosts is blocking existing users from logging in from unknown (new) IP addresses

text: I have denyhosts set up and working on Ubuntu 12.04. It apparently works well, except it is too strict. I can log in from any IP address that I have added to hosts.allow in advance. My sshd_config does not allow password login, only login with keys. However, logging in from a new IP address with my valid RSA key (which works from my known IP addresses), the server shows this msg in /var/log/auth.log: > Jun 23 19:16:31 MyServerName sshd[5949]: refused connect from > hostname.comcast.net (XXX.XXX.XXX.XXX) In order to connect, all I have to do is add the new IP address to /etc/hosts.allow. That's it. Then I can log in: > Jun 23 19:45:03 MyServerName sshd[6024]: Accepted publickey for username > from XXX.XXX.XXX.XXX port 61236 ssh2   >  Jun 23 19:45:03 MyServerName sshd[6026]: pam_unix(sshd:session): session > opened for user username by (uid=0) I have not changed any of the default denyhosts config values and it works really well -- except that it is too strict. (Or does something else read /etc/hosts.allow?) I need to allow any linux user (whose account already exists on the server) to log in from any IP address without making changes on the server in advance (such as adding the IP to hosts.allow). EightBitTony suggests that denyhosts should allow this behavior. In response to EightBitTony, I changed this question and the title.


title: Determine libc version used to create static library

text: I am seeing symbol referencing errors with the static libraries I am using (available with OpenSPARC processor). I have glibc 2.15 on my system. How do I determine the version of glibc used to create the libraries so I can update my system accordingly?


title: mkfst command not found

text: My server has just been reinstalled by my host If I do,               mkfst.ext4  /dev/sdb1      I get following error :               command not found      It's usually there when the system is installed. What should I do so that `mkfst` command is available?


title: rename a list of files according to a text file

text: I have a list of files in a folder, which I will like to rename according to a textfile. For example: These are the 5 files in the folder.               101_T1.nii     107_T1.nii      109_T1.nii     118_T1.nii     120_T1.nii      I will like to have them rename using a text file containing a list of new filenames in the same order, without the extension `.nii`:               n01     n02     n03     n04     n05      How may I go about doing so?


title: After I log in, Debian stops registering input

text: So I just installed Debian on my (other) computer, and I've run into an interesting problem: once I log in, the keyboard and mouse buttons don't work. I can move the mouse, but clicking does nothing, as do keyboard shortcuts. I installed from a 7.1.0 64x network CD, with /home, /, /usr, /var, etc. spread across multiple drives (I have a SSD and two HDD's). I know the mouse and keyboard work, as I've used them in Windows.


title: Node installation: No module named gyp.common

text: I was trying to install node.js on CentOS 6.4 VirtualBox guest on a Windows XP host with the following commands:               cd /usr/local/src/     git clone git://github.com/joyent/node.git     cd node     ./configure     make     make install      I only reached as far as `./configure`. When I executed `./configure` I got the following errors:               Traceback (most recent call last):     File "./configure", line 14, in     <module> from gyp.common import GetFlavor     ImportError: No module named gyp.common


title: Why some packages don't get upgraded?

text: I upgrade packages in terminal using this command `apt-get update && apt-get dist-upgrade -y --show-progress && apt-get autoremove -y && apt-get check && apt-get autoclean -y` I have to copy the names of not upgraded packages and run `apt-get install -y [pasted package names]` How to fix this?


title: How to increase horizontal and vertical default spacing between icons on desktop at EL6

text: I have installed centos 6.5, by default icons are appearing very near to each other on desktop. From where I can increase space between them? Any clue? Which file is recommended to modify manually, any idea?


title: /dev/sda not appearing after secure erase

text: I decided to wipe my SSD with a secure erase before installing Arch Linux, since the Arch wiki said that it would improve performance. I followed the instructions listed on the wiki, but now when I attempt to install Arch, `/dev/sda` does not show up and errors about I/O are given. When I run `fdisk -l`, the following error log appears:               end_request: I/O error, dev sda, sector 0     Buffer I/O error on device sda, logical block 0     sd 0:0:0:0: rejecting I/O to offline device     sd 0:0:0:0: rejecting I/O to offline device     sd 0:0:0:0: rejecting I/O to offline device     sd 0:0:0:0: rejecting I/O to offline device     fdisk: cannot open /dev/sda: Input/output error      A few other errors also appear at boot, saying:               ata1.00: failed command: READ FPDMA QUEUED     ata1.00L status { DRDY }      The SSD appears in the BIOS, and it also appears in the hardware detection tool on the Arch LiveCD. I tried booting with GParted, Ubuntu, and Gentoo, but none of the other OSes would create `/dev/sda` either. `/dev/sda` does not appear in `fdisk`, `testdisk`, or any other tools. I've spent hours trying to make progress on this issue. Does anyone know of a solution? Here's the complete log of dmesg: http://sprunge.us/RCgY


title: Control USB connection/power - only charge

text: When I charge my GoPro with a wall-charger I'm able to still use it and take photos, but when I connect it to my Linux computer I can't. I want to be able to programmatically control how my computer is connected to this device. So I can charge it and switch to the storage connection mode to manage files on it. Is it possible to **only** charge the device, so it won't know it's connected to the computer?


title: Which one is lighter security- and CPU-wise: LXC versus UML

text: I'm trying to decide between "jailing" certain applications and I know the trade-offs of KVM versus LXC and how I can use them both. Lately I came across UML (User-Mode Linux) again and was wondering how it compares with respect to security and resource consumption (or overhead, if you will). Where can I find a comparison like that, or does anyone here know how they compare? Basically:   * what is the disk I/O and CPU overhead?   * how strict is the separation and how secure is the host from what's going on in the guest?


title: How do I change the colour of all lines to red begining with a % symbol?

text: When I use `sed -i "s,.*%.*,$(tput setaf 1)&$(tput sgr0),g" A.log` the whole line vanishes and when I use `sed -i "s,^%.*,$(tput setaf 1)&$(tput sgr0),g" A.log` only the first character(`%`) turns red. What should I do? EDIT : Actually the whole line doesn't vanish, I was using `more` but when I used `less -R` I saw this (with a control M character) and % in red color.                % Invalid input detected at '^' marker.^M


title: Confusion with how to restore corrupt ext3 files if power outage occurs during a file write

text: I am running a small embedded system. Because the system will never be gracefully shutdown and will just have the power cable unplugged, I am running an initramfs but mounting an `ext3` partition on a compact flash drive where critical logging data is recorded (at approximately 1 second intervals). The data integrity is crucial and this is why I have chosen `ext3`. My current understanding (possibly incorrect) of how this works is that somehow a backup of file information is kept whenever a new write is attempted, so that in the event of a power loss in the middle of a write, that old data can be retrieved instead of leaving the file containing corrupt data. My question is this: **do I have to do anything explicitly to make the system check for these events and if necessary restore the old file image?** I have done some reading about `fsck` but must I really run this every time the system starts up? From what I have read the `fsck` utility seems targeted at actually repairing a corrupt file system rather than restoring specific files. What must I do check for and to restore any potentially corrupt data on the `ext3` partition at **every** system startup?


title: Does /usr/sbin/nologin as a login shell serve a security purpose?

text: In my `/etc/passwd` file, I can see that the `www-data` user used by Apache, as well as all sorts of system users, have either `/usr/sbin/nologin` or `/bin/false` as their login shell. For example, here is a selection of lines: > >     daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin >     bin:x:2:2:bin:/bin:/usr/sbin/nologin >     sys:x:3:3:sys:/dev:/usr/sbin/nologin >     games:x:5:60:games:/usr/games:/usr/sbin/nologin >     www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin >     syslog:x:101:104::/home/syslog:/bin/false >     whoopsie:x:109:116::/nonexistent:/bin/false >     mark:x:1000:1000:mark,,,:/home/mark:/bin/bash >   Consequently, if I try to swap to any of these users (which I'd sometimes like to do to check my understanding of their permissions, and which there are probably other at least halfway sane reasons for), I fail:               mark@lunchbox:~$ **_sudo su www-data_**     This account is currently not available.     mark@lunchbox:~$ **_sudo su syslog_**     mark@lunchbox:~$       Of course, it's not much of an inconvenience, because I can still launch a shell for them via a method like this:               mark@lunchbox:~$ **_sudo -u www-data /bin/bash_**     www-data@lunchbox:~$  But that just leaves me wondering what _purpose_ is served by denying these users a login shell. Looking around the internet for an explanation, many people claim that this has something to do with security, and everybody seems to agree that it would be in some way a bad idea to change the login shells of these users. Here's a collection of quotes: > Setting the Apache user's shell to something non-interactive is generally > **good security practice** (really all service users who don't have to log > in interactively should have their shell set to something that's non- > interactive). -- http://serverfault.com/a/559315/147556 > the shell for the user www-data is set to /usr/sbin/nologin, and it's set > **for a very good reason.** -- http://askubuntu.com/a/486661/119754 > [system accounts] **can be security holes** , especially if they have a > shell enabled: > >   * Bad >   >     >     bin:x:1:1:bin:/bin:/bin/sh >   > >   * Good >   >     >     bin:x:1:1:bin:/bin:/sbin/nologin >   > > -- http://unix.stackexchange.com/a/78996/29001 > **For security reasons** I created a user account with no login shell for > running the Tomcat server: >   >   >     # groupadd tomcat >     # useradd -g tomcat -s /usr/sbin/nologin -m -d /home/tomcat tomcat >   -- http://www.puschitz.com/InstallingTomcat.html While these posts are in unanimous agreement that not giving system users real login shells is good for security, not one of them justifies this claim, and I can't find an explanation of it anywhere. What attack are we trying to protect ourselves against by not giving these users real login shells?


title: how to configure xorg.conf for extended desktop?

text: I would like to setup the dual monitor settings where I can use two monitors as a single Desktop with single panel, single launcher and when some programs are maximized then it should span both the monitors (i.e fullscreen over both the monitors) I have ATI raedon graphics cards and after searching it in the internet I found that by configuring the xorg.conf file I can setup the settings that I want. I have tried several ways to do it i.e                using gksu amdcccle       And setting MultiDisplay settings , but my requirement has not yet been met. I have done this using Nvidia graphics but its seem that it doesnot work with ATI graphics card. After searching for a while I found the link which gave me hope that it can be done in ATI as well , According to this  link xrandr must be disabled and AMD catalyst center will give the extra option of Big Desktop, to set it I used                sudo aticonfig --set-pcs-str="DDX,EnableRandR12,FALSE"      Then I restart X as per that  link But this command gives this output to the stdout               SetPcsStr is exclusive, other options will not be used.      And I didnot find any extra configuration in my xorg.conf file. And I didnt even get the Big Desktop option in the AMD Catalyst center's Display manager. There is still three options i.e                Single Desktop      Cloned Display      Multiple Display


title: How can I keep control+d from disconnecting my session?

text: I regularly ssh to a centos 5 box. Somehow they keys are mapped so that `control+d` will log me out of my current shell. If I am sudo'ed to another use it puts me back to the previous user. If I am not sudo'ed it just disconnects me. How can I keep this from happening? I regularly use control+d to cancel out of the python interpreter and sometimes I accidentally press it more than once.


title: how to bootup/reboot in verbose mode?

text: I have Ubuntu 14.04TLS. How can I permanently change grub to switch to verbose mode on bootup/reboot so I can see the rolling text? I would like to make this change stick. Thanks!


title: Problems with automatically starting screen on SSH login

text: I'm looking at http://taint.org/wk/RemoteLoginAutoScreen to setup my server so it autostarts a screen session when I login via SSH. I have added the following to my .bashrc:               # Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen     # if we're coming from a remote SSH connection, in an interactive session     # then automatically put us into a screen(1) session.   Only try once     # -- if $STARTED_SCREEN is set, don't try it again, to avoid looping     # if screen fails for some reason.     if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]     then       STARTED_SCREEN=1 ; export STARTED_SCREEN       [ -d $HOME/lib/screen-logs ] || mkdir -p $HOME/lib/screen-logs       sleep 1       screen -RR && exit 0       # normally, execution of this rc script ends here...       echo "Screen failed! continuing with normal bash startup"     fi     # [end of auto-screen snippet]      The catch is that I always have a detached named screen session running a rails application server. Now when I login I am put into this session. Is there anyway to modify the above code to not select the session either by name or some other value? If the detached session is the only screen session then I would like to start a new screen session. Another issue that I am encountering is that when I detach I am completely logged out of my SSH connection as opposed to just leaving the screen session.


title: How can I edit multiple files in VIM?

text: I know I can open multiple files with `vim` by doing something like `vim 2011-12*.log`, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the current file that I'm editing?


title: Logical AND in a bash script

text: I have an `if` in my bash script that has to check if EITHER of the 2 files exists, if they don't exist it should echo match. Code I have:               if [[ ! -f /etc/benchmarking/code ]] && [[ ! -f /etc/benchmarking/code.class ]]; then      echo "match"     fi      But this doesn't not seem to work for some reason. I am 110% sure that these 2 files do not exist. I don't get any errors, it just doesnt enter the `if`. I am new to bash scripting so I'm not sure what could be wrong.


title: Crontab entry with hour range going over midnight

text: Is this valid crontab time specification, doing what is expected:               0 22-4 * * *      Or is it necessary to do something like               0 22,23,0,1,2,3,4 * * *


title: Remote VNC from Fedora to Ubuntu

text: PC-A: remote Ubuntu box   PC-B: my local Fedora box      PC-A [via ssh]:   apt-get install tightvncserver      and i gived a good password      ok!   PC-B:   yum install vinagre      i flushed all my iptables rule      And i tried to connect with IPADDRESS:5901 from my "PC-B" Fedora box to PC-A.      Well..the good thing is, that vinagre pops a password box, and i can see the wallpaper of the Ubuntu machine. But after giving the good password, nothing happens. I can see the wallpaper, and the mouse is waiting, and waiting..      What am i missing? Either PC-A hasn't any firewall rule.


title: How to remove length limit from losetup -a

text: I am using losetup -a to see my loop devices, but it has a length limit (which is 62 characters). So I can't know for sure which loop device I really want. Ex:               [root@r7byach]# losetup -a      /dev/loop0: [fc03]:33030504 (/storage5_vol1/6/ABCD116476-linux-ubuntu-10_04-64b-base-07150/*)     /dev/loop1: [0015]:4933 (/storage4/5/ABCD12345-linux-centos-5-64b-base-86836/hdc)      I can get the output on /dev/loop1 using               losetup -a|grep diskPath |cut -f1 -d:|cut -f3 -d/      But I can't get the device on loop0, since the name is not fully qualified. How can I get the loop device regardless of this size limit?


title: Machine Check Exceptions with Wildcard TE420 and Asus P5N-E SLI

text: I have been seeing machine check exceptions when trying to call dahdi_cfg (or, sometimes, even on just loading the kernel module) to configure a Digium Wildcard TE420 Quad-Span T1 PCI-E card. Running Debian Wheezy (kernel 3.2.0-4), dahdi kernel modules 2.6.1. Machine check looks something like this (recovered using netconsole; machine is quite dead after MCE):               CPU 1: Machine Check Exception: 5 Bank 5: b200121020080400     RIP !INEXACT! 10:<ffffffff810146a3> {mwait_idle+0x7f/0xac}     TSC b773cee10f      PROCESSOR 0:6f7 TIME 1354843514 SOCKET 0 APIC 1 microcode 66     Run the above through 'mcelog --ascii'     CPU 1: Machine Check Exception: 5 Bank 0: b200004000000800     RIP !INEXACT! 10:<ffffffff810146a3> {mwait_idle+0x7f/0xac}     TSC b773cee10f      PROCESSOR 0:6f7 TIME 1354843514 SOCKET 0 APIC 1 microcode 66     Run the above through 'mcelog --ascii'     Some CPUs didn't answer in synchronization     Machine check: Processor context corrupt     Kernel panic - not syncing: Fatal machine check on current CPU      By fiddling around with which PCI express socket its plugged into, as well as removing the other PCI-E card (an nVidia video card), sometimes it doesn't immediately machine check. I then managed to get an error in the kernel log. I get these messages, error is the last line:               [    6.222755] wct4xxp 0000:02:08.0: 5th gen card with initial latency of 2 and 1 ms per IRQ     [    6.222767] wct4xxp 0000:02:08.0: Firmware Version: c01a016d     [    6.225338] wct4xxp 0000:02:08.0: FALC Framer Version: 3.1     [    6.225477] wct4xxp 0000:02:08.0: Found a Wildcard: Wildcard TE420 (5th Gen)     [    6.225525] wct4xxp 0000:02:08.0: VPM450: Not Present     [   13.089474] wct4xxp 0000:02:08.0: Span 1 configured for ESF/B8ZS     [   13.089616] wct4xxp 0000:02:08.0: RCLK source set to span 1     [   13.089621] wct4xxp 0000:02:08.0: Recovered timing mode, RCLK set to span 1     [   13.089627] wct4xxp 0000:02:08.0: SPAN 1: Primary Sync Source     [   15.192016] wct4xxp 0000:02:08.0: Interrupts not detected.      Checking `/proc/interrupts` indeed confirms that the 1000-per-second expected interrupts aren't present. Also, alarm lights (there are currently no T1s plugged in) aren't on; there are no lights lit on the board. Googling didn't find much useful. There is a patch to the dahdi drivers, but that should already be included in the version I'm using. Someone else had this problem with an old revision of the board (solved by getting a newer board), but I have the newer revision. I unfortunately do not have a spare machine to check on.


title: Getting current TCP connection count on a system

text: Instead of doing `wc -l /proc/net/tcp`, is there a faster way of doing it? I just need a total count of tcp connections.


title: MySQL server on Ubuntu fails to start after changes made to my.cnf in Windows

text: I have MySQL 5.5 running on Ubuntu Server 12.10. When I run `/etc/init.d/mysql restart`, I get the following:               mysql start/running, process 2754      However, when I open /etc/mysql/my.cnf in Windows via a Samba share and save the file without any changes, I get the following when running the exact same command, `/etc/init.d/mysql restart`:               start: Job failed to start      What is causing the mysql from restarting? How can I make edits in windows without breaking my config file?


title: I can create a file but I can't read from it

text: I've been using linux for a while, but I always had root access, so permission problems were no big deal. But now I don't have root access and it's driving me mad. I have a ssh access to a web server. This means I have access to my user `gabitoptalentro`, and also to the `apache` user through PHP backticks. I have problems with some `tmp` folder ( _not_ `/tmp`). `ls -l` says this:               drwxrwxrwx  2 gabitoptalentro toptalentro   4096 Jun 15 19:15 tmp      When I try to `touch` a file (`touch tmp/QQ`) to create it in this folder it works (the file is created), **but** it doesn't show up in `ls -l`. Here is the entry from **my ssh account** :               -rw-r--r-- 1 apache apache   0 Jun 15 19:37 QQ      So the file actually belongs to `apache`, but `apache` can't read it. I also tried to `chown` the whole folder to `apache`, but it won't let me (`chown: changing ownership of ...: Operation not permitted`). Wtf, it doesn't let me give my own folders to someone else? So, do you have any idea how I can get myself out of this mess and help `apache` read it's own files?


title: Trouble getting Exfat formatted drive to mount

text: I've just performed a new install of arch linux (3.15.3-1) on a macbook pro 8.2 All of my data is on an exfat drive, and I've installed exfat-utils. However, when I try               mount -t exfat /dev/sdb1 ~/drivemount      the return is               mount: unknown filesystem type 'exfat'      I saw a post on the arch forum mentioning doing modprobe exfat-fs, which I proceeded to try to no avail. I've looked around here, but couldn't find a post that explained it, so here I am. Do I need some other packages, like fuse-exfat? (And why doesn't it just work with exfat-utils?) How might I resolve this?


title: RES memory more than initial and maximum memory for java

text: We have a java application running on Centos 6.4 what we notice is that the RES is around 370m which is more then the allocated max that is 256m. Does this signify that we the application is leaking?


title: Archlinux forum question doesn't seem answerable

text: I'm trying to register for the Archlinux forum, and they have a question at the bottom that verifies that you're using Linux:               What is the output of "date -u +%V$(uname)|sha256sum|sed 's/\W//g'"?(Required)      The answer I gave was:               31b5001da5e8fcaa06cc3d8db96331e80cf1488f443dfc500581133a63e396ea      I tried on Ubuntu and Arch and got the same result. No dice. Here are some of the pieces (that seem to be working):               $ date Wed Jun  5 15:16:05 UTC 2013          $ date -u +%V$(uname)     23Linux      Is there something I'm doing wrong? If not, who should I contact about this?


title: Have screen indicate there is a bell/alert with entire status bar

text: I am wondering if anyone knows a way to have the entire status bar in screen change when there is a bell alert inside a screen session. Internally at my company we use jabber, and being that I work in a screen environment 90% of the day I use a command-line based chat client. When someone in our company sends me a message I don't always see the alert right away. Right now it underlines the session name, but sometimes that is hard for me to notice. For what it is worth, I am using mcabber for my chat client. I know you can run commands in addition to sending a bell alert for new messages - if that would help make this work. Here is my current .screenrc               startup_message off          screen     screen -t jabber mcabber     screen -t root     screen -t misc          bind  ! select 11     bind  @ select 12     bind \# select 13     bind  $ select 14     bind  % select 15     bind \^ select 16     bind  & select 17     bind  * select 18     bind  ( select 19     bind  ) select 10          hardstatus alwayslastline     hardstatus string '%{= kC}%{g}[%{G}%H%{g}]%{C}%?%-Lw%?%{Ck}%n*%f %t%?(%u)%?%{kC}%?%+Lw%?%= %{g}[%{B}%Y%m%d %{W}%c%{g}]'


title: Get text between a word and the last line?

text: According to the answers in Stack Overflow question _How to use sed/grep to extract text between two words?_ , we can get text between two words:               sed -n "/first/,/second/p" file      But what if I want to get text between a word and the last line of the file, as in the following?               sed -n "/word/,/lastline/p" file


title: Why wget does not work via ssh tunnel? What does proxy prevent ssh-client to do?

text: To test things I'm trying to establish a local ssh tunnel from my laptop to a site via `ssh-server`, and download a page of the site (or view it in a browser). The tunnel is made like this:               $ ssh -L 9999:www.gnu.org:80 ssh-server      I check the tunnel works with `nc` program and `~#` characker on the server. I check I'm allowed to do http requests on ssh-server by running `wget` and `lynx` on the server -- they both run without errors. But when I run `wget --no-proxy localhost:9999` on the laptop I get error 403. I can do the same thing using `ssh ssh-server 'wget -O - http://www.gnu.org/' >> whatever`. But why the tunnel doesn't work? So I want to clear up what is going on and what kind of things the proxy does not allow. My guess is proxy prevents specifically the ssh-client from doing http requests. Is it so? If it is so - how does proxy distinguish ssh-client from other programs? Can it distinguish a request sent from ssh-client and a request from another program? And what are common ways for "masking ssh-client to another program" (or other ways to pass by the proxy)? **PS** It would be awesome if someone wrote the address of a free ssh-server open for testing ssh-tunneling and other stuff in the comments. (Usually ssh- servers don't allow tunneling for free.)


title: CONFIG_GPIO_SYSFS makes /sys/class/leds disappear

text: I have an embedded Linux board I'm working on, with a button and a couple LEDs. By default, I can control the LEDs via               /sys/class/leds/redled/brightness However, I have no way to monitor the button. If I enable CONFIG_GPIO_SYSFS, I can't see the LEDs anymore - /sys/class/leds/ is empty. Additionally, the GPIOs that in theory should go to the LEDs don't do anything, so I can't even hack it. Any thoughts on how I could get both of these working?


title: What is equivalent to Mac's purge in Linux?

text: In Mac I use `purge` to free up some memory. What is equivalent to it in Linux(Ubuntu Server)? `apt-get install purge` gave me nothing. If you are no familiar with Mac's `purge` here is it's `man` page:               purge(8)                  BSD System Manager's Manual                 purge(8)          NAME          purge -- force disk cache to be purged (flushed and emptied)          SYNOPSIS          purge          DESCRIPTION          Purge can be used to approximate initial boot conditions with a cold disk          buffer cache for performance analysis. It does not affect anonymous mem-          ory that has been allocated through malloc, vm_allocate, etc.          SEE ALSO          sync(8), malloc(3)                                        September 20, 2005


title: Restricting access to just CVS and Git commands

text: At work we have a server which hosts our CVS repository and in order to restrict shell access to this system, I have deployed rssh which has worked well for a number of years. We are now converting part of our repository to Git and using this existing server to host a centralized bare Git repository. I would like to extend these restrictions to Git commands as well, but `rssh` does not support Git. I know that Git has git-shell which does a similar thing for Git (though I haven't used it) but I don't think it understands CVS. Given that both approaches use the mechanism of setting the user's shell to one of these, I can't use them both at the same time. We still need to use the CVS repository so **is there any mechanism that would work for both CVS and Git?** My options at the moment are:   * Do nothing (not really an option).   * Find a way to make them both work (hence this question).   * Forget security and just give everyone shell access.   * Abandon the idea and put the central Git repository on another server (probably virtual) and use `git-shell`.   * Something else which I haven't thought of.


title: Managing (Dynamic) DNS Zone Files with Puppet (Solved)

text: I'm running a Debian 7.0 (Wheezy) server and I have a dynamic DNS setup wherein my clients make DHCP requests and the DHCP server updates the DNS zone files with whatever IP was assigned to each client. I want to manage this setup with Puppet. There's only one problem, though: I don't want Puppet clobbering my DNS records every time I push my manifests. In any case, it doesn't make much sense for the zone files to be managed by Puppet in the first place as they will normally be continuously updated. What I would like to do, however, is to have Puppet push "skeleton" zone files in their correct place when the DNS service (`bind9`) is first installed. The reason I want this is because I want to encapsulate all of the server configuration in one place so that with only a few manifests, I can clone the entire configuration of the server. At first I wanted to have `file` resources for the zone files subscribe to the DNS server package and set `refreshonly` to `true`. The only problem is that `file` types don't have a `refreshonly parameter`. So obviously, this approach is a dead-end. Is there a "correct" way of doing this? Perhaps with Augeas? * * * **Update** I tried               augtool ls /files/etc/bind      and this returned _nothing_! It seems that Augeas is unable to parse my zone files for some reason. It seems Augeas is not the answer, then...


title: Unix/Linux command syntax

text: This might come across a completely noob question, but on the other hand this has puzzled me more than a few times or probably I haven't seen enough of linux to draw a pattern. When linux commands list their usage, this usually is how they do it (for eg wget):               wget [option]... [URL]...      From what I understand of this pattern of specifying command usage, this is not the usual regex way of specifying patterns and for the wget command says that it is not mandatory to specify any options and by that logic it is not mandatory to specify any URL as well. I mean I can directly do               wget www.google.com      and this will work. So the options are not mandatory. If the options are not mandatory because they are in square brackets, then following through with that logic specifying a URL should not be mandatory as well and just               wget      as a command should work as well. My question is- Is there some document where this pattern of specifying command usage is elaborated on?


title: Chmod u-x isn't changing anything and I have no idea why

text: I'm a user on a Debian machine. When I create a file in my home directory, the default permissions appear to be 700, even though umask returns 0022:               eulerz@foo:~$ touch testing     eulerz@foo:~$ ls -l testing      -rwx------ 1 eulerz users 0 2012-03-15 19:34 testing      In addition, when I create a file in the tmp directory, it doesn't show up as executable, but it does when I move it to my home directory:               eulerz@foo:~$ touch /tmp/made_in_tmp     eulerz@foo:~$ ls -l /tmp/made_in_tmp      -rw-r--r-- 1 eulerz users 0 2012-03-15 19:39 /tmp/made_in_tmp     eulerz@foo:~$ mv /tmp/made_in_tmp ~     eulerz@foo:~$ ls -l /u/eulerz/made_in_tmp      -rwxr--r-- 1 eulerz users 0 2012-03-15 19:39 /u/eulerz/made_in_tmp      and, of course, chmod doesn't change this:               eulerz@foo:~$ chmod -v u-x made_in_tmp      mode of `made_in_tmp' changed to 0644 (rw-r--r--)     eulerz@foo:~$ ls -l /u/eulerz/made_in_tmp      -rwxr--r-- 1 eulerz users 0 2012-03-15 19:39 /u/eulerz/made_in_tmp      What the heck? Why is this happening? Where is it telling my home directory "set new things as u+x NO MATTER WHAT"? And this just started happening recently; the older files in my home directory don't have this problem (but I made a copy of one and it did.)


title: Will using a compressed filesystem over an encrypted volume improve performance?

text: Encryption/decryption is often the main bottleneck when accessing an encrypted volume. Would using a filesystem with a fast transparent compression (such as BTRFS + LZO) help? The idea is that there would be less data to encrypt, and if the compression is significantly faster than the encryption algorithm, the overall processing time would be less. **Update:** As Mat pointed out, it depends on the compressibility of the actual data. Of course, I assume that its compressible, like source code or documents. Of course it has no meaning using it for media files (but I guess it won't hurt too much, as BTRFS tries to detect incompressible files.) Since testing this idea is a very time consuming process, I'm asking if somebody has already some experience with this. I tested just a very simple setup, and it seems to show a difference:               $ touch BIG_EMPTY     $ chattr +c BIG_EMPTY     $ sync ; time ( dd if=/dev/zero of=BIG_EMPTY bs=$(( 1024*1024 )) count=1024 ; sync )     ...     real    0m26.748s     user    0m0.008s     sys 0m2.632s          $ touch BIG_EMPTY-n     $ sync ; time ( dd if=/dev/zero of=BIG_EMPTY-n bs=$(( 1024*1024 )) count=1024 ; sync )     ...     real    1m31.882s     user    0m0.004s     sys 0m2.916s


title: Install an app made for SUSE Enterprise 11 on openSUSE 11.4

text: I'm trying to see if I can install Symantec System Recovery 2011 Linux edition on an openSUSE 11.4 system. According to the docs, SSR 2011 for Linux supports (among others) SUSE Linux Enterprise Server 11 and 11 SP1. I downloaded the trial version, extracted it and ran a .bin installer but it failed with the error message, "Kernel (2.6.37.6_0.11_desktop) is not supported". The 2.6.37 kernel appears to be the latest version as installed by Yast. So I'm wondering is it possible downgrade the kernel to match the one in SLES 11 SP1? Would doing that make Symantec System Recovery able to install? The kernel in SLES 11 SP1 is apparently 2.6.32. Thanks


title: SMTP connectivity issue in Zenoss ("Connection unexpectedly closed")

text: I am using Zenoss for monitoring purpose. I have been using its mail service for a long time. Suddenly my mail service in zenoss stopped and started showing `<class 'smtplib.SMTPServerDisconnected'> \- Connection unexpectedly closed` and no mails are outgoing. When I ran the mail command via CLI, the mail goes to the email address. While executing the zenoss script for mailer won't work and throws out the error as shown above. My server is RHEL 5.3 x86_64, with Zenoss 4.2 & sendmail email server. ### Sendmail logs & Zenoss email conf               Apr 11 07:14:30 XXXhostnameXX sendmail[13582]: r3BBDgia013582: lost input channel from localhost.localdomain [127.0.0.1] to MTA after mail     Apr 11 07:14:30 XXXhostnameXX sendmail[13582]: r3BBDgia013582: from=<fromaddress@emaildomain.com>, size=146972, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]      Zenoss is following basic smtp connection as emailing is done by local sendmail server (localhost) in port 25. No specific configuration is used.


title: Prevent pressing the alt hotkey from focusing menu in Gtk 3

text: The behavior of `Alt` changed in a subtle manner between `gtk2` and `gtk3`. In `gtk2`, pressing `Alt` then releasing it did nothing. In `gtk3`, pressing `Alt` then releasing it focuses the first item of the first menu (usually, File > New). Is there any hidden setting that reverts the `gtk2` behavior?


title: How do I make the 'man' utility as comprehensive as ss64.com?

text: The 'man' utility that comes with a Debian distro is not as comprehensive as ss64.com, and in environment like cygwin, it is even more so. Is there a software or a script that will make my 'man' more like ss64 pages? ss64.com contains command line reference for many different environments including Windows CMD and Mac OS X, and bash. One example I have is the man page for read **Edit:** From lifehacker.com, I found the following function:               man () { /usr/bin/man $@ || (help $@ 2> /dev/null && help $@ | less) }         help utility gives me the page I am looking for - but it does not bypass the underwhelming man page for `read`.


title: package.use equivalent for VIDEO_CARDS, ABI_X86, etc

text: You can configure USE flags per package in `/etc/portage/package.use`. Is there an equivalent for similar flags like `ABI_X86` or `VIDEO_CARDS`?


title: Linux sort last column

text: I'm running a script (that I have no control of) to get the following output. I want to sort by the last(3rd) column. Each column is separate by spaces, and the 2nd column includes spaces/symbols.                   > ./script         37622       (this is || test1)&&(SGD||HKD||RMB)     40010         43944       (this is)&&(SGD||HKD)    102732         79378       (this is||test2)&&(HKD||RMB)    205425         457000      (test2) && (SGD||RMB||HKD||YEN)        71         559658      (test1||test2)&&(RMB||YEN||SGD)     14043      I tried to use sort -k, but it doesn't work. Then I found this question - How to numerical sort by last column? - the solution provided is               awk '{print $NF,$0}' file.txt | sort -nr | cut -f2- -d' '      My question is: how do I make use of this when I run the script?                   > ./script | <something??>      Thank you.


title: Shell script debugging

text: I was wondering if there is an IDE that would allow me to define an ssh connection to a remote host, connect, and locally debug a script running remotely (kind of like you can debug a remote Java app in Eclipse)? I want to be able to go line by like and examine vars and all that.


title: Print non-existent files from a pipe input

text: I have a directory of lots of `.PDF` and `.JPG` files. There should be a `.JPG` file for each `.PDF` with the same name.   I'm trying to use a command to find `.PDF` files that doesn't have a `.JPG` file. My current command is:               find -iname '*.jpg' -print0|sed 's/jpg$/pdf$/ig' |xargs -0 ls      This prints `: No such file or directory` error for non-existing files;   the problem is the errors of `ls` cannot be handled by `grep` or `sed` .   Any of these solves my problem:   * How can I make `ls` only list files that doesn't exists?   * How to handle/filter errors of `ls` with `sed`/`grep`?   * any other way for file existence check (without creating bash script files)?


title: suphp directory not owned by user

text: I have an odd problem with suphp. I have logged in as tom and added some php to a directory in my web server. Now I'm getting this error:               Directory /home/.../web/public_html is not owned by tom      I can't/won't change the ownership of public_html as various different users may be contributing to the site in this way. Is there a configuration in suphp I need to edit in order to allow this to work? Thank you.


title: shell script for executing mux verilog code

text: I have a verilog file mux.v and testbench muxTB.v. used `ifdef caeses for behavioural model `ifdef struct for structural model I have executed these files using the commands iverilog mux.v muxTB.v -D cases vvp a.out gtkwave T.vcd How can i write a shell script to see the output and whats the syntax for using mux.v and muxTB.v files in script??script should show output wen i give 'run mux cases'.$1 =mux and $2 =cases.


title: Can I change the default mail recipient on cron jobs?

text: I believe that if there is any output from a cronjob it is mailed to the user who the job belongs to. I think you can also add something like `MAILTO=vivek@nixcraft.in` at the top of the cron file to change where the output is sent to. **Can I set an option so that cron jobs system-wide will be emailed to** `root` **instead of to the user who runs them?** (i.e. so that I don't have to set this in each user's cron file)


title: Any (text based) plotting tools in unix toolbox?

text: I was wondering if there are any generic plotting tools available in the unix toolbox?   By plotting I mean simple bars or things you see in many curses based utilities.   And by unix toolbox I mean things that you can pipe data into them using standard unix conventions. I need to count somethings in log files (that I am monitoring with `tail -F` or something) and plot live ratios of things (like percent errors or warnings).


title: Upon bootup, all iptables are lost because the kernel module ip_set is not loaded

text: i can get iptables to whitelist / blacklist using ipset members, but after a reboot, the iptables are emptied out because the kernel module is not loaded. Have limped along in the past by customizing the iptables init script, but there has to be an out-of-the-box method. On CentOS/RHEL 6.5, you can install ipset from the base repository. The first line from               yum info says > IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel, which can > be : administered by the ipset utility. so i was surprised there is a problem with a kernel module:               ip6tables: Loading additional modules: nf_conntrack_netbios_ns ... OK     iptables: Applying firewall rules: iptables-restore v1.4.7: Kernel module ip_set      is not loaded in.      i have tried both ip-set and ip_set for this module name with no luck:               /etc/sysconfig/iptables-config:        IPTABLES_MODULES="nf_conntrack_netbios_ns ip_set"      There may also be separate modules for each ipset data structure. In other words, a module just for ipset hash versus ipset bitmap versus ipset list. modinfo ip_set and other details


title: RHEL 5 license for RHEL 6?

text: A few years ago We have bought a **"Redhat Enterprise Linux 5 Server"** license, we used that license only on offline servers. Now we are migrating to a new system, we need to install RHEL 6 which will be connected to the internet. Can we use RHEL 5 license's for RHEL 6 or do we need an new one? Does the license limit number of servers that can be installed or the performance of a server (Like oracle)? can we use our installation number to create support account, we have never created one?


title: Debian installation has no uucp user - how to create

text: I have just installed Debian Squeeze x64 and tried sending myself a test email from it using the normal "mail" command. When I sent it I got this error from Exim: 2013-06-08 08:12:46 Exim configuration error in line 173 of /var/lib/exim4/config.autogenerated: user uucp was not found   Can't send mail: sendmail process failed with error code 1 After a bit of research into this it sounds like all Debian systems should have the "uucp" user, but can I just run "useradd uucp" or does it need setting up to own certain directories and stuff?


title: Why does this command not work on AIX?

text: I want to remove UTF-8 BOM from a file using this command:               sed '1 s/\xEF\xBB\xBF//' old.java > tmp.java      But it did not work. I am running with ksh on AIX 7.1


title: Read Multiple Entries from an Input File

text: I wrote a program in Fortran that asks me for latitude and longitude and the name of the output file every time I run it. It works great. What I have been meaning to do is run this program for the entire globe (i.e. 65341 total different possible combination). I am having a hard time doing this with shell scripting. Can any one give me some pointers? So far I have been messing around with an input file, but the program reads the first three entries of the input file (lat, lon, and the filename) and stops. What would be excellent is if I could write a source script that goes something like the following:               $ ./myprogram < lat1, lon1, filename1          $ ./myprogram < lat2, lon2, filename2      However, the sign `<` only feeds in the input file. Is there a similar way to feed in input _values_ instead of input file?


title: UNIX-, BSD-, GNU-options in Linux's ps command. Where are they from?

text: In the manual for the `ps` command on Ubuntu there is this text: > This version of ps accepts several kinds of options: >   >   >        1   UNIX options, which may be grouped and must be preceded by a >            dash. >        2   BSD options, which may be grouped and must not be used with >            a dash. >        3   GNU long options, which are preceded by two dashes. >   Why is it possible that a command built in Ubuntu uses options from different operating systems? I know that the origin of Linux, UNIX and BSD are the same but they are different branches.


title: Lightweight virtualization on Linux with user isolation

text: What Linux-on-Linux virtualization technologies provide user isolation? Specifically, I want root in the virtual machine not to have any privilege on the host. This was not the case for LXC, but was a long-term goal. Is root isolation available in recent versions? If so, which? Apart from LXC, what is the status of root isolation for OpenVZ, VServer and any other contender?


title: Need script: latest JPEGs to video, then delete old JPEGs

text: I have an IP cam which uploads JPEG pictures to an FTP folder on my Arch Linux box whenever it detects movement in the room it is looking in. It uploads a JPEG every second until all motion activity stops. It names the JPEG files in the following way: ![enter image description here](http://i.stack.imgur.com/8wZ1l.png) Dissected, it means:               name-of-camera(inside)_1_YEAR-MONTH-DATE-TIME-SECONDS_imagenumber.jpg      I want a script that can make a 1 frame-per-second video from them (easy with `ffmpeg` I know), BUT, it must be clever enough to only make the video from the images that are within 2 seconds of each other, then delete those jpegs that it used. I say "2 seconds of each other" in-case of network latency where it misses one frame. Any future images that are within 2 seconds of being taken, should become its own video. So it should basically be able to make videos from each 'event' of motion the camera saw. I know programs like `zoneminder` and `motion` can do this, but I want to design a script instead. Any ideas much appreciated.


title: Why do systems become slow when doing massive writes to disk?

text: I want to know why systems become slow when writing mass data to disk. I think that for system to become slow, there should be some issue with CPU. But write is only I/O bound. Do hardware interrupts occur when writing data? If so, it may be because of the interrupts that the CPU is always context switching.


title: append something else before ssh-copy-id

text: Im using this `ssh-copy-id` command but before I add the public key I would like to add some stuff like, new line and Name. For example:               new line         #Name of the person     pub.key here ..asdadsdad      Because this is going through script with for loop on many servers how can I put this to go with it. For now I have this:               for i in $( cat file_servers ) do      ssh-copy-id -i keyfile root@$i       etc. But I don't know how can I add new line and the "#name of the person" before the key is append at the last line.


title: Do I need to stop processes like mysql or apache before "reboot"?

text: I have been wondering if issuing a reboot command safely stops running LAMP processes like MySQL or Apache?


title: xentop gives static info about memory usage

text: I am using CentOS 6.5 and Xen 4.2.4-30 xentop does not change `MEM(%)` at all.                     NAME  STATE   CPU(sec) CPU(%)     MEM(k) MEM(%)  MAXMEM(k) MAXMEM(%) VCPUS NETS NETTX(k) NETRX(k) VBDS   VBD_OO   VBD_RD   VBD_WR  VBD_RSECT  VBD_WSECT SSID       Domain-0 -----r         68    0.0    1048568   25.0    1048576      25.0     1    0        0        0    0        0        0        0          0          0    0            vm1 --b---          7    0.0    1536000   36.6    1536000      36.6     1    1       49        0    1        0     6518      433      95640       4034    0            vm2 --b---          8    0.0    1536000   36.6    1536000      36.6     1    1       55        5    1        0     6562      551      97336       5090    0      Is there anyway to get how much of the allocated memory for each VM like CPU(%) in `xentop`