title: Why doesn't WPA handshake occur?

text: [root@notebook /opt/aircrack-ng] dmesg -C     [root@notebook /opt/aircrack-ng] aireplay-ng --test wlan0     ioctl(SIOCSIWMODE) failed: Device or resource busy          ARP linktype is set to 1 (Ethernet) - expected ARPHRD_IEEE80211,     ARPHRD_IEEE80211_FULL or ARPHRD_IEEE80211_PRISM instead.  Make     sure RFMON is enabled: run 'airmon-ng start wlan0 <#>'     Sysfs injection support was not found either.          [root@notebook /opt/aircrack-ng] dmesg     [37950.649811] wlan0: deauthenticating from 92:f6:52:f5:aa:d9 by local choice (reason=3)     [37950.664362] cfg80211: All devices are disconnected, going to restore regulatory settings     [37950.664371] cfg80211: Restoring regulatory settings     [37950.664697] cfg80211: Calling CRDA to update world regulatory domain     [37950.672526] cfg80211: Ignoring regulatory request Set by core since the driver uses its own custom regulatory domain     [37950.672531] cfg80211: World regulatory domain updated:     [37950.672533] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)     [37950.672536] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     [37950.672539] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)     [37950.672541] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)     [37950.672543] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     [37950.672546] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     [root@notebook /opt/aircrack-ng]       I alread did               airmon-ng start wlan0      **My question** : since the test failed, I never get a "WPA handshake" when using "airodump-ng". What am I missing? I'm using Ubuntu 12.04. How can I succeed at the test and make a WPA handshake? Using other driver? I tried two wireless cards: an USB stick: "050d:705e" and a built-in "Intel Corporation Centrino Advanced-N 6200 (rev 35)" UPDATE: there isn't any dmesg messages when using: airodump-ng


title: Insert Unicode Characters at Console Login

text: My password contains "special" characters like `ü`. How can I login at the console (no `X` running) when the default keyboard layout does not provide these characters? Or, differently put: how can I insert arbitrary Unicode characters at the login prompt? My box runs Debian 6.


title: how to install .git file?

text: I know this has been covered everywhere, but I still don't get it. I `apt-get install git-core`. I'm trying to install websocketcpp here https://github.com/zaphoyd/websocketpp. I `wget https://github.com/zaphoyd/websocketpp.git`. I have no idea what to do next. Please help. (I've read http://stackoverflow.com/questions/315911/git-for-beginners-the- definitive-practical-guide and http://www.thegeekstuff.com/2011/08/git- install-configure/, but I'm obviously missing something)


title: Loading input from a file in lex

text: First of all, I was not sure whether to post this question here or on stackoverflow, but here's my question anyway. Besides using `input redirection`, i.e. `./code < inputFile.dat`, is there any way I can load my data file into a program written in `lex`? Basically, here's how I would like to be able to load my data: `./code inputFile.dat` Is there any way I can do that?


title: Sometimes I have no picture on the screen at boot on my laptop

text: I never gave much importance because this happened to me too from time to time. What looked like a minor issue, but now I take this phenomenon has become very annoying indeed. I do not know how to begin to debug the problem ... any ideas? May well reach a solution. ## [UPDATE] Will try to explain my self a little better; When I turn on the notebook, the load grub ok. After that, will I notice when I go to see the welcome screen only when if I see for a split of a second _"creating node with uuid"_ If you do not see it means that I will see the black screen, but I notice that the disk is still working. ## [DETAILS] My laptop is a `Acer Aspire 5253-0435` with 3gb of ram. Video is `AMD Radeon HD 6320`.                # lspci | grep VGA     00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Wrestler [Radeon HD 6320]      My OS is `Opensuse 12.2` my filesystem is reiserfs.


title: Write out without quitting in Vim?

text: I looked through the `vim` manual, and I could only find the commands for "write and quit" and "write (if edited) and quit". Is there a command for "write out without quitting", similar to `^o` in `nano`?


title: How do I write a script to keep retrying Yum Update Program?

text: My job let me always release a new version of the program to a satellite server, then in the running server, I use `yum update program` to update the program. However, due to unknown reason, in most of times, even if I upload the program to the satellite server, `yum update program` can't get the update soon. I always have to wait, keep retrying, etc. So anyone can tell me how to write a script, so   1. it keeps retrying `yum update program` if no update available   2. if update is available, then the update in yum is forced   3. after successful update, the script quits. Thanks


title: Can two application share library loaded at runtime?

text: I have 2 application lets say A1 ,A2 shared one shared object(lets say lib1) which loaded in application at runtime. A1 load lib1 using dlopen successfully. Now A2 wants to load library. Can A2?(as lib1 loaded in A1 address space). What if A1 load using RTLD_LOCAL. Can A2 load lib? I am new in this field please give me directions


title: How do I keep 'indent' from moving curly braces to the next line?

text: I have several empty inline function definitions in C++ like so:               class C     {         void foo(){}         void bar(){}     };      now if I run `indent -st -i4 -nut test.cc` in order to just fix the indentation I get               class C     {         void foo ()         {         }         void bar ()         {         }     };      But I just want to fix the indentation without moving curly braces around! How can I achieve that?


title: boot labels and sectors

text: Two of my disks have a boot label. How can I find from which disk my system (Debian Sid) booting? How can I find whether the boot sector is in the Master Boot Sector or in a Volume Boot Sector (at the beginning of the first disk partition)? How can I move Boot Sectors from one disk to another?


title: Installing shared library - questions and problems

text: I'm having trouble "installing" a shared library I download online. The library name is run time access (http://www.runtimeaccess.com/). In the quick start guide, they explain how to use the library using -L when compiling to define the library location and exporting the LD_LIBRARY_PATH env variable after adding the path of the library dir. First of all why do you need to define the lib location twice? using -L and LD_Library_PATH env variable? Second part. I'm trying to avoid passing these arguments and also avoiding modification of the LD_LIBRARY_PATH env, so all I have to do is compile like so:               $ gcc myapp.c -lrtadb      so I would like to include the lib as part of the system lib. So I copied the whole `rta-0.8.1` folder to `/usr/local/lib/rta-0.8.1` and then add a `/etc/ld.conf.d/rtadb.conf` file containing the path of the library directory `/usr/local/lib/rta-0.8.1/src` in there.               $ cat /etc/ld.so.conf.d/rtadb.conf      #rta (run time access) lib     /usr/local/lib/rta-0.8.1/src      and then I ran `sudo ldconfig` to update the shared library list - but no luck. When I try to compile my code, the library is not found:               $gcc myappdb.c -lrtadb     /usr/bin/ld: cannot find -lrtadb     collect2: ld returned 1 exit status      What am I doing wrong here? here is the list of files in /usr/local/lib/rta-0.8.1/src               user@ubuntu:/usr/local/lib/rta-0.8.1/src$ ls -l     total 724     -rw-r--r-- 1 root root  24994 2012-11-14 10:49 api.c     -rw-r--r-- 1 root root  26132 2012-11-14 11:07 api.o     -rw-r--r-- 1 root root  62634 2012-11-14 10:49 do_sql.c     -rw-r--r-- 1 root root   5419 2012-11-14 10:49 do_sql.h     -rw-r--r-- 1 root root  41184 2012-11-14 11:07 do_sql.o     -rw-r--r-- 1 root root 149186 2012-11-14 11:07 librtadb.a     lrwxrwxrwx 1 root root     15 2012-11-14 11:07 librtadb.so -> librtadb.so.3.0     lrwxrwxrwx 1 root root     15 2012-11-14 11:07 librtadb.so.3 -> librtadb.so.3.0     -rwxr-xr-x 1 root root 117749 2012-11-14 11:07 librtadb.so.3.0     -rw-r--r-- 1 root root   2387 2012-11-14 10:49 Makefile     -rw-r--r-- 1 root root  10962 2012-11-14 11:07 parse.output     -rw-r--r-- 1 root root  21929 2012-11-14 11:07 parse.tab.c     -rw-r--r-- 1 root root    425 2012-11-14 11:07 parse.tab.h     -rw-r--r-- 1 root root  25064 2012-11-14 11:07 parse.tab.o     -rw-r--r-- 1 root root   6711 2012-11-14 10:49 parse.y     -rw-r--r-- 1 root root  46636 2012-11-14 10:49 rta.h     -rw-r--r-- 1 root root  31551 2012-11-14 10:49 rtatables.c     -rw-r--r-- 1 root root  17028 2012-11-14 11:07 rtatables.o     -rw-r--r-- 1 root root  58843 2012-11-14 11:07 token.c     -rw-r--r-- 1 root root   6291 2012-11-14 10:49 token.l     -rw-r--r-- 1 root root  37996 2012-11-14 11:07 token.o      btw, I'm running Ubuntu 10.04 LTS thank you. edit: if your new to this info read link below: http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html


title: uploading from Netbeans to remote CentOS server failed

text: I have a php web application on Netbeans on my Ubuntu , and server is CentOS on a virtualBox . Suddenly uploading to server stopped and I'm getting these errors for non-root user : > >     Failed: >     file      backup_restore.php                Cannot upload file > backup_restore.php (unknown reason). >     file      jq/ajax.js                        Cannot upload file ajax.js > (unknown reason). >     file      login.php                         Cannot upload file login.php > (unknown reason). >     file      templates/backup_restore.html     Reason: Cannot change to the > remote directory /. >   I checked SELinux and it's disabled , I also tried to make a new project folder but It didn't help ! Does anyone know what is this problem ?


title: repairing a damaged grub with centos

text: I have a damaged grub in my centos system. to repairing this problem, I use rescue mode and then I execute this follwing comand :               chroot /mnt/sysimage          grub-install /dev/mapper/ddf1OSp3          and then reboot ;      when boot from hard disk, it's sshow error message "file not found" when I execute the same comand in grub.conf under grub CMD, it s work fine and the file existe !! how to proceed to resolve this problem information about system : linux kernel 2.6. repartition of disk:               $ df          /dev/mapper/ddf1OSp3    /          /dev/mapper/ddf1OSp1    /boot          /dev/sdd1               /data          tmpfs                   /dev/shm


title: Where is fsck startet for the root filesystem at boot?

text: I want to extend an existing **Debian 6.0** system so that it is able to automatically fix a corrupt root file system by restoring a separate image. That process should start automatically instead of the typical               UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY      error message (so that the machine can be left unattended). I was expecting that some script in `initrd.img` is responsible for checking the root fs (and handling error cases like the one above), but I can't find it. Is that job perhaps done by the Kernel itself or the boot loader (GRUB in this case) ? (I'm using `initramfs`)


title: sox: splitting audio on silence but leaving tails

text: I love how sox has the ability to split an audio file on silence. The issue I'm haivng is that occasionally my audio tracks end with fadeouts, or notes decaying into reverb (subtle sounds that sox will mistake for silence). I'm trying to adjust the sox command to split the tracks on silence, but LEAVE a LITTLE silence after each split. I can't figure out exactly how to do it. here's the command I have so far:               sox in.wav out.wav silence 1 2 0.5% 1 4.0 0.9% : newfile : restart      Any help with this would be greatly appreciated!


title: Log number of keyboard hits

text: How can I log a keyboard hit via shell script? My aim is to log the number of keyboard hits of a login session on my Ubuntu system. Note: I do not want to log the keystrokes itself, only the number of hits. So in the end it says:               94853 hits today.


title: Zipping files two by two

text: I have a directory that has 800 files like this:               file1.png     file1@2x.png          file2.png     file2@2x.png          file3.png     file3@2x.png          ... etc      I need to create zip files like this               file1.zip (containing file1.png and file1@2x.png)     file2.zip (containing file2.png and file2@2x.png)     file3.zip (containing file3.png and file3@2x.png)      Is there a magic command I can use to do that?


title: Default printing options in KDE 4 dialog

text: How can I set default printing options, so that they are always pre-populated in the KDE 4 print dialog window (when printing from Ocular for example)? EDIT: In particular I would like to set duplex printing and printing colour as grey to be default parameters.


title: Have backticks (i.e. `cmd`) in *sh shells been deprecated?

text: I've seen this comment many times on Unix & Linux as well as on other sites that use the phrasing "backticks have been deprecated", with respect to shells such as Bash & Zsh. Is this statement true or false?


title: NFS Automatic Fail-over or Load-balanced or Clustering?

text: I've been using `NFS` _(and it is the only one i know well in Network Files)_ for a few years. But still can not able to find out ..   * How to make `NFS` Servers in Clustered Design (or Load-balanced?)   * Or at least to having it deployed on MORE-THEN-ONE Server and to "Automatic Failover". * * * The major objective is to NOT TO let my single running NFS Server a Single- point-of-Failure. * * * Since i do not know how to make it properly, so far i have invented on my own is:   1. NFS on 2 Servers.   2. RSYNC from 1st (assumed Master) Server to another 2nd Server.   3. From Application (Web, etc) Servers, put a `Shell Script` to check the healthy state of NSF-Master Server Mount Point. And then if need, auto-unmount from it (leaving) and then auto-mount from 2nd one.   4. The main function i used in my automatic Shell Script, is `nfsstat -m` .. to check the health of mount point. _(I'm using **Redhat** )_ But anyway, i still DO NOT think it is the safe & standard way. Please kindly suggest the best ways as in something like _Industrial Standard_ if there are.


title: How to copy 5 newest files from one directory to another and delete the old copies

text: How can I copy the 5 newest files from a directory to another in a "new to old" order.


title: Blank lines of unknown origin when running vim after tput clear

text: I have a rather bizarre issue with terminal behaviour. If I execute `tput clear` to clear the screen, my cursor (as expected) goes to the top of the terminal. If I run `vi` after that (`vim` actually), when it exits there are some blank lines before the next prompt. When I do that normally, the prompt simply shows up at the next line. The following shows a transcript after `tput clear` and running `vi` twice (simply exiting each time):               +--------------------------+     |pax> vi                   |     |                          |     |                          |     |                          |     |pax> vi                   |     |pax>                      |     :                          :     +--------------------------+      As you can see, the first execution left three blank lines between the prompts, the second left none. Other terminal manipulation style programs like `less` don't exhibit this behaviour. There's nothing the least bit suspicious in my `PS1` prompt variable, it's simply set to `"pax> "` with absolutely no funny characters or escape sequences. What could be causing it? Environment: running Debian 7.3 (from `/etc/debian_version`), vim 7.3 (from `vim --version`), Gnome Terminal 3.4.1.1 (from `gnome-terminal --version`), `uname -a` output of:               Linux paxbox01 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux


title: Finding function parameters for functions in shared object libraries

text: I am currently fiddling around with some c libraries without documentation. I am wondering if it is at all possible to retrieve more metadata, such as parameters and return values, outside of what is provided by calling `nm -D` or `objdump -T filename | grep text`. I'm not sure if this is possible, but if it is, it saves me from hunting down whoever was in charge of the library! Edit: I'd like to be able to do this without reading machine code if possible. It appears that there are some solutions that allow me to do so easily if I was an expert at machine code, but since I am not and do not have the current desire to jump down that rabbit hole, I'm really hoping there is another way.


title: Command-line editing and wrapping

text: When entering long queries into the command-line `psql`, my terminal[1] is not wrapping the input line correctly. Additional charactes wrap back to the left of the screen, but on the same line as the existing text, and further editing is difficult. How can I enable multi-line editing in `psql`? Mutli-line editing in bash via SSH wraps correcty, so this is related to `psql` specifically. For reference:               $ psql --version     psql (PostgreSQL) 8.4.21     contains support for command-line editing      This is unrelated to using screen/byobu? When I launch `psql` outside of screen/byobu. it displays multi-line inputs somewhat better (they now span multiple lines), but editing is still not possible due to incorrect positioning of the cursor. I experienced similar difficulties editing long input lines when using iTerm2 with and without screen/byobu. In both cases, the terminals were set to default value for emulation (xterm-256color). I experienced the same difficulties using xfce4-terminal in Xubuntu in a VirtualBox. I experienced the same difficulties using PuTTY from a Microsoft Windows Vista computer. Has `psql` ever handled multi-line editing correclty? I've used it for years and have never experienced this difficuty before ... [1] Terminal.app in Apple Mac OS X Mavericks, with a secure shell session to an Ubuntu server running bash.


title: BSD Kernel Vs. Linux kernel?

text: I wanted to know in technical terms; what is the difference between `BSD Kernel` and `Linux Kernel`.   In Linux, we can download the source kernel then `patch` it and `make` and `make modules` it. Even we have multiple tools to edit the kernel `config` such as `menuconfig`, `xconfig` and ... .   But I couldn't find such kinda vast field on BSD. First, Could I download the `BSD kernel`? How could I config it? and ... So what am I asking is: (Without referring to ancestry and etymology)   * Is the `Kernel` in each case (in)dependent of a distribution?   * Ways to config Each `Kernel` and tools available for the job?   * Whether any Patch work could be done in each case?   * Availability of the `kernel` outside the realm of distribution? (`Kernel Sources`)?   * Flavour of `Kernels` available in each case (`X??BSD`/`Linux`) Like `XEN/Vmware/GEN`?


title: what does a "deleted file" entry look like in the journal

text: I hope I've got this right: A file's `inode` contains data such as inode number, time of last modification, ownership etc. - and also the entry: » ** _deletion time_** «. Which made me curious:   _Deleting_ a file means removing it's inode **number** , thus marking the storage space linked to it as available. There are tools to recover (accidentally) deleted files (e.g. from a journal, if available). And I know the `stat` command. ## Question **What does a "deleted file" entry look like in the journal?** My guess is a quite unspectacular looking output as such as if issued the `stat`'s command`. I know that deleting a file and trying to recover it would be a first-hand experience, but then I'm not at a point where I could do this without outside help and I want to understand exactly what I'm doing. Getting into data resurrection would be sidetracking for me at the moment, as I try to get a firm grip on the basic stuff … I'm not lazy, this isn't homework, this is for private study.


title: Amazon EC2 micro instance large number of IO requests

text: I'm trying to understand why I have a huge number of EBS IO request on my Amazon EC2 micro instance. I launched the instance roughly 6 days ago and has racked up over 4 million IO requests so far. The instance came pre-loaded with a LAMP stack (Virtualmin, PHP, Apache, MySQL). I installed one Wordpress site and only loaded it in a browser a few times to do some testing. Can anyone guide me on how to determine what is generating all these IO requests possibly using `iotop` or some other Linux utility?


title: Backup 'empty' parts of disk drive

text: I have a USB drive which has around 7MB of 'empty' space at its beginning. The first partition in MBR starts at 8225kB, according to Parted. How can I back up this space using something like `dd`? I've already backed up the MBR table using `dd if=/dev/sdX bs=512 count=1 of=device.mbr`. How can I give dd a byte range in the disk to grab and then write that locally to a file on disk?


title: How does the kernel know which file descriptor to write data to after fork() in a concurrent server?

text: Basic concurrent client/server architecture: There's a main loop listening for requests on a port (for example 3000), after accepting the connection the server spawns a child process that ends up having access to file descriptors where data can be read. If we have multiple clients connected to the server, the server will have a child process per request. So S1 (child server process) reads data from C1 (a client), S2 reads from C2 and so on. My question is how is it possible that all clients (C1, C2...) are sending information to the same port (3000) and yet the server processes (S1, S2...) are reading only the information sent from the client assigned to them? Where is the multiplexing being done and how?


title: How to renumber GPT partitions on an umounted disk?

text: I tried to sort (renumber) partitions on `/dev/sdb` via terminal, using `gdisk` from the operating system (running on `/dev/sda`) and none of the `sdb` partitions mounted but the only option I get is `[-l]` which lists options the option I'm trying to use.               root@arch-bill /home/bill # lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk      |-sda1   8:1    0  15.6G  0 part /     |-sda2   8:2    0 915.9G  0 part /home     `-sda3   8:3    0     2M  0 part      sdb      8:16   0   1.8T  0 disk      |-sdb1   8:17   0     2M  0 part      |-sdb2   8:18   0     4G  0 part      |-sdb3   8:19   0    16G  0 part      |-sdb4   8:20   0    60G  0 part      `-sdb6   8:22   0   1.8T  0 part      sr0     11:0    1  1024M  0 rom       root@arch-bill /home/bill # blkid     /dev/sdb1: PARTUUID="c1073e4b-fc00-4f02-8b81-6f17b8a188c4"      /dev/sdb2: LABEL="var" UUID="62921c0a-5d34-464d-8a7a-2ff46ad8f12b" TYPE="ext4" PARTUUID="c350316a-0bd8-4e82-8597-123553977f99"      /dev/sdb3: LABEL="rootbkp" UUID="c245c20e-d503-4b61-aaaf-060aae1b21d4" TYPE="ext4" PARTUUID="b1f391db-de37-479c-8b44-ff27f3bd6aa5"      /dev/sdb4: LABEL="snapster" UUID="8fef4e0a-efd4-455b-b484-83bd4500161f" TYPE="ext4" PARTUUID="02801cd9-3fe5-4814-9b92-c4c83b86173d"      /dev/sdb6: LABEL="homebkp" UUID="51d73ac7-fd96-4ac1-b4f3-4abf6bc4936b" TYPE="ext4" PARTUUID="481ae7d0-228f-4979-8949-befbd498534b"      /dev/sda1: UUID="91865df2-0841-42f5-80f3-a5133976e70f" TYPE="ext4" PARTUUID="48dc34cb-e791-4838-b9f2-2fe2b2cced33"      /dev/sda2: UUID="e5743a89-13ed-4c96-b39d-78cb6478fb72" TYPE="ext4" PARTUUID="4156cbf2-2a2d-47ae-87cf-99c14cf8f2c2"      /dev/sda3: PARTUUID="8669392a-663e-4e15-bc63-a6a5e95c97ad"           root@arch-bill /home/bill # gdisk -s /dev/sdb     GPT fdisk (gdisk) version 0.8.10          Usage: gdisk [-l] device_file     1      root@arch-bill /home/bill # gdisk -l /dev/sdb                                                                                :(     GPT fdisk (gdisk) version 0.8.10          Partition table scan:       MBR: protective       BSD: not present       APM: not present       GPT: present          Found valid GPT with protective MBR; using GPT.     Disk /dev/sdb: 3907029168 sectors, 1.8 TiB     Logical sector size: 512 bytes     Disk identifier (GUID): 0645408C-0374-4357-8663-D2A3512E07BD     Partition table holds up to 128 entries     First usable sector is 34, last usable sector is 3907029134     Partitions will be aligned on 2048-sector boundaries     Total free space is 4204653 sectors (2.0 GiB)          Number  Start (sector)    End (sector)  Size       Code  Name        1            2048            6143   2.0 MiB     EF02          2            8192         8396799   4.0 GiB     0700          3         8398848        41953279   16.0 GiB    0700          4        41955328       167786495   60.0 GiB    0700          6       167788544      3902834687   1.7 TiB     0700       1 root@arch-bill /home/bill #


title: How to tell aptitude to automatically install missing packages instead of removing ones to statisfy dependencies?

text: I'm creating a live CD with Skype using live-build. During the build process I run the following script:               # Download the Skype package suitable for Squeeze     wget --continue -O skype-install.deb \         http://download.skype.com/linux/skype-debian_4.0.0.7-1_i386.deb     # Install the package.     dpkg -i --force-architecture --no-debsig skype-install.deb || true     # Fix missing dependencies     aptitude -f install      The problem is that `aptitude -f install` suggest to remove Skype instead of installing the missing libraries. I have to tell it interactively to prefer the second solution. Can I tell somehow on the command line? Ideally I'd like to run it unattended like               aptitude -y --some-flag-to-ensure-no-removals -f install


title: Use a keyboard shortcut to switch between synergy-"ized" monitors/windows

text: Is it possible to map a command to my keyboard so that I can switch between my various windows? I checked on the synergy website but was not able to find very much about the subject. I'm trying to be able to essentially alt+tab and cycle through all the applications I have running on all my computers. It's not necessary that all windows show up on the main screen but I'd like to be able to shift focus to a different window without having to move my mouse.


title: Open a directory and let it update itself using "tail -f"

text: Similar to my last question: Open a text file and let it update itself; is there a way I could do the same but for a folder instead? As I have a log folder, can I use `tail -f` with a folder? i.e.               $ tail -f /tmp/logs/      I know that this won't work, but is there an alternative? I am using RHEL 5.10


title: Multiple PHP Versions / cPanel with mod_fcgid

text: I'm trying to get multiple PHP versions working on a cPanel server which was compiled with mod_fcgid and PHP 5.3. Below is the PHP config generated by cPanel.               AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml      I did compiled PHP 5.2 from source and placed it's files under /usr/local/php52 then created a wrapper as below;               #!/bin/sh          exec /usr/local/php52/bin/php-cgi      Then added the below to Apache's PHP configuration file.               AddHandler fcgid-script-php52 .php52     FCGIWrapper /usr/local/cpanel/cgi-sys/php52 .php52      I am not sure if this is the correct approach for this. Now what I wonder is how I can have a specific account to utilize this wrapper instead of default one?


title: Scaling issues of i7 3520M with intel_pstate module on Kernel 3.10.0

text: Few days ago I updated my openSUSE 12.3 system from Kernel 3.9.8-1.gf3348a8-desktop to 3.10.0-1.g3dcd746-desktop and since then, turbo mode of my i7 3520M is enabled by default and it does not throttle down when idle. It is constantly running at 3.6GHz. The `intel_pstate` module is enabled by default, thus any userspace settings are ignored (as intended). Tools such as cpufreq or cpupower are not installed any more on my machine. Booting the 3.9.8 Kernel still shows its old behaviour, that the CPU is throttling as expected. In addition, adding `intel_pstate=disable` to the kernel command line deactivates the intel_pstate module resulting in the desired behaviour of a throttling CPU. Another point of minor interest is, that I'm not able to trigger the turbo mode of my CPU if it is throttling (i.e. Kernel 3.9.8 or disabled intel_pstate). Any help is appreciated.


title: Are layer 2 protocols part of NIC or NIC's device driver at kernel?

text: 1. Are layer 2 protocols like IEEE 802.2 (LLC), PPP, HDLC, frame relay, etc part of NIC or NIC's device driver at kernel?   2. When we configure layer 2 protocol to be used like PPP, where is the configuration file stored? The only thing I am quite sure is IEEE 802.3 has to be part of NIC because it controls the transceiver (transmit/receive) activity on the medium/media.


title: Fault injection into a specific function

text: I want a tool for fault injection in linux C code programs (currently I'm trying to inject faults on Gedit). I want to corrupt function return values, like a bit flip into the binary representation, corrupt internal values, internal comparisons, but without the need to modify the code manually and recompile the program again. I want it in execution time.


title: Pip install - CPU you selected does not support x86-64 instruction set

text: I'm trying to use `pip install mysql-python` inside a virtualenv container and am getting the error               building '_mysql' extension          gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1          _mysql.c:1:0: error: CPU you selected does not support x86-64 instruction set          error: command 'gcc' failed with exit status 1      Why is gcc trying to use `-march=i686` when I'm on a 64-bit system and using a 64-bit version of Python?


title: How to execute changes on remote server as root?

text: I'm wondering if there is a way to execute a script/commands from the the local machine without making any modifications as root on the remote machine? **Some background** I'm trying to setup some tasks via Capistrano and I require `sudo` access. There are about 30+ servers and for me to manually update `/etc/sudoers` will be painful so I was wondering if there is a method to update this file remotely?


title: How can I learn some advanced logrotate techniques?

text: The `logrotate` section in the Linux administrator's handbook is very brief. The `man` page is ok but lacks examples. Where can I find some more comprehensive information, examples, and best-practice information for this command?


title: Is file /etc/vfstab Solaris specific?

text: Is file /etc/vfstab Solaris specific. I mean it only exists in SunOS/Solaris and there is no such file in other UNIX-es/Linux/*BSD.


title: Ubuntu Server Continuously "goes to sleep"

text: I am running a web server at home using Ubuntu 11.4 (maybe? I can't 100% recall) on an older AMD 2400+ desktop with 1 or 2 GB of RAM. Sorry I can't recall the details 100%. Anyway, I have a KVM hooked up to a monitor and PS2 keyboard that I use to switch between the server and my iMac (The keyboard is only hooked up so I can switch between the two easily. Many times a week, Pingdom will tell me the server is down and I can't hit the server. When I get home (it rarely happens when I am home), I hit the Ctrl key twice to switch to the server, hit the space bar and everything is now up and running again. I need to look again, but I don't believe there is any power saving features turned on in the BIOS. Does anyone have any other suggestions of what I may have going on? I have my uncle's website running on it now and I really would like to have a better up- time than 95% As a note, I do not have any GUI installed so everything has to be done on the console (or through WebMin) and I know my way around, but I am by no means experienced.


title: Do all Linux distro's use the same cryptographic hash function?

text: Do all Linux distro's use same Cryptographic hash function? If yes, is it provided with the kernel itself? **EDIT:-** I refer to the function mainly used for storing user login passwords.


title: Should /usr owner be root?

text: After having installed the MySQL database on openSUSE I realized that for all files in `/usr/bin` the owner was changed to the "mysql" user of the "mysql" group. Maybe there was some mistake of mine. The worst problem was with the `/usr/bin/sudo` command, which obviously did not work, but I've taken back the ownership to _root_ (having logged to _root_ ) and it is OK now. Should I change owner of all files in `/usr/bin` to _root_ or may this cause some malfunctioning of other programs? Should they also have the "Set UID" option marked in the Privileges tab as `sudo` does?


title: How can I find and filter a specific column in a .csv file?

text: I have .csv files with the following structure:               cat,dog,mouse,pig,bird,cow,...     21,34,54,566,78,1,...     23,10,12,569,56,4,...     32,20,13,123,56,3,...     34,30,44,322,66,2,...      I want to filter the column related to the mouse, for instance:               54     12     13     44      How do I do it? Please keep in mind that I do not know in which column the mouse is found (my files are quite large, there are several files to filter, and the positions of the columns vary). If I knew the exact position, I could use, for instance:               cat $file | awk '{printf("%s\n", $3);}' > filtered_file      What if I do not know the mouse is in column 3? I really appreciate any help.


title: Russian timezone is not up-to-date

text: I have noticed, that the Russian timezone is not up-to-date. The GMT offset is set to +3 h now, whereas the current GMT offset is +4 hours. Could someone tell me how can i manually edit the tzdata file to set it up to date?


title: Listing audio files with bit rate in the command line

text: Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried `ls -l` but it doesn't work.


title: What is the foolproof/proper way to set hostname and domain on CentOS

text: I've seen a few ways of changing hostnames of domain names. One way is to issue the `hostname` command followed by the name such as:               hostname localhost.localdomain      `/etc/sysconfig/network` also has a `hostname` field, but changing that does not affect the output of the `hostname` command. My question is, where is each of these used, which do I care about and why? What's the proper way of setting the hostname?


title: Is it possible to copy data from one screen session to another?

text: I recently needed to copy X amount of lines from a file, that I opened in `vim` and then paste them to another file opened in a different screen session (and different server). So on screen #1 I ran in `vim`: `:15,20y` and on screen #2 I tried to use `p` to paste the lines, but I couldn't because the register was empty (to be honest, I was expecting that but I just wanted to give it a try). I eventually worked my way around in order to get those lines to the right place, but I wonder if it is possible to copy-paste data between screen sessions.


title: Shutdown my (backup) hard disk on Linux when I don't use it

text: I have a hard disk in my computer that I use to make backups of my data. I do not use this disk otherwise. How can I stop this disk from spinning once my backup is finished? Also how would I make it spin back up again before the backup takes place later on? The drive is a regular SATA drive.


title: How to limit a UNIX user to only a given script?

text: How can I limit a UNIX user (BESIDES sudo!) to only allow it to run a script as root?


title: Whether monitor is off without appealing to X or /proc

text: How can I know whether the monitor is on or off if `X` is not running, and without appealing to `/proc/acpi/video`? The latter isn't available from my kernel. If `X` is running it's just a matter of                 $ DISPLAY=:0 xset -q 2>/dev/null| grep "^\s*Monitor is"      But what if `X` is **not** running?


title: Keep NumLock always on

text: I have standard keyboard with numerical keys on the right side (I guess it's called 104-key keyboard). I want to use the numerical keys only as numerical keys. That means, I don't want the `NumLock` to switch on and off the numerical keys. However, sometimes it happens (I don't know how, perhaps by me accidentally hitting the `NumLock` key) that the numlock is turned off, and I have to press it again. This is extremely annoying. Is it possible to disable switching off numlock? In other words: **I want my numerical keys to always act as number keys, and to disable the numlock switch**. I am using Debian and LXDE (Openbox).


title: problem reading and comparing files using nested loops

text: while read newfile <&3; do         if [[ ! $newfile =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi         #      while read oldfile <&3; do         if [[ ! $oldfile =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi            echo Comparing "$newfile" with "$oldfile"         #         if diff "$newfile" "$oldfile" >/dev/null ; then           echo The files compared are the same. No changes were made.         else             echo The files compared are different.         fi          done 3</infanass/dev/admin/oldfiles.txt     done 3</infanass/dev/admin/newfiles.txt      I think this is the right way to do nested loops.. but it doesnt quite work right.


title: How is cron scheduling actually implemented and makes sure scripts run on time?

text: I want to ask about cron jobs. OK, we place the scripts in the crontab and the cron daemon executes them. Now if I understand this, each minute, cron checks the crontab of each user and executes the configured scripts. But how is this actually done? Does it fork child processes etc? It can not execute the tasks sequentially since the timings would be lost (e.g. due to waiting a long-running script to finish). So how is this actually implemented. Just to help out, I'm not looking for low level code. A high level description (of the algorithm perhaps?) or how this is implemented in most distros would suffice to me.


title: Bootup prompt for ecryptfs password

text: Is it possible to setup ecryptfs mounts to prompt for password upon bootup? Say for example /home and /var are ecryptfs folders that need to be mounted; how do I force a prompt upon bootup to ask for mount passwords?


title: Can't map XF86AudioRaiseVolume key in QJoyPad

text: I wanted to map my PSone gamepad to do some basic KDE/keyboard/mouse functions and everything works well except one thing. I use logitech ultra-x keyboard which has a few multimedia buttons (play, home, volumeup, volumedown..) and I wanted to map `volumeup` and `volumedown` keys to my pad with everything else. `volumedown` works well, but `volumeup` makes some trouble. after I start qjoypad and map it - it does work but after mapping it I still see the "[NO KEY]" (while it is doing its job - volumeup; that's strange).. after I turn qjoypad off and on I get this error: "Error reading button 6" and after that "Error reading definition for joystick 0". This is my layout:               QJoyPad 4.1 Layout File          Joystick 1 {         Axis 4: gradient, dZone 6505, maxSpeed 11, tCurve 2, sens 2, mouse+h         Axis 5: gradient, dZone 6264, maxSpeed 11, tCurve 2, mouse+v         Button 1: key 114         Button 2: mouse 3         Button 3: mouse 1         Button 4: key 113         Button 5: key 122         Button 6: key 123         Button 7: key 62         Button 8: key 105         Button 9: key 23         Button 10: key 65     }      With `xev` I got it what 122 and 123 are (they work normaly under KDE when I press them, it's just that 123 wont map and stay mapped for my pad)               keycode 122 = XF86AudioLowerVolume     keycode 123 = XF86AudioRaiseVolume      Any hint on what I should do to fix this and make my configuration stay? If it means anything, or helps anyhow - system is arch with 2.6.35 kernel, kde 4.5.1.


title: How to install Linux on a Lenovo ThinkPad T400

text: I want to completely format my computer and replace my current OS with Linux. How should I go about doing this? Particularly, how do I handle finding all the device drivers I'll need? I'm using a Lenovo ThinkPad T400


title: Uname gives unfamiliar timestamp for kernel

text: I'm recompiling a new kernel (adding some debugging info) on Ubuntu by doing the following:               make vmlinux; make install;      after this I do a reboot and select my new custom kernel from the list. However, when I do:               uname -a      I get a timestamp that doesn't correspond to the last time I built the kernel. When I look in /boot not a single file in there matches up with this timestamp. Also, my changes aren't showing up in the log files. What could be going on here?! Thanks!


title: sed: match two lines

text: I have a text file, where records are split on two lines. I would like to put them on one line. The records look something like this:               2013-07-29      apt-get install git     2013-07-29      apt-get install rsync     2013-07-31      apt-get install nmap     2013-08-02      apt-get install cifs-utils     2013-08-05      apt-get install telnet      I would like to get the following:               2013-07-29 apt-get install git     2013-07-29 apt-get install rsync     2013-07-31 apt-get install nmap     2013-08-02 apt-get install cifs-utils     2013-08-05 apt-get install telnet      I tried with `sed`, but I am unable to match two lines. Is there some trick in `sed`, or is there some better tool ?


title: Failed dependencies

text: I am searching for the following :   1. libpython2.5.so.1.0   2. libtinfo.so.5   3. python(abi) = 2.5 I searched , but I am not able to find these. I am running Centos 5.6 with linux kernel 2.6.18-238.el5.               $ rpm -q --provides python | grep -Fw 'python(abi)'     python(abi) = 2.4      As far as I searched, libtinfo.so.5 is a part of ncurses library now. But It is searching for that specific dependecy library. My current python version is 2.4.3. If someone has any idea about installing these dependencies please help me out.


title: AES-NI not passed to guest in Virtualbox

text: I'm trying to use encryption inside a virtual machine. The problem is that the AES-NI doesn't seem to be passed to the guest virtual machine. I have Vt-x enabled. This is my host cpuinfo:               processor       : 0     vendor_id       : GenuineIntel     cpu family      : 6     model           : 42     model name      : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz     stepping        : 7     cpu MHz         : 1600.000     cache size      : 8192 KB     physical id     : 0     siblings        : 8     core id         : 0     cpu cores       : 4     apicid          : 0     initial apicid  : 0     fpu             : yes     fpu_exception   : yes     cpuid level     : 13     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid     bogomips        : 6801.03     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      This is my guest cpuinfo:               processor       : 0     vendor_id       : GenuineIntel     cpu family      : 6     model           : 42     model name      : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz     stepping        : 7     cpu MHz         : 3399.615     cache size      : 6144 KB     physical id     : 0     siblings        : 2     core id         : 0     cpu cores       : 2     apicid          : 0     initial apicid  : 0     fpu             : yes     fpu_exception   : yes     cpuid level     : 5     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc rep_good nopl pni ssse3 lahf_lm     bogomips        : 6799.23     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      Am I missing some configuration option? Or is this a problem of Virtualbox?


title: Grub-customizer: error while loading shared libraries: libarchive.so.13: cannot open shared object file: No such file or directory

text: I wrote this question at stackoverflow and got recommended I prob would have a better shot here. So I'm trying to install grub customizer so I can make Windows the default OS to boot since I use that more frequently (I'm sorry). Anyway, I finally got it isntalled, but now I can't start it cause of the error message in the description. My real problem is that, that file do exist... I think... I am a real linux novice. I've only used it from now and then for roughly 6 months. Mostly worked with the allready installed software and other times apt-get has worked! Anyway! Here is what I get in my terminal.               root@ninjaPanda:~# gksu grub-customizer     grub-customizer: error while loading shared libraries: libarchive.so.13: cannot open shared object file: No such file or directory     root@ninjaPanda:~# ls -l /usr/local/lib/     total 8056     drwxr-sr-x 2 root staff    4096 Aug 29 13:30 grub-customizer     -rw-r--r-- 1 root staff 5217320 Aug 29 13:26 libarchive.a     -rwxr-xr-x 1 root staff     997 Aug 29 13:26 libarchive.la     lrwxrwxrwx 1 root staff      20 Aug 29 13:26 libarchive.so -> libarchive.so.13.1.2     lrwxrwxrwx 1 root staff      20 Aug 29 13:26 libarchive.so.13 -> libarchive.so.13.1.2     -rwxr-xr-x 1 root staff 3002216 Aug 29 13:26 libarchive.so.13.1.2     drwxr-sr-x 2 root staff    4096 Aug 29 13:26 pkgconfig     drwxrwsr-x 4 root staff    4096 Aug 27 18:45 python2.6     drwxr-xr-x 4 root root     4096 Aug 27 18:45 python2.7     drwxrwsr-x 3 root staff    4096 Aug 27 18:45 python3.2     drwxr-sr-x 4 root staff    4096 Aug 27 18:45 site_ruby      Edit: Someone told me it could Possibly /etc/ld.so.conf does not contain /usr/local/lib. and asked me to run this.               root@ninjaPanda:~# ldd grub-customizer     ldd: ./grub-customizer: No such file or directory


title: Disable screen blackout in KDE while watching iPlayer

text: How can I turn off the screen blackout in Linux when playing a film in BBC iPlayer? I usually use it in Chrome, but if there is a way to do it in Firefox (Iceweasel) than it is good enough as well. I think by default iPlayer uses Flash, but if there is a way to switch to HTML 5 that does the job than I am fine to do it as well. I know how to turn it off completely, but obviously I want it to save energy in all other circumstances.


title: How to switch user if the Screen is Lock

text: Sometime this happen that when I had to do something on server I find that the screen is lock and I dont know the password of that user to unlock it and switch the user. So i need to know that How to Switch the user even if the screen(User) is lock Note :: OS is redhat 5.*


title: Solaris 10, useradd command

text: When I used `useradd` command to add a new user for my Solaris 10 System, I specify `/home/user-name` to be its home directory. but the command didn't run successfully, and when I put the `/export/home/user-name` as its home directory it runs successfully. The first command is: `useradd -md "/home/munix" -s "/bin/ksh" munix` --> give me an error, which is the home directory can not be created, but the user is added to passwd file the second command is: `useradd -md "/export/home/munix munix" munix` --> home directory created successfully why????


title: How can I peek at the output of a running crontab task on OpenBSD?

text: I have an hourly hour-long crontab task running with some `mtr` (`traceroute`) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far. On Linux, it can be done by accessing the open fd of the temporary file to which the results of the script are saved. How can I do this on OpenBSD? I've tried doing `fstat | fgrep -e USER -e cron -e mtr`, but couldn't find any temporary files at all.


title: How can I access a deleted open file on Linux (output of a running crontab task)?

text: I have an hourly hour-long crontab job running with some `mtr` (`traceroute`) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far. On Linux, I have used `lsof -n | fgrep cron` (`lsof` is similar to BSD's `fstat`), and it seems like I might have found the file, but it is annotated as having been deleted (a standard practice for temporary files is to be deleted right after opening):               COMMAND     PID       USER   FD      TYPE     DEVICE  SIZE/OFF       NODE NAME     ...     cron      21742       root    5u      REG      202,0      7255      66310 /tmp/tmpfSuELzy (deleted)      And cannot be accesses by its prior name anymore:               # stat /tmp/tmpfSuELzy     stat: cannot stat `/tmp/tmpfSuELzy': No such file or directory      **How do I access such a deleted file that is still open?**


title: Scripting vmware-player with Windows in Linux

text: I have a Windows XP virtual machine, that I run with vmware-player on Linux. In the virtual machine, I have a .bat script that reads some input from a given place (insite the machine's virtual disk), does something with it and puts it somewhere (again, in the virtual disk). What I want to do is somehow "automate this". To be more exact, what I want to do is:   * run the vmware machine in the player    * somehow copy input file from the "regular computer" to the virtual machine   * run the .bat script in the Windows XP    * after the .bat script is done, copy the file "out"   * and then turn off the virtual machine (just suspending is fine) I would suspect this will be quite simple, but I have no idea where to look. I hope this question is on-topic, since the _outside machine_ is running Linux. However, it is slightly Windows-related too, since the _virtual_ machine runs Windows XP.


title: Linux drivers for Ricoh Aficio SP 100SU

text: Does anyone have a driver for the Ricoh Aficio SP 100SU on Linux? Any directions to correctly install it and have the printer work?


title: Ensure torrent client uses openvpn

text: I recently signed up to a VPN provider and to log in, I use network manager for my normal wireless connection and then start the openvpn connection from network manager. In my browser I can check that I'm using the tunnel by going to an ip location finder site but how do I ensure that my torrent client actually uses this connection? For example, couldn't it happen that my VPN provider logs me out after some time (intentionally or not) and then my torrent client starts using the still available normal wifi connection?


title: Install Tribes: Ascend on Linux Mint?

text: I've been able to install any game that I want besides Tribes: Ascend. I'm trying to install it on Wine 1.4.1, and I get the following install error: `Failed to start the Hi-Rez Authentication and Update service` I've done a plethora of research looking for this game ported to Linux and any possible bugs. I've found this bug, but no fix for it. Does anyone know a workaround for this game?


title: How to expand a substring of a command?

text: I would like to know what a command would look like if I entered a substring of this command. I'm not interested in the result, but in the history expansion. The purpose of this is to show in an interactive way, how the expansion works in zsh. For example, let's say I want to illustrate the usage of zsh history modifiers:               mv /Volumes/hdd1/path/to/a/file.foo !#$:r:s/foo/bar/ # moves and renames at the same time     ....................................0123456789abcdef      (The line above is a rule for referencing substrings in this question) Some of the substrings are valid, some are not. I would like for each substring ending at [0..f], to execute the history expansion, as if I typed `TAB` after each character in [0..f].


title: Semi-asynchronous pipe

text: Assume I have the following pipe:               a | b | c | d      How to wait for completion of `c` (or `b`) in `sh` or `bash`? This means that script `d` can start any time (and does **not** need to be waited for) but requires complete output from `c` to work correctly. The use case is a `difftool` for `git` that compares images. It is called by `git` and needs to process its input (the `a | b | c` part) and display the results of the comparison (the `d` part). The caller will delete input that is required for `a` and `b`, this means that before returning from the script, process `c` (or `b`) must terminate. On the other hand, I cannot wait for `d` because this means I'm waiting for user input. I know I can write the results of `c` to a temporary file, or perhaps use a FIFO in `bash`. (Not sure if the FIFO will help, though.) Is it possible to achieve this without temporary files in `sh`? **EDIT** : Perhaps it would be sufficient if I could find out the process ID of the `c` (or `b`) process in a reliable fashion. Then the whole pipe could be started asynchronously, and I could wait for a process ID. Something along the lines of               wait $(a | b | { c & [print PID of c] ; } | d)      **EDIT^2** : I have found a solution, comments (or still better solutions) are welcome.


title: appendable and greppable archive on CentOS to hold many log files (logrotate on steroids)

text: I have a bunch of applications on a CentOS 6.3 box, which generate daily logs (text files with a very similar content) in this vein:               /data/logs/app/my-2014-06-29.log     /data/yet_another_app/logs/catalina.20140629     /data/in_fact/there_are/around_500_such_paths/2014-06-29-1.log      I need to keep 5 years of these logs. I currently treat them in a traditional Unix way, just compressing them in place (as `.log.bz2`), but I'm unhappy they still occupy a lot of space. I feel I could save a lot of space but compacting them and then compressing (think one giant .zip that holds entire year of logs). Requirements: ## RHEL kosher No "compile from source" please. If it isn't mature enough to be distributed in an .rpm then it's not for me. ## grep Archive should allow a recursive grep (like `grep -rli`):               grep_my_zip  -rli  pattern   /this/and/that/wildcards/2014-06-*      The archive shouldn't de-compress everything when grepping, just the files that match a wildcard. ## append Each week I'm putting my files into the _same_ archive and deleting them from filesystem:               append_and_remove   $( find /this/and/that  -name '*.log' -type f -mtime +31 )     # weekly log cleaning job      This is not the weekly archive, I want to append to a single big yearly archive each week. ## MS Windows access Archive, while mainly operated on CentOS Linux, should also allow a single file retrieval on Windows for emergency purposes (so a squashfs-style filesystem is not a viable option). ## Optional stuff (a plus, but not neccessary)   * append should be space effective - consider that previous log files are very similar to the current log files   * logrotate integration for the weekly job   * grep_my_zip that works on Windows   * archive could also be updateable (i.e. writable), not only appendable Originally posted on this pitiful sibling


title: Specific directory permission for one user using sftp

text: My web server structure looks like this:               /Home/User/Public_Html/Website_one                           /Website_two                           /Website_three/Directory_one                                         /Directory_two                                         /Directory_three                                          /Directory_four      Now, I need my friend to have access from this server only to `Directory_two` and `Directory_four` under `website_three`. I have created an SFTP account based on SFTP Jails. I also created a `home` folder for him and SFTP works fine. But the problem is I couldn't give him access to those directories with sub files. How can I give him access only to `Directory_two` and `Directory_four`?


title: Bash: How to read one line at a time from output of a command?

text: I am trying to read the output of a command in bash using a `while loop`.               while read -r line     do         echo "$line"     done <<< $(find . -type f)      The output I got               ranveer@ranveer:~/tmp$ bash test.sh     ./test.py ./test1.py ./out1 ./test.sh ./out ./out2 ./hello     ranveer@ranveer:~/tmp$       After this I tried               $(find . -type f) |      while read -r line     do         echo "$line"     done       but it generated an error `test.sh: line 5: ./test.py: Permission denied`. So, how do I read it line by line because I think currently it is slurping the entire line at once. Required output:               ./test.py     ./test1.py     ./out1     ./test.sh     ./out     ./out2     ./hello


title: Redirect Output with Iptables

text: Is possible on Debian to change the port of packets that are going to a specific port, using iptables? **Example:** I want packets going in the outbound direction to a.b.c.d for port 1723 to be redirected to the address a.b.c.d on port 10000. Is this possible?


title: mutt: macro for saving messages to a folder

text: This is an expansion on my previous question. I have following macro, which will save **tagged** messages to my `archive` folder.               macro  index  S  ":set confirmappend=no delete=yes\n<tag-prefix-cond><save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      and a second macro for doing the same action, but on the current message (not tagged):               macro index A ":set confirmappend=no delete=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      Is there a way to combine these two macros into one? I.e., I would like a macro that does following action when I press `S`:               a) in case any messages are tagged, move all of them to `archive`     b) in case no messages are tagged, move current message to archive


title: Scanner works in laptop, not in desktop

text: I have an Epson Perfection 660 flatbed scanner that works on my laptop. This is what appears in `/var/log/syslog` when I plug it in:               Dec 18 15:43:57 lap kernel: [   31.868278] usb 6-2: new full-speed USB device number 2 using uhci_hcd     Dec 18 15:43:57 lap kernel: [   32.033506] usb 6-2: New USB device found, idVendor=04b8, idProduct=0114     Dec 18 15:43:57 lap kernel: [   32.033514] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Dec 18 15:43:57 lap kernel: [   32.033519] usb 6-2: Product: EPSON Scanner     Dec 18 15:43:57 lap kernel: [   32.033524] usb 6-2: Manufacturer: EPSON      Now I want to use that scanner in my desktop computer. I followed the same instructions, but it does not work. The problem is that it's not recognized as a valid USB device. It does not appear on `lsusb`, and this is what shows in syslog:               Dec 18 15:31:34 desktop kernel: [  390.193219] usb 3-14: new full-speed USB device number 18 using xhci_hcd     Dec 18 15:31:39 desktop kernel: [  395.213900] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:39 desktop kernel: [  395.213902] usb 3-14: can't read configurations, error -110     Dec 18 15:31:39 desktop kernel: [  395.325902] usb 3-14: new full-speed USB device number 19 using xhci_hcd     Dec 18 15:31:44 desktop kernel: [  400.346570] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:44 desktop kernel: [  400.346572] usb 3-14: can't read configurations, error -110     Dec 18 15:31:45 desktop kernel: [  400.458648] usb 3-14: new full-speed USB device number 20 using xhci_hcd     Dec 18 15:31:50 desktop kernel: [  405.479280] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:50 desktop kernel: [  405.479282] usb 3-14: can't read configurations, error -110     Dec 18 15:31:50 desktop kernel: [  405.591352] usb 3-14: new full-speed USB device number 21 using xhci_hcd     Dec 18 15:31:55 desktop kernel: [  410.611960] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:55 desktop kernel: [  410.611962] usb 3-14: can't read configurations, error -110     Dec 18 15:31:55 desktop kernel: [  410.611973] hub 3-0:1.0: unable to enumerate USB device on port 14      At first sight, looks like the laptop uses UHCI, whereas the desktop uses XHCI. Both systems use Linux Mint 16, kernel 3.11.0-12 x86_64. The behavior is the same regardless of the usb port used. What can I do?


title: talkd doesn't print a message

text: I wanted to use talk with my brother (we both have Debian jessie). So i installed inetutils-inetd, inetutils-talk, and inetutils-talkd. Now i wanted to try wether it works. So i created a testuser named foo. The i logged in as this user and as my original user. I switched mesg on both terminals to yes and then tried this on my originals user:               $talk foo     [Service connection established.]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]      And foo never gets a message like it is described in the manpage. I also checked that inetd is running and enabled talkd by inetd. Here's the only line in /etc/inetd.conf that isn't uncommented.:               talk    stream  tcp nowait  root    /usr/sbin/talkd talkd      I also tried to let both users try to talk to each other, but that didn't work either. Does anyone know how i can get talk to work?


title: Errors after creating partitions during Fedora 20 installation

text: I made drives like this :                 /       10GB       /home   37GB       swap     8GB      but there is an error :                 you have not created a bootloader stage1 target device.       you have not created a bootable partition.      what should I do?


title: First line of awk output isn't what I expect

text: I am trying to figure out why a part of a file name disappears. In my case, I have created three files               $ ls     some-part-of-file.1  some-part-of-file.2  some-part-of-file.3      and when I use awk with `FS = "-"`, one of them is blank.               $ ( echo some-part-of-file.1 ; echo some-part-of-file.2 ; echo some-part-of-file.3 ) | awk '{ FS = "-" ; print $0 " " $2}'     some-part-of-file.1     some-part-of-file.2 part     some-part-of-file.3 part      Why does `some-part-of-file.1` `$2` not print `part` like the others?


title: Big file overwriten with a 0B file

text: I just opend for write (by mistake) a big file with data (about 200 MB). Now I have this file and it has 0B. I want to know If I can find raw data on disk for recovery... ?


title: Is the FreeBSD login program compatible with AFS?

text: Is FreeBSD's `login` program compatible with AFS, so you can just login normally instead of using the `kinit` method (this is possible according to the OpenAFS manual)?


title: Fail to install node.js on Debian

text: I'm running Raspbmc which is running a minimal Linux distribution based on Debian. And I would like to install node.js via package manager but I'm fail to install on my system. Which it come with this error.               In file included from /usr/include/linux/kernel.h:4:0,                      from /usr/include/arm-linux-gnueabihf/sys/sysinfo.h:25,                      from ../deps/uv/src/unix/linux-core.c:34:     /usr/include/linux/sysinfo.h:8:2: error: unknown type name '__kernel_long_t'     /usr/include/linux/sysinfo.h:9:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:10:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:11:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:12:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:13:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:14:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:15:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:18:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:19:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:21:22: error: '__kernel_ulong_t' undeclared here (not in a function)     make[1]: *** [/root/src/node-0.10.21/out/Release/obj.target/libuv/deps/uv/src/unix/linux-core.o] Error 1     make[1]: Leaving directory `/root/src/node-0.10.21/out'     make: *** [node] Error 2      I'm following this step to install node.js               sudo apt-get install python g++ make checkinstall     mkdir ~/src && cd $_     wget -N http://nodejs.org/dist/node-latest.tar.gz     tar xzvf node-latest.tar.gz     mv node-v0.10.19 node-0.10.19     cd node-0.10.19     ./configure     checkinstall --install=no


title: Recover files on unmounted partition

text: I have 2 partitions on my macbook, but I can't mount one of them. When I run the disk utility, the console (show details area) returns the message: > Updating boot support partitions for the volume as required.Error: Disk > Utility can’t repair this disk. Back up as many of your files as possible, > reformat the disk, and restore your backed-up files. I need to recover my files that are on the unmounted partition. Is there a way to list and recover these files without mounting the partition?


title: Ubuntu 10.0 sound muted automatically on ThinkPad

text: My laptop is ThinkPad T61, with Ubuntu 10.10 installed. The sound works all well, until I plugged the Creative XiFi Go USB sound card. After I reboot my computer, the internal speaker is muted automatically. I have to use 'alsamixer' to unmute it each time. How can I persistent this setting?


title: Shell filename pattern that expands to dot files but not to `..`?

text: Recently I had a little mishap caused by a shell pattern that expanded in an unexpected way. I wanted to change the owner of a bunch of dot files in the `/root` directory, so I did               chown -R root .*      Naturally, the `.*` expanded to `..` which was a bit of a disaster. I know in `bash` this behaviour can be changed by tweaking some shell option, but _with the default settings_ is there any pattern that would expand to every dot file in the directory but not to `.` and `..`?


title: Passing print pattern as a variable to awk

text: I am trying to use `awk` to print variables from various columns in a line delimited by `,` .The columns and pattern which I want to print is stored in another variable `b`. The pattern `a` and print patter `b` are given below:               a='15986327,415532694,850257614,875121642,20140819'     b='$1","$2","$4'      I am trying to get the output as below.               15986327,415532694,875121642      I am trying to pass the pattern `b` to awk using `-v` switch but not sure how to use that with `print` inside `awk`. Tried below commands but this is not the output I was trying to get to.               echo $a |awk -v ba="${b}" -F"," '{print ba}'     $1","$2","$4          echo $a |awk -v ba="${b}" -F"," '{print $ba}'     15986327,415532694,850257614,875121642,20140819


title: How can I script the creation of a single partition that uses the entire device?

text: I am specifically using this to partition and mount EBS volumes on Amazon EC2 instances, but really this should be generally applicable to initializing any new drive. As the question says I want to script the creation of a single primary partition which uses all available space on the given device. I won't know ahead of time how big the device is and it could be very large (i.e. several TB). In researching this it seems `parted` is the best command to use for scripting. I think something along the lines of `parted /dev/sdf mkpart primary 0 END` is what I want, but I'm having a hard time figuring out an elegant way to determine what END should be. Does anyone know an easy way to do this?


title: Save setxkbmap settings?

text: I'm having trouble setting my keyboard settings to swedish, running Raspbian on a raspberry pi. I've tried everything and the only thing that worked was the command `setxkbmap se`. But this doesn't permanently save the settings, and it's back to default after reboot. Is there a command to permanently save these settings?


title: Script to list only files of type ASCII text in the current directory?

text: How to write a shell script which searches the current UNIX directory and returns the names of all files of type ASCII text?


title: Low-level serial configuration?

text: I'm using embedded Linux platform, kernel is 2.6. I'm using stty command to configure ttyS* high level. The problem is that when I want to turn hardware flow control on:               stty -F /dev/ttySA0 crtscts      it cannot communicate with other device (which also have flow control enabled - this is checked). I have found that in /proc/tty/driver/sc16is7x2 (this is serial device) there is:               serinfo:1.0 driver revision:     0: uart:sc16is752 port:00000001 irq:53 tx:155 rx:0 DSR|CD|RI     1: uart:sc16is752 port:00000002 irq:53 tx:10 rx:0 DSR|CD|RI      while on the other platform with the same hardware (and where hardware flow control works) there is something like:               serinfo:1.0 driver revision:     0: uart:sc16is752 port:00000001 irq:53 tx:155 rx:0 CTS|DSR|CD|RI     1: uart:sc16is752 port:00000002 irq:53 tx:10 rx:0 CTS|DSR|CD|RI      So the difference is in "CTS|DSR|CD|RI" vs "DSR|CD|RI". Could this "DSR|CD|RI" be a problem I cannot use hardware flow control?


title: Getting capabilities of my CD/DVD drive when wodim --devices doesn't work

text: I used to be able to run either commands successfully on my Fedora 14 Thinkpad T410 laptop:               $ wodim --scanbus     $ wodim --devices      However since upgrading to Fedora 19 this no longer seems to work and I'm not sure why. Are there any alternative methods for getting the drives capabilities from `wodim`?


title: No CentOS Windows 8 GRUB Options on Restart

text: How do I dual-boot CentOS 6.3 **Minimal Version** on an Acer 64-bit Windows 8 Laptop and get the GRUB options to select either CentOS or Windows 8 when I restart? (Currently it boots straight into Windows 8. Also I do not want the full version of CentOS with the GUI ). Here are the steps I took to dual boot CentOS with Windows 8:   1. Using the Disk Management tool, I shrank my C drive and left the new space (50000 MB) unallocated   2. Rebooted using the CD (changed boot order with CDRom first)   3. Selected English, US English   4. Selected **Basic Storage Devices**   5. For networking, I left hostname as default   6. Selected the City   7. Entered my root password, confirmed root password   8. For Installation Type, I selected **Create Custom Layout**   9. Selected the Free space, clicked Create   10. Create Storage dialog, I selected **LVM Physical Volume** , create   11. File System Type ( **swap** ), Size (2000 MB), Additional Size Options (Fixed size), ok   12. Selected the free space again, create, Create Partition (Standard Partition), create, Mount Point (/), File System Type (ext4), Size (47000), Additional Size Options (Fill to maximum allowable size), ok, Next, write changes to disk   13. **Install boot loader on /dev/sda2 (ticked), Boot loader operating system list (CentOS /dev/sda7 is selected but there is another option labeled Other /dev/sda4 which is not selected)**   14. After installation completed successfully, I rebooted, pressed F2, changed the Boot order back to **Windows Boot Manager** , saved, exit I also noticed that CentOS File System is labelled RAW in the Disk Management tool. * * * **EDIT 1** Here is my first update to my Windows 8 CentOS 6.3 Minimal dualboot problem: I changed the boot order in the BIOS to boot from the HDD instead of Windows Boot Manager and after another restart, it booted into CentOS this time (still no GRUB menu). I found the grub.conf file and notice a line in it that said "hiddenmenu" that was NOT commented out. So I commented it out and upon another restart I got the GRUB screen to appear but only CentOS and "Other" were there, no Windows 8 options. In the grub.conf file there was an entry for "Other" rootnoverify (hd0,3) chainloader +1. My question is, how do I chainload Windows 8? I've already disabled Secure Boot **(but left boot type set to UEFI because the "legacy boot" option did not allow my system to boot at all)**. How do I get the GRUB to allow me to choose between Windows 8 and CentOS?


title: Linux Mint gets stuck at boot from Live-CD

text: I am trying to install Linux Mint (Cinnamon) from a CD. It will act like it is loading for a while, the CD drive will make a ton of noise for a while, and then everything just freezes (the CD drive will go silent). I tried this a few times and then started in `compatibility mode`. Every time, I get the following:               failed to load file amd-ucode/microcode_amd.bin      I'm trying to install on an older Toshiba Satellite laptop (with Ubuntu currently installed). Any ideas on a fix ?


title: Comparison of shells?

text: Do shells have any actual advantages or disadvantages? They can all run any binary, they all support pipes and `>` (output to file). Why would one choose `bash` over `sh`, or `sh` over `ksh`, etc? Why does any shell other than `sh` exist in the first place?


title: Terminate Root Processes

text: Is there a way to terminate a root process without entering an administrator's password? You might be wondering why I'd want to do this 'cause it sounds fishy. Well I just need to end a process started by a daemon from an agent but daemons runs as root and agents are user specific.


title: Archbang can't connect to wireless

text: Last week I tried Crunchbang 11, it couldn't connect to wireless. Yesterday I removed it and installed Archbang from CD (final 2012 version). Everything was working perfectly, when I did `pacman -Syu` and rebooted, Archbang stopped detecting my wireless card so I bet that the new Linux drivers aren't compatible with my HP Pavillion G. It's not the first time that I've seen drivers incompatible with my laptop, I've seen it last week with Crunchbang, and I've had graphics issues with every Linux that i've used on this laptop. What I would like to do is simple. I want to downgrade the Archbang wireless drivers, I want my original drivers back, the ones installed in the final 2012 version (I have the CD, can I use it?), and then I don't want to allow pacman to upgrade my wireless drivers, so next time I run `pacman -Syu`, I want everything to be upgraded except my wireless drivers, and if possible my graphic card drivers. You see Ubuntu 12.04 works great, 12.10 doesn't work at all, I don't even see the login screen, even with `nomodeset`. I don't want that to happen, and Archbang is a rolling release so I don't know if the next time I upgrade my packages I'll face some issues, I want to allow pacman to upgrade everything, just don't mess with my graphics and my wireless, that's it.


title: Vimperator status bar not working

text: I have just installed Vimperator 3.8.2 on Firefox 32 (running Fedora 20). The status bar at the bottom of the window does not display any information in Normal mode , even though when I do               :set status?      I get               status=input,location,bookmark,history,tabcount,position,      Nor do I get the little highlighted Error indicator, or mode indicators when I enter Insert or Caret. Everything else seems to work just fine. I haven't modified any of the default values. What might be causing this?


title: Specifying which git repo to use

text: I have a bash script, called cgit, that acts as **git** for one specific git **repo** (located at `/.git`):               #!/bin/bash     cd /;     sudo git $@ > /dev/stdout      I use it to keep track of imporant system files:               cgit add /etc/rc.conf      The trouble is when I try to add content relative to the directory I'm in, for example:               cd /home/user     cgit add .ssh/config      **cgit** would try and add `/.ssh/config` to the `/.git` repo. Any suggestions or work-arounds?


title: Awk print problem

text: I have a code that takes values from a log file and populates them into an excel spreadsheet:               function ltrim(s) { sub(/^[ \t]+/, "", s); return s }     function rtrim(s) { sub(/[ \t]+$/, "", s); return s }     function trim(s)  { return rtrim(ltrim(s)); }          function getfield( xml, fieldname) {         i = index ( xml, "fieldName=\""fieldname"\"");         if(i < 1){           ts = "";         }         else{            ts = substr( xml, i + length("fieldName=\""fieldname"\"") );            ts = substr( ts, index( ts, "value=\"" ) + length( "value=\"" ) );            ts = substr( ts, 1, index( ts, "\"")-1);            gsub(/&/, "&", ts );            if ( index( ts, "," ) > 0 ) ts ="\""ts"\"";         }                 return ts;             }     BEGIN   { FS = "--------";OFS=",";}      {sub(/..,[A-Z][A-Z]/, "CT-PT")}                  {                     orig = $0;                    # $7 = getfield(orig, "Modalities In Study");                     $9 = getfield(orig,"Subject Patients Sex");                     $10 = getfield(orig,"Modality Body Region");                     $11 = getfield(orig, "Patients Birth Date");                     $12 = getfield(orig, "Protocol Name");                     $13 = getfield(orig, "Timepoint ID");                     print;              }      Everything is working great except for one thing. If I place this print statement anywhere in the code, it loops in the whole Excel spreadsheet. So basically the print statement appears in every other row. I only want it to appear in the first row:               {print "Study Instance UID,Number of Series,Number of Instances, Exam Transfer Date,Exam Date,Subject Number,Modalities In Study,Upload Status,Subject Patients Sex,Modality Body Region,Patients Birth Date,Protocol Name,Timepoint"}      I am not sure why this occurs. I even tried placing this line right after function `trim(s) { return rtrim(ltrim(s)); }` but still keeps looping in the spreadsheet. Does anyone have any suggestions or might know why this occurs?


title: Is there a linux vfs tool that allows bind a directory in different location (like mount --bind) in user space?

text: For a user process, I want to mount a directory in other location but in user space without root privilieges. Something like mount --bind /origin /dest, but with a vfs wrapper. Like a usermode fine-tuned chroot. The program would wrapper the syscalls to files to "substitute" the paths needed. It could be called with a command line like: bindvfs /fake-home:/home ls /home I am sure that this alredy exists! :)


title: What does libgcc_s.so contain?

text: I tried running objdump on the lib to figure it out without success. Is there a way to find out what a library does?


title: Why is vimdiff so slow?

text: Whenever I'm in `vimdiff` mode, my PuTTY session slows down considerably. This is especially noticeable when I try to scroll down many lines by keeping `j` pressed.   1. Why is it so slow in comparison to regular Vim running under `vsplit`? I realize it matches across lines and color-highlights the differences, but does that account for all the speed differences?   2. What can I do about it? I would like to keep line matches across files (and color highlighting as well). What settings can I change to help speed up the performance of my `vimdiff` utility?


title: Can I truncate long file names in ls listing

text: I have a number of files with very long names. Please, is there a way to use ls -C and truncate the file names to get more columns for an overall view? Or is there a better way to get a compact listing?


title: Terminal emulator for Android that supports viewing images?

text: I am planning on logging into my unix desktop via an Anroid tablet. Is there a terminal emulator that will allow me to view images, such as making plots in ipython, via X11 protocol?


title: How to remove a file from the git index

text: How do I remove a file from a git repositorie's **index** without removing the file from the working tree? If I had a file `./notes.txt` that was being tracked by git, I could run `git rm notes.txt`. But that would remove the file. I'd rather want git just to stop tracking the file.


title: Compile proftpd with MySQL authentication support on AIX

text: ### Edit 1: The problem seems to be related to MySQL component. because if I remove every SQL directives from config file, it does work on `ftp/ftpes`, `sftp` and `ftps` * * * ### Edit 2: If I put an existing host not hosting a DB, connection to ftp daemon will hang and finally timeout, while if I put an incorrect db or a non responding host, it will try to run unix auth instaed of mysql auth. * * * ### Edit 3: Sqllog mention we can see that the line `Feb 07 15:44:12 mod_sql/4.3[15139036]: entering mysql cmd_open` is followed by a new log line after more than one minute `Feb 07 15:45:27` :               Feb 07 15:44:11 mod_sql/4.3[15139036]: defaulting to 'mysql' backend     Feb 07 15:44:11 mod_sql/4.3[15139036]: backend module 'mod_sql_mysql/4.0.8'     Feb 07 15:44:11 mod_sql/4.3[15139036]: backend api    'mod_sql_api_v1'     Feb 07 15:44:11 mod_sql/4.3[15139036]: >>> sql_sess_init     Feb 07 15:44:11 mod_sql/4.3[15139036]: entering         mysql cmd_defineconnection     Feb 07 15:44:11 mod_sql/4.3[15139036]:   name: 'default'     Feb 07 15:44:11 mod_sql/4.3[15139036]:   user: 'mysql_poney_user'     Feb 07 15:44:11 mod_sql/4.3[15139036]:   host: 'pingableHostWithoutDB.net'     Feb 07 15:44:11 mod_sql/4.3[15139036]:     db: 'mysql_poney_user'     Feb 07 15:44:11 mod_sql/4.3[15139036]:   port: '15140'     Feb 07 15:44:11 mod_sql/4.3[15139036]:    ttl: '2'     Feb 07 15:44:11 mod_sql/4.3[15139036]: exiting  mysql cmd_defineconnection     Feb 07 15:44:11 mod_sql/4.3[15139036]: connection 'default' successfully established     Feb 07 15:44:11 mod_sql/4.3[15139036]: mod_sql engine     : on     Feb 07 15:44:11 mod_sql/4.3[15139036]: negative_cache     : off     Feb 07 15:44:11 mod_sql/4.3[15139036]: authenticate       : users     Feb 07 15:44:11 mod_sql/4.3[15139036]: usertable          : proftpd_users     Feb 07 15:44:11 mod_sql/4.3[15139036]: userid field       : userid     Feb 07 15:44:11 mod_sql/4.3[15139036]: password field     : passwd     Feb 07 15:44:11 mod_sql/4.3[15139036]: UID field          : uid     Feb 07 15:44:11 mod_sql/4.3[15139036]: GID field          : gid     Feb 07 15:44:11 mod_sql/4.3[15139036]: homedir field      : homedir     Feb 07 15:44:11 mod_sql/4.3[15139036]: shell field        : shell     Feb 07 15:44:11 mod_sql/4.3[15139036]: SQLMinUserUID      : 200     Feb 07 15:44:11 mod_sql/4.3[15139036]: SQLMinUserGID      : 1     Feb 07 15:44:11 mod_sql/4.3[15139036]: <<< sql_sess_init     Feb 07 15:44:12 mod_sql/4.3[15139036]: >>> sql_escapestr     Feb 07 15:44:12 mod_sql/4.3[15139036]: entering         mysql cmd_escapestring     Feb 07 15:44:12 mod_sql/4.3[15139036]: entering         mysql cmd_open     Feb 07 15:45:27 mod_sql/4.3[15139036]: exiting  mysql cmd_open     Feb 07 15:45:27 mod_sql/4.3[15139036]: exiting  mysql cmd_escapestring     Feb 07 15:45:27 mod_sql/4.3[15139036]: unrecoverable backend error     Feb 07 15:45:27 mod_sql/4.3[15139036]: error: '2003'     Feb 07 15:45:27 mod_sql/4.3[15139036]: message: 'Can't connect to MySQL server on 'pingableHostWithoutDB.net' (78)'     Feb 07 15:45:27 mod_sql/4.3[15139036]: entering         mysql cmd_exit     Feb 07 15:45:27 mod_sql/4.3[15139036]: exiting  mysql cmd_exit      * * * ### Orginal question I have a proftpd config file that is tested on both `proftpd 1.3.4b` and `proftpd 1.3.4d`. Now I want to compile on a new system a `AIX 6.1`.   I'm using IBM XLc compiler. here's the library I installed :               rpm -qa         apr-1.4.6-1         mkisofs-1.13-4         pci.df1000fa-1-191A5         openldap-2.4.23-0.3         apr-util-ldap-1.5.1-1         openssl-1.0.1e-2         bash-3.0-1         coreutils-5.0-2         grep-2.5.1-1         pci.1069B166.0A-050A008a-1         pci.1069B166.08-0508008a-1         pci.1069B166.10-0510006d-1         pci.df1000fa-1-90X13         pci.df1080f9-1-91x4         ibm.scsi.disk.10k300-RPQR-1         ibm.scsi.disk.73lpx15-c51d-1         ibm.scsi.disk.146z10-s28g-1         ibm.scsi.disk.146lp-C50K-1         ses.0018-0018-01         cdrecord-1.9-7         pci.1069B166.10-0710000b-1         screen-3.9.10-2         expat-2.1.0-1         zlib-1.2.7-2         AIX-rpm-6.1.6.15-5         gettext-0.10.40-8         libiconv-1.14-2         apr-util-1.5.1-1         db4-4.7.25-2         bzip2-1.0.6-1         info-4.13a-2         readline-6.2-4         pcre-8.32-1         openssl-devel-1.0.1e-2         httpd-2.4.3-1         mpfr-3.1.2-1         MySQL-devel-5.1.56-1         libgcc-4.6.1-1         gcc-4.6.1-1         libstdc++-4.6.1-1         libstdc++-devel-4.6.1-1         gmp-5.1.3-1         gmp-devel-5.1.3-1         mpfr-devel-3.1.2-1         libmpc-1.0.1-2         libmpc-devel-1.0.1-2         gcc-cpp-4.6.1-1         zlib-devel-1.2.7-2      Here's the script I use to compile:               export CONFIG_SHELL=/opt/freeware/bin/bash     export CONFIG_ENV_ARGS=/opt/freeware/bin/bash     export CC=cc     export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"     export CXX=xlC     export CXXFLAGS=$CFLAGS     export CPPFLAGS='-U__STR__'     export F77=xlf     export FFLAGS="-O -I/opt/freeware/include"     export LD=ld     export LDFLAGS="-L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib:/opt/freeware/lib/mysql:/opt/freeware/lib/mysql/mysql"     export PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin:/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin:/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl     export CFLAGS="-DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"     make clean     ./configure  '--with-modules=mod_tls:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp:mod_sftp_sql' '--without-getopt' '--enable-openssl' '--with-includes=/home/poney/libmath_header:/home/poney/include_mysql/mysql/' '--with-libraries=/home/poney/libmath_lib:/opt/freeware/lib/mysql/mysql:/opt/freeware/lib/mysql/mysql/libmysqlclient.a' '--prefix=/usr/local/proftpd'     make      The things is it does compile without much further warning. still I do get a warning when `make install`:               ld: 0711-224 WARNING: Duplicate symbol: .bcopy     ld: 0711-224 WARNING: Duplicate symbol: .memmove     ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.      My configuration allow FTPS SFTP and FTP, and if I try to connect with `ftps` it does work until I type the password :               openssl s_client -connect 127.0.0.1:210 -starttls ftp         CONNECTED(00000003)         depth=0 /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd         verify error:num=18:self signed certificate         verify return:1         depth=0 /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd         verify return:1         ---         Certificate chain          0 s:/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd            i:/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd         ---         Server certificate         -----BEGIN CERTIFICATE-----         MIICWDCCAcGgAwIBAg[...]8dqCxa3HS6bgg==         -----END CERTIFICATE-----         subject=/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd         issuer=/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd         ---         No client certificate CA names sent         ---         SSL handshake has read 1264 bytes and written 341 bytes         ---         New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA         Server public key is 1024 bit         Secure Renegotiation IS supported         Compression: NONE         Expansion: NONE         SSL-Session:             Protocol  : TLSv1             Cipher    : DHE-RSA-AES256-SHA             Session-ID: 6F520DFBC97CF172B68A99510AAFA765658324A4478D87ACB481362070A88034             Session-ID-ctx:             Master-Key: [...]             Key-Arg   : None             Start Time: 1391443369             Timeout   : 300 (sec)             Verify return code: 18 (self signed certificate)         ---         220 ProFTPD 1.3.4d Server (ftp daemon) [127.0.0.1]         USER frank         331 Password required for frank         PASS $$$$$      And after that nothing, it hangs doing nothing. on the proftpd side the deamon does provide some trace :   see pastbin I can't read anything usefull here. I'm pretty sure there's something wrong with the library, but I really don't know what or why it does not want to wrok in the end as it compile without problem.


title: Why does a disk clone using dd take up more space on the target than the source image?

text: I'm doing some Android development on Ubuntu 11.10. I'm building a set of SD card and eMMC card Android images using a Bash script. Due to Android's idiosyncrasies, I have several file system images that need to be copied to the target card. There are several lines in my script to copy over the images that look like this:               image_dir=/some/directory     node=/dev/some/block/device     dd if=${image_dir}/data.img of=${node}; sync      Here's where things get weird. After partitioning the card and copying over`data.img` using this `dd` command, there is a vast inconsistency between the size of the `data.img` on my dev machine and the amount of space taken up on the target SD card partition. For instance, the `data.img` file on my disk takes up 128 **megabytes** of space, roughly, but takes up almost 2.5 **gigabytes** on the partition of the SD card. For obvious reasons, this is a serious problem. I've tried modifying the number of blocks `dd` reads and writes, but that didn't seem to change the amount of space required. I've done a fair bit of googling, but I can't seem to find any references to problems like this. What can I do to fix this issue so the image doesn't take up so much space? Could there be something wrong with the `data.img` file? Am I using `dd` wrong? I've been tearing my hair out over this for a week, help me StackExchange, you're my only hope. EDIT: Question clarified above: It's not that the **file system** takes up a lot of space on the partition, it's that the partition is filled almost completely with data after running `dd`, despite the file system image being substantially smaller than said partition.


title: How do I add and cancel print jobs in debian wheezy?

text: So I have a Canon MP150 printer running in debian wheezy, which I've added using the CUPS print manager (going to `http://localhost:631/jobs/`). I tried to print with not enough paper in the printer and it came up with an error (ie. the printer showed `E2` on the display and then failed to print). I added paper and nothing happened, so I thought I'd just delete the print job. Deleting it in the print manager (clicking on the job and pressing the `stop` icon) had no effect, so I went into the `CUPS` server and clicked `Administration->Manage Jobs`. I see the jobs there, but when I click `Cancel Job` I get a page like this: > Request Entity Too Large I tried restarting my computer but the print job is still there, and I am unable to print. I looked online and found some solutions that suggest deleting the printer driver and reinstalling, but judging by my linux printer experience thus far I'm guessing this is a problem I'll be encountering frequently, so a quicker solution would be helpful!


title: Raspbian migrating to bigger SD card

text: As I was running out of space on my Raspberry PI, I picked up another SD card. The 'old' card was only 4GB, the new one is 8GB. I made an image with Win32DiskImage and wrote this to the 8GB card. Everything went well. But, I discover that actually nothing was happend, so still 4GB... I checked out the web and discover that this is quite normal. So, I searched for a 'how to'. And I found one: click. So, I followed this tutorial, or at least I tried so. It looks like my SD card layout isn't the same at all. But, I tried to so with: /dev/mmcblk0p6 . But didn't work out, so I re-wrote the image to the SD card. By the way, I installed Raspbian using the NOOBS method. Some more information: `df -h` gives:               pi@raspberrypi:~$ df -h     Filesystem      Size  Used Avail Use% Mounted on     rootfs          3.4G  3.0G  216M  94% /     /dev/root       3.4G  3.0G  216M  94% /     devtmpfs        215M     0  215M   0% /dev     tmpfs            44M  268K   44M   1% /run     tmpfs           5.0M     0  5.0M   0% /run/lock     tmpfs            88M     0   88M   0% /run/shm     /dev/mmcblk0p5   60M  9.4M   50M  16% /boot      `fdisk /dev/mmcblk0` gives:               pi@raspberrypi:~$ sudo fdisk /dev/mmcblk0          Command (m for help): p          Disk /dev/mmcblk0: 8072 MB, 8072986624 bytes     4 heads, 16 sectors/track, 246368 cylinders, total 15767552 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00004bf1                  Device Boot      Start         End      Blocks   Id  System     /dev/mmcblk0p1            8192      240234      116021+   e  W95 FAT16 (LBA)     /dev/mmcblk0p2          245760     7663615     3708928   85  Linux extended     /dev/mmcblk0p3         7663616     7729151       32768   83  Linux     /dev/mmcblk0p5          253952      376831       61440    c  W95 FAT32 (LBA)     /dev/mmcblk0p6          385024     7663615     3639296   83  Linux          Command (m for help): q          pi@raspberrypi:~$      `parted /dev/mmcblk0` gives:               pi@raspberrypi:~$ sudo parted /dev/mmcblk0     GNU Parted 2.3     Using /dev/mmcblk0     Welcome to GNU Parted! Type 'help' to view a list of commands.     (parted) unit chs     (parted) print     Model: SD F0F0F (sd/mmc)     Disk /dev/mmcblk0: 1955,38,37     Sector size (logical/physical): 512B/512B     BIOS cylinder,head,sector geometry: 1955,128,63.  Each cylinder is 4129kB.     Partition Table: msdos          Number  Start      End        Type      File system  Flags      1      1,2,2      29,101,15  primary   fat16        lba      2      30,60,60   950,44,43  extended      5      31,62,62   46,93,28   logical   fat32        lba      6      47,95,31   950,44,43  logical   ext4      3      950,44,44  958,60,59  primary   ext4          (parted)      So, any help is welcome...


title: Shell script to compile C files

text: I used to have a shell script that would compile all of the FILE.c files in a directory to FILE.out I lost it and am trying to remake it and have the following which I know is very similar but can't tell where I am going wrong.               #!/usr/bin/env bash          for i in 'ls *.c'     do         gcc -g3 -o3 $i -o {$i%.}.out     done


title: cURL socks5 proxy: "Empty reply from server"

text: I'm accessing an http resource using Chrome, FoxyProxy without any problems. The proxy is defined as `socks5` in the standard port `1080`. I've tried accessing the same resource using cURL (actual URLs changed for privacy reasons):               $ curl -vvv -socks5 SOCKS_SERVER:1080 -X GET "THE_URL_FROM_BROWSER"      And got:               * About to connect() to SOCKS_SERVER port 1080 (#0)     *   Trying IP... connected     * Connected to SOCKS_SERVER (IP) port 1080 (#0)     > GET / HTTP/1.1     > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5     > Host: SOCKS_SERVER:1080     > Accept: */*     >      * Empty reply from server     * Connection #0 to host SOCKS_SERVER left intact     * Connection #0 seems to be dead!     * Closing connection #0     * About to connect() to URL_HOST port 80 (#0)     *   Trying SOME_IP...      Which never comes back with a response. Any idea why cURL can't access the same resource accessed by FoxyProxy?


title: Installing Linux Mint on a blank SSD

text: I've dual booted Mint and Windows 7, but I'd really like to get rid of Windows all together. And from what I understand, it's not really a true dual boot, but it's actually just running from inside Windows. So I was wondering if there was a way to install Mint on a blank SSD (in an external enclosure), so I can just later swap it for my HDD. And if this isn't possible, please explain why.