title: Extract the number of failures from a test report

text: How would I parse following output of `lein test`               $ lein test     lein test nepleaks-engine.core-test          Ran 1 tests containing 1 assertions.     0 failures, 0 errors.      **Where I want is get number before`failures` using bash script.** I only know better is `grep`,               $ lein test | grep 'failures' | cut -d' ' -f1     0       Suggest me the better ways of doing this.


title: How can I enter the login and same time enter the OpenVPN server machine?

text: How can I do to configure my client computer that is on the VPN network, and as you enter the login, it automatically now enters automatic mode server? More or less like this video? http://youtu.be/tSNCE6j2zxM


title: No bluetooth adapters found: how to get rid of this error message?

text: I am unable to enable bluetooth on my laptop. I am using Ubuntu13.04. I go to settings>Hardware>Bluetooth Then I see what the below screen shot shows: ![enter image description here](http://i.stack.imgur.com/gM5c2.png) I am unable to get rid of this error: No bluetooth adapters found. I w'd like to add that I have related posts on other 2 sites as given below: http://www.linuxquestions.org/questions/linux-networking-3/bluetooth-on- ubuntu13-04-not-functioning-4175473853/ Connect Nokia N73 to laptop via bluetooth Though it seemed to be a common problem, but I really couldn't get a solution in google!! I had been waiting for this issue to get resolved since long.


title: Move data row(s) to single column while retaining row header(s)

text: I have reports that are generated in the following tab-delimited format:               UNIT  TC    CC    PC    TCP   FTX   FRX        HOUSE 55    65    75    85    95    105     CAR   100   200   300   400   500   600     H2    5     10    15    20    25    30     C2    10    20    30    40    50    60      I need to change them to the following format:               HOUSE TC    55     HOUSE CC    65     HOUSE PC    75     HOUSE TCP   85     HOUSE FTX   95     HOUSE FRX   105     CAR   TC    100     CAR   CC    200     CAR   PC    300     CAR   TCP   400     CAR   FTX   500     CAR   FRX   600      And so on. I would like to use standard tools such as SED AWK BASH but any suggestions are welcome. The code will be inserted into a BASH script that I'm already using to parse and concatenate the data beforehand. The number so entries will always be the same, the reports don't change. Also, I am a newbie and just starting to learn, so an explanation of each part of the solution would be very helpful for my learning process. TIA


title: How can I get from menu.lst to syslinux.cfg?

text: **Problem** I'm creating a bootable iso from a YUMI USB drive to burn on DVD's for friends. More info here. I took the grldr and menu.lst from a bootable XBoot iso, but now I'm trying to figure out a way to get from the menu.lst to the syslinux.cfg menu? Is this completely nonsensical? Am I on the right lines / how might I be able to do this? As a little test I have the following in my menu.lst:               ### MENU START     label Syslinux Menu     kernel vesamenu.c32     append /multiboot/syslinux.cfg      MENU SEPARATOR       ### MENU END      But I end up at a grub4dos command prompt rather than my syslinux.cfg menu! No real idea what I'm doing in all honesty, just trial and error and would love a bit of guidance!


title: Alsa - how can i tell my default audio output is card 2 and device 0, not hdmi?

text: how can i tell my system default sound output is card 2 and device 0 not card 2 device 3 or 7 or 1? I did this but no sound.               $ aplay -l     **** List of PLAYBACK Hardware Devices ****     card 0: Device [C-Media USB Audio Device], device 0: USB Audio [USB Audio]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]       Subdevices: 0/1       Subdevice #0: subdevice #0          $ cat /etc/asound.conf     #pcm.!default {      #  type plug;      #  slave { pcm "hw:2" }      #}      pcm.!default {         type hw         card 2         device 0     }


title: Installing slime and emacs

text: I'm trying to install SLIME on Fedora 17 so that I can do some lisp. Here is what I downloaded: http://www.common-lisp.net/project/slime/#downloading The CVS Snapshot link. I have a .emacs file:               (add-to-list 'load-path "~/programming/slime/slime-2012-09-18")     (setq inferior-lisp-program "/usr/local/sbcl")     (require 'slime)     (slime-setup)      When I start `emacs --debug-init`, I get the following message:               Debugger entered--Lisp error: (file-error "Cannot open load file" "slime")       require(slime)       eval-buffer(# nil "/home/sam/.emacs.el" nil t)  ; Reading at buffer position 159       load-with-code-conversion("/home/sam/.emacs.el" "/home/sam/.emacs.el" t t)       load("~/.emacs" t t)       #[0 "\205\262 What am I doing wrong ?


title: How to configure vim to interact with interactive command line shells?

text: From time to time I want to use vim as scratch pad for commands that I would like to send to a command line shell like `psql` (Postgres), `ghci` (Haskell programming language), `octave` ('calculator'), `gnuplot` (plot) etc. The advantages would be that you could put comments next to command lines, directly document your session, incrementally develop command lines, test examples ad-hoc in manuals etc. Pro features I would like to use: send a selection to a shell, send e.g. the next 10 lines to a shell, display the output of a shell command into a vim output buffer, into a vim yank-register, directly insert it etc. There should be some support of a shell-session concept, i.e. the shell should not be started for each command from scratch. I could live with a kind of remote controlled xterm which I would put side by side to a vim window.


title: How to check a Fedora system if IPv6 is disabled or not?

text: I remember that some distribution installers asked in the past if IPv6 should be enabled or not. Perhaps the Fedora installer did (or does) it as well. How do I easily check a Fedora system (>= 17) if IPv6 was enabled/disabled during the installation? Or how do I check if the Fedora system is ready for IPv6 enabled routers?


title: Problem changing the /home directory to another location

text: I decided to move my `/home` directory to a separate parition. But, since I am using more than one linux distro, I want to separate the `/home` directories as follows:               /dev/sdax/ubuntu     /dev/sdax/debian     /dev/sdax/suse      After copying all the neccessary files to this folder, I changed the `/etc/fstab` to mount the new `/home` location as the default home drive               /dev/sdax    /homedrive ext4 nodev,nosuid 0 2     /homedrive/debian /home bind default,bind 0 0      Now, as far as I can see while starting up debian, it is mounting the folder properly, but while I try to login it gives an error: > Could not update ICEauthority file /home/user-name/.ICEauthority And after closing that message I get: > There is problem with the configuration server (/usr/libexec/gconf-sanity- > check-2 ... What's going wrong?


title: Writing a Linux file system for NFS

text: I want to write my own custom file system in Linux. Can I share it over standard NFS without making any changes to the local NFS server? If so what VFS APIs are required to be implemented by my file system? Any other guidelines / gotchas for such an approach?


title: Match ids and print original file

text: I have two files Original: (5000 entries)               Chr Position     chr1    879108     chr1    881918     chr1    896874     …      and a file with allele frequencies (2000 entries)               Chr Position MAF     chr1 881918  0.007        chr1 979748  0.007        chr1 1120377 0.007       chr1 1178925 0.036        I would like the original file matched with the allele frequencies and print out the output file with 5000 entries. Can this be done with awk or sed?               Chr Position MAF     chr1    879108     chr1    881918 0.007     chr1    896874     …


title: No DNS on Debian wifi after unplugging the DNS cable

text: I have installed wheezy Release Candidate 1 to my old laptop (Benq Joybook A52) right now, and I have some problem with my wireless card (Atheros 5006). It can actually see the wireless networks, I can even connect to my home network, but if I unplug the ethernet cable the internet is not working, not a single page loads in the browser. I don't use any proxies, I don't have any special security settings on my router apart from the password, and it was working with Windows yesterday. Any ideas? I'm new to linux, so please be patient, and give a detailed answer. Thanks. Edit: I ran /sbin/ifconfig, here is the result:               eth0      Link encap:Ethernet  HWaddr 00:1b:24:2c:d1:9e             inet addr:192.168.0.106  Bcast:192.168.0.255  Mask:255.255.255.0           inet6 addr: fe80::21b:24ff:fe2c:d19e/64 Scope:Link           UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:428 errors:0 dropped:0 overruns:0 frame:0           TX packets:416 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:70208 (68.5 KiB)  TX bytes:37104 (36.2 KiB)           Interrupt:20 Base address:0xa000           lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:45 errors:0 dropped:0 overruns:0 frame:0           TX packets:45 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:6099 (5.9 KiB)  TX bytes:6099 (5.9 KiB)          wlan0     Link encap:Ethernet  HWaddr 00:17:c4:04:28:a5             inet addr:192.168.0.105  Bcast:192.168.0.255  Mask:255.255.255.0           inet6 addr: fe80::217:c4ff:fe04:28a5/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:10072 errors:0 dropped:0 overruns:0 frame:0           TX packets:7874 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:11775024 (11.2 MiB)  TX bytes:1303131 (1.2 MiB)      I also ran route -n:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0     192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0      And the result for ping -n 8.8.8.8 is this:               PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_req=1 ttl=49 time=18.7 ms     64 bytes from 8.8.8.8: icmp_req=2 ttl=49 time=20.5 ms                                64 bytes from 8.8.8.8: icmp_req=3 ttl=49 time=18.3 ms                                64 bytes from 8.8.8.8: icmp_req=4 ttl=49 time=18.6 ms                                64 bytes from 8.8.8.8: icmp_req=5 ttl=49 time=17.6 ms                                64 bytes from 8.8.8.8: icmp_req=6 ttl=49 time=18.3 ms                                64 bytes from 8.8.8.8: icmp_req=7 ttl=49 time=19.0 ms                                64 bytes from 8.8.8.8: icmp_req=8 ttl=49 time=18.8 ms     64 bytes from 8.8.8.8: icmp_req=9 ttl=49 time=18.7 ms     64 bytes from 8.8.8.8: icmp_req=10 ttl=49 time=18.6 ms     64 bytes from 8.8.8.8: icmp_req=11 ttl=49 time=18.6 ms     64 bytes from 8.8.8.8: icmp_req=12 ttl=49 time=18.5 ms     64 bytes from 8.8.8.8: icmp_req=13 ttl=49 time=18.9 ms     64 bytes from 8.8.8.8: icmp_req=14 ttl=49 time=18.8 ms     64 bytes from 8.8.8.8: icmp_req=15 ttl=49 time=18.7 ms     64 bytes from 8.8.8.8: icmp_req=16 ttl=49 time=18.5 ms


title: RAM limit query in linux

text: I am working on _friendly-arm_ Linux based application, in which only one program is running that is creating many processes and many files are appending with data. One of these processes is PPP. My _friendly-arm_ Linux RAM size is 128MB. When this 128MB ram is filled then the process PPP is hanging so I want to set as - When ram memory exceeds 127MB then don't write data to files. How it can be done? Can one give useful information?


title: emacs shell sync directory

text: I encounter this quite a lot. when I open a emacs shell and run **M-x dirs** it will complain to me that: **couldn't cd** or sometimes **just hang emacs** what is the solution for this ? **What shell are you running?** I am using: GNU Emacs 23.3.1 (x86_64-unknown- linux-gnu, GTK+ Version 2.22.1) of 2012-02-07; not the eshell, but the builtin emacs shell **Have you customized shell-dirstack-query?** tried, but I don't have this variable in my emacs **Are you issuing M-x dirs at the shell prompt?** yes **Does the dirs command do what it normally does?** yes, sometimes **What does your prompt look like?** if it finished successfully then it will echo dirs and the PWD @Gilles


title: Linux not detected by grub

text: I have two partitions with Linux, `/dev/sda7 and /dev/sda8` `/dev/sda7` had Deeproot Linux installed (based on Ubuntu), later I installed Sabayon in `/dev/sda8`. It reinstalled the grub. The problem is that it is not detecting my Deeproot Linux and is not showing it in the grub menu. `update-grub` is not being recognized by Sabayon.. What am I supposed to do?


title: How to boot the system from my build kernel on VM?

text: I am running Ubuntu on Windows 7 using Virtual machine without any problems and even able to build kernel on it. Now I want to know how to boot my kernel on Ubuntu using virtual machine which is running on windows.


title: None of the linux programs work except 'cd'

text: Before stating the question, here's what I did and observed before the problem started:   1. On a fedora 18 Xfce, I tried compiling 3.6.10 kernel with a cdv driver,   2. After many attempts, it finally compiled without error, so I went ahead with `make modules_install`, and `make install`.   3. Then I had to install couple of binaries from a few tarballs. Everything seemed fine till this moment. I could use `firefox`, `vi` in terminal, `yum`, `rpm` etc. commands.   4. I installed binaries from few tarballs using `tar xvf` and a few files from these tarballs were moved to directories like `/usr`, `/usr/lib`. Even after this point, I remember using `vi` and `rpm`.   5. Then finally I installed the last tarball using same `tar xvf` and it transferred few files to `/lib`, `/lib/firmware` etc.  After the 5th step above, without doing anything else, I just tried opening one file using `vi` command and got following error:               bash: /usr/bin/vi /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory      I tried opening Firefox for solution, but it did not open. Fired few more commands from terminal but all the commands gave similar error. I checked few solutions that suggest installing glibc but neither `yum` works nor `rpm`. What might have gone wrong? How can it be fixed now when no command except `cd` is working, not even `ls`? Meanwhile the only other hiccup that happened was that I had for kill Firefox somewhere in between since the machine wasn't responding very well and some plugin in it was eating up resources.


title: uvcvideo - No space left on device

text: I'm trying to setup a camera (Swann ADW-200 wireless) in Zoneminder but having difficulties. Even when the camera is the only USB device hooked into the server it still errors with bandwidth problems               ~$ v4l2-ctl -d 0 --all          Driver Info (not using libv4l2):             Driver name   : uvcvideo             Card type     : Wireless PC-CAM             Bus info      : usb-0000:00:1d.0-1.4             Driver version: 3.2.37             Capabilities  : 0x04000001                     Video Capture                     Streaming     Format Video Capture:             Width/Height  : 320/240             Pixel Format  : 'MJPG'             Field         : None             Bytes per Line: 0             Size Image    : 307200             Colorspace    : SRGB     Crop Capability Video Capture:             Bounds      : Left 0, Top 0, Width 320, Height 240             Default     : Left 0, Top 0, Width 320, Height 240             Pixel Aspect: 1/1     Video input : 0 (Camera 1: ok)     Streaming Parameters Video Capture:             Capabilities     : timeperframe             Frames per second: 5.000 (5/1)             Read buffers     : 0          ~$ lsusb -t     /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M         |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M             |__ Port 2: Dev 11, If 0, Class=vend., Driver=pl2303, 12M             |__ Port 4: Dev 23, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 12M             |__ Port 4: Dev 23, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 12M             |__ Port 4: Dev 23, If 2, Class=audio, Driver=snd-usb-audio, 12M             |__ Port 4: Dev 23, If 3, Class=audio, Driver=snd-usb-audio, 12M     /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M         |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M          ~$ cat /etc/modprobe.d/uvcvideo.conf      options uvcvideo quirks=128          ~$ tail -n 2 /etc/sysctl.conf      kernel.shmall = 250000000     kernel.shmmax = 250000000               /usr/src/mjpg-streamer/mjpg-streamer# ./mjpg_streamer -i "input_uvc.so -d /dev/video0 --fps 5" -o "output     _http.so -p 8787 -w ./www"     MJPG Streamer Version: svn rev: 3:172      i: Using V4L2 device.: /dev/video0      i: Desired Resolution: 640 x 480      i: Frames Per Second.: 5      i: Format............: MJPEG     Adding control for Pan (relative)     UVCIOC_CTRL_ADD - Error: Invalid argument     Adding control for Tilt (relative)     UVCIOC_CTRL_ADD - Error: Invalid argument     Adding control for Pan Reset     UVCIOC_CTRL_ADD - Error: Invalid argument     Adding control for Tilt Reset     UVCIOC_CTRL_ADD - Error: Invalid argument     Adding control for Pan/tilt Reset     UVCIOC_CTRL_ADD - Error: Invalid argument     Adding control for Focus (absolute)     UVCIOC_CTRL_ADD - Error: Invalid argument     mapping control for Pan (relative)     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Tilt (relative)     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Pan Reset     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Tilt Reset     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Pan/tilt Reset     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Focus (absolute)     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for LED1 Mode     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for LED1 Frequency     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Disable video processing     UVCIOC_CTRL_MAP - Error: Invalid argument     mapping control for Raw bits per pixel     UVCIOC_CTRL_MAP - Error: Invalid argument      o: www-folder-path...: ./www/      o: HTTP TCP port.....: 8787      o: username:password.: disabled      o: commands..........: enabled     Unable to start capture: No space left on device      i: Error grabbing frames


title: What is the easiest way to boot Linux from a USB drive on Intel Mac?

text: I would like to boot an Intel Mac from Linux on an external USB drive. Right now, I have install rEFIt and use grub on the internal hard disc to boot the external drive. That seems pretty complicated. Isn't there an easier way? In particular one that does not involved installing anything on the internal drive?


title: Year 2038 problem

text: What is the likelihood of the Year 2038 issue being very problematic?


title: Run a command at a certain time in cygwin

text: I am writing a bash (.sh) script for cygwin. I want to run a certain command at specific time. I tried the following:               echo "test" | at 19:00      but I get the following error:               The AT command has been deprecated. Please use schtasks.exe instead.      So can I only use Scheduled Task in Windows for this?


title: How to scp/tar files that are in between specific days?

text: I need to copy db log files between two suse servers where I am interested in files ONLY in between 10.3.2013 - 13.3.2013 It is desired to compress the files before copying so I tar them and scp. Currently I am using `tar -cvzf /tmp/saas_archive_logs.tar.gz /var/lib/edumate/backup/archive_logs/db2inst1/SAAS --newer-mtime=2013-03-10` that gives me all files from 10.3.2013 till now. But I don't need all of them. And I didn't find any tar switch that would help me.


title: Hardening debian?

text: So I have thought a bit about hardening a Debian squeeze file & VPN server lately.   Right now, we've placed the machine behind a firewall only allowing SSH connections from LAN, set a strong `root` password and installed `unattended- upgrades` to keep us fresh on those security fixes. What more should we do?


title: How to backup debian system?

text: I have VPS hosting with debian operating system. I would like to backup whole system time by time. Here is a lot of questions how to backup OS on local machine, but it's not what I need. I have just ssh and superuser account.


title: understanding DNS in ubuntu 12.04

text: I have Ubuntu 12.04 installed, and also use unbound and usually use openDNS as my DNS server. When I run `dig google.com` say I get `SERVER: 127.0.0.1#53(127.0.0.1)`. What exactly is this thing listening on port #53? is this unbound or is it something to do with dnsmasq (do I even have dnsmasq installed as `dnsmasq.conf` doesn't seem to be in `/etc`?) In resolv.conf there is `nameserver 127.0.0.1` but then in network manager I have the DNS servers pointed to the two openDNS addresses. So what is going on here? does the local nameserver point to dnsmasq which then uses the values from network manager? or is it unbound that is in fact listening?


title: How to add a torrent to a running rtorrent download?

text: So there is a directory full of torrent files:               debian.iso.torrent     fedora.iso.torrent      I can start downloading them with a:               rtorrent *.torrent      command, when the working directory is the same where the torrents are. But. Every time when I start rtorrent in this way it calculates all the hashes..it takes looong time do to that and it's a cpu intensive thing. Are there any methods to avoid this? (other console-based torrent client? or a feature to add a single torrent when already downloading a torrent without calculating all the torrent's hashes?)


title: zsh wants to correct vim to .vim

text: I'm using zsh on Gentoo x64, and when I type `sudo vim /path/to/file` from my home folder, zsh asks:               zsh: correct 'vim' to '.vim' [nyae]?      I want to run `vim` not my `.vim` folder. How do I fix this? My guess is that `setopt autocd` is causing this. Odd thing is, if I don't add `sudo`, zsh doesn't ask to correct anything.


title: How to make progress dialog for Bash in XFCE?

text: Previously, in KDE, this was simple -- I called KDialog with number of steps, I got DCOP handle in return, then I called dcop with that reference and step, and progress dialog got updated. However, now DCOP is obsolete, and since I moved from KDE 3.5.10 to XFCE, I thought it would be a good idea that instead converting my script from KDialog+DCOP to KDialog+DBUS I migrate to XFCE progress dialog. **So how do you build progress dialog for Bash purposes in XFCE?** Bash purpose = I perform some computation in Bash, but the progress is shown in GUI way, as nice dialog on the desktop.


title: Where do I place commands to automatically be exported for all users?

text: I have an embedded platform running an Arago linux distribution. Right now the only "user" is `root` but there will eventually be others, but I don't know how many or what user IDs they will have. Every user of this system must have a particular environment variable exported in order for the GUI to work correctly. I found that if I created and then added the export command to `/home/root/.profile` it is set correctly for `root`. Where should I place the command such that it is exported for every (current and future) user of the system? Note: On my system, at start up there were no files present in `/home/root`, I added `.bash_profile` but that didn't work, then I added `.profile` and that did work. I thought I might have a dash shell because of that, but when I check `/bin/sh` it points to `bash`... so I tagged both.


title: Understanding smartctl output for a CF card

text: I'm testing SMART support on some Compact Flash cards. After running `smartctl -A` on my card I'm getting the output below (also available here: http://pastebin.com/BX8GcLCX). The `UPDATED` column says offline, does anyone know exactly what that means? UPDATE - it means the data is only collected offline. Also all the values seem to be at their defaults of 100 (except powercycle count). Does anyone know how to get the card to report it's values? The card I'm testing is an ATP AF1GCFI. Additionally if I try and run an offline test with "smartctl --test=short /dev/sda" I get back "Warning: device does not support Self-Test functions." Given the fact that the parameters can only be reported offline, does this mean I can't get any SMART data at all?               === START OF READ SMART DATA SECTION ===     SMART Attributes Data Structure revision number: 1      Vendor Specific SMART Attributes with Thresholds:      ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE          1 Raw_Read_Error_Rate     0x0000   100   100   000    Old_age   Offline      -       0          2 Throughput_Performance  0x0000   100   100   000    Old_age   Offline      -       0          5 Reallocated_Sector_Ct   0x0000   100   100   000    Old_age   Offline      -       0          7 Seek_Error_Rate         0x0000   100   100   000    Old_age   Offline      -       0          8 Seek_Time_Performance   0x0000   100   100   000    Old_age   Offline      -       0        12 Power_Cycle_Count       0x0000   100   100   000    Old_age   Offline      -       358      195 Hardware_ECC_Recovered  0x0000   100   100   000    Old_age   Offline      -       0      196 Reallocated_Event_Count 0x0000   100   100   000    Old_age   Offline      -       0      197 Current_Pending_Sector  0x0000   100   100   000    Old_age   Offline      -       0      198 Offline_Uncorrectable   0x0000   100   100   000    Old_age   Offline      -       0      199 UDMA_CRC_Error_Count    0x0000   100   100   000    Old_age   Offline      -       0      200 Multi_Zone_Error_Rate   0x0000   100   100   000    Old_age   Offline      -       0


title: Which is better for installed applications: /usr/bin or user's home directory?

text: It's not entirely clear to me whether it would be better to install a GUI application in `/usr/bin` or my home directory. I've read through this article and this one, but it doesn't really talk about philosophy of how to use these different directories. Should commands should be treated differently from GUI applications?


title: In CentOS, how to find free disk space?

text: In CentOS and Ubuntu, how do I find out how much free disk space I have left and other disk stats like disk usage?


title: Linux distro that supports touchpads and acpi on Macbook Pros

text: I've had a Macbook pro for 1 year running OSX, but I really miss Linux. I read plenty of docs but I never got a useful answer to the following questions:   1. How's the autonomy with Ubuntu/Arch/Fedora/Suse or other distributions?   2. How does the touchpad work? I really love the 2 & 3 fingers touchpad gestures in OSX.   3. Is it possible to utilize the same `acpi` control in Linux, as in MacOSX? I never reboot my mac just close the lid and it gets sleepy. Do you guys use a Linux distribution on your Macbook pro? I have the 7.1 model. Do you have major issues with these features?


title: How to convert pdf to eBook format

text: Is there a way to convert a PDF document into an eBook format such as epub, azw or mobi? I am looking for an application, which is fast in conversion. I have just tried calibre. After 10 minutes not even 2% of the conversion have been reached. So please no calibre. CLI is preferred.


title: How to run rtl8192cu driver in linux with kernel 3.8?

text: I have a trouble with usb WiFi dongle TPLink WN725N (rtl8192cu driver). Dongle it start, but cannot connect. Driver in official Realtek site support only 2.6.18~2.6.38 and 3.0.8 kernels. Is there a way to run it on kernel 3.8? (sorry for my english) dmesg show this error:               IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready


title: How can I manage jobs after I disconnect from my tty/ssh session?

text: If I `ssh` to a box and start a task that will take some time to complete I usually press `control+z` to pause the process, and then immediately type `bg 1` to put run it in the background. I can then type `jobs` and see it running. If I disconnect (type `exit`, press `control+d`, etc) and then log back in, I can no longer type `jobs` to see it running - it won't show anything. I know I can type something like               ps -u `whoami`      to see what items are running, bug I'm not sure if I can pause them any longer. I know I can kill them, but is there a way to pause them or can I somehow get them to show back up in the `jobs` list? _Linux-fu tips regarding jobs and process management are also welcome and will be upvoted._


title: system settings -> shortcuts and gestures

text: Something is stealing my `Ctrl`+`F7` and `Ctrl`+`F8` shortcuts from eclipse. I checked out the settings panel from the title but could not spot any such bindings over there. So, how do I get to see who is keeping those key combos and how to unbind them ? LE: I was blind actually; the keyboard shortcuts were just in the place from title under the "KWin" application.


title: Suggestions to debug missing kernel messages from systemd journal

text: I have recently been playing around with a new freescale i.mx6 system. I have installed archlinuxarm on it. Strangely, all kernel messages are missing from the journal.               $ sudo journalctl -k     -- Logs begin at Thu 1970-01-01 10:00:07 EST, end at Thu 2014-02-13 09:25:43 EST      This is very odd. "dmesg" has a huge amount of output. systemd-journal has opened /dev/kmsg               $ sudo lsof /dev/kmsg     COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME     systemd      1 root    3w   CHR   1,11      0t0   62 /dev/kmsg     systemd-j 1431 root    6w   CHR   1,11      0t0   62 /dev/kmsg     systemd-j 1431 root    8u   CHR   1,11      0t0   62 /dev/kmsg      Somehow no kernel messages are ending up in the journal. Messages from other processes are all being received fine. What should I look in an attempt to solve this?


title: Target filesystem doesn't have requested /lib/systemd/systemd

text: I have been using `systemd` for about a month without any problems on my Debian Jessie. I installed it according to the Debian wiki. But all of a sudden today I got this error:    ![ss of error](http://i.stack.imgur.com/BqdEh.jpg) _Original:http://i.imgur.com/DWqZVIz.jpg_ How can I fix this?


title: Apparmor cp -al

text: I am attempting to setup a Apparmor profile for rsnapshot. When I run in complain mode I get no errors. When I enable to the profile, I still get no apparmor errors, but rsnapshot itself is broke. This is my profile right now:               # Last Modified: Mon Feb 10 12:23:23 2014     #include <tunables/global>          /usr/bin/rsnapshot flags=(complain) {       #include <abstractions/base>       #include <abstractions/perl>                 capability chown,       capability dac_override,       capability fowner,       capability fsetid,                 /bin/cp rix,       /bin/dash r,       /bin/pwd rix,       /bin/rm rix,       /etc/ r,       /etc/** r,       /etc/rsnapshot.conf r,       /home/ r,       /home/*/ r,       /home/*/** r,       /home/sjackson/bin/backup_pgsql.sh rix,       /mnt/backup/ rw,       /mnt/backup/** rwl,       /mnt/data/ r,       /mnt/data/** r,       /run/rsnapshot.pid w,       /usr/bin/logger rix,       /usr/bin/perl ix,       /usr/bin/rsnapshot r,       /usr/bin/rsync rix,       /usr/lib/postgresql/9.1/bin/pg_dumpall rix,       /usr/share/postgresql-common/PgCommon.pm r,       /usr/share/postgresql-common/pg_wrapper rix,       /var/log/rsnapshot.log w,          }      And these are the errors that I am getting:               /bin/cp: cannot create hard link `/mnt/backup/daily.1/localhost/mnt/data/OS/One X/Backup (12-1-12)/pulse/catalogImageCache/http%3A%2F%2Fpulseapi.appspot.com%2Fapi%2Fcatalog%2Fcatalog_image%3Fcatalog_item_primary_key%3D53788596%26image_type%3Dicon.1' to `/mnt/backup/daily.0/localhost/mnt/data/OS/One X/Backup (12-1-12)/pulse/catalogImageCache/http%3A%2F%2Fpulseapi.appspot.com%2Fapi%2Fcatalog%2Fcatalog_image%3Fcatalog_item_primary_key%3D53788596%26image_type%3Dicon.1': Permission denied      with the error at the end:               ERROR: /bin/cp -al /mnt/backup/daily.0 /mnt/backup/daily.1 failed (result 2, exit status 0).  Perhaps your cp does not support -al options?      Does anyone know how to get Apparmor to allow hardlinks like this? I tried changing `/bin/cp rix` to `/bin/cp rux` but it still failed (which is strange since that should have given `cp` unrestricted privileges). The source and destination folder has link/write privileges from `/mnt/backup/** rwl,`


title: How should I proceed in troubleshooting rtorrent?

text: I have a computer connected via ethernet cables to my home router that preforms server like duties. Specifically, for some time I was running rtorrent on this machine. I wish I knew when this started to occur (then I could try and associate the break with an event), yet mysteriously all of my active torrents suddenly failed to seed or download. The program error message read `Tracker: [Failed sending data to the peer]`. My first attempt at troubleshooting was to completely uninstall and reinstall rtorrent. I rewrote (read: uncommented the example) my config files and started clean. The first torrent file in erred with the same message. I am familiar with the common key sequences to fix torrents that go rogue in rtorrent: `C-d, C-k, C-e, C-r, C-s` and many variations on the same, none of them proved fruitful. Next up the operating system. I formatted a rather poorly maintained Linux Mint install and wrote it over with a fresh command-line Ubuntu installation. Feeling sure that I had nuked the issue I installed rtorrent only to once again be greeted with `[Failed sending data to the peer]`. If my thinking is logical the next step would be to investigate the connection between the machine and the router. However I am not really sure how to do that (only an amateur with network engineering) or what to analyze/check or even how to start. Any recommendations for how to proceed? Also if you need any specifics about the setup to offer advice, just ask and I will post links to config files or other information. Extra Info: I can successfully download torrents from other machines on the same subnet. **Edit 1** : I've verified something suspicious about the machine in question. When it is requested to `ping www.google.com` it replies `unknown host` If I discover google's public IP on a different computer (same subnet!) and then using that information request the faulty machine to `ping 74.125.239.131` instead it succeeds. Could this DNS issue (that's what it is right?) be affecting the torrent protocol?


title: can't ssh into remote host with root, password incorrect

text: I have a remote host, previously I can ssh into it with root and password               ssh root@remote_host      or I ssh into it first using a regular user account               ssh esolve@remote_host      and then `su root` and input password but today, in both ways, my password is always incorrect, like               [esolve@local esolve]$  ssh root@remote_host     root@remote_host's password:      Permission denied, please try again.      or               [esolve@remote_host ~]$ su root     Password:      su: incorrect password      related information:   1. I can use this password to log in with root if I operated locally on that remote machine today.   2. I ssh into is via VPN Why did this happen? How can I solve this problem?


title: Shell script output incorrectly splitting while being passed as an argument to script

text: Let's say I have the following two shell scripts:               #!/bin/sh     #This script is named: args.sh          echo 1 "\"Two words\"" 3      , and:               #!/bin/sh     #This script is named: test.sh          echo "Argument 1: "$1     echo "Argument 2: "$2     echo "Argument 3: "$3      When I call the scripts as:               sh test.sh $(sh args.sh)      , I recieve:               Argument 1: 1     Argument 2: "Two     Argument 3: words"      When I expected instead to get:               Argument 1: 1     Argument 2: Two words     Argument 3: 3      Copying the output of `sh args.sh` and pasting it as the input of `sh test.sh` works just fine; so I assume this isn't actually what the shell is doing. I can achieve the desired/expected output by calling `sh args.sh | xargs sh test.sh` instead. However, I'm wondering if there's an equivalent way of doing this without piping the output of the first script (args.sh) to xargs? I want the scripts to be called in the original order; the argument script to output the parameters to the second. I'm also looking for an explanation as to why this call doesn't work as expected?


title: VMware path to System ISOs on remote server

text: When I connect to a remote server in vmware workstation I can create a new vm.   But where to put the .iso files on the remote server? (linux)   As shown on the screenshot I have only a "[standard]" folder. How to add other? ![enter image description here](http://i.stack.imgur.com/JhRA9.png)


title: How to get past "Loading Initial Ramdisk" hang after going from x86_64 to i686 cpu

text: Long story short, I have a Ubuntu 12.04 64-Bit Server setup as a virtual machine with VirtualBox (4.1.18). I migrated the guest machine from an AMD chipset (a gaming machine) to an Intel Xeon (server hardware with dual processor support) thinking that there wouldn't be any issues. Once I got the guest machine setup on the server, I started the guest machine only to find that it hangs at "Loading Initial Ramdisk". I mounted the Ubuntu 12.04 64-Bit setup ISO to see if I could get in to see any logs, but get "Kernel requires x86-64 CPU, but only detects i686 CPU" when trying to boot off the ISO. Keep in mind that host OS on both source and destination machines are also Ubuntu 12.04 Server 64-Bit. This lead me to look into how the guest OS sees the CPU information within the virtual machine. I found that the CPU information looks exactly the same on the host as it does on the guest on the source machine. Source CPU Info:               Processor - AMD Phenom™ II X4     Model - 925     OPN Tray - HDX925WFK4DGI     OPN PIB - HDX925WFGIBOX     Operating Mode 32 Bit - Yes     Operating Mode 64 Bit - Yes     Revision - C2     Base Speed (MHz) - 2800     Boost Speed (MHz)     Voltages - 0.850-1.425V      Wattage - 95 W     AMD Virtualization Technology - Yes     L1 Cache Size (KB) - 128     L1 Cache Count - 4     L2 Cache Size (KB) - 512     L2 Cache Count - 4     L3 Cache Size (KB) - 6144     CMOS - 45nm SOI     Socket - AM3     AMD Business Class - No     Black Edition - No      Destination CPU Info:               3 Ghz Xeon - SL7ZF     Number of Cores - 1     Clock Speed - 3 GHz     L2 Cache - 2 MB     FSB Speed - 800 MHz     FSB Parity - Yes      Instruction Set - 64-bit     Embedded Options Available - No     Lithography - 90 nm     Max TDP - 110 W     VID Voltage Range - 1.2875V-1.3875V     Physical Address Extensions - 32-bit     ECC Memory Supported - No     Processing Die Size - 135 mm2     Number of Processing Die Transistors - 169 million     Sockets Supported - PPGA604     Intel® Hyper-Threading Technology - No     Intel® Virtualization Technology (VT-x) - No     Intel® Trusted Execution Technology - No     Intel® 64 - Yes      Idle States - Yes       I found a similar question, but wasn't sure if this is applies to my situation. The destination cpu show to support 64-Bit instructions. On the other hand, I've also read that Intel's 64-Bit is not _true_ 64-Bit. **Am I stuck rebuilding my guest VM from scratch?**


title: Is there a usable gui front-end to git on Linux?

text: I'm a former windows user and just started using ubuntu. On windows, we had two great softwares: `TortoiseSVN` and `TortoiseGit`. Both are so good programs that they allow us to do everything like commit, rollback, merge, view history, browse repos, etc. without knowing a SINGLE cli command. Now on linux, I'm finding it difficult to do memorize git commands for everything. `git push` and `git remote add` is fine. But merging is tedious especially conflict-resolution. In TortoiseGit, it is simply a matter of a few right-clicks! I've found some crap like git-gui, etc. but the features are nothing comparable to TortoiseGit. Why isn't there any fully-fledged TortoiseGit port on linux systems?


title: Is there a command line spell to drop a column in a CSV-file?

text: Having a file of the following contents:               1111,2222,3333,4444     aaaa,bbbb,cccc,dddd      I seek to get a file equal to the original but lacking a n-th column like, for n = 2 (or may it be 3)               1111,2222,4444     aaaa,bbbb,dddd      or, for n = 0 (or may it be 1)               2222,3333,4444     bbbb,cccc,dddd      A real file can be gigabytes long having tens thousands columns. As always in such cases, I suspect command line magicians can offer an elegant solution... :-) In my actual real case I need to drop 2 first columns, which can be done by dropping a first column twice in a sequence, but I suppose it would be more interesting to generalise a bit.


title: Postgres 9.0 linux command to windows command conversion

text: i am working on an application using `delphi 7` as the front end and `postgres 9.0` as the back end. I have to upload images to the server so i use `\lo_import` and `\lo_export` for inserting images on the server and geting the images from the server. i had come across a problem where is needed the `LASTOID` after a `\lo_import` so i can use the OID to update a row in my table but i cant set the syntax correct in windows here is my question on stackoverflow.com.. i have got the answer but the script is in linux sheel command ..i cannot run it in windows                        psql -h 192.168.1.12 -p 5432 -d myDB -U my_admin << EOF              \lo_import '/path/to/my/file/zzz4.jpg'              UPDATE species              SET    speciesimages = :LASTOID              WHERE  species = 'ACAAC04';              EOF      and                 echo "\lo_import '/path/to/my/file/zzz4.jpg' \\\\ UPDATE species SET speciesimages =   :LASTOID WHERE  species = 'ACAAC04';" | \      psql -h 192.168.1.12 -p 5432 -d myDB -U my_admin      i have tried this though in windows                 "C:\Program Files\PostgreSQL\9.0\bin\psql.exe" -h 192.168.1.12 -p 5432 -d myDB -U my_admin -c "\lo_import 'C://im/zzz4.jpg'";       then immediately (programmatically) im doing                   "C:\Program Files\PostgreSQL\9.0\bin\psql.exe" -h 192.168.1.12 -p 5432 -d nansis -U nansis_admin -c " update species SET speciesimages = :LASTOID WHERE species='ACAAC24'"       But i get `Syntax error at or near ":"` can any1 tell tell me how to covert it to windows commnad?


title: Terminating a bash shell script running in the background

text: I often use `bash` shell scripts to run simple commands for many different files. For example, suppose that I have the following `bash` shell script, called `script.sh`, that runs the program/command `foo` on three text files `"a.txt"`, `"b.txt"`, `"c.txt"`:               #!/bin/bash          for strname in "a" "b" "c"     do     foo $strname".txt"     done      Also, suppose that `foo $strname".txt"` is slow, so the execution of the script will take a long time (hours or days, for example). Because of this, I would like to use `nohup` so that the execution continues even if the terminal is closed or disconnected. I would also like the script to immediately go to the background, so I will use the `&` operator. Thus I will use the following command to call `script.sh`:               nohup bash script.sh &      This works fine for running the script in the background and without hangup, but now suppose that I would like to terminate the execution at some point for some reason. How can I do this? The problem that I have encountered is that, by looking at `top`, I see only the `foo` corresponding to `"a.txt"`. I can terminate that `foo` call, but then the `foo` corresponding to `"b.txt"` gets called and then I have to terminate that one as well, and so on. For tens or hundreds of text files specified in the `for` loop, it becomes a pain to terminate every `foo`, one by one! So somehow I need to instead terminate the shell script _itself_ , not the _particular_ calls issued from the shell script. When I type the command               ps -u myusername      where `myusername` is my username, I get a list of processes that I'm running. But I see two different process IDs called `bash`. How do I know which of these processes, if any, corresponds to my original call `nohup bash script.sh &`?


title: GPG installation got messed up, can't fix

text: My GPG installation got messed up, after trying to do some experiments as follows:               echo "trust" > "/proc/self/fdinfo/27"     echo "trust" > "/proc/self/fdinfo/26"     echo "trust" > "/proc/5639/fd/0"     echo "trust" > "/proc/5639/fd/1"     echo "trust" > "/proc/5639/fd/2"     echo -e -n "trust\n" > "/proc/5639/fd/2"     echo -e -n "trust\n" > "/proc/5639/fd/3"     echo -e -n "trust\n" > "/proc/5639/fd/4"     echo -e -n "trust\n" > "/proc/5639/fd/5"     echo -e -n "trust\n" > "/proc/5639/fd/6"     echo -e -n "trust\n" > "/proc/5639/fd/7"     echo -e -n "trust\n" > "/proc/5639/fd/8"     echo -e -n "trust\n" > "/proc/5639/fd/2"      The number 5639 is a process id of `gpg --edit-key "Dor"`.   As for now, every time I try to do something, a weird error appears. Example:               $ gpg     gpg: Go ahead and type your message ...     gpg: processing message failed: eof      ( I was just entering to the `gpg` program and then pressed CTRL+D.   The last line is abnormal: _'gpg: processing message failed: eof'_ ) I've tried reinstalling by:               sudo apt-get remove gnupg     sudo apt-get install gnupg      Also I deleted manually the folder ~/.gnupg But still the strange error appears. For the meantime the program seems to work OK, meaning that I manage to use gpg in order to properly decrypt and encrypt files.   But this error disturbs me very much and I would like to fix it. * * * **Edit #1 (22 Sep, 18:41 UTC):** Here's another command that I entered and the resulting error message received from `gpg`:               $ gpg --delete-secret-key "Dor"     gpg: key "Dor" not found: eof     gpg: Dor: delete key failed: eof


title: USB mount doesn't work on Centos 6.4

text: I have a problem. After an update, my USB drives are not mounted automatically and I'm unable to mount them manually... The output of my `fdisk -l` command is:               Disk /dev/sdb: 15.8 GB, 15762194432 bytes     2 heads, 63 sectors/track, 244329 cylinders     Units = cylinders of 126 * 512 = 64512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x018d6a09             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *           1      244330    15392736    b  W95 FAT32      I tried with               mount -t nfs /mnt/usb /dev/sdb1      but it dowsn't work. Any ideas?


title: How can I improve my productivity in Linux?

text: I have been mostly using Windows but I know my way around a Linux system but I am not as productive as in Windows. I am looking for some "survival" guidelines on what should I focus to be able to improve my productivity in Linux (mainly, being more efficient with the command line interface).


title: What does "rm is hashed" mean?

text: I'm going through http://mywiki.wooledge.org/BashGuide/CommandsAndArguments and came across this:               $ type rm     rm is hashed (/bin/rm)     $ type cd     cd is a shell builtin      Just a little earlier, the guide listed the various types of commands understood by Bash: aliases, functions, builtins, keywords and executables. But there wasn't mention of "hashed". So, in this context, what does "hashed" mean?


title: How to install a .bin file that gives the error that it needs more space in /tmp?

text: Here is the error:               ~]$ ./jdev_suite_121200_linux64.bin      0%....................................................................................................100%     Not enough disk space in dir /tmp/sfx_bG4Mlk, requires at least -1893 MB disk space     ** Error during execution, error code = -1.      EDIT:               ~]$ df -h     Filesystem                       Size  Used Avail Use% Mounted on     /dev/dm-3                         50G   25G   22G  54% /     devtmpfs                         1.9G     0  1.9G   0% /dev     tmpfs                            1.9G  1.6M  1.9G   1% /dev/shm     tmpfs                            1.9G  1.1M  1.9G   1% /run     tmpfs                            1.9G     0  1.9G   0% /sys/fs/cgroup     tmpfs                            1.9G  904K  1.9G   1% /tmp     /dev/sda2                        477M  130M  319M  29% /boot     /dev/sda1                        200M  9.6M  191M   5% /boot/efi     /dev/mapper/fedora_hostName-home  405G  182G  203G  48% /home


title: Creating a variable to a directory that persists until deletion

text: I'm currently using bash on Ubuntu, and I work a lot with a directory saved at /home/me/path/to/project_dir. It is a nuisance to change to the directory every time I open bash. So I'd like to save the path to a variable, say `projdir`, so that I can just do `cd projdir`. If my working directory changes, I should be able to change the path by overwriting the variable. I want to be able to update the variable easily, preferably with one command, without messing with .bashrc. One important thing is that this variable should persist even if I restart bash. How do I do this? I'd still like to see my home directory when I start up bash, so changing the default starting directory to project_dir is not an option.


title: screen buffer and dialog

text: I was trying to use different screen buffer for my script using tput. Below is small script that I am running.               tput smcup     clear     dialog --yesno "Do you want to continue?" 0 0     rc=$?     clear     tput rmcup     if [ "${rc}" == "0" ]; then       echo Yes     else       echo No     fi      After the script is finished executing there is a blank part on the screen(as shown below in the image) which is equal to the rows occupied by the prompts before running the script.Ideally `tput` should have switched to second screen buffer and after executing it should have come back to the first screen buffer. **The script switches to the second screen but after coming back it leaves a blank space which shouldn't be there .** ![enter image description here](http://i.stack.imgur.com/yq271.jpg)


title: Allow application specific access in iptables using guid

text: I would like to get Skype working with `iptables` and don't want to allow a huge range of ports thus I thought a solution might be               iptables -A OUTPUT -m owner --gid-owner skypeGrp -j ACCEPT      iptables -A INPUT -m owner --gid-owner skypeGrp -j ACCEPT      where in advance I had created a group called `skypeGrp` and then put the skype application into it:               sudo addgroup skypeGrp     sudo usermod some_username -G skypeGrp     sudo chgrp skypeGrp /usr/bin/skype      Shouldn't this work? EDIT: I think another key insight here to make the method I originally outlined in my question work, is to realise that it `active group` that `iptables` takes notice of. Thus my user doesn't just have to belong to the `skypeGrp`, this also must be his `active group` at the time of running `Skype` (see here for more).


title: How to use variables in sed

text: I want to print out the lines of a file between two indices in a Bash script. I have the file name and indices as variables I tried doing this               sed -n "$2,$3p" $1          sed: -e expression #1, char 4: invalid usage of line address 0      but I got an error. How do I do this?


title: Openbox placing cursor on the window titlebar

text: I was able to use one really neat thing. In many DE or WM, when you **Maximize** the window and then try drag the window from the **Titlebar** , the window would be **Unmaximized**. I achieved this by the following config:               <context name="Titlebar">      <mousebind button="Left" action="Drag">       <action name="Unmaximize"/>       <action name="Move"/>      </mousebind>     </context>      The **Move** action is necessary to keep to be still moving window. BUT there is one thing...I hope you can help me.. This way, when window becomes, **Unmaximized**. The cursor will still be on top of the screen. How to move the cursor to still be on a **Titlebar**?


title: Google Compute Engine with multiple SSH users, Debian

text: I have managed to set up my server with a default user 'admin'. The sshKeys in the metadata is set with the following format, described in the google documentation.                key: sshKeys       value: admin:ssh-rsa XXXXXXXXXX      However, I am trying to add a new user to the system, hence I updated the metadata to the following                key: sshKeys       value: admin:ssh-rsa XXXXXXXXXX newuser:ssh-rsa YYYYYYYYY      This has worked perfectly for me on one instance of server that I have set up sometime back. However I was unable to set it up on the new one. Can someone help me out with this?


title: Help searching in files for regex patterns, recursively, with specialized output

text: My problem is that I need to:   1. Find all lines matching `regex_pattern` in all files (deep search) in a given root directory   2. For each line that matches, output:      * File name     * Line number containing the match     * Line contents     * The regex pattern   3. Import the above data into Excel (so a CSV, or delimited output format comes to mind) **What is the easiest way to do this task?** For the sake of proving I thought about this somewhat, I would write a Perl script that took as input a single fully qualified filename and a regex pattern, and process the lines using the approximate Perl below (I haven't tried yet, but this is what my first attempt would resemble):               while (<FILE>) {       $line_number++;            if ($_ =~ m/regex_pattern/) {         # output: file_name\tline_number\tregex_pattern\t$_         # ignore escaping issues for the time being       }     }      I'm still not sure how I'd pass in the contents of each directory with a recursive search into this Perl script. I can do the searching in Perl but I'm sure there's a nice Unix/Linux way to do this. I'm not married to Perl. If there's a way to do it chaining together standard Unix/Linux tools, that'd be awesome. If not, I prefer to use Perl as I'm somewhat familiar with it's syntax.


title: Android Emulator on Arch Linux

text: I would like to run Android Emulator on Arch Linux. Is there any way to run Android Emulator on Arch Linux?


title: How you stop 'wget' after it gets a 404?

text: If you use brace expansion with `wget`, you can fetch sequentially-numbered images with ease:               $ wget 'http://www.iqandreas.com/sample-images/100-100-color/'{90..110}'.jpg'      It fetches the first 10 files numbered `90.jpg` to `99.jpg` just fine, but `100.jpg` and onward return a _404: File not found_ error (I only have 100 images stored on the server). These non-existent files become more of "a problem" if you use a larger range, such as `{00..200}`, with 100 non-existent files, it increases the script's execution time, and might even become a slight burden (or at least annoyance) on the server. Is there any way for `wget` to stop after it has received its first 404 error? (or even better, two in a row, in case there was a missing file in the range for another reason) The answer does not need to use brace expansion; loops are fine too.


title: How do you hide a pane?

text: I have 3 panes in my tmux window:               --------------------------     |             |      2   |     |             |          |     |        1    |----------|     |             |      3   |     |             |          |     --------------------------      Panes 1 and 2 have `vim`. Pane 3 runs a cli I am developing. Sometimes I want to compare panes 1 and 2, so I want to hide pane 3:               --------------------------     |             |          |     |             |          |     |        1    |       2  |     |             |          |     |             |          |     --------------------------      and then bring back pane 3 again. I don't want to kill pane 3 as I have set up some things there and don't want to go though setting them up again.   * Is there something similar to `PREFIX + z` which can zoom pane 2 but without touching pane 1? Or    * Is there a way to hide pane 3 quickly and bring it up back when needed?


title: Virtual Host setup works for one server, not another

text: Having an issue with my virtual host set up. Used this tutorial as a reference on both: http://youtu.be/wXIJMtwmPCE Apache/2.2.15 (Unix) on both servers. Seemingly Identical httpd.conf file on both servers: http://pastebin.com/2LRzLZ8Z Working server's webmin shows vhosts as:               Handles the name-based server foo.com on address *.      While non-working server's webmin shows vhosts as:               Handles the name-based server urbanvacations.net on all addresses      Virtual files contains:               <VirtualHost *>         DocumentRoot "/srv/vhosts/foo.com/htdocs"         ServerName mysite.com         <Directory "/srv/vhosts/foo.com/htdocs">             allow from all             Options +Indexes         </Directory>     </VirtualHost>      I am not sure if I'm missing something in apache's configuration or on the CentOS server itself. Both conf files have "NameVirtualHost" commented out; however even with it uncommented, vhosts still won't work on the second server. The domain just shoots back over to the default apache welcome page. The second server is AWS EC2, and the first server is dedicated via another company.


title: Debian: change Gnome Classic Places menu for all users

text: I'm using debian 7 with Gnome Classic. I want to change the items in my Places menu for every users. I know that I can manage Applications menu items from _/usr/share/applications_ How can I manage,in a similar way, the Places menu? Thanks.


title: Why do *nix filesystems support file names with newlines?

text: According to this page: > File names in Linux can contain any characters other than (1) a forward > slash ( / ), which is reserved for use as the name of the root directory > (i.e., the directory that contains all other directories and files) and as a > directory separator, and (2) the null character (which is used to terminate > segments of text). Spaces are permitted, although they are best avoided > because they can be incompatible with legacy software in some cases. Great, both restrictions make a lot of sense. Since it is clearly possible to forbid the inclusion of certain characters in file names, why were newlines allowed? As far as I can tell their only use is to complicate our scripts. Is there ever a valid reason to have a new line in a file name?


title: How to run gVim in a single instance

text: I want it in such a way that on double clicking an already opened file, or a new file, gVim uses the same window. From this question asked previously on Stackoverflow I figured out how to do this by putting up an alias like:               alias gvim="gvim --remote-tab-silent" || gvim      This works great for the terminal without any problems. To enable this for the desktop too, I tried editing the `/usr/share/applications/gvim.desktop`. The default execution command in `gvim.desktop` is:               gvim -f %F      I changed this to:               gvim --remote-tab-silent %F      This gives me trouble when I'm trying to open an already opened file. It takes too long to open and doesn't open in the end. What may have caused the problem? I'm running Gnome 2.x and Vim 7.2.x if it matters.


title: How do I show all files in a directory except those that have a certain extension AND display them in multiple columns?

text: Since I write in Python a lot it's kind of annoying to see .pyc files all the time and I would like to just hide them at this point. I tried the following, but I can't seem to figure out how to get it to print in multiple columns.               ceasarbautista@hse140:~/Desktop/Statistics/statistics/probability$ ls     __init__.py     calculus.py     conditional.py      counting.pyc        distributions.pyc   event.pyc       objects.pyc     __init__.pyc        calculus.pyc        counting.py     distributions.py    event.py        objects.py      plots.py     ceasarbautista@hse140:~/Desktop/Statistics/statistics/probability$ ls | grep -v .pyc     __init__.py     calculus.py     conditional.py     counting.py     distributions.py     event.py     objects.py     plots.py     ceasarbautista@hse140:~/Desktop/Statistics/statistics/probability$ ls -C | grep -v .pyc     conditional.py      event.py


title: Manipulating X key and pointer grabs on the command line

text: What command line tools exist to list and manage X server grabs? (That's grab as in key and pointer grabs, i.e. restricting the use of a particular key or mouse button to a particular application, or constricting the mouse pointer to remain in a particular screen area.) I'm looking for a hypothetical `xgrab` utility that would show things like               Key     0x00f00ba5  0x123   0     Button  0x00f00ba5  2            Pointer 0x00abcdef        meaning that there has been a call to `XGrabKey(display, 0x123, 0, 0x00f00ba5, ...)` and so on with `XGrabButton`, `XGrabPointer`, `XGrabKeyboard`, `XGrabServer` (if possible). The display format doesn't matter, what I want is some way to see who's grabbing what, and possibly some way of revoking these grabs (if it's possible, I'm not sure if the X11 API allows that).


title: How can I prefer one wifi network over another?

text: From my home I have access to my home wifi network as well as a public network that is deployed throughout the city. The public network has a lower signal strength and is unprotected. However, my computer sometimes connects to that network instead of my home network. Other than "forgetting" the public network, is there a way to tell NetworkManager to prefer my home network over other networks?


title: How to remove any string from a file via shell scripts?

text: I try to remove string from `.bash_profile`. String is added when my shell script run: My string at bash_profile as follows:               # for Myapllication     export MYAPP_HOME=/opt/myapp      I want to remove the strings from `.bash_profile` when myapp is removed via `rpm`. How to remove any string from a file via shell script? (or possible alternative method)


title: What is GNU Info for?

text: I understand what GNU Info is and how to use it, but what is it _for_? Why does it exist in parallel to the man pages? Why not write detailed man pages rather than provide a separate utility?


title: Installing a platform driver

text: I have recently acquired a device driver for an integrated watchdog timer on a x86 board on which I am running a minimal Linux system. The kernel is 3.6.11 and it has been built using `buildroot`. My installation does not run `udev` so I am required to manually perform an `insmod` and `mknod` for any drivers that I require. I have managed to do this for a CAN driver, but for this watchdog driver, I am able to cross-compile the source code for the target and I am successfully able to `insmod` the resulting .ko file. After this there are no errors generated and a call to `lsmod` reports that the module is loaded. The problem I am having is that I need to created a device node in `/dev` for this driver and I am not sure how to proceed. I do not know how to obtain device major and minor numbers like I can for char devices. The source of this driver suggests it is a platform device driver but I am not sure what that even means. I have only heard of character and block devices and so – is the notion of major and minor numbers relevant to platform devices? If so, how can I obtain this information? There is no entry within `/proc` for this device driver name and I am unsure how to proceed.


title: Why not use pathless shebangs?

text: Is it possible to have a shebang that, instead of specifying a path to an interpreter, it has the name of the interpreter, and lets the shell find it through $PATH? If not, is there a reason why?


title: Choose at GRUB menu whether NVidia driver should be used

text: For some games, I need the `nvidia-current` driver, but when it's enabled, I can't get my work done as it messes up everything. So is there a way I can get two options in my GRUB menu? One wich will load my operating system **with** the `nvidia-current` drivers, and one which will use the default _non- proprietary_ one? It seems a bit stupid to me to have 2 Ubuntu installations (one for games, one for the rest). But I can't get my daily work done **with** the Nvidia drivers enabled as it messes up some applications, randomly freezes the system, etc. But I still want to be able to play some games. If there's a way to just load and unload the `nvidia-current` driver with a script or something, that would also be welcome.


title: find the single largest file

text: We host a share of size 4 TB. How efficient is it to find a file with highest size. Usually we use:               du -ak | sort -k1 -bn | tail -1      and it is not easy to scan through a share of such huge size and then again sort them. Any suggestions to know only the single largest file in the share. And also `du -ak` is returning the size of current directory like (". 123455"). How do i avoid that?


title: Gnome Activity Journal stalls

text: I installed gnome-activity-journal, restarted zeitgeist and launched gnome- activity-journal, and the app just loads without ever displaying anything. I tried the latest version from the PPA:               ii  zeitgeist                             0.8.2-0ubuntu1~ppa1~natty                  event logging framework     ii  zeitgeist-core                        0.8.2-0ubuntu1~ppa1~natty                  event logging framework - engine     ii  gnome-activity-journal                0.6.0-0ubuntu1~natty1~ppa                             graphical user interface for Zeitgeist      But the result is the same: ![stalled_activity_journal](http://i.stack.imgur.com/sZlC8.png) The daemon says:               [DEBUG - zeitgeist.engine] Found 0 events in 0.000194s     [DEBUG - zeitgeist.engine] Found 53 events in 0.000753s     [DEBUG - zeitgeist.engine] Got 0 raw events in 0.000776s     [DEBUG - zeitgeist.engine] Got 53 events in 0.000109s     [DEBUG - zeitgeist.engine]     Where time spent in _get_event_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in _get_subject_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in apply_get_hooks in 0.000000s     [DEBUG - zeitgeist.engine] Found 28 events in 0.000766s     [DEBUG - zeitgeist.engine] Got 0 raw events in 0.000444s     [DEBUG - zeitgeist.engine] Got 28 events in 0.000113s     [DEBUG - zeitgeist.engine]     Where time spent in _get_event_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in _get_subject_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in apply_get_hooks in 0.000000s     [DEBUG - zeitgeist.engine] Found 236 events in 0.001218s     [DEBUG - zeitgeist.engine] Got 0 raw events in 0.003643s     [DEBUG - zeitgeist.engine] Got 236 events in 0.000178s     [DEBUG - zeitgeist.engine]     Where time spent in _get_event_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in _get_subject_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in apply_get_hooks in 0.000000s     [DEBUG - zeitgeist.engine] Found 115 events in 0.000892s     [DEBUG - zeitgeist.engine] Got 0 raw events in 0.001598s     [DEBUG - zeitgeist.engine] Got 115 events in 0.000118s     [DEBUG - zeitgeist.engine]     Where time spent in _get_event_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in _get_subject_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in apply_get_hooks in 0.000000s     [DEBUG - zeitgeist.engine] Found 10 events in 0.000587s     [DEBUG - zeitgeist.engine] Got 0 raw events in 0.000191s     [DEBUG - zeitgeist.engine] Got 10 events in 0.000102s     [DEBUG - zeitgeist.engine]     Where time spent in _get_event_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in _get_subject_from_row in 0.000000s     [DEBUG - zeitgeist.engine]     Where time spent in apply_get_hooks in 0.000000s     [DEBUG - zeitgeist.engine] Found 0 events in 0.000665s     [DEBUG - zeitgeist.fts] Indexing 'file:///home/raphink/Pictures/stalled_activity_journal.png'     [DEBUG - zeitgeist.fts] Indexing 'file:///home/raphink/Pictures/stalled_activity_journal.png'     [DEBUG - zeitgeist.fts] Indexing 'file:///home/raphink/Pictures/stalled_activity_journal.png'     [DEBUG - zeitgeist.engine] Inserted 3 events out of 3 in 0.207549s     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/1     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/3     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/2     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/5     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/4     [DEBUG - zeitgeist.notify] Checking monitor :1.146/org/gnome/zeitgeist/monitor/6     [DEBUG - zeitgeist.notify] Notifying :1.146/org/gnome/zeitgeist/monitor/6 about 3 insertions     [DEBUG - zeitgeist.fts] Committing FTS index     [WARNING - zeitgeist.notify] Failed to deliver notification: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.      Any idea what's wrong?


title: Screenshots from multiple Xservers

text: I want to take screenshots simultaneously from multiple X servers on one desktop PC. I have multiple users logged in different terminals (`tty1`, `tty2`, `tty3`, `tty4`) who start multiple Xservers with `startx /usr/bin/openbox-session -- :1` (and `:2`, `:3`, `:4` respectively). So I can access each one of them with `Ctrl+Alt+F8`, `+F9`, `+F10`, `+F11`. There is only one monitor on that desktop. I want to take screenshots for each of these X servers, preferably with `scrot`, but I currently get a black/blank image whenever I try it. Only when I am active on that X server I get a proper screenshot. For example, if I am on `Ctrl+Alt+F8` and run `scrot test.png` I get a proper screenshot; if I understand correctly I do not have to set the `$DISPLAY`, since being on `Ctrl+Alt+F8` I get `echo $DISPLAY` > `:1`. But if I run `sleep 10; scrot test.png` and go to `Ctrl+Alt+F7`, then I get a black image. How can I get multiple screenshots from each one of those terminals simultaneously? What worked for me was `Xephyr`. The only problem with this solution seems to be that when I run extremely fast `xdotool` commands it is not as responsive as X. For future reference, what I did for every of the four users and terminals was: In `~/.profile`, I set each user to auto-login after my system boot, like:               if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then          sleep 30 # for some reason it crashes if I do not let                    # it sleep for a while, not necessarily so long.                    # I guess it has to do with my "normal" X at DISPLAY=:0 .                    # Thus for tty2 I let it sleep 40 seconds,                    # for tty3 50 seconds and so on.          startx     fi      In `~/.Xsession`, I start an Xserver/client (with blackbox) and Xephyr (with openbox) in it like:               Xephyr -fullscreen -screen 1920x1200 :11 &     exec blackbox &      sleep 3 # Perhaps sleeping is redundant.     DISPLAY=:11 /usr/bin/openbox-session      I want the "final" window manager do be `openbox-session`. I would like to use `openbox` for both the Xserver and `Xephyr`, but `exec openbox & DISPLAY=:11 /usr/bin/openbox-session` crashes, while `exec openbox & DISPLAY=:11 /usr/bin/openbox` does not. This way, the user in `:11` can take screenshot, while the monitor shows `:0`. (or `:13`, `:14`, etc.). I did not try `XVnc`, but I have the feeling that it might be slower than `Xephyr`; please correct me if I am wrong.


title: Can applications like VirtualBox run at startup without any users logging in ubuntu?

text: This question comes to mind because we are tinkering with the idea of going VM with some of our servers. KVM is a bit involved, VMWare acts like they want to be a free product, and Microsoft is just out of the question when it comes to virtualization. However, the machine is going to remote location with electrical issues long enough to surpass the capability of our UPS units. In short, **I want to be able to make phone call and tell somebody to push the power button back on and have services running again on the guest machine** without have to talk somebody through logging on (which ivolves giving user name and pw to the machine) and starting the virtual machine. **Is this possible**?


title: Moving to Solaris (from Linux)

text: I got curious about why not so many people have Solaris in their desktops and laptops. I wonder whether it's a good idea at all, or something just for the absolute geek. Could I maybe give it a try either in an open server online or through a live- cd? What difficulties would I expect to find and what version is good for beginners?


title: Can't get rEFIt to boot after install (Ubuntu + OSX on macbook pro)

text: I'm trying to dual boot Ubuntu and OSX on my macbook (`MacBookPro8,2`). As per the usual guide, I downloaded rEFIt (the .dmg) and installed it. Then I rebooted about 12 times and still always just get brought to the OSX login screen. I've never seen any rEFIt menu. Here's the output of rEFIt's partition map:               *** Report for internal hard disk ***          Current GPT partition table:      #      Start LBA      End LBA  Type      1             40       409639  EFI System (FAT)      2         409640    716757759  Unknown      3      716757760    718027295  Mac OS X Boot      4      718027296    976510983  Mac OS X HFS+          Current MBR partition table:      # A    Start LBA      End LBA  Type      1              1    976773167  ee  EFI Protective          MBR contents:      Boot Code: None          Partition at LBA 40:      Boot Code: None (Non-system disk message)      File System: FAT32      Listed in GPT as partition 1, type EFI System (FAT)          Partition at LBA 409640:      Boot Code: None      File System: Unknown      Listed in GPT as partition 2, type Unknown          Partition at LBA 716757760:      Boot Code: None      File System: HFS Extended (HFS+)      Listed in GPT as partition 3, type Mac OS X Boot          Partition at LBA 718027296:      Boot Code: None      File System: HFS Extended (HFS+)      Listed in GPT as partition 4, type Mac OS X HFS+


How can we measure that in a given period, what window was on the top? (active one) I already tried based on "wmctrl", but I can't show the currently active window.. in the second example I tried with ":ACTIVE:", it showed ALL again, but only the terminal was the active then..               $ wmctrl -l | awk '$2 != "-1"'     0x044006a3  8 notebook Mozilla Firefox     0x0456fb4c  0 notebook How to measure that how much time is the active window opened? - Unix & Linux Stack Exchange - Mozilla Firefox     0x03000004  0 notebook Terminal     $      $ wmctrl -l :ACTIVE: | awk '$2 != "-1"'     0x044006a3  8 notebook Mozilla Firefox     0x0456fb4c  0 notebook How to measure that how much time is the active window opened? - Unix & Linux Stack Exchange - Mozilla Firefox     0x03000004  0 notebook Terminal     $       Purpose: The output would be something like this (from an example 8 hour shift, so 480 minutes):               MINUTE  TASK     195 Mozilla Firefox     165 Terminal     74  Thunderbird     36  Idle (was away, machine locked, no app was on top..)     10  Unknown (the machine wasn't powered on)      With the `awk '$2 != "-1"'` I just excluded the "Bottom Expanded Edge Panel". **Question:** I only need the part that how can I show the currently active window. I can do the part where I run a script in ex.: every 10 seconds and gather the time information. p.s.: I'm using Ubuntu 12.04 or CentOS 6 both with GNOME.


title: Change Startx Default on Slackware?

text: I installed Slackware as a VM within Virtual Box. Host is Windows 7, if it matters. I have successfully installed guest additions and XFCE starts and runs cleanly with or without the guest additions. KDE however (which was set as the default for `startx`) starts well giving me the appropriate desktop at the appropriate resolution but crashes halfway during the splashscreen animation. I am not sure it is worth wrestling with it. How do I change the default for `startx` to xfce? I realize that I can always start it at the command line with `startxfce4` at the command line but I may like to change the inittab run level to 5 which would trigger KDE with it's crashes.


title: Can I resize the root partition without uninstalling and reinstalling Linux (or losing data)?

text: I have started using a machine that has both Debian and Windows 7 installed. However, after installing some programs I started getting a message that there is not enough space. I knew that the system had more than 1TB of hard disk space in total and did some research. It seems that the root partition is only 5GB. Is there any way to allocate more disk space to the specific partition without reinstalling Linux? Below you can find the results of a couple of commands that I executed:               fdisk -l          Disk /dev/sda: 640.1 GB, 640135028736 bytes     255 heads, 63 sectors/track, 77825 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x4a47e2fd             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          13      102400    7  HPFS/NTFS     Partition 1 does not end on cylinder boundary.     /dev/sda2              13       53507   429687500    7  HPFS/NTFS     Partition 2 does not end on cylinder boundary.     /dev/sda3           53507       77826   195340289    5  Extended     Partition 3 does not end on cylinder boundary.     /dev/sda5           53507       53537      243712   83  Linux     /dev/sda6           53538       77826   195095552   8e  Linux LVM          Disk /dev/sdb: 640.1 GB, 640135028736 bytes     255 heads, 63 sectors/track, 77825 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x4a47e2fe             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               2       62261   500097657+   f  W95 Ext'd (LBA)     /dev/sdb5               2       62261   500097656+   7  HPFS/NTFS          Disk /dev/dm-0: 4999 MB, 4999610368 bytes     255 heads, 63 sectors/track, 607 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/dm-0 doesn't contain a valid partition table          Disk /dev/dm-1: 1996 MB, 1996488704 bytes     255 heads, 63 sectors/track, 242 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/dm-1 doesn't contain a valid partition table          Disk /dev/dm-2: 20.0 GB, 19998441472 bytes     255 heads, 63 sectors/track, 2431 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/dm-2 doesn't contain a valid partition table      * * *               df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/HU-root   4.6G  4.4G   32M 100% /     tmpfs                 2.0G     0  2.0G   0% /lib/init/rw     udev                  2.0G  220K  2.0G   1% /dev     tmpfs                 2.0G  356K  2.0G   1% /dev/shm     /dev/sda5             231M   22M  198M  10% /boot     /dev/mapper/HU-home    19G  751M   17G   5% /home      * * * Edit (extra info based on comment):               # mount     /dev/mapper/HU-root on / type ext3 (rw,errors=remount-ro)     tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     udev on /dev type tmpfs (rw,mode=0755)     tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)     /dev/sda5 on /boot type ext3 (rw)     /dev/mapper/HU-home on /home type ext3 (rw)     fusectl on /sys/fs/fuse/connections type fusectl (rw)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)      * * *               # pvdisplay       --- Physical volume ---       PV Name               /dev/sda6       VG Name               HU       PV Size               186.06 GiB / not usable 3.00 MiB       Allocatable           yes        PE Size               4.00 MiB       Total PE              47630       Free PE               41194       Allocated PE          6436       PV UUID               wmEFAc-eSb6-r3qo-jIjy-vuKH-v9JK-eQfJFZ      * * * As a sidenote, I would also appreciate any suggestions for good books that explain these subjects in depth (file systems, how the various operating systems understand the file systems etc).


title: issue with find -exec cp

text: Consider this example (newbie alert):               touch test0     touch timestamp     touch test1     sudo find /var/www/import -iname 'test*' -newer timestamp -exec cp {} new \;      It actually copies file test1, but it returns the message:               cp: `/var/www/import/new/test1' and `new/test1' are the same file      What am I doing wrong? 2nd question, can I use "+" with this command so that files are copied in a single "bundle"? There are thousands of files!


title: vsftpd virtual user read permissions

text: I have a `vsftp` server that services a read-only public space by anonymous login. It works fine. I need to add a few specific users that will authenticate by username/password and they will have different user-specific home directories that are also read-only. I have configured virtual guest users and they can log in (authenticating via PAM). The problem that I have is that these users can only access world- readable files. I don't want to make the files world-readable - they are all owned and accessible by the `nobody` user and they have no group or world permissions. I have configured `vsftp` so that it runs as `nobody` and so that the guest user name is `nobody` - I would have expected that this meant all guests were 'nobody' and should therefore be able to read files accessible to `nobody`. The configuration that I added for virtual users is below                # Specific users      local_enable=YES      guest_enable=YES      guest_username=nobody      user_sub_token=$USER      local_root=/srv/backup/$USER      pam_service_name=vsftpd      allow_writeable_chroot=YES      An example home directory (listed from the filesystem):               drwx------ 2 nobody nobody 4096 May 15 12:09 a_directory     drwx------ 5 nobody nobody 4096 May  7 12:07 another_directory     -rw------- 1 nobody nobody  95744 May  4 17:07 FILE.txt     -rw------- 1 nobody nobody 104502 Apr 22 17:14 another_file      How do I configure `vsftp` so that virtual users can see the files in their directories ?


title: Cannot get rc.local to automatically run at all

text: so I've been trying to get the `/etc/rc.local` script to run, and for the life of me, nothing seems to work. I can run it manually by using `service rc.local start`, and it just echos 'hi' to a file in my home directory, but on reboot it does not run. All the correct permissions seem to be set and links exist in the correct rc#.d directories. For reference, here is the relevant information:               # ls -l /etc/rc.local     -rwxr-xr-x 1 root root 45 Apr 12 21:10 /etc/rc.local               # ls -l /etc/init.d/rc.local                                       -rwxr-xr-x 1 root root 812 Apr 12 21:00 /etc/init.d/rc.local               # for i in {0..6}; do cd rc$i.d ; pwd; ls -l |grep rc.local; cd ..; done     /etc/rc0.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 K20rc.local -> ../init.d/rc.local     /etc/rc1.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 K20rc.local -> ../init.d/rc.local     /etc/rc2.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 S20rc.local -> ../init.d/rc.local     /etc/rc3.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 S20rc.local -> ../init.d/rc.local     /etc/rc4.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 S20rc.local -> ../init.d/rc.local     /etc/rc5.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 S20rc.local -> ../init.d/rc.local     /etc/rc6.d     lrwxrwxrwx 1 root root  18 Apr 12 20:53 K20rc.local -> ../init.d/rc.local               # cat /etc/rc.local     #! /bin/bash          echo hi > ~user/test          exit 0      I've tried deleting both `/etc/rc.local` and `/etc/init.d/rc.local`, running `update-rc.d rc.local remove`, then restoring them and running `update-rc.d rc.local defaults` like in this question: Rc.local does not execute. That did not work. It also does not work after reboot or entering any init level. It did not work when the shebang line read `#! /bin/sh -e` or `#! /bin/bash`. If I run it manually I can get both the `/etc/rc.local` and `/etc/init.d/rc.local` scripts to echo to different files, though. So my question is...what am I doing wrong and how can I get rc.local to run? Also, while I don't mind hearing about alternatives (like upstart), I will only accept an answer that shows me (or helps me find) how to get rc.local to run normally (and ideally tells me what went wrong). Here's some additional info for what it's worth:               # dmesg | grep "Linux version"     [    0.000000] Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 (Ubuntu 3.5.0-17.28-generic 3.5.5)               # cat /proc/version     Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012          # lsb_release -a     No LSB modules are available.     Distributor ID: LinuxMint     Description:    Linux Mint 14 Nadia     Release:        14     Codename:       nadia


title: Needs help on setting up kernel keyboard mapping

text: I already got the keycode from kernel, but `acpi_listen` won't recognize it in Arch Linux:               # /usr/lib/udev/keymap -i /dev/input/by-path/platform-thinkpad_acpi-event     Press ESC to finish, or Control-C if this device is not your primary keyboard     scan code: 0x1A    key code: micmute      Now I try to map the key by:               # /usr/lib/udev/keymap /dev/input/by-path/platform-thinkpad_acpi-event 0x01a micmute     setting scanode 0x1A to key code 248      But `acpi_listen` still got no output here. How should I make `acpi_listen` recognize it? **UPDATE2** Well , evdev driver doesn't seem to recognize this , I heard someone saying that xorg won't route key event number that went beyond the limit.. It has to be solved as a acpi event , but don't know how **UPDATE** Seems to be complicated,               $ xmodmap -e 'keycode 248 = XF86MicMute NoSymbol XF86MicMute'     xmodmap:  commandline:1:  bad keysym name 'XF86MicMute' in keysym list     xmodmap:  commandline:1:  bad keysym name 'XF86MicMute' in keysym list     xmodmap:  2 errors encountered, aborting.


title: Run in root shell from within a user bash script

text: I have a script that , among other things, needs to do some stuff as root, like creating a mount folder. I tried:               echo "Linux user password is needed in order to ..."     sudo -s     # also tried:     # sudo su     ... code that requires root permission     exit     ... code that requires user permission      The problem is that the script stops after the "sudo -s" and continues only after I manually exit the automatically created root shell. **Is there a way to run root shell commands within a user script?** Thanks.


title: How do I check if a distribution is Fedora-based?

text: The Python M2Crypto library requires a slightly different installation command if the Linux distribution is Fedora-core based (e.g., Fedora, RHEL, CentOS, Scientific Linux). Is there a way to check if a distribution is Fedora-Core based, so I can write a script to execute the correct install command depending on the distribution?


title: Is Oracle Solaris UNIX?

text: Is Oracle Solaris officially declared UNIX? I want to know all the official UNIX presently available in the market (whether free or paid). Please correct me if I am wrong: To the best of my knowledge, an operating system must satisfy all the terms and conditions as laid by the owners of "UNIX", The Open Group, to be coined as UNIX. Linux is an UNIX-like kernel almost resembling UNIX but still open-source and free to distribute.


title: Why does CentOS not have an NTP drift file?

text: It seems that CentOS does not have a `ntp.drift` or similar file. In `/etc/ntp.conf`, it says that you can use `/var/lib/ntp/drift` as a drift file but this file does not exist. Does CentOS does not consider drifting? Or does it let the user adjust if necessary? Or does it use another mechanism?


title: How to set up a blacklist for insmod?

text: I want to block a certain driver module from loading in the linux kernel. So I created a file in /etc/modprobe.d/cdc_acm.conf. In this file I added the following line:               install cdc_acm /bin/false      This works as expected when issuing:               modprobe cdc-acm          libkmod: ERROR libkmod/libkmod-module.c:924     command_do: Error running install command for cdc_acm ERROR: could not     insert 'cdc_acm': Operation not permitted      The problem is that when I use the insmod utility the module is loaded:               insmod cdc-acm.ko          [ 1051.914578] cdc_acm 2-1.1:1.0:     usb_probe_interface [ 1051.919437] cdc_acm 2-1.1:1.0:     usb_probe_interface - got id [ 1051.926323] cdc_acm 2-1.1:1.0:     ttyACM0: USB ACM device [ 1051.934700] usbcore: registered new     interface driver cdc_acm [ 1051.941315] cdc_acm: USB Abstract Control     Model driver for USB modems and ISDN adapters      Why is this happening is there a way to create a blacklist file for insmod ?


title: Gimp core dumped

text: I'm on ArchLinux, Gimp is updated (already tried to uninstall and re-install) but when I run it I get (after 6 seconds):               Bus error (core dumped)      I don't understand what it could be... Googling it reveals almost nothing. Any suggestions?


title: What is the most portable method of launching a terminal emulator?

text: Say I need to write a script that will launch a terminal and execute a command and I need that to work on various systems. How can I do that in a safe and portable manner? Is `xterm` always installed? I assume that any *nix with a GUI must have some terminal emulator. How can I get to it? Debian systems have `x-terminal- emulator` but that, apparently, does not even work in Red Hat, let alone non- Linux *nixes.


title: Choose a terminal emulator from Java

text: I am writing a platform independent Java console tool and within which will have to execute some commands in separate independent terminal at runtime. However, I need to know which terminal should I be using gnome-terminal or xterm. i.e. the one available on that particular system. Since there are many different linux variants are available. I want to support at least the most obvious ones. Normally in Java `System.getProperty("os.name")` returns `Linux` but it doesn't tell you if its Ubuntu or any other Linux varient. So It is difficult to know which terminal to start at runtime. Whether gnome-terminal or xterm or if there is anything else as well that I don't know. Working sets: In Windows:               cmd /c start java -jar jarTool arguments      In Ubuntu:               gnome-terminal --execute java -jar jarTool arguments      or               xterm -e java -jar jarTool arguments      Also just for additional information,I am using `Runtime.getRuntime().exec(args or commands)` to start terminal from Java program at runtime.


title: How to recover a shell after a disconnection

text: Am doing some work on a remote centos 5.6 machine and my network keeps dropping. Is there a way i can recover my hung sessions after i reconnect? EDIT: am doing some updating and installing with yum and am worried this might be a problem is processes keep hanging in the middle of whatever theyre doing


title: Linux, printing specific parts of a text document

text: I want to print, for each line of a given document, the ﬁrst names and the ages of people (which are entries of the document). What linux command would I use? Hopefully based around grep using a regex pattern. Example of input document:               Linda:F:Las Vegas, USA:18:telnet       Steve:M:Leipzig, Germany:33:ftp     Henry:M:Milan, Italy:19:sftp      Alice:F:Izmir, Turkey:32:pop3s     Robert:M:Verona, Italy:21:scp     Olga:F:Gorontalo, Indonesia:19:pop3s     Kimberly:F:Lille, France:25:ping     Henry:M:Oslo, Norway:26:ftp     Carol:F:New Delhi, India:23:pop3s     Thomas:M:New Delhi, India:32:http


title: SD card corrupt and stuck at 32MB, any way to fix it?

text: Using the Linux area since I'm using Linux apps and utilities. My phone crashed (several times) and managed to corrupt my microSD card. It no longer appears to have partitions and shows as 32MB rather than 2GB. That's using testdisk. dd and ddrescue only pulled 30.6MB of null off of it. It isn't a fake, SanDisk branded, purchased from a reputable retailer, and the space has been working perfectly for a year. I expect it's had it, but I didn't see the harm in asking. Even if I forget about the few files I'd like off of it, formatting will probably leave me with a fairly useless 32MB card. If anyone has any method of at least repairing the card, it would be much appreciated.