title: As what user is an sshfs mounted folder being accessed?

text: I'm trying to do a network backup of a drive. There are two machines in this process. PC1:   * Distant machine with 2 hards sda and sdb   * sdb is the drive which needs backing up   * two users exist, _root_ and _user_ PC2:   * machine I'm on   * working as user Alan, can go root when needed I do the following on PC2:               sshfs root@PC1:/dev ~/Desktop/netdisk/      Mounts fine. I have sdb available in ~/Destkop/netdisk/. Next step:               sudo dd if=~/Destkop/netdisk/sdb | gzip -c > ~/Destkop/ddbackup/image.gz      Yields an error:               dd: opening `netdisk/sdb': Permission denied      When i check the permissions of sdb:               brw-rw---- 1 root    disk    0, 0 Jan  3 10:47 sdb      Since i ssh-ed to PC1 as _root@PC1_ doesn't that mean that I have root access to files mounted as sshfs? From this example it seems it doesn't, is there a concept here that I'm missing?


title: How to search the current word in all opened tabs in Vim?

text: I have started learning Vim word-search using `*` and `#` while the cursor is over the current word. But this search is limited to the current file buffer. Is there a command or a shortcut to extend this search to:   1. all opened tabs?   2. all opened buffers?


title: How do you save a complex regex for multiple reuse in sed?

text: In using `sed`, I often create rather complicated and intricate regexes that I need to match twice in a file. Is there a way for me to save this regex and just reference it twice? Maybe something that looks like this?               sed ' complicated_regex=/^(([a-f0-9]{32})+([a-zA-Z0-9=]{{$i}})?)+$/     s/complicated_regex:complicated_regex/simple-output/     ' my_file      Update: An answer has presented the solution of using a bash variable. This doesn't work. Given a `test.txt`.               #test.txt     foo bar     bar foo      And the script               #!/bin/bash          VALUE='foo \([a-z]\+\)'          sed 's/"${VALUE}"/foo happy \1/' test.txt      This should produce the output               foo happy bar     bar foo      But instead I get the error               sed: -e expression #1, char 24: invalid reference \1 on `s' command's RHS


title: "sys/ioctl.h" header in linux

text: I am on `Linux 2.6.32-26-generic` When I look in to the linux source code for "ioctl.h" hearer file, I could see many variants. (for different platforms, I guess). i.e.               ./fs/ocfs2/ioctl.h     ./fs/btrfs/ioctl.h     ./fs/ceph/ioctl.h     ./include/config/i2o/config/old/ioctl.h     ./include/asm-generic/ioctl.h     ./include/linux/hdlc/ioctl.h     ./include/linux/ioctl.h     ./drivers/video/via/ioctl.h     ./drivers/staging/vt6655/ioctl.h     ./drivers/staging/vt6656/ioctl.h     ./arch/ia64/include/asm/ioctl.h     ./arch/h8300/include/asm/ioctl.h     ./arch/microblaze/include/asm/ioctl.h     ./arch/score/include/asm/ioctl.h     ./arch/avr32/include/asm/ioctl.h     ./arch/alpha/include/asm/ioctl.h     ./arch/x86/include/asm/ioctl.h     ./arch/m32r/include/asm/ioctl.h     ./arch/mn10300/include/asm/ioctl.h     ./arch/sparc/include/asm/ioctl.h     ./arch/powerpc/include/asm/ioctl.h     ./arch/m68k/include/asm/ioctl.h     ./arch/sh/include/asm/ioctl.h     ./arch/xtensa/include/asm/ioctl.h     ./arch/mips/include/asm/ioctl.h     ./arch/s390/include/asm/ioctl.h     ./arch/arm/include/asm/ioctl.h     ./arch/blackfin/include/asm/ioctl.h     ./arch/frv/include/asm/ioctl.h     ./arch/parisc/include/asm/ioctl.h     ./arch/cris/include/asm/ioctl.h      But I see that file being included as `#include <sys/ioctl.h>` How does this mapping work?


title: What does . match?

text: In working with regular expressions, I have been told that a dot character `.` will match _everything_. Except for newlines `\n`. Are there any other exceptions? What about the NUL character `\0`, or the backspace character `\b`, or any of the other various non-printable ASCII characters? Do different utility/programs like sed, awk, perl, and vim behave differently or the same in this aspect?


title: Script that spawns terminal windows suddenly waiting for each window to close before opening the next one

text: I recently started using a bash script to setup terminal workspaces for myself, and everything worked fine for the first couple of days. I run the script, and four or five or seven terminals pop up, all in precisely the right places on the screen, all cd'ed into the proper directories, ready for use. This morning I installed conky, and the next time I tried to run my script, the oddest thing hapened. Now it will only open the first window. When I close that window, the second one opens. When I close that one, the third, and so on until the end of the script. So now my script is useless except as a pasteboard for me to copy and paste into the terminal from. Here is my script:               #!/bin/bash          if [ $1 = "deploy" ]; then         cd ~/         gnome-terminal --geometry=185x41+0+0 --window-with-profile=Colquhoun              cd ~/Utilities/Ad\ Tag\ Generators         gnome-terminal --geometry=85x15+1312+0 --window-with-profile=Generator         cd ~/Utilities         gnome-terminal --geometry=85x28+1312+280 --window-with-profile=Deployer         cd ~/Staging         gnome-terminal --geometry=85x20+1312+730 --window-with-profile=Monitor     fi          if [ $1 = "servers" ]; then         cd ~/         gnome-terminal --geometry=89x20+0+0 --window-with-profile=Colquhoun         gnome-terminal --geometry=89x20+640+0 --window-with-profile=Colquhoun              gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun              gnome-terminal --geometry=89x20+0+360 --window-with-profile=Colquhoun         gnome-terminal --geometry=89x20+640+360 --window-with-profile=Colquhoun              gnome-terminal --geometry=89x20+0+700 --window-with-profile=Colquhoun         gnome-terminal --geometry=89x20+640+700 --window-with-profile=Colquhoun     fi          if [ $1 = "logchecks" ]; then         cd ~/         gnome-terminal --geometry=89x65+0+0 --window-with-profile=Colquhoun         gnome-terminal --geometry=89x65+640+0 --window-with-profile=Colquhoun         gnome-terminal --geometry=89x65+1280+0 --window-with-profile=Colquhoun     fi      Does anyone know why this might be happening? And why it wasn't happening previously but is now?


title: Wrong output of du?

text: I think my du command is confused.               % du -shc DIR ...     ...     6123941496      total          % du -shc DIR ...     ...     6.1G    total          % du -sc --si DIR ...     ...     6.6G    total      I've tried giving `LANG=C` and double-checking the result in a spreadsheet. It looks like -h already outputs using powers of 1000 (--si), and --si gives wrong answer. I think the correct answer should be 5.7G for -h and 6.1G for --si. So what happens here?               % du --version     du (GNU coreutils) 8.20     ...          % uname -a     Linux XXX 3.9-1-amd64 #1 SMP Debian 3.9.8-1 x86_64 GNU/Linux


title: Tricks and tips for finding information in man pages

text: Does anyone have any tricks and tips for finding information in man pages?


title: I need to turn a series of commands piped together into an alias in .bashrc

text: sudo ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'      The above command when run from terminal outputs the right "internal" ip address. When I try to pass as alias like:               alias intip='sudo ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}''      I am getting the following error:               alias: addr: | cut -d: -f2 | awk { not found     alias: print not found     alias: } not found      What I am doing wrong here?


title: Script to quickly test all keyboard keys

text: I need to check some notebooks for bad keyboard keys, and so I'd like to speed that up as much as possible. I found nothing for this specific task, so my idea is a script that reads the pressed keys and knows all the keyboard keys, so I can bash them quickly and it reports which ones are not pressed yet. I suppose I could accomplish that with either `showkey` or `xev`, grepping the output:               xev | grep keysym      Sample output:               state 0x10, keycode 46 (keysym 0x6c, l), same_screen YES,     state 0x10, keycode 33 (keysym 0x70, p), same_screen YES,     state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,     state 0x10, keycode 51 (keysym 0x5d, bracketright), same_screen YES,     state 0x10, keycode 36 (keysym 0xff0d, Return), same_screen YES,      The readable keysym is quite useful, but I keed to test keycodes, as they do not change as modifier keys are switched on/off (caps lock, num lock). I'm new to bash, so I'm putting something together. This is best result so far:               #!/bin/bash          function findInArray() {         local n=$#         local value=${!n}         for ((i=1;i < $#;i++)) {         if [[ ${!i} == ${value}* ]]; then         echo "${!i}"         return 0         fi         }         echo         return 1     }          list=( 38:a 56:b 54:c 40:d 26:e 36:Return 50:Shift_L )     xev | \     # old grep solution     # grep -Po '(?<=keycode )[0-9]+(?= \(keysym 0x)' | \     # 200_success' suggestion     awk '/state 0x.*, keycode / { print $4; fflush() }' | \     while read keycode ;      do       found=$(findInArray "${list[@]}" ${keycode})       if [[ $found ]]; then         echo Pressed $found         list=(${list[@]/${keycode}\:*/})         echo 'Remaining ===>' ${list[@]}         if [[ ${#list[@]} == 0 ]]; then           echo All keys successfully tested!           pkill xev           exit 0         fi       fi     done      While I used `grep` it was only printing the output when I closed `xev` and it wouldn't kill it at the end too. The `awk` suggestion from @200_success solved these issues, but it does not print the output immediatelly: it takes 5-6 keystrokes for the output to be "flushed". How can I fix that? Note: I know that this script would require a different list of keys for each different model of keyboard, but this is OK, as I only have a couple models to test. * * * Edit 1: I edited the question with my latest script code. Edit 2: script updated according to @200_success suggestion.


title: How do I copy a folder keeping owners and permissions intact?

text: So I was going to back up my home folder by copying it to an external drive as follows:               sudo cp -r /home/my_home /media/backup/my_home      With the result that all folders on the external drives are now owned by `root:root`. How can I have `cp` keep the ownership and permissions from the original?


title: How can I set my default shell to start up tmux

text: I would like my default bash shell to go straight into tmux instead of my always having to type tmux every time.


title: What does "0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31" mean in tcpdump?

text: I am trying to learn `tcpdump`. I ran the following command:-               tcpdump -i eth0 -lnXs1600 host google.com and port 80       and got the following results:-               2:23:45.781779 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [S], seq 3301439566, win 5840, options [mss 1460,sackOK,TS val 212804497 ecr 0,nop,wscale 5], length 0             0x0000:  4500 003c dbdf 4000 4006 64ad 0a10 1e1c  E..<..@.@.d.....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84e 0000 0000  ..$A...P...N....             0x0020:  a002 16d0 a18e 0000 0204 05b4 0402 080a  ................             0x0030:  0caf 2391 0000 0000 0103 0305            ..#.........     12:23:45.782354 IP 173.194.36.65.http > 10.16.30.28.42957: Flags [S.], seq 3225093944, ack 3301439567, win 32768, options [mss 1460,nop,wscale 0,nop,nop,TS val 102501848 ecr 212804497,sackOK,eol], length 0             0x0000:  4500 0040 d258 4000 3f06 6f30 adc2 2441  E..@.X@.?.o0..$A             0x0010:  0a10 1e1c 0050 a7cd c03b 0738 c4c7 f84f  .....P...;.8...O             0x0020:  b012 8000 4be5 0000 0204 05b4 0103 0300  ....K...........             0x0030:  0101 080a 061c 0dd8 0caf 2391 0402 0000  ..........#.....     12:23:45.782513 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [.], ack 1, win 183, options [nop,nop,TS val 212804497 ecr 102501848], length 0             0x0000:  4500 0034 dbe0 4000 4006 64b4 0a10 1e1c  E..4..@.@.d.....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84f c03b 0739  ..$A...P...O.;.9             0x0020:  8010 00b7 0af9 0000 0101 080a 0caf 2391  ..............#.             0x0030:  061c 0dd8                                ....     12:23:45.783359 IP 10.16.30.28.42957 > 173.194.36.65.http: Flags [P.], seq 1:374, ack 1, win 183, options [nop,nop,TS val 212804498 ecr 102501848], length 373             0x0000:  4500 01a9 dbe1 4000 4006 633e 0a10 1e1c  E.....@.@.c>....             0x0010:  adc2 2441 a7cd 0050 c4c7 f84f c03b 0739  ..$A...P...O.;.9             0x0020:  8018 00b7 2113 0000 0101 080a 0caf 2392  ....!.........#.             0x0030:  061c 0dd8 4745 5420 2f20 4854 5450 2f31  ....GET./.HTTP/1             0x0040:  2e31 0d0a 486f 7374 3a20 676f 6f67 6c65  .1..Host:.google             0x0050:  2e63 6f6d 0d0a 5573 6572 2d41 6765 6e74  .com..User-Agent             0x0060:  3a20 454c 696e 6b73 2f30 2e31 3270 7265  :.ELinks/0.12pre             0x0070:  3520 2874 6578 746d 6f64 653b 204c 696e  5.(textmode;.Lin             0x0080:  7578 3b20 3830 7832 342d 3229 0d0a 4163  ux;.80x24-2)..Ac             0x0090:  6365 7074 3a20 2a2f 2a0d 0a41 6363 6570  cept:.*/*..Accep             0x00a0:  742d 4c61 6e67 7561 6765 3a20 656e 0d0a  t-Language:.en..             0x00b0:  436f 6e6e 6563 7469 6f6e 3a20 4b65 6570  Connection:.Keep             0x00c0:  2d41 6c69 7665 0d0a 436f 6f6b 6965 3a20  -Alive..Cookie:.             0x00d0:  5052 4546 3d49 443d 3066 3366 3864 3864  PREF=ID=0f3f8d8d             0x00e0:  3538 6535 6534 6333 3a46 463d 303a 544d  58e5e4c3:FF=0:TM             0x00f0:  3d31 3337 3234 3332 3939 373a 4c4d 3d31  =1372432997:LM=1             0x0100:  3337 3234 3332 3939 373a 533d 4e7a 776e  372432997:S=Nzwn             0x0110:  5a72 5a51 2d70 5f75 515a 666e 3b20 4e49  ZrZQ-p_uQZfn;.NI             0x0120:  443d 3637 3d52 5a7a 3556 3072 5f4e 7849  D=67=RZz5V0r_NxI             0x0130:  3470 3631 4875 354d 684a 7653 5235 5074  4p61Hu5MhJvSR5Pt             0x0140:  6149 4a4f 6d72 6c32 7844 5f42 356c 4c78  aIJOmrl2xD_B5lLx             0x0150:  6a65 756a 592d 4379 7562 4353 6b55 6a4c  jeujY-CyubCSkUjL             0x0160:  656f 5a49 5757 5334 5f78 2d6d 5551 6e6e  eoZIWWS4_x-mUQnn             0x0170:  3831 5067 586a 426e 7771 386f 365a 3775  81PgXjBnwq8o6Z7u             0x0180:  3953 6459 776e 5453 7155 706e 5946 7842  9SdYwnTSqUpnYFxB             0x0190:  347a 795a 3036 6e75 6355 5f47 582d 4e78  4zyZ06nucU_GX-Nx             0x01a0:  475f 6544 310d 0a0d 0a                   G_eD1....      I want to know what does `0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31` stand for in the line `0x0030: 061c 0dd8 4745 5420 2f20 4854 5450 2f31 ....GET./.HTTP/1` Any help would be highly appreciated.


title: Is my volume group dead?

text: I have a notebook with Scientific Linux 6.4, also a Desktop PC with SL 6.4. The PC didn't booted in a day, saying KERNEL PANIC :) So I tried to get the disk from the PC to the notebook (VolGroup is the notebooks VG, VGSTUFF is the PC's):               [root@localhost ~] vgdisplay       --- Volume group ---       VG Name               VGSTUFF       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  14       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                6       Open LV               0       Max PV                0       Cur PV                1       Act PV                1       VG Size               465,26 GiB       PE Size               4,00 MiB       Total PE              119106       Alloc PE / Size       108417 / 423,50 GiB       Free  PE / Size       10689 / 41,75 GiB       VG UUID               XXXX            --- Volume group ---       VG Name               VolGroup       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                3       Open LV               3       Max PV                0       Cur PV                1       Act PV                1       VG Size               465,26 GiB       PE Size               4,00 MiB       Total PE              119106       Alloc PE / Size       119106 / 465,26 GiB       Free  PE / Size       0 / 0          VG UUID               XXXX          [root@localhost ~] find /dev | grep -i VGSTUFF     [root@localhost ~]       **QUESTION** : But even after I do a pvscan/vgscan... the /dev entry doesn't gets created. WHY? I can see the volumegrpu in the vgdsiplay.. I just want to run an FSCK on the LV's on the VG from the PC, because maybe that would fix the kernel panic on the PC. (ps.: there were times when we just unplugged the PC from the power, maybe that caused the corruption..)


title: How to quickly switch between displays in fedora 18

text: I have installed Fedora after using Windows 7. I have two screens connected to my computer: a TV and a 19" monitor. I only want one screen active at a time. I'd like to be able to switch which screen is active using a simple mouse-click or keyboard combination. From the settings window, all I can see is how to clone/extend the screen, which is not what I want to do. ![enter image description here](http://i.stack.imgur.com/6zxhA.png) In Windows 7 when I wanted to switch between connected displays I typed `Win`+`p`.


title: Imagemagick convert incorrectly sizes landscape pdfs

text: When I run               convert example.pdf example.png      I get a png image, but the image in the pdf is off-center and too small. How do I convert so that the png image is the right size and takes the whole page? Actually, this conversion is an automatic feature of an Elog that I use. If I do end up altering the call to convert, I need to do it programatically so the image orientation is detected and the correct options applied. When doing this with portrait-oriented images, it works fine. example.pdf: https://www.dropbox.com/s/d8k2odc384tixzb/example.pdf example.png: ![ExamplePNG](http://i.stack.imgur.com/AZSbu.png)


title: How to setup PPPoE with OpenWrt

text: Probably this is a simple question, but I can't find an answer... I have an ADSL router (Dlink DSL-524T) which runs OpenWrt Backfire 10.03.1. It connects to the internet using PPPoA: this is my `/etc/config/network` file:               config 'interface' 'loopback'             option 'ifname' 'lo'             option 'proto' 'static'             option 'ipaddr' '127.0.0.1'             option 'netmask' '255.0.0.0'          config 'interface' 'lan'             option 'type' 'bridge'             option 'ifname' 'eth0 eth1'             option 'proto' 'static'             option 'netmask' '255.255.255.0'             option 'nat' '1'             option 'ipaddr' '192.168.1.6'          config 'atm-bridge'             option 'unit' '0'             option 'encaps' '11c'             option 'vpi' '8'             option 'vci' '35'          config 'interface' 'wan'             option '_orig_ifname' 'nas0'             option '_orig_bridge' 'false'             option 'proto' 'pppoa'             option 'encaps' 'vc'             option 'atmdev' '0'             option 'vci' '35'             option 'vpi' '8'             option 'username' 'x'             option 'password' 'x'      I would like to switch to PPPoE, but I am not able to write a correct `network` file (and I can't find any _howto_ on the internet). Can someone help me?


title: Finding corrupted files

text: I have a directory that have zillions of files. As soon as I try to copy this directory, I receive a message that a file could not be copied (corrupt ?) and the copy stops. Is there any command I can type on terminal that can check all files on that directory tree and list all files that could not be copied or that are corrupt? I would not like to copy the files at this time, just to check if files would not be possible to copy/read if I try. I am on OS X Mountain Lion but any unix command should work fine, I hope. thanks. NOTE: by corrupt I mean a file that cannot be read or copied.


title: What is the kerberos keytab file used for in UNIX/AD kerberos authentication?

text: I have proved that UNIX/AD Kerberos authentication works without the presence of a keytab file so I'd like to know whether I should worry about it (given I'll need an individual keytab for each server I want to provide AD authentication services on).


title: Error using SCP: "not a regular file"

text: I have been searching for a while and I can't find the definition of a regular file. My path is permanent (I start at `/`) and I am connecting to               scp root@IP: /path/to/picture.jpg      Results in an inquiry for a password and then...               scp: .: not a regular file


title: git command not found

text: I had to install git from source on RHEL. After installation the git command is shown to be in `/usr/local/bin/git` when trying the `whereis` command.This path is available in `$PATH` also. When I type git it still says "Command not found." How to resolve this? EDIT : output of various commands               $type git     type: Command not found.          $which git     git: Command not found.          $ls -l /usr/local/bin/git     -rwxr-xr-x 112 root users 5851488 Mar 15 20:07 /usr/local/bin/git          $whereis git     git: /usr/local/bin/git          $echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin      EDIT: It works now but do not know why I disconnected the telnet connection and logged in again few minutes back and find that the git command works. I am not sure what caused it to start working. This is confusing.


title: Piping output to text file within a for loop

text: I'm trying to do the following within a `for` loop:   * Find files that satisfy a condition   * Echo the name of the files to a log file.   * Gzip the file. I can get the script to find the files and echo their names to the screen but cannot pipe them to a file. (I have not got as far testing the gzip part) Here's the relevant portion of the script (The `$LOGCLEAN_FILE` exists and is written to in an earlier portion of the script):               for F in `find . -type f \( ! -name '*.gz' \) -a \( ! -name '*.Z' \) -mtime +7`     do                  {             print "Will be compressing file  ${F}" >> $LOGCLEAN_FILE             } ;              ##gzip $F     done      If I run the script without the `" >> $LOGCLEAN_FILE"` text then the output displays on the screen. What am I doing wrong? Criticisms are welcome - I'm still learning.


title: Why is my rootfs filling up so fast?

text: I'm trying out Linux by installing openSUSE 12.2 x64 on VirtualBox; the host is 64 bit Windows 7 Ultimate. I gave the install 16GB of storage - I will only be messing around with it - I thought this should be plenty. By default, Virtual Box splits the storage you give it roughly in half - giving half to the rootfs and about half to user space. I've figured out via previous attempts that when the rootfs partition gets full - nothing works. But I've hardly done anything with it - I've installed Linux, run some updates and haven't even installed any extra software. I'm seeing that my rootfs is filling up fast - 83% already with no extra software installed - and hardly anything is going to my other partition (/home). Is this expected behavior? Does all installed software get installed to the rootfs? I've heard you should try to keep rootfs as small as possible, but all I've done is install Linux and update the system and it's at 4.8 GB - 83% full. How can I keep my rootfs from filling up? Should I have adjusted the VirtualBox defaults to just make rootfs bigger? Here's the results from a df: Notice how the /dev/sda3 is hardly used.               linux-5guy:/ # df -h                                                                                Filesystem      Size  Used Avail Use% Mounted on                                                             rootfs          6.1G  5.1G  732M  88% /                                                                      devtmpfs        2.0G   36K  2.0G   1% /dev     tmpfs           2.0G   80K  2.0G   1% /dev/shm     tmpfs           2.0G  552K  2.0G   1% /run     /dev/sda2       6.1G  5.1G  732M  88% /     tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup     tmpfs           2.0G     0  2.0G   0% /media     tmpfs           2.0G  552K  2.0G   1% /var/lock     tmpfs           2.0G  552K  2.0G   1% /var/run     /dev/sda3       7.8G  410M  7.0G   6% /home


title: Move root filesystem on a logical volume to a different disk

text: I'm trying to move my root LV to a new VG on my brand new SSD and it's driving me crazy. I think I pulled it off with rsync, but now grub is refusing to register the new boot option off of /dev/vg_ssd/lv_root. Why doesn't linux have cplv or lvmove like AIX? I want to use vg_ssd/root to mount to / instead of vg_dopey/lv00. /boot is separate. Grub2/FC17. Linux dopey 3.6.2-4.fc17.x86_64 #1 SMP Wed Oct 17 02:43:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux lvdisplay               --- Logical volume ---       LV Path                /dev/vg_ssd/root       LV Name                root       VG Name                vg_ssd       LV UUID                oDms4t-cKve-Eg27-jdcW-H3Wu-kvhs-qHhJQm       LV Write Access        read/write       LV Creation host, time dopey, 2012-10-22 20:25:31 -0400       LV Status              available       # open                 0       LV Size                32.00 GiB       Current LE             8191       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:1            --- Logical volume ---       LV Path                /dev/vg_dopey/lv01       LV Name                lv01       VG Name                vg_dopey       LV UUID                2tSy4L-kPnC-8rSE-jXX8-Dad4-9F4v-TPVmQz       LV Write Access        read/write       LV Creation host, time dopey, 2012-10-01 22:50:49 -0400       LV Status              available       # open                 1       LV Size                468.69 GiB       Current LE             14998       Segments               2       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:2            --- Logical volume ---       LV Path                /dev/vg_dopey/lv00       LV Name                lv00       VG Name                vg_dopey       LV UUID                SYe9Ze-XFUb-kIcu-UxEO-dhMd-ubaf-oAphsk       LV Write Access        read/write       LV Creation host, time dopey, 2012-10-01 22:50:53 -0400       LV Status              available       # open                 1       LV Size                19.53 GiB       Current LE             625       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           253:0      /etc/fstab, both on new and old root lvs               #/dev/mapper/vg_dopey-lv00 /                       ext4    defaults        1 1     UUID=587081f1-e607-43bd-85f5-7632d833726e /boot                   ext4    defaults        1 2     /dev/vg_dopey/lv01      /home       ext4    defaults    1 2     UUID=8dec0c61-6593-4e1d-a7b1-86de1816a601 /opt/media              ext4    defaults        1 2     UUID=910763ef-317b-4c48-b92f-8f24a729ffb8 swap                    swap    defaults        0 0     #/dev/mapper/vg_ssd-root     UUID=f7ada493-298d-4c09-8260-a8988ede1cfe / ext4 discard,noatime,errors=remount-ro 0 1      /boot/grub2/grub.cfg               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub2-mkconfig using templates     # from /etc/grub.d and settings from /etc/default/grub     #          ### BEGIN /etc/grub.d/00_header ###     if [ -s $prefix/grubenv ]; then       load_env     fi     set default="${saved_entry}"          if [ x"${feature_menuentry_id}" = xy ]; then       menuentry_id_option="--id"     else       menuentry_id_option=""     fi          export menuentry_id_option          if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }          function load_video {       if [ x$feature_all_video_module = xy ]; then         insmod all_video       else         insmod efi_gop         insmod efi_uga         insmod ieee1275_fb         insmod vbe         insmod vga         insmod video_bochs         insmod video_cirrus       fi     }          if [ x$feature_default_font_path = xy ] ; then        font=unicode     else     insmod part_msdos     insmod part_msdos     insmod lvm     insmod ext2     set root='lvm/vg_dopey-lv00'     if [ x$feature_platform_search_hint = xy ]; then       search --no-floppy --fs-uuid --set=root --hint='lvm/vg_dopey-lv00'  67deba56-4839-41c3-8c51-46185c8efd0e     else       search --no-floppy --fs-uuid --set=root 67deba56-4839-41c3-8c51-46185c8efd0e     fi         font="/usr/share/grub/unicode.pf2"     fi          if loadfont $font ; then       set gfxmode=auto       load_video       insmod gfxterm       set locale_dir=$prefix/locale       set lang=en_US       insmod gettext     fi     terminal_output gfxterm     set timeout=5     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Fedora' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-67deba56-4839-41c3-8c51-46185c8efd0e' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos6'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e         else           search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e         fi         echo    'Loading Linux 3.6.2-4.fc17.x86_64 ...'         linux   /vmlinuz-3.6.2-4.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet          echo    'Loading initial ramdisk ...'         initrd  /initramfs-3.6.2-4.fc17.x86_64.img     }     submenu 'Advanced options for Fedora' $menuentry_id_option 'gnulinux-advanced-67deba56-4839-41c3-8c51-46185c8efd0e' {         menuentry 'Fedora, with Linux 3.6.2-4.fc17.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.6.2-4.fc17.x86_64-advanced-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.6.2-4.fc17.x86_64 ...'             linux   /vmlinuz-3.6.2-4.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet              echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.6.2-4.fc17.x86_64.img         }         menuentry 'Fedora, with Linux 3.6.2-4.fc17.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.6.2-4.fc17.x86_64-recovery-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.6.2-4.fc17.x86_64 ...'             linux   /vmlinuz-3.6.2-4.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro single rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet             echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.6.2-4.fc17.x86_64.img         }         menuentry 'Fedora, with Linux 3.6.1-1.fc17.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.6.1-1.fc17.x86_64-advanced-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.6.1-1.fc17.x86_64 ...'             linux   /vmlinuz-3.6.1-1.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet              echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.6.1-1.fc17.x86_64.img         }         menuentry 'Fedora, with Linux 3.6.1-1.fc17.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.6.1-1.fc17.x86_64-recovery-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.6.1-1.fc17.x86_64 ...'             linux   /vmlinuz-3.6.1-1.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro single rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet             echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.6.1-1.fc17.x86_64.img         }         menuentry 'Fedora, with Linux 3.5.6-1.fc17.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.6-1.fc17.x86_64-advanced-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.5.6-1.fc17.x86_64 ...'             linux   /vmlinuz-3.5.6-1.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet              echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.5.6-1.fc17.x86_64.img         }         menuentry 'Fedora, with Linux 3.5.6-1.fc17.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.6-1.fc17.x86_64-recovery-67deba56-4839-41c3-8c51-46185c8efd0e' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6'  587081f1-e607-43bd-85f5-7632d833726e             else               search --no-floppy --fs-uuid --set=root 587081f1-e607-43bd-85f5-7632d833726e             fi             echo    'Loading Linux 3.5.6-1.fc17.x86_64 ...'             linux   /vmlinuz-3.5.6-1.fc17.x86_64 root=/dev/mapper/vg_dopey-lv00 ro single rd.md=0 rd.dm=0  KEYTABLE=us SYSFONT=True rd.luks=0 LANG=en_US.UTF-8 rd.lvm.lv=vg_dopey/lv00 rhgb quiet             echo    'Loading initial ramdisk ...'             initrd  /initramfs-3.5.6-1.fc17.x86_64.img         }     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###          ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/20_ppc_terminfo ###     ### END /etc/grub.d/20_ppc_terminfo ###          ### BEGIN /etc/grub.d/30_os-prober ###     menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-AA0C2EE80C2EAF6F' {         insmod part_msdos         insmod ntfs         set root='hd0,msdos1'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  AA0C2EE80C2EAF6F         else           search --no-floppy --fs-uuid --set=root AA0C2EE80C2EAF6F         fi         drivemap -s (hd0) ${root}         chainloader +1     }     ### END /etc/grub.d/30_os-prober ###          ### BEGIN /etc/grub.d/40_custom ###     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     ### END /etc/grub.d/40_custom ###          ### BEGIN /etc/grub.d/41_custom ###     if [ -f  ${config_directory}/custom.cfg ]; then       source ${config_directory}/custom.cfg     elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###      mount               proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)     devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=2013244k,nr_inodes=503311,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)     tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel)     tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)     /dev/mapper/vg_dopey-lv00 on / type ext4 (rw,noatime,seclabel,discard,errors=remount-ro,data=ordered)     securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)     selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)     tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,seclabel,mode=755)     cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)     cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)     cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)     cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)     cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)     cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)     cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)     cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)     cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)     systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=27,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)     mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel)     tmpfs on /media type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,mode=755)     debugfs on /sys/kernel/debug type debugfs (rw,relatime)     configfs on /sys/kernel/config type configfs (rw,relatime)     hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)     /dev/sdc1 on /opt/media type ext4 (rw,relatime,seclabel,data=ordered)     /dev/sda6 on /boot type ext4 (rw,relatime,seclabel,data=ordered)     /dev/mapper/vg_dopey-lv01 on /home type ext4 (rw,relatime,seclabel,data=ordered)     gvfs-fuse-daemon on /run/user/me/gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)     fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)


title: Mount cifs Network Drive: write permissions and chown

text: I have access to a cifs network drive. When I mount it under my OSX machine, I can read and write from and to it. When I mount the drive in ubuntu, using:               sudo mount -t cifs -o username=${USER},password=${PASSWORD} //server-address/folder /mount/path/on/ubuntu      I am not able to write to the network drive, but I can read from it. I have checked the permissions and owner of the mount folder, they look like: > 4.0K drwxr-xr-x 4 root root 0 Nov 12 2010 Mounted_folder I cannot change the owner, because I get the error: > chown: changing ownership of `/Volumes/Mounted_folder': Not a directory When I descend deeper into the network drive, and change the ownership there, I get the error that I have no permission to change the folder´s owner. What should I do to activate my write permission?


title: Logitech cordless mouse problem

text: I recently purchased a new Toshiba laptop and a Logitech M510 cordless mouse. I am running Mint 13 on the laptop. Initially (at least once) the mouse worked fine. Then it ceased to work. I've seached around on various fora and found reports of similar problems and various suggested solutions. One of the solutions was to switch the mouse off and remove the dongle from the laptop before booting. Then log in. The wait (at least) 10 seconds before switching on the mouse and plugging in the dongle. This seems to work most of the time, but has failed to work at least once. I have seen a posting (David Gatrell, 2012-06-23) to the effect that "This is really more a duplicate of bug #958174, which is still open." But as far as I can discern there has been no "activity" on this bug since the given date. And I'm not sure that this applies to Mint 13 (or only to "real" Ubuntu (12.04? 12.10?). Has anyone any ideas as to how I can get reliable performance out of this cordless mouse?


title: Installing VirtualBox inside of OpenVZ - missing sources

text: I'm attempting to install VirtualBox inside of an offsite OpenVZ instance I got a good deal on. The point being to run a small Windows XP box for some kind of Windows Server.   * Yes, it's an experiment.   * No, it's not for production.   * Yes, I am a stingy bastard. It seems like everything would work fine, but the installer can't find my distro's sources. My instance has Debian 6 installed. Running `uname -r` gives me `2.6.32-042stab061.2`. I've looked all through my apt-cache for anything similar, tried installing linux-sources-2.6.32 and a variety of linux-headers, but I'm having no luck. Does anyone know how I can get the proper sources for this instance so VirtualBox can compile itself? Thanks.


title: Using sed/awk to remove anything after first space

text: aaaaaaaa 09       bbbbbbbb 90        ccccccccccccccc  89       ddddd 09      Using sed/awk/replace, in the above text I want to remove anything that comes after the first space in each line. For example the output will be:               aaaaaaaa       bbbbbbbb         ccccccccccccccc       ddddd       any help will be appreciated.


title: OpenAM to OpenLDAP to SysAID (LDAP) Authentication

text: We just began using a new software called SysAid which uses LDAP to authenticate users. We have a client, which uses OpenAM to authenticate their users for a proprietary web application. Our goal, is to use OpenLDAP as a sort of broker, or middle man, between the OpenAM server and the LDAP server. The end goal is to allow users to login to SysAID with their OpenAM credentials without having to create any additional accounts. I've managed to get an OpenAM server and an OpenLDAP server running successfully in virtual machines, however I'm quite stumped as to what my next move should be. There could be better ways to accomplish what I we want to do, otherwise some helpful pushes in the right direction would do my day wonders!


title: How can I toggle mouse scrolling behavior while screen is already running?

text: Right now I have the following line in my `~/.screenrc` so I can scroll back and see the output for a screen window:               termcapinfo xterm ti@:te@      Now that I am editing in `vim`, I would like to use my mouse for scrolling _inside_ vim, not in the terminal scrollback. Is there a way to disable the terminal scrollback at runtime? The `screenrc` manual page mentions that `termcapinfo` cannot be changed once started: > You have to place these commands in one of the screenrc startup files, as > they are meaningless once the terminal emulator is booted. ... so that cannot be relied on. Reasonable hacks are also fine, I am using the Konsole terminal emulator.


title: How to grep number of occurence of two different words in a file on Linux?

text: How to grep number of occurrence of two different words e.g. 'register' and 'evn' in a file on Linux ? The output should be like following:               registered:20


title: What is Partition System ID?

text: If I go to fdisk, and I type t and then L I saw:               0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris      1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-      2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-      3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-      4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx      5  Extended        42  SFS             86  NTFS volume set da  Non-FS data      6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .      7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility      8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt      9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access      a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O      b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor      c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs      e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT      f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/     10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b     11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor     12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor     14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary     16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS     17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE     18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto     1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep     1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT     1e  Hidden W95 FAT1      What are those? Also on top of that we have file system. Things like ext2, ext3, ext4. What are those? Why do we have partition system ID and then have file system on top of that? I thought ntfs (windows file system) is a file system. I thought Fat32 is a file system. Which one I should use for linux centos if I want to host some stuff?


title: How do I know if a partition is ext2, ext3, or ext4?

text: I just formatted stuff. One disk I format as ext2. The other I want to format as ext4. I want to test how they perform. Now, how do I know the kind of file system in a partition?


title: No rule to make target `install'

text: I am following these instructions https://trac.ffmpeg.org/wiki/CentosCompilationGuide But when I try the code:               cd ~/ffmpeg_sources     curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz     tar xzvf yasm-1.2.0.tar.gz     cd yasm-1.2.0     ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"      make     make install     make distclean     . ~/.bash_profile      I get > No targets specified and no makefile found. Stop.


title: Filesystem surprisingly large

text: I'm running a dual booted Windows 7 with Linux Mint right now and I just checked my filesystem size and it jumped from quite small (about 30 GB) to 200 GB recently (no clue what triggered this, I just casually noticed it today). I can't figure out what is causing this. Here is what I have tried.               $ df          Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda5      327455500 195173172 115641816  63% /     none                   4         0         4   0% /sys/fs/cgroup     udev             2990264         4   2990260   1% /dev     tmpfs             601500      1940    599560   1% /run     none                5120         0      5120   0% /run/lock     none             3007492      7108   3000384   1% /run/shm     none              102400        36    102364   1% /run/user               $ sudo du /home | sort -rn | more     188966356   /home     188966352   /home/david     7361816 /home/david/Music     7361812 /home/david/Music/Music     6451008 /home/david/Dropbox     2869284 /home/david/Dropbox/Camera Uploads     2125920 /home/david/Dropbox/Photos     1301432 /home/david/Dropbox/CheapTixDownload     1132260 /home/david/Dropbox/Photos/EVERYTHING DAVATIE     684044  /home/david/Dropbox/Photos/Camera Uploads     561428  /home/david/.cache     492288  /home/david/.cache/google-chrome     492284  /home/david/.cache/google-chrome/Default     432896  /home/david/.cache/google-chrome/Default/Cache     302268  /home/david/Music/Music/Franz Ferdinand Complete Studio        264748  /home/david/Music/Music/Growlers     247924  /home/david/Downloads     199368  /home/david/Music/Music/GROWLERS      And after that it tapers off quite a bit (as you can see). So I can't imagine that it all adds up to 200 GB. The only packages I can think of that I recently installed were TexMaker but I had Tex and Lyx before and the space was still reasonable. I've also tried               sudo apt-get autoremove       sudo apt-get clean       sudo apt-get autoclean       Any clue as to what is causing this all?


title: Laptop VGA Output Randomly Changes Name Between VGA1 and VGA2

text: Periodically (every few reboots by the look of it) my external VGA output on my Laptop changes name between VGA1 and VGA2. For example right now xrandr is displaying:               timp@helez:~$ xrandr | grep VGA     VGA2 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 433mm x 271mm      But next time I reboot my system that could easily swap to VGA1 instead. I do have an Optimus graphics card, so that may be related, and I did in the past have Bumblebee installed, but I have since removed all the related packages and/or downgraded them back to their standard versions. Has anyone seen anything like this or have any ideas how to fix it? More info on my system:   * Laptop Model: Acer Aspire 5830TG   * Distribution: Slackware 14.1 64-bit   * GPU: NVIDIA GF 520M:              timp@helez:~$ /sbin/lspci | grep VGA     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     01:00.0 VGA compatible controller: NVIDIA Corporation GF119M [GeForce GT 520M] (rev a1)        * Xorg Version Info:              timp@helez:~$ Xorg -version          X.Org X Server 1.14.3     Release Date: 2013-09-12     X Protocol Version 11, Revision 0     Build Operating System: Slackware 14.1 Slackware Linux Project     Current Operating System: Linux helez 3.10.17 #2 SMP Wed Oct 23 16:34:38 CDT 2013 x86_64     Kernel command line: auto BOOT_IMAGE=Linux ro root=801 vt.default_utf8=1     Build Date: 09 October 2013  08:27:11PM          Current version of pixman: 0.30.2         Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.        * Video Driver: Intel:              timp@helez:~$ grep intel /var/log/Xorg.0.log     [   285.689] (II) LoadModule: "intel"     [   285.691] (II) Loading /usr/lib64/xorg/modules/drivers/intel_drv.so     [   285.733] (II) Module intel: vendor="X.Org Foundation"     [   285.733] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:     [snip a bunch more lines of output]        * Window Manager: i3 version 4.7.2


title: Why does sendmail's status keep changing to "dead but subsys locked"?

text: Every day I get the output of `sudo service --status-all` emailed to me using `crond`. The server is a CentOS 6.5 web server which I use to host a few WordPress websites. Occasionally `sendmail` will change from `is running...` to `dead but subsys locked` like in the example below.               crond (pid  7768) is running...     httpd (pid  2922) is running...     mysqld (pid  1314) is running...     sendmail dead but subsys locked     openssh-daemon (pid  11173) is running...      I normally fix this by restarting the service with this command `sudo service sendmail restart`. The change in status doesn't seem to affect `sendmail` at all as my WordPress sites still send emails fine (which is all I use `sendmail` for). What is causing this to happen and is it a problem? How do I go about fixing it?


title: I want to understand Buildroot - the 3 compression config options (kernel, initramfs & rootfs)

text: I'm using buildroot to generate my images and for sure there is the option of compression with the help of different methods (LZO, LZMA, gzip, ...). So far i found these 3 compression options in buildroot (v. 2013.11):   * Kernel compression Mode (in make linux-menuconfig)   * Built-in initramfs compression mode (in make linux-menuconfig)   * Compression method for the .cpio root file system ( (in make menuconfig) my questions are:   1. what is the difference of these modes and   2. why am I forced to chose between 3 methods for the kernel compression, instead of leaving it uncompressed ? greetings


title: How to disable a shell keyword?

text: Using `enable` builtin command we can disable a shell builtin command, for example `echo`, as follow:               enable -n echo      But how can we disable a shell keyword like `time`? If we try:               enable -n time      we will get the following "answer":               bash: enable: time: not a shell builtin      **Note** : I know how to run the `time` that's in `/usr/bin`, so I just want to know if it is possible to accomplish what I asked in the title.


title: Can I just disable updatedb?

text: Is `updatedb` necessary at all? I never use `locate` and my servers tend to have dozens of millions of files which usually makes updatedb to run for a long time and consume I/O needed by MySQL and/or other software. Can I just remove it from cron and expect everything to work? (by everything I mean usual software found on server: linux, cpanel, mysql, apache, php etc.).


title: Delete ghost files with special characters

text: I have read several ways to delete files with special characters, but none of them works for me in one special folder in my cache system. I have no idea how the files got there, and why they turned into ghost files. if i do: "ls -li" in my cache\1\a folder I get the following list (partial screen dump): * * *               335413265 -rw-r--r-- 1 www-data www-data 58734 Jul 30 08:18 1ah17.xml     335413267 -rw-r--r-- 1 www-data www-data 63256 Aug  2 22:12 1ah1.xml             ? ?????????? ? ?        ?            ?            ? 1ah2.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan12.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan30.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+cyan31.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n5.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+gr%C3%B8n6.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+r%C3%B8d1.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+sort2.xml     335413265 -rw-r--r-- 1 www-data www-data 58734 Jul 30 08:18 1ah+-+sort3.xml             ? ?????????? ? ?        ?            ?            ? 1ah+-+sort8.xml     242562822 -rw-r--r-- 1 www-data www-data 61613 Aug  2 07:35 1amp+operations+in+c     rimping+tool+number+of+pins%3A+-1.xml      * * * So I get a lot of files without an inode number. If I do a "find" in the folder I get a lot of errors saying that it can't read the ghost files. How can I get rid of these files and/or the entire folder?


title: Since I execute 'stty erase ~' I can't type / anymore in Putty

text: Yesterday I was fed up with being forced to type `Caps`+`Backspace` to erase character in Putty, because a `Backspace` was printing a `~`.   I found some info on internet saying you should type `stty erase ~`, or at least that how I understand it.   Since then when I type on `/` it send a `←` to the terminal and I'm not even capable to copy/paste in my putty.   Does anyone has a good idea to save me ? **Note** :   `/` is still working in binary like `vi` or `more` but not in `bash` (where I typed the command). Additional info:               bash-3.2# stty -a     speed 38400 baud; 55 rows; 210 columns     eucw 1:1:0:0, scrw 1:1:0:0:     intr = ^C; quit = ^\; erase = /; kill = ^U; eof = ^D; eol = <undef>     eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; dsusp = ^Y; reprint = ^R     discard = ^O; werase = ^W; lnext = ^V     -parenb -parodd cs8 -cstopb -hupcl cread -clocal -parext     -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc     ixon -ixany -ixoff -imaxbel     isig icanon -xcase echo -echoe -echok -echonl -noflsh     -tostop -echoctl -echoprt -echoke -flusho -pending -iexten     opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3      **Edit 2** :   Also `stty -g` provide a string usable by other `stty` so if you have a working command elsewhere you can export the result of one to import it to the buggy one.


title: Right way to start VirtualBox with shared folders mounted

text: Need of commandline to start VM with access to shared folder. Now if I run               /usr/lib/virtualbox/VirtualBox --comment "win" --startvm "c252555c-bla-bla"      I get VM running but shared folders not mounted, and I have to go to VirtualBox GUI manager and manualy re-select sharedfolders connections. unless the checkbox automount is checked. It has no effect in commandline launch mode.


title: How to install SMS Servers and Phone Servers?

text: If we want our servers to email, we know that we should install sendmail or qmail. If we want our servers to send sms or robot calling (e.g voice confirmation [insecure method] ), what should we install on our servers?   I'm a kid. Help me.


title: Guake throws an error on startup

text: I'm using Ubuntu-Server 12.04, but I wasn't sure if this was an Ubuntu specific question, so I'm posting it here. I got myself a graphical user interface by installing `xinit` and `openbox` (using `apt-get install`). I installed `guake` as well (again using `apt-get install`). However, when I try to run `guake` in my terminal emulator (Sakura), I get the following error message:               Traceback (most recent call last):       File "/usr/lib/guake/guake.py", line 1356, in <module>         if not main():       File "/usr/lib/guake/guake.py", line 1299, in main         instance = Guake()       File "/usr/lib/guake/guake.py", line 649, in __init__         notification.show()     glib.GError: GDBus.Error: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files      How can I fix this and get `guake` to run?


title: How to install rtl8723ae firmware in CentOS 6.4

text: I am experimenting with CentOS 6.4 on an external hard drive. My main system in based on Ubuntu 13.04 and works well with the Wi-Fi (rtl8723ae) installed on My Toshiba C855 laptop. I have tried upgrading the Kernel, but still no Wi- Fi connection. Are there any RPM files I still need to install? I have also installed the header files.


title: Keyboard Shortcut To Send Text Strings To Program

text: How can I configure a shortcut key to send a text string to the current program? The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, etc). I don't need any further automation than just entering the text. Gentoo Linux (3.2.12-gentoo) Xfce Desktop Environment (Version 4.8)


title: Broadcast port to other computers after SSH reverse tunnelling

text: I have been reading on how to reverse tunnel and I am using this command: `ssh -f -N -T -R25565:localhost:25565 dns.mindfulhacker.tk` To forward my Minecraft server. My other server can connect to my Minecraft server but clients cannot connect to it by using the IP: `dns.mindfulhacker.tk:255565` How can I forward my tunnel so it works like this? Both servers run Ubuntu Server 12.04 LTS and clients will be running Windows. (If the clients used Linux I would allow them to SSH Tunnel it back.)


title: Why do most distros (other than Debian) recommend/require a full reinstall when upgrading to a new version?

text: Having spent most of my Linux life using Debian, I'm been having a look at other distros and am really surprised at extent to which they don't provide a smooth upgrade between versions. Debian is infinitely upgradeable, and I've upgraded through a few major stable versions now. I'm talking about well-supported distros like Fedora (and derivatives), even Ubuntu and derivatives. Even stable server-oriented distros like CentOS. Is it because Debian's package management system and package upgrade scripts are just far more advanced than anything other distros have to offer? Or is reinstalling from scratch on a major version upgrade just a better idea overall, regardless of distro?


title: UTF-8 works in gnome-terminal only after selecting already selected encoding

text: Running Centos 6.3. In gnome-terminal UTF-8 works, but only after I've chosen (the already chosen) UTF-8 encoding in gnome-terminal settings. How do I force gnome-terminal to respect its own encoding setting?


title: How to allow www-data to create a folder without giving read access to the parent folder

text: I'm not exactly sure the right question to ask, so I'll try to explain what I'm trying to do. I have an internal web application (in PHP) that I want to be able to create a folder. The trouble is that the Apache user www-data doesn't have any access to the parent folder that I want my folder to be created in. I don't think it's appropriate to give www-data access to the parent folder, so I'm wondering if I can create a script somewhere that www-data can run which has more privileges than www-data does. The script would simply do something like this (psuedocode):               FOLDER_NAME = sanitise(<arg-val-1>)     mkdir /some-path/$FOLDER_NAME      Where would it be appropriate to create this script, and how would it be run by www-data as root? (Or alternatively, is there a better way to solve the problem?) I'm running Debian Linux.


title: Copying and renaming files to a single directory by a single shell script

text: I have multiple files with an example of how they look like shown below.               -rw-r--r--   1 my_user     users           12 Dec 13 09:56 Example_30_001_20130913175000.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 09:57 Example_30_002_20130913180854.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 09:58 Example_30_003_20130913180857.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 09:58 Example_30_004_20130913180901.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 09:59 Example_30_005_20130913180904.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 10:02 Example_30_006_20130913180907.DAT       -rw-r--r--   1 my_user     users           12 Dec 13 09:59 Example_30_007_20130913180911.DAT        My question is how do I copy them in the same directory and rename the copied files using a sh script such that they start with something like the filenames shown below?               Ex_Example_001.DAT       Ex_Example_002.DAT       Ex_Example_003.DAT       Ex_Example_004.DAT       Ex_Example_005.DAT       Ex_Example_006.DAT       Ex_Example_007.DAT


title: Mass ID3 tag editor like vorbistagedit?

text: My favorite tool for batch editing of vorbis comments is vorbistagedit. I can do `vorbistagedit *.ogg` and it lets me edit the metadata in all my ogg files at once in my favorite editor (emacs). I'm wondering if there is a tool that works in a similar fashion for id3 tags? I could see it opening up a file that looked something like:               : file1.mp3     + file1.mp3     TIT2=Title     TPE1=Artist     TALB=Album          : file2.mp3     + file3.mp3     ...      And I could add/edit tags as I see fit, and when I close out the $EDITOR, it writes the tags back to the files. It wouldn't have to work exactly like that, but I think that would be my ideal. Anything would be easier than a bunch of BASH `for` loops with `id3v2`. If nothing like it exists, I might end up writing my own that uses the eyeD3 library. And please don't bother suggesting EasyTag. It's a great program, but I'm looking for something that doesn't require a GUI. **P.S.** For those who don't want to bother reading the comments below, I simply modified vorbistagedit to support id3 tags in mp3 files. The modified script can be found on GitHub.


title: Opencats installation error

text: i am trying to install opencats. While installing i am getting following error.. What is the problem? ![enter image description here](http://i.stack.imgur.com/egSH4.png)


title: Calculate relative positions in strings

text: Sample input file:               #name   complete(cs)    len(cs) simple(ss)  len(ss) position(ss)     NAME1   A0AAA000AAA00A  14      AAAAAAAA    8        4,6     NAME2   AAAA0AA00000A   13      AAAAAAA     7        7      Let's say I'm interested in knowing the corresponding position in the complete string (cs) of some letters of the simplified string(ss), given in the position(ss) column. _Note: in the simple string(ss), only letters are allowed. In the complete string, every character's allowed._ In this exemple, it would return: Sample output file:               #name   complete(cs)    len(cs) simple(ss)  len(ss) pos(ss) pos(cs)     NAME1   A0AAA000AAA00A  14      AAAAAAAA    8        4,6    5,10     NAME2   AAAA0AA00000A   13      AAAAAAA     7        7      13      I'm currently building this file using python, but I'm sure there is an easy Unix way out.


title: How to delete this undeletable directory?

text: I untarred a corrupt tar file, and managed to end up with some directory that I can not delete, If I try to delete it, it seems like it can not be found, but `ls` shows it's present, both with bash and with python I get similar behaviour, except right after I try to delete it with `rm -rf`, `ls` complains it can't find it, then it lists it (see below after `rm -rf`). The `find` command shows the file is present, but still I can't think of a way to delete it.   Here are my attempts: Here you see both `ls` and `find` agree we have a directory,               rl]$ ls     mikeaâ??cnt     rl]$ find -maxdepth 1 -type d -empty -print0       ./mikeaâcnt       But I can't delete it:               rl]$ find -maxdepth 1 -type d -empty -print0 |  xargs -0 rm -f -v      rm: cannot remove `./mikeaâ\302\201\302\204cnt': Is a directory     rl]$ ls     mikeaâ??cnt      I can `cd` to it though and it's empty:               rl]$ cd mikeaâ^Á^Äcnt/     mikeaâ^Á^Äcnt]$ ls     mikeaâ^Á^Äcnt]$ pwd     .../rl/mikeaâcnt               mikeaâ^Á^Äcnt]$ cd ../     rl]$ ls     mikeaâ??cnt      see below that is not a simple file but a directory, plus `ls` behaves funny after the `rm -rf` it says it can't find the file then lists it straight after:               rl]$ rm mikeaâ^Á^Äcnt/     rm: cannot remove `mikeaâ\302\201\302\204cnt/': Is a directory     rl]$ rm -rf  mikeaâ^Á^Äcnt/     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt     rl]$       So this is the attempt with python, the file is found, but the name is not usable as a name that can be deleted:               rl]$ python      Python 2.6.6 (r266:84292, Jul 10 2013, 22:48:45)      [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2     Type "help", "copyright", "credits" or "license" for more information.     >>> import os     >>> import shutil     >>> os.listdir('.')     ['mikea\xc3\xa2\xc2\x81\xc2\x84cnt']     >>> shutil.rmtree(os.listdir('.')[0] )     Traceback (most recent call last):       File "<stdin>", line 1, in <module>       File "/usr/lib64/python2.6/shutil.py", line 204, in rmtree         onerror(os.listdir, path, sys.exc_info())       File "/usr/lib64/python2.6/shutil.py", line 202, in rmtree         names = os.listdir(path)     OSError: [Errno 2] No such file or directory: 'mikea\xc3\xa2\xc2\x81\xc2\x84cnt'      even when I use tab completion the name it picks up is no usable:               rl]$ rm -rf mikeaâ^Á^Äcnt      rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt      using the name that python shows with bash I get this:               rl]$ rm -rf "mikea\xc3\xa2\xc2\x81\xc2\x84cnt"     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt      Is there anything I can do to get rid of this corrupt dir? The underlying filesystem (NFS) seems functional and no other problems are reported, and I have had no such problems until the corrupt tar file. EDIT: Here is using `find`'s own `-exec` option to call `rm`               rl]$ find -maxdepth 1 -type d -empty -exec rm -f {} \;     find: `./mikeaâ\302\201\302\204cnt': No such file or directory     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt     rl]$      but the file is still there, (`ls` complains it can't find it, but then shows it anyway) 2nd EDIT:               rl]$ find -maxdepth 1 -type d -empty -exec rm -rf {} \;     find: `./mikeaâ\302\201\302\204cnt': No such file or directory     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt      The behaviour is still unchanged, the file still present 3rd EDIT:               rl]$ ls     mikeaâ??cnt     rl]$ find -maxdepth 1 -type d -empty -exec rm -rf {} +      rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt      There seems to be more to the name than `mikeaâcnt` from looking at the output of the python attempt `mikea\xc3\xa2\xc2\x81\xc2\x84cnt`, and this screenshot: ![ls output](http://i.stack.imgur.com/K7ZAJ.png) 4th EDIT: This is the attempt with a wild card:               rl]$ echo *      mikeaâcnt     rl]$ echo mike*      mikeaâcnt     rl]$ rm -rf mike*     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt      and my locale:               rl]$  locale     LANG=en_US.utf8     LC_CTYPE="en_US.utf8"     LC_NUMERIC="en_US.utf8"     LC_TIME="en_US.utf8"     LC_COLLATE="en_US.utf8"     LC_MONETARY="en_US.utf8"     LC_MESSAGES="en_US.utf8"     LC_PAPER="en_US.utf8"     LC_NAME="en_US.utf8"     LC_ADDRESS="en_US.utf8"     LC_TELEPHONE="en_US.utf8"     LC_MEASUREMENT="en_US.utf8"     LC_IDENTIFICATION="en_US.utf8"     LC_ALL=      5th Edit:               rl]$ ls -i      ls: cannot access mikeaâcnt: No such file or directory     ? mikeaâ??cnt      but also the behaviour has changed, now `ls` and `cd` do this:               rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt     rl]$ cd mikeaâ^Á^Äcnt      mikeaâcnt: No such file or directory.      This has happened after the attempts to delete, I'm thinking that it might be NFS issues as suggested in one of the answers here by vinc17. 6th EDIT: This is the output of `lsof` and `ls -a` ~~rl]$ /usr/sbin/lsof mikeaâ^Á^Äcnt lsof: status error on mikeaâ\xc2\x81\xc2\x84cnt: No such file or directory~~ above is wrong, here is the correct `lsof` invocation:(rl is the parent directory)               rl]$ /usr/sbin/lsof | grep mike | grep rl      tcsh      11926   mike  cwd       DIR   0,33     4096 19569249 /home/mike/mish/rl     lsof      14733   mike  cwd       DIR   0,33     4096 19569249 /home/mike/mish/rl     grep      14734   mike  cwd       DIR   0,33     4096 19569249 /home/mike/mish/rl     grep      14735   mike  cwd       DIR   0,33     4096 19569249 /home/mike/mish/rl     lsof      14736   mike  cwd       DIR   0,33     4096 19569249 /home/mike/mish/rl     rl]$           rl]$ ls -a     ls: cannot access mikeaâcnt: No such file or directory     .  ..  mikeaâ??cnt      7th Edit: move wont work, (I tried it before all this, but I did not save the output), but it has the same problem as `ls` and `rm` with the file. 8th EDIT: this is using the hex chars as suggested:                rl]$ ls --show-control-chars | xxd     0000000: 6d69 6b65 61c3 a2c2 81c2 8463 6e74 0a    mikea......cnt.     rl]$ rmdir $'mikea\6d69\6b65\61c3\a2c2\81c2\8463\6e74\0acnt'      rmdir: failed to remove `mikea\006d69\006b651c3\a2c2\\81c2\\8463\006e74': No such file or directory     rl]$ ls     ls: cannot access mikeaâcnt: No such file or directory     mikeaâ??cnt     rl]$      9th Edit: for the `stat` command:                rl]$ stat  mikeaâ^Á^Äcnt      stat: cannot stat `mikeaâ\302\201\302\204cnt': No such file or directory      rl]$      Its seems even more likely from all the output, there is a bug or other NFS misbehaviour as suggested in the comments. Edit 10: This is strace output in a gist since its so large, its the output or these two commands:               strace -xx rmdir ./* | grep -e '-1 E'`     strace -xx -e trace=file ls -li`      https://gist.github.com/mikeatm/e07fa600747a4285e460 Edit 11: So before the above `rmdir` i noticed that i could `cd` into the directory, but after the `rmdir` i could not `cd` again, similar to yesterday. the `.` and `..` files were present:               rl]$ ls     mikeaâ??cnt     rl]$ cd mikeaâ^Á^Äcnt/     mikeaâ^Á^Äcnt]$ ls     mikeaâ^Á^Äcnt]$ ls  -a     .  ..     mikeaâ^Á^Äcnt]$ cd ../      Final Edit: I saw a local admin over this and it was dealt with by logging on to the server itself and deleting from there. The explanation from them is that it could be a problem with character sets in the name being inappropriate.


title: A log which holds all actions

text: I was wondering if Centos 6.4 has some kind of log which stores most actions that happen. The issue is as following. I have two VirtualMachines, both running CentOS and on both independant machines (tough on the same physical machine), there are files being removed. I have no idea who or what removes those files, we Bacula running but i don't want to point fingers, tough that is the only external source which really handles / does something with files. So my question is if there is a place i could look to see what is going on. I just had this issue happen again on me 30 minutes ago, quite some folders got removed, and quite some files (even config files for some web apps).


title: ncq disabled on usb drive with ncq capabilities

text: I've recently purchased a Gigabyte BRIX paired with WD10JFCX 1TB Drive which is encased in an USB3.0 box. On it I run Ubuntu LTS 14.04 When I look at `/sys/block/sdb/devices/queue_depth` it reads 1 meaning NCQ is disabled. Whenever I try to set this value (as root) to anything but one, I get a 'permission denied' error message. Since the permissions on the path are set to 444 I've changed this to 744 which results in an Input/Output Error like this (the device is currently mounted):               echo 32 > /sys/block/sdb/device/queue_depth     -su: echo: write error: Input/output error      I've not found USB drives to not have NCQ capabilities so I'm a bit oblivious to what is going on. Should I rewrite some part of udev rules ?


title: How does one disable the floppy module from loading on boot in CentOs7?

text: I'm running a CentOS 7 install in VMWare Workstation 9. I have removed the floppy drive from the VM configuration (as my host machine does not have one, and I haven't used one in literally 12 years). When the VM boots, an error message comes up:               end_request I/O error dev fd0 sector 0      The error does not halt the machine from running, but i would like to deal with the issue. After looking around online, it seems that the floppy module is loaded at start up by default, whether there is a floppy drive connected or not. This can be disabled by telling the system not to load the module at start up, and apparently the different flavours of GNU Linux all have different ways of doing this. I've tried several methods, and all have failed as the module still loads on start up and the same error message still appears during boot. I've tried adding the following line to each corresponding file: `/etc/modprobe.conf`: > alias floppy off `/etc/modprobe.d/blacklist.conf`: > blacklist floppy `/etc/modprobe.d/floppy.conf`: > blacklist floppy In each case those files did not exist as default and needed to be created, and thus far every method has failed. _Does anyone have a definitive answer for how to disable the floppy module from loading on boot in CentOS 7 specifically?_ I have asked on the CentOS 7 forums, but there has not been any reply, hence me asking here instead. Please note that the solution for CentOS 6.5 does not work.


title: How to include data files (pictures, text files, ...) in a debian package

text: I'm a beginner in Debian packaging so sorry for the obvious question. I followed a tutorial to make a package application, but it only deals with the source, there's absolutely no other file types mentioned. How do I include data files so I can access them from my application in a package? For example, in the makefile, there's a $(DESTDIR) option but I would never move the data files in $(DESTDIR)/usr/bin (at least I think i'm not supposed to)


title: wc -L reports a line-length of 8 for a tab-char. bug or feature?

text: `-L` is a useful feature of `wc`, or so I thought. It prints the length of the longest line. For some reason it expands a single-byte tab-char to a length of 8.   Is there some way to set this to not "expand" the tab? and what might be the rationale behind this expansion?               echo -n $'\t' | wc -L      outputs `8` wc (GNU coreutils) 7.4   GNU bash, version 4.1.5


title: How to disable the Forward/Back buttons on my mouse

text: My mouse has an unfortunate feature. On the left side, right where my thumb sits ever so gently when I'm using it, there are two buttons that are so sensitive a mere brush will make them click. I'm talking of course about the pesky forward/back buttons which, if pressed in a browser, can make watching that hour-long youtube video that much harder. Is there a way for me to disable them? Would this be handled by X?


title: Cross compiling expect for ARM

text: I have downloaded expect5.4 . I'm trying to cross compile it for ARM(PandaBoard) running stripped down version of linux. In the initial setup of configuring , I try               Shell$ ./configure --host=ARM     configure: WARNING: If you wanted to set the --build type, don't use --host.         If a cross compiler is detected then cross compile mode will be used.     checking for correct TEA configuration... ok (TEA 3.9)     configure: configuring expect 5.45     checking for Tcl configuration... found /home/user1/scripts/tcl8.6.0/unix/tclConfig.sh     checking for existence of /home/user1/scripts/tcl8.6.0/unix/tclConfig.sh... loading     configure: --prefix defaulting to TCL_PREFIX /usr/local     configure: --exec-prefix defaulting to TCL_EXEC_PREFIX /usr/local     checking for ARM-gcc... /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc     checking for C compiler default output file name... a.out     checking whether the C compiler works... yes     checking whether we are cross compiling... yes     checking for suffix of executables...     checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc accepts -g... yes     checking for /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc option to accept ANSI C... none needed     checking how to run the C preprocessor... /home/user1/toolchain/toolchain/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -E     checking for a BSD-compatible install... /usr/bin/install -c     checking whether make sets $(MAKE)... yes     checking for ARM-ranlib... no     checking for ranlib... ranlib     checking for egrep... grep -E     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     ..     ..      ..     ..     ..     checking for openpty... no     checking for openpty in -lutil... yes     checking if running Sequent running SVR4... no     checking build system type... i686-pc-linux-gnu     checking host system type... Invalid configuration `ARM': machine `ARM' not recognized     configure: error: /bin/bash tclconfig/config.sub ARM failed      Its able to pick arm-gcc but it fails for some reason. **UPDATE:** On compiling with ./configure --host=arm , It goes further the error i'm getting now is               checking for sysconf... yes     checking for strftime... yes     checking for strchr... yes     checking for timezone... yes     checking for siglongjmp... yes     checking for memcpy... yes     checking if WNOHANG requires _POSIX_SOURCE... configure: error: Expect can't be cross compiled


title: how to make terminal utf-8

text: How can I make my terminal(bash) window uft-8, that it can show utf-8 characters? my operating system is : ubuntu 12.04 my desktop : gnome-shell How about native shell(outside of desktop)?


title: Replacing a pattern in line preceding another pattern of interest

text: I have a log file with many instances of statements as shown below:               14 Aug 19 16:30:11.506: <DATA>  |POS|IDLE|1|01131844090|5950|$hostIp|$size  |$data     20 Aug 19 16:30:12.439: <DATA>  |POS|IDLE|1|01131844090|5950|$hostIp|$size  |$data     21 ###############################################################################      I want to replace `IDLE` just preceding the `#########..` to say, `END` and have other cases of `IDLE` retained. How do I achieve it? Edit: Maybe something is different with my actual file. Answers to this question haven't met the requirement. Detailed extract and my requirement is shown below:                 22 Aug 19 16:47:33.159: <DATA>  |POS|RINGING|1|1126710938|5950|$hostIp|$size  |$data         23 Aug 19 16:47:33.453: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data         24 Aug 19 16:47:33.484: <DATA>  |POS|TRAINING|1|1126710938|5950|$hostIp|$size  |$data         25 Aug 19 16:48:05.824: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data         26 Aug 19 16:48:05.916: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data         27 Aug 19 16:48:05.947: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data         28 Aug 19 16:48:23.792: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data         29 Aug 19 16:48:23.853: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data         30 Aug 19 16:48:23.884: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data         31 ##############################################################################      After operating on the above instance, the result should be: (`IDLE` preceding `####` line is changed to `END`.Note there are many instances of such events. My actual need is to find time diff between `RINGING` and `IDLE - aka END)`               22 Aug 19 16:47:33.159: <DATA>  |POS|RINGING|1|1126710938|5950|$hostIp|$size  |$data     23 Aug 19 16:47:33.453: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data     24 Aug 19 16:47:33.484: <DATA>  |POS|TRAINING|1|1126710938|5950|$hostIp|$size  |$data     25 Aug 19 16:48:05.824: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data     26 Aug 19 16:48:05.916: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data     27 Aug 19 16:48:05.947: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data     28 Aug 19 16:48:23.792: <DATA>  |POS|IDLE|1|1126710938|5950|$hostIp|$size  |$data     29 Aug 19 16:48:23.853: <DATA>  |POS|INIT|1|1126710938|5950|$hostIp|$size  |$data     30 Aug 19 16:48:23.884: <DATA>  |POS|END|1|1126710938|5950|$hostIp|$size  |$data     31 ##############################################################################


title: Traffic not being routed through Cisco VPN

text: I'm unable to use my school's VPN correctly in Linux. This is what I did:   1. Installed a fresh x64 Kali linux (latest).    2. Updated all current packages through apt-get    3. Installed the required vpn packages through apt-get.    4. Configured the VPN as "Cisco Compatible VPN (vpnc)"   5. Entered everything according to the Cisco config file which I downloaded This is the .pcf file I downloaded from my school's site: port configuration file This is the screenshot of the configuration window in kali: ![VPN Config screenshot](http://i.stack.imgur.com/YZx3M.png) When I select the vpn from the Networkmanager GUI I get a successful login message and the tray icon shows a little lock, indicating the connection is secure I guess. I also get a tun adapter in my ifconfig: ifconfig output But that's it, my public IP remains the same and I can't access my school's servers. I tried:   * Restart of network manager   * System reboot


title: Sorting blocks of lines

text: I have a file that contains 4n lines. Here is an excerpt from it containing 8 lines               6115 8.88443     6116 6.61875     6118 16.5949     6117 19.4129     6116 6.619      6117 16.5979      6118 19.4111     6115 8.88433        What I want to do is sort a block, where each block consists of 4 lines based on the first column. The output for the excerpt should look as shown below.               6115 8.88443     6116 6.61875     6117 19.4129     6118 16.5949     6115 8.88433      6116 6.619      6117 16.5979      6118 19.4111


title: Zswap, Zram, Zcache desktop usage scenarios

text: I've been trying to understand the difference in **use cases** for Zswap, Zram, and Zcache. Apologies in advance for the long/slightly sloppily worded question. I've done a bunch of googling, and I understand that zram is basically a block device for compressed swap, while zswap compresses in kernel using the frontswap api. It appears that one advantage of zswap is that it can move some pages to a backing swap when under pressure in a LRU manner, while zram can't do that (please confirm, not sure if this is true). So here's my question: 1.) As a desktop user, what is the performance difference between zcache/zswap/zram, especially zswap and zram? For example, is one much better/worse at memory fragmentation (the kind that leads to excessive memory usage and waste)? Bonus question: 2.) Is there a likely ideal combination of the above (say, zram+zswap, or zram+zcache) for desktop performance (including responsiveness of desktop, plus minimally disruptive swap behavior and sane memory management)? *Citation of sources is greatly appreciated. I should add that I'm a decently experienced linux user (5 years), and have tried to really understand how my system including the kernel works. However, I'm not a programmer, and only have very basic programming knowledge (3 credits college course). But be technical if you need to; I'll parse your meaning on my own time. System specs: Linux Mint 15 Processor:Core 2 Quad 6600 (2.4ghz) Ram: 8G linux kernel: liquorix 3.11 series Storage: 128 GB SSD, 1TB HDD 5400rpm **Also no "buy more ram" comments plz ;) I've maxed the ram on this mobo, and have a $0 upgrade budget for the foreseeable future. However I like to keep open memory intensive programs (multiple browsers being the main consumers of my ram) so I don't mind swapping within reasonable performance degradation limits.


title: Defining aliases for a certain directory

text: Is there a way to have an alias set for a particular directory and its subdirectories? I know I can put it in my `.bashrc` file, but I would like it only for a certain directory. **Edit:** what i mean is i'd like to run commands that are aliased inside of the directory               ~$ foo     -bash: foo: command not found     ~/project$ foo     Bar!


title: Getting new files to inherit group permissions on Linux

text: I am having a problem with permissions on a Linux server. I am used to BSD. When a directory is owned by a group the user who owns it isn't in such as www-data, files created in it will be owned by that group. This is important because I want files to be readable by the webserver (which I will not run as root) but so a user can still put new files in the directory. I can't put the users in www-data because then they can read every other users websites. I want the webserver to read all websites, I want users to be able to change their own. The permissions are set like this on the folders at the moment....               drwxr-x--- 3 john www-data 4096 Feb 17 21:27 john      It is standard behavior on BSD for permissions to work this way. How do I get Linux to do this?


title: shell script problem with using the operators

text: I am comparing two strings using the `levenshtein distance` algorithm. I got the PHP implementation of the algorithm from here. I am calling this php implementation from my shell script as below.               levenshtein_return=$(php levensh.php "String1" "String2")      The `levenshtein_return` variable contains the value as 1 now as there is a single character difference. Now, before inserting the value as such in database tables, I need to perform some arithmetic operations using this variable. I am trying to implement as,               table_value=$( expr( 1/ ( 1 + $levenshtein_return ) ) )      However, if I use the above syntax I am getting an error as,               line 52: syntax error near unexpected token `1'      How can I change the expr statement so that I can get the actual value for the `table_value` variable?


title: How to get rid of unnecessary lines in gnuplot

text: So I'm pretty new to using gnuplot, and my code looks like this:               set isosamples 40     unset key     set title "Radial Matrix Elements"     set xrange [1:15]     set yrange [1:15]     set xlabel "n1*"     set ylabel "n2*"     set zlabel 'R'     splot 's1p.pun' u 1:2:4 with lines     set view 135,135      replot      The output looks like the image below. How do i get rid of the connecting lines and get the same look as if they weren't there? ![enter image description here](http://i.stack.imgur.com/zXbRu.jpg)


title: Print lines if pattern is not matched

text: Print lines of `File 1` only if they don't contain patterns specified in `File 2` Exemple:               $ cat File_1     L1  pattern1     L2  pattern     pattern2     L3  pattern3    pattern     L4  pattern4          $ cat File_2     pattern1     pattern2      Expected output               $cat File_3     L3  pattern3    pattern     L4  pattern4


title: What does eno1 and lo mean

text: I have tried using google for this and cant seem to find much results. When running cmd in bash               netstat -i      I am returned something which looks like this               Kernel Interface table     iface    MTU ...     eno1     1500     lo       50000      I ran this cmd with the intentions to find what type of network adapters(hardware) I have.(should return wireless adapter + more) I am unable to tell what these mean. Is this the correct command for this.


title: Print all lines between a searched pattern of a text file to different file

text: I have a file called `test.txt` that contains:               ....Request....     asaksa     sda     dsad     dsad     ....Request...     21mklk     nnm212     mkmr543     849238     ....Request...     4392840     kndska     94i0-jkfjdk     smdla     .....Request..     839281     ksndlka     nsc     mcxmzl      I want all lines between two "Request" pattern should print to different -2 file like: file1 :               asaksa     sda     dsad     dsad      file2:               21mklk     nnm212     mkmr543     849238      file3:               4392840     kndska     94i0-jkfjdk     smdla      file4:               839281     ksndlka     nsc     mcxmzl      like wise


title: Is it possible to make a window invisible to clicking in fluxbox?

text: I'd like to display a few things "on top" of everything else, but making it click-through-able (Conky, or a video player, for instance). Is this possible in fluxbox? Or even in another window manager?


title: AWK: Passing shell variables to awk

text: I am trying to pass a **variable** number of arguments from the shell script to a pattern recognition subset of a table. Here is my attempt so far: The file 'infile':                   ID,GROUP         1,GROUP2             2,GROUP2             3,GROUP4             4,GROUP4             5,GROUP5             6,GROUP5             7,GROUP23            8,GROUP23            9,GROUP23         The file subset.sh:                   #!/bin/sh         rm -f outfile_$week              week = $1         shift              for TOKEN in "$@"         do              echo "adding records for" $TOKEN              awk -F "," -v group = $TOKEN '{ if(FNR > 2 && $2 ~/group/){print $0} }' infile >> outfile_$week         done      I have also tried group = "$TOKEN", "group = $TOKEN" and then both with single quotes. I am submitting like this:                   sh subset.sh 061314 GROUP2 GROUP23      The error I get is an astoundingly uninformative                   Usage: awk [-F fs][-v Assignment][-f Progfile|Program][Assignment|File] ...      Any help is much appreciated, thanks! EDIT: I tried running                   awk -F "," -v group ="GROUP1" '{ if(FNR > 2 && $2 ~/group/){print $0} }' infile      to no avail... (same error as above) anyone know of any reason this might happen?


title: Toggle Skype notification status

text: Being notified whether a contact appears online/offline or not can be changed via the _Skype Options_ or via the `~/.skype/your_skype_id/config.xml`. In this file, depending on what you chose, on can find the following lines:               <Notify>       <Chat>0</Chat>       <Offline>1</Offline>       <Online>1</Online>     </Notify>      where `<Offline>n</Offline>` (resp. `<Online>n</Online>`) corresponds to the _"Contact came offline"_ (resp. _"Contact came online"_ ) option and where `n` obviously states whether it's on or not. Thus my question is the following: _Can one toggle the notifications on/off automatically?_ It's important to note that `Offline` and `Online` appear only once on the `XML` file. So far all I can do is:               sed -i config.xml -e '197s!<Online>1</Online>!<Online>0</Online>!'      where `197` is the line number (which is case dependant, so it's pretty bad), and where I don't check the existing status of the notification, I only turn it off. * * * In short, what I would like to do is to change `0` to `1` (or `1` to `0`) automatically to both lines.


title: When is double-quoting necessary?

text: The old advice used to be to double-quote any expression involving a `$VARIABLE`, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of `$VARIABLE` would throw off the shell. I understand, however, that in more recent versions of shells, double-quoting is no longer always needed (at least for the purpose described above). For instance, in `bash`:               % FOO='bar baz'     % [ $FOO = 'bar baz' ] && echo OK     bash: [: too many arguments     % [[ $FOO = 'bar baz' ]] && echo OK     OK     % touch 'bar baz'     ls $FOO     ls: cannot access bar: No such file or directory     ls: cannot access baz: No such file or directory      In `zsh`, on the other hand, the same three commands succeed. Therefore, based on this experiment, it seems that, in `bash`, one can omit the double quotes inside `[[ ... ]]`, but not inside `[ ... ]` nor in command-line arguments, whereas, in `zsh`, the double quotes may be omitted in all these cases. But inferring general rules from anecdotal examples like the above is a chancy proposition. It would be nice to see a summary of when double-quoting is necessary. I'm primarily interested in `zsh`, `bash`, and `/bin/sh`.


title: How should I configure /etc/host.allow on OpenBSD to only allow given IP's?

text: I have an OpenBSD 5.1 box that is running a static html based website. I have a list of IP addresses that I want to allow, ex.:               ...     78.128.49.0/24     78.128.50.0/24     ...      It's a ~10 KByte. ~10 000 lines. I only want to allow these IP addresses, not else to contact the server (httpd, ssh, anything, even ports that aren't used). _**Q_** : What is the best syntax to do this in the host.allow/host.deny file? (AFAIK it should be better to put 10 000 IP address ranges in a file then puting them in the firewall..)


title: How to know if a background job is finished?

text: I invoke a script (do_something) in background via another script (do_manythings) as below.               nohup do_something &      How would I know in the parent script (do_manythings) that the job invoked (do_something) has been done?