title: Openswan connecting to multiple right subnets not working

text: I'm trying to use Openswan (version 2.6.37) to connect an IPsec VPN from my local network to a remote site. Everything works fine when I just want to connect to a single subnet on the remote site. However, the remote site also has an extra subnet that I want to access. This is my configuration:               conn myConn             type=tunnel             left=192.168.139.14             leftsubnet=192.168.139.0/24             leftxauthclient=yes             right=X.X.X.X             rightsubnet=172.16.1.0/24             keyexchange=ike             auth=esp             authby=secret             phase2alg=3des-sha1             pfs=yes      When I replace `rightsubnet` with `rightsubnets`, like so:               rightsubnets={172.16.1.0/24 192.168.3.0/24}      ...then the connection is created successfully but only the last subnet in the list is available. Any attempts to ping anything on the `172.16.1.0` subnet fails. If I swap the order of the subnets around then I can ping `172.16.1.X` but can't ping anything on the other subnet. It's as if Openswan is only using the last subnet in the list to create a connection. Am I doing something wrong here? A little bit of extra information that I neglected to mention (although I'm not sure it's relevant): My Openswan client is behind a router using NAT and I have `nat_traversal=yes` in my `ipsec.conf` file.


title: Fastest way to determine if two sorted lists contain unique elements

text: I have two sorted files `A` and `B` where the size of `A` is much greater than `B`, e.g. A is 100GB while B is 50MB. I want to _quickly_ determine if there are any lines in `B` that are contained in `A`, stopping once a match is made. I currently have a python script for this but it runs slowly when the process has to be repeated thousands of times for different `B`'s.


title: Fix sound stuttering from snd-hda-intel

text: When I play mp3s on my openSUSE 12.3 (x586) Compal JFL92 laptop with codec Realtek ALC268 and sound driver `snd-hda-intel` the sound will skip forward and backwards a few times every minute at random places. It did work well in 2009 with an Ubuntu load, but broke after that, and was also broken with a Fedora load. I have tried adding `tsched=0` in `/etc/pulse/default.pa` (`load-module module-udev-detect tsched=0`), specifying in `/etc/modprobe.d/50-sound.conf` various options `snd-hda-intel` variants, including `enable_msi=0` and `postion_fix=1` or 2, disabling or removing `pulseaudio` entirely, etc. Flash plays similarly poorly, jumping forwards and back in chrome. I'd love just the simple fix for it, but if there are debugging steps I can do to get more information those are great, too.


title: What is the most efficient way to move a large number of files that reside in a single directory?

text: CentOS 5.x I apologize if this is a repeat question. I've seen a lot of similar questions (regarding deleting files) but not exactly the same scenario. I have a directory containing hundreds of thousands of files (possibly over a million) and as a short-term fix to a different issue, I need to move these files to another location. For the purpose of discussion, let's say the these files originally reside in `/home/foo/bulk/` and I want to move them to `/home/foo2/bulk2/` If I try `mv /home/foo/bulk/* /home/foo2/bulk2/` I get a "too many arguments" error. Mr. Google tells me that an alternative for deleting files in bulk would be to run find. Something like: `find . -name "*.pdf" -maxdepth 1 -print0 | xargs -0 rm` That would be fine if I was deleting stuff but in this case I want to move the files... If I type something like `find . -name "*" -maxdepth 1 -print0 | xargs -0 mv /home/foo2/bulk2/` bash complains about the file not being a directory. What's the best command to use here for moving the files in bulk from one directory to another?


title: Problem accessing an Apache-hosted folder

text: I'm running Centos 6.2, and Apache. I'm running into an error to do with access rights/permissions when trying to navigate to a webpage. I'm trying to go to the URL `http://localhost/repos`, but I get the error: > You don't have permission to access /repos on this server Am I missing something essential? I've tried running `chmod 775`, which I believe should have given me the correct access rights, but to no avail.


title: in Shell Scirpt I want to use ::ssu <USERNAME>

text: I want to `ssu` or alternate command in shell script. However it's asking for password in middle of shell script. I don't want to do that. Any alternate command or suggestion? E.g.               ssu <username>     cp -r /path/     ksh wrapper.ksh      after finish `wrapper.ksh`, exit from `ssu` mode.


title: Setting up LS colors with a human-readable script in tcsh

text: I have a shell script (`set_up_my_ls_colors.sh`) that, if I call from my shell, it configures my color scheme for `ls`. The nice thing about the script is that it allows me to configure colors in a human-readable format. The file works well under zsh and bash, but it does not work well in `tcsh`. If I call it as:               . ~/.set_up_my_ls_colors.sh      I get:               .: Permission denied       even though the file has `u+x` permissions. I have also tried with               /bin/tcsh ~/.set_up_ls_colors.sh      which returns               Illegal variable name      Below is the file `set_up_my_ls_colors.sh` in question:               # Call this script as . ~/path_to_this_file.sh          export LS_COLORS=$( \     ( grep '\w' | grep -v '^#' | sed 's/#.\+//' | perl -lane 'printf "%s=%s:", shift @F, join ";", @F;' ) <<< "          # HUMAN_FORMATTED_DATA     # list one per line          # these are basic filesystem items     no 00          # normal     fi 00          # file     di 01 34       # directory     ln 00 36       # link     pi 40 33       # pipe     so 00 35       #     bd 40 33 01     cd 40 33 01     or 01 05 37 41     mi 01 05 37 41     ex 00 91       # executable     ow 01 34       # other writables               *.cmd 00 32     *.exe 00 32          # archive, compressed things etc     *.gz  00 90     *.bz2 00 90     *.bz  00 90     *.tz  00 90     *.rpm 00 90     *.rar 00 90     *.zip 00 90     *.iso 00 90               *.cpio 00 31                    # perl & CODE     *.c      33     *.h      33     *.sh     33     *.t      33     *.pm     33     *.pl     33     *.cgi    33     *.pod    33     *.PL     33     *.js     33     *.php    33     #*.xs          # strikethrough     *.off 00 9     *.bak 00 9     *.old 00 9               # documents misc, html webstuff     # really TEXT     *.htm    94     *.html   94     *.txt    94     *.text   94     *.css    94               # MOVIE     *.avi    96     *.wmv    96     *.mpeg   96     *.mpg    96     *.mov    96     *.AVI    96     *.WMV    96     *.mkv    96          # images & pdf     *.jpg    96     *.jpeg   96     *.png    96     *.xcf    96     *.JPG    96     *.gif    96     *.svg    96     *.eps 00 96     *.pdf 00 96     *.PDF 00 96     *.ps  00 96          *.ai  00 91 # adobe ill     *.doc 00 91 # msword shit          # data, such as .db, .csv     *.csv    95     *.dsv    95     *.db     95     *.sql    95     *.meta   95     # CONFS     *.xml    95     *.yaml   95     *.yml    95     *.conf   95     # [a-z0-9]*rc     ")          #echo GOT: $LS_COLORS     #export LS_COLORS          # The codes are:     # code  0 = default colour     # code  1 = bold     # code  4 = underlined     # code  5 = flashing text     # code  6 = no change     # code  7  = reverse field     # code  8 = black     # code  9 = strikethrough (cool!)     # code  10 - 29= no change     # code  30  = light green     # code  31  = red     # code  32  = green     # code  33  = orange     # code  34  = blue     # code  35  = purple     # code  36  = cyan     # code  37  = grey     # code  38 = underline     # code  39 = no change     # code  40  = black background     # code  41  = red background     # code  42  = green background     # code  43  = orange background     # code  44  = blue background     # code  45  = purple background     # code  46  = cyan background     # code  47  = grey background     # code  90  = dark grey     # code  91  = light red     # code  92  = light green     # code  93  = yellow     # code  94  = light blue     # code  95  = light purple     # code  96  = turquoise     # code  100 = dark grey background     # code  101 = light red background     # code  102 = light green background     # code  103 = yellow background     # code  104 = light blue background     # code  105 = light purple background     # code  106 = turquoise background


title: I am trying to install Google Chrome on Linux Mint 7

text: It seems like Jaunty is not being maintained anymore. When trying to install the chrome package:               steven@steven-desktop ~/Desktop $ sudo dpkg -i google-chrome-stable_current_i386.deb      Selecting previously deselected package google-chrome-stable.     (Reading database ... 106471 files and directories currently installed.)     Unpacking google-chrome-stable (from google-chrome-stable_current_i386.deb) ...     dpkg: dependency problems prevent configuration of google-chrome-stable:      google-chrome-stable depends on libasound2 (>> 1.0.22); however:       Version of libasound2 on system is 1.0.18-1ubuntu9.      google-chrome-stable depends on libc6 (>= 2.11); however:       Version of libc6 on system is 2.9-4ubuntu6.      google-chrome-stable depends on libcups2 (>= 1.4.0); however:       Version of libcups2 on system is 1.3.9-17ubuntu1.      google-chrome-stable depends on libdbus-1-3 (>= 1.2.14); however:       Version of libdbus-1-3 on system is 1.2.12-0ubuntu2.      google-chrome-stable depends on libfontconfig1 (>= 2.8.0); however:       Version of libfontconfig1 on system is 2.6.0-1ubuntu12.      google-chrome-stable depends on libgconf2-4 (>= 2.27.0); however:       Version of libgconf2-4 on system is 2.26.0-0ubuntu1.      google-chrome-stable depends on libgcrypt11 (>= 1.4.2); however:       Version of libgcrypt11 on system is 1.4.1-2ubuntu1.      google-chrome-stable depends on libgtk2.0-0 (>= 2.18.0); however:       Version of libgtk2.0-0 on system is 2.16.1-0ubuntu2.      google-chrome-stable depends on libnss3-1d (>= 3.12.3); however:       Version of libnss3-1d on system is 3.12.2~rc1-0ubuntu2.      google-chrome-stable depends on libstdc++6 (>= 4.4.0); however:       Version of libstdc++6 on system is 4.3.3-5ubuntu4.      google-chrome-stable depends on libatk1.0-0 (>= 1.30.0); however:       Version of libatk1.0-0 on system is 1.26.0-0ubuntu2.     dpkg: error processing google-chrome-stable (--install):      dependency problems - leaving unconfigured     Processing triggers for man-db ...     Errors were encountered while processing:      google-chrome-stable      It seems like there is no way for me to update all of these libraries to the correct versions anymore because they all report being already updated.               steven@steven-desktop ~/Desktop $ sudo apt-get install libasound2     Reading package lists... Done     Building dependency tree            Reading state information... Done     libasound2 is already the newest version.     You might want to run `apt-get -f install' to correct these:     The following packages have unmet dependencies:       google-chrome-stable: Depends: libasound2 (> 1.0.22) but 1.0.18-1ubuntu9 is to be installed                             Depends: libc6 (>= 2.11) but 2.9-4ubuntu6 is to be installed     ...      What can I do? Try to dig up a .deb of the most recent version of Chrome which does not require dependencies more recent than what is available on Jaunty? Am i likely to ever succeed with this? The reason I chose a distro based on Jaunty is because Jaunty is nice and stable. I figured that would help me succeed in getting `npm`, node.js package manager, working. I'll want an updated Chrome to test that... This is an awful bit of catch-22...


title: Why is my graphical desktop running on TTY1

text: I recently installed gnome-shell on my new Archlinux and X is running on TTY1. Is this is a normal behaviour?               screenfetch                                 -`                           .o+`                 rkmax@satellite                          `ooo/                 OS: Arch Linux                          `+oooo:                Kernel: x86_64 Linux 3.9.9-1-ARCH                        `+oooooo:               Uptime: 13m                        -+oooooo+:              Packages: 785                      `/:-:++oooo+:             Shell: bash                     `/++++/+++++++:            Resolution: 2726x768                    `/++++++++++++++:           DE: Gnome 3.8.2                   `/+++ooooooooooooo/`         WM: Not Found                  ./ooosssso++osssssso+`        WM Theme: Not Found                 .oossssso-````/ossssss+`       GTK2 Theme: Adwaita                -osssssso.      :ssssssso.      GTK3 Theme: Adwaita               :osssssss/        osssso+++.     Icon Theme: gnome              /ossssssss/        +ssssooo/-     Font: Ubuntu 11            `/ossssso+/:-        -:/+osssso+-   CPU: Intel Core i3 CPU M 380 @ 2.533GHz           `+sso+:-`                 `.-/+oso:  RAM: 1312MB / 2808MB          `++:.                           `-/+/            .`                                 `/


title: Cannot echo colored text when inserting in status bar in dwm

text: I'm using Fedora 18. I'm trying to create a custom status bar in dwm. Now what I'm thinking of is to check if the battery is under a certain level, the background of the battery region in the status bar will be red. The problem is, when this condition is true, I get a different result. What I expected this to be shown inside the status bar with a red background:               (red bg: Discharging, 50%) | 04:21:20 AM 29/06/2013      But I get : ![ss of taskbar](http://i.stack.imgur.com/MUiSJ.png) Here's my startup script :               #!/bin/bash       2        3 # Created By Rafael Adel       4        5 # This script is to start dwm with customizations needed       6        7        8 while true;do       9         datestr=`date +"%r %d/%m/%Y"`      10         batterystr=`acpi | grep -oP "([a-zA-Z]*), ([0-9]*)%"`      11         batterystate=`echo $batterystr | grep -oP "[a-zA-Z]*"`      12         batterypercent=`echo $batterystr | grep -oP "[0-9]*"`      13       14       15         if [ $batterypercent -le 90 ]      16         then      17                 finalstr="`echo -e "\033[41m${batterystr}\033[0m | $datestr"`"      18         else      19                 finalstr="$batterystr | $datestr"      20         fi      21                 xsetroot -name "$finalstr"      22         sleep 1      23 done &      24       25 xbindkeys -f /etc/xbindkeysrc      26       27 exec dwm      Any help will be appreciated. Thanks.


title: How to fix bash looking for a program in the wrong dir (Issues setting up NPM on Ubuntu 11.10)

text: This time I ran the "trusting" install script `curl http://npmjs.org/install.sh | sudo sh` from the dir `/`.               $ which npm     /usr/local/bin/npm     $ npm     bash: /home/steven/local/bin/npm: No such file or directory     $ echo $PATH     /home/steven/local/bin:/home/steven/local/bin:/home/steven/local/bin:/home/steven/local/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games     $ ls /home/steven/local/bin     node  node-waf     $ ls /usr/local/bin     node  node-waf  npm  npm_g  npm-g      It seems like some script somewhere is polluting my `$PATH`. What I wonder is, if `bash` can't find the program in the first dir it looks in, doesn't it keep looking through `$PATH`? It should be able to find it in `/usr/local/bin`! `npm` really, really doesn't seem to want to just work. I think I'm gonna go load up a slightly older Ubuntu and give this another go...


title: How does this sed command work?

text: I've come across this solution for printing a specific line from a text file:               sed '123!d;q' file      Why doesn't sed quit after the first line of input in this case?


title: Disable bold font in urxvt

text: I want to disable the bold font in my urxvt config (`.Xresources`). xterm has the option allowBoldFonts. Is there a similar option for urxvt? I can't find anything similar.


title: Why is there a mismatch between size reported by LVM and the size reported by df -h?

text: I'm new to LVM and have been very confused by this: I am transfering a large file to a partition that I thought had about 1.5 terabytes of space on it. Near the end of the transfer, rsync exits with an error claiming that the partition is full. I investigate and find the following:               $ sudo lvm lvs       LV        VG     Attr   LSize   Origin Snap%  Move Log Copy%  Convert       home      system -wi-ao  97.66G                                             log       system -wi-ao  48.81G                                             log.audit system -wi-ao   9.75G                                             root      system -wi-ao 341.59G                                             swap      system -wi-ao   4.88G                                             temp      system -wi-ao  97.66G                                             var       system -wi-ao   1.46T        This seems to imply that /var (the partition that I'm transfering to, has the amount of storage I expect. However, then I see:               $ sudo df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/system-root                           331G  1.3G  313G   1% /     /dev/mapper/system-temp                            95G  188M   90G   1% /tmp     /dev/mapper/system-var                            95G   90G     0 100% /var     /dev/mapper/system-home                            95G  188M   90G   1% /home     /dev/mapper/system-log                            48G  264M   45G   1% /var/log     /dev/mapper/system-log.audit                           9.5G  340M  8.7G   4% /var/log/audit     /dev/sda1              99M   25M   70M  26% /boot     tmpfs                 8.0G     0  8.0G   0% /dev/shm      I'm guessing this has something to do with the volume being resized at some point. While I have reliable backups, I'd rather not interrupt services for the time it will take to get the backup and restore. Thus, is there anyway to make the filesystem seen by the OS match the space available according to lvm without losing data?


title: Connect to KVM instance using virsh when image launched through Eucalyptus?

text: I'm using Eucalyptus on Ubuntu 10.04 to set up a private cloud. Sometimes I'm not able to ssh into the VM instances, and I'd like to be able to connect directly to the console of the VM instance. However, by default, that doesn't seem to work through virsh:               $ sudo virsh -c qemu:///system console i-486B085E     No console available for domain      Is there some way to enable this, for example, by changing the way Eucalyptus generates the XML file that gets passed to libvirt? Here's the libvirt.xml file that Eucalyptus generates:               $ cat /var/lib/eucalyptus/instances/admin/i-486B085E/libvirt.xml     <domain type='kvm'>         <name>i-486B085E</name>         <os>         <type>hvm</type>             <kernel>/var/lib/eucalyptus/instances//admin/i-486B085E/kernel</kernel>             <initrd>/var/lib/eucalyptus/instances//admin/i-486B085E/ramdisk</initrd>             <cmdline>root=/dev/sda1 console=ttyS0</cmdline>         </os>         <features>             <acpi/>         </features>         <memory>262144</memory>         <vcpu>1</vcpu>         <devices>             <disk type='file'>                 <source file='/var/lib/eucalyptus/instances//admin/i-486B085E/disk'/>                 <target dev='sda'/>             </disk>             <interface type='bridge'>                 <source bridge='eucabr10'/>                 <mac address='d0:0d:48:6B:08:5E'/>                 <model type='e1000'/>             </interface>             <serial type="file">                 <source path='/var/lib/eucalyptus/instances//admin/i-486B085E/console.log'/>                 <target port='1'/>             </serial>         </devices>     </domain>      Here's the output of virsh dumpxml:               $ sudo virsh dumpxml i-486B085E     <domain type='kvm' id='3'>       <name>i-486B085E</name>       <uuid>3b762376-4de1-f6ac-7327-9df520fa4862</uuid>       <memory>262144</memory>       <currentMemory>262144</currentMemory>       <vcpu>1</vcpu>       <os>         <type arch='x86_64' machine='pc-0.12'>hvm</type>         <kernel>/var/lib/eucalyptus/instances//admin/i-486B085E/kernel</kernel>         <initrd>/var/lib/eucalyptus/instances//admin/i-486B085E/ramdisk</initrd>         <cmdline>root=/dev/sda1 console=ttyS0</cmdline>         <boot dev='hd'/>       </os>       <features>         <acpi/>       </features>       <clock offset='utc'/>       <on_poweroff>destroy</on_poweroff>       <on_reboot>restart</on_reboot>       <on_crash>destroy</on_crash>       <devices>         <emulator>/usr/bin/kvm</emulator>         <disk type='file' device='disk'>           <source file='/var/lib/eucalyptus/instances//admin/i-486B085E/disk'/>           <target dev='sda' bus='scsi'/>         </disk>         <interface type='bridge'>           <mac address='d0:0d:48:6b:08:5e'/>           <source bridge='eucabr10'/>           <target dev='vnet0'/>           <model type='e1000'/>         </interface>         <serial type='file'>           <source path='/var/lib/eucalyptus/instances//admin/i-486B085E/console.log'/>           <target port='0'/>         </serial>         <console type='file'>           <source path='/var/lib/eucalyptus/instances//admin/i-486B085E/console.log'/>           <target port='0'/>         </console>       </devices>       <seclabel type='dynamic' model='apparmor'>         <label>libvirt-3b762376-4de1-f6ac-7327-9df520fa4862</label>         <imagelabel>libvirt-3b762376-4de1-f6ac-7327-9df520fa4862</imagelabel>       </seclabel>     </domain>      Here's the full KVM command-line that ends up being invoked:               /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 256 -smp 1 -name i-486B085E -uuid 3b762376-4de1-f6ac-7327-9df520fa4862 -nographic -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/i-486B085E.monitor,server,nowait -monitor chardev:monitor -boot c -kernel /var/lib/eucalyptus/instances//admin/i-486B085E/kernel -initrd /var/lib/eucalyptus/instances//admin/i-486B085E/ramdisk -append root=/dev/sda1 console=ttyS0 -drive file=/var/lib/eucalyptus/instances//admin/i-486B085E/disk,if=scsi,index=0,boot=on -net nic,macaddr=d0:0d:48:6b:08:5e,vlan=0,model=e1000,name=e1000.0 -net tap,fd=55,vlan=0,name=tap.0 -chardev file,id=serial0,path=/var/lib/eucalyptus/instances//admin/i-486B085E/console.log -serial chardev:serial0 -parallel none -usb      _Note: Cross-posted fromserverfault since question migration isn't supported yet._


title: Removing blank spaces and tabs from line without messing with line endings

text: I am trying to remove all spaces on a file without messing with line endings. This is to be run from inside a bash script. I have tried all the solutions here: http://stackoverflow.com/questions/9953448/how-to-remove-all-white-spaces- from-a-given-text-file They work from the command line but when I try them from the bash script the final file is a mess, completely destroyed. File is using UNIX file endings. Any clues?


title: What is the mknod command used for?

text: I just started using Ubuntu as my main OS and I wanted to learn about things I should not do, and learn by the bad things people have done in the past. I came across these email about horror stories that UNIX & Linux sys admins had done on their own system when they where new. Many of them involved the use of the mknod command to both distory and fix a problem. I've never heard of this command before and the man page within Ubuntu is not very helpful. So my question is, what is this command used for, and what are some examples where it is useful in day to day use?


title: Unable to access page with https

text: I have configured https on my server with apache2 which is in cloud. The below Listen directives are enabled in it.               Listen 80     Listen 443      The port 80 is firewalled in cloud. So I used port 443 to access it. But the problem is that if both of the above Directives are enabled then only I am able to access the page with https. If I remove `Listen 80`, then httpd started with 443 but I am not able to access the page and the log is showing giving               "GET /portal HTTP/1.1" 302 -      Can anyone help me understanding why this is happening. I have used the below rewrite rules:               RewriteEngine On     RewriteCond %{SERVER_PORT} !^443$     RewriteRule ^/(.*)$ https://myxenvm/$1 [NE]


title: How do I emulate a USB stick with an external CDROM drive?

text: I am working with a Linux-based high-security network appliance (hereon: device) and do not have access to the user space so I can't log in. The only thing I can do is send it commands to upgrade through the USB port. It then reads the USB stick and starts the upgrade. I have been tasked to attempt to upgrade it without a USB stick but an external CDROM drive instead.      The USB stick must be less than 4GB and formatted with FAT32. Here is an example of a USB stick that the device recognizes:               [root@pitfall ~]# fdisk -l /dev/sdc          Disk /dev/sdc: 15.6 GB, 15606349824 bytes     64 heads, 32 sectors/track, 14883 cylinders     Units = cylinders of 2048 * 512 = 1048576 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x23ff8244             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1               2         257      262144    b  W95 FAT32      I thought I could dd this USB partition and then manipulate the output in some way and burn it to a CD. Here is the file that resulted in that dd:               [root@pitfall ~]# file /tmp/dd_output     /tmp/dd_output: x86 boot sector, mkdosfs boot message display, code offset 0x3c, OEM-ID " mkdosfs", sectors/cluster 8, root entries 512, Media descriptor 0xf8, sectors/FAT 256, heads 64, sectors 524288 (volumes > 32 MB) , serial number 0xa740f5a9, label: "           ", FAT (16 bit)      I am not sure how to trick the device into thinking that the external CDROM drive is a USB stick. I imagine it will involve mkisofs in someway, but from what I can tell this command doesn't support vfat.      Here is the dmesg output for the external CDROM drive:               ISO 9660 Extensions: Microsoft Joliet Level 1     ISOFS: changing to secondary root     usb 2-2: USB disconnect, address 5     usb 2-2: new high speed USB device using ehci_hcd and address 7     usb 2-2: New USB device found, idVendor=1bcf, idProduct=0c31     usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1     usb 2-2: Product: USB to Serial-ATA bridge     usb 2-2: Manufacturer: Sunplus Innovation Technology.     usb 2-2: SerialNumber: FFFFFFFEDF102230086505     usb 2-2: configuration #1 chosen from 1 choice     scsi7 : SCSI emulation for USB Mass Storage devices     usb-storage: device found at 7     usb-storage: waiting for device to settle before scanning     usb-storage: device scan complete     scsi 7:0:0:0: CD-ROM            Slimtype DVD A  DS8A5S    WX13 PQ: 0 ANSI: 0     sr1: scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray     sr 7:0:0:0: Attached scsi CD-ROM sr1     sr 7:0:0:0: Attached scsi generic sg2 type 5


title: Bash script to signal a concurrently running instance (same script) about a condition and increment counter

text: ### Background Here's what I want to achieve. I have a (potentially) long-running process. Now I have locking in place just fine and all is generally in order. However, since this is a scheduled job, the script will be executed again and again and again. In the real script I have, a file keeps track of that failure count. When it reaches a threshold a mail gets sent off to the admin, in case the original script became zombie or otherwise stuck. If the threshold is reached and the initial process that claims to have the lock doesn't live anymore, the lock is broken and an alternative text is sent to the admin informing about the condition. All of this is probably not really relevant to the problem, but I want to give the complete picture here. Whenever the threshold is reached, the failure count in the file gets reset and starts over from there. The original instance thus may or may _not_ get to see the failure count file. The original script instance that held the lock will (hopefully) eventually finish its job and exit. ### Question How can I implement a scheme whereby the "failed" instances that encounter the lock send a signal (I tried `SIGUSR1`) to the original instance and the original instance keeps track of how many times it was "pinged"? Here's the test script I came up with so far:               #!/usr/bin/env bash     LOCKFILE=/tmp/$(basename $0).lock     let COUNTER=0          function concurrent_run     {         let COUNTER=COUNTER+1         echo -e "\ncaught SIGUSR1 (counter = $COUNTER)"     }          if ( set -o noclobber; echo "$$" > "$LOCKFILE" ) 2> /dev/null; then         trap 'rm -f "$LOCKFILE"; exit $?' INT TERM EXIT         trap concurrent_run USR1         echo "I was first, going to sleep"         sleep 100000         trap - INT TERM EXIT USR1     else         LOCKPID=$(cat "$LOCKFILE")         echo "Lock already held by $LOCKPID"         [[ -n "$LOCKPID" ]] && kill -0 $LOCKPID && { kill -USR1 $LOCKPID; echo "... knock knock? ($LOCKPID)"; }         exit 1     fi     echo "End: $COUNTER"     exit 0      (the `sleep` is mimicking the long-running job the real script performs) I am testing on Linux and I have tried the name for the signal as `USR1` and `SIGUSR1`, both giving the same result (i.e. none).               builtin trap -l      gave me 10 as `SIGUSR1`, so I also tried a manual `kill -10 PID` on the `PID` of the original instance. Unfortunately I cannot get it to see the signal. What am I doing wrong? * * * ### How to test Start one instance of the script (I named it `sigtest`):               $ ./sigtest     I was first, going to sleep      Start a second instance of the script in another terminal, window, pane (same user!):               $ ./sigtest     Lock already held by 15360     ... knock knock? (15360)      Repeat ... Expected outcome in the first terminal (skipping empty lines):               caught SIGUSR1 (counter = 1)     caught SIGUSR1 (counter = 2)     caught SIGUSR1 (counter = 3)     caught SIGUSR1 (counter = 4)      * * * ### Bash version               $ echo $BASH_VERSION     4.1.5(1)-release


title: understanding lsof -i output with web browsing

text: Sorry, if my question is nooby, but i don't understand some output lsof command. I try to run lsof -i on my home machine(debian linux) and what i obtain (showed one line; my browser chromium was running)               # lsof -i     COMMAND    PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME     chromium- 2379   brenta   70u  IPv4  45006      0t0  TCP brenta.local:44023->stackoverflow.com:www (ESTABLISHED)      the man page explains about column NAME:               the local and remote Internet addresses of a network file;     the local host name or IP number is followed by a colon (':'), the port,     ``->'', and the two-part remote address.      I try to run this comman on the other machine (linux mint):               COMMAND    PID     USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME     firefox   2778   brenta  59u   IPv4 68476917      0t0  TCP NOT_MY_HOST:39812->stackoverflow.com:http (ESTABLISHED)      Why column NAME contains not my host, but the other machine in local network?


title: `git remote add` to home dir by `~` expression

text: I created git bare repository in my home directory like `~/git-repos/foo.git`. To add a remote repository I typed like `git remote add origin ssh://username@hostname:10022~/git-repo/foo.git`. But it fails with error `ssh: Could not resolve hostname hostname:10022~: Name or service not known`. If I replace `~` to `/home/username`, then it works fine. Is there way to use `~` expression for `git remote` with ssh protocols?


title: How to check if an USB device is present without lsusb?

text: I want to see if an USB device is present but I don't have lsusb. Is there another way to check if an USB device is present without having to use lsusb?


title: How to override configuration of a logrotate by another configuration

text: There is a log folder on my disk, whose rotation policy is as follows               "/mnt/foo/shared/log/*.log" {       # rotate the files daily       daily       # Save the last 7 days worth of logs before deleting       rotate 7       # missing file is not an error case - just ignore.       missingok       # this is important for the logs       copytruncate     }      There is a set of logfiles in the `/mnt/foo/shared/log` folder named `indexer_cron_1.log`to `indexer_cron_4.log` I want only these 4 files to be rotated for 14 days. How do I override this configuration? I thought of creating another configuration but the thought of duplicate rotations occured and I stopped this. I do not have a machine where I can test this before, hence asking here.


title: "debuild -S" changes debian/control

text: I'm trying to modify an nvidia-related package from the Ubuntu Saucy repositories. I change the Build-Depends: line, I run `debuild -S` to generate a source upload for my PPA, and... surprise, the Build-Depends line in debian/control reverts to the original. How is this possible and how do I prevent this insanity? I mean, in general, how can a package affect the input to its build process? This is similar to `gcc -o prog prog.c` being able to change prog.c. I don't know why Debian made source building so Turing complete -- or why anyone would take advantage of such misguided features.               dget http://archive.ubuntu.com/ubuntu/pool/restricted/n/nvidia-graphics-drivers-319-updates/nvidia-graphics-drivers-319-updates_319.60-0ubuntu1.dsc     dpkg-source -x nvidia-graphics-drivers-319-updates_319.60-0ubuntu1.dsc     # change the Build-Depends line     perl -pi.bak -e 's/(xserver-xorg-dev)/xserver-xorg-dev-lts-raring | $1/' debian/control     cp debian/control /tmp     debuild -S     diff debian/control /tmp/control # proving debuild changed debian/control


title: Odd behavior of software sources GUI in Ubuntu-based eOS (sources selected in the background)

text: Oddly enough, they all look unselected - I do not know that this is really true, but they look like they are not selected. ![enter image description here](http://i.stack.imgur.com/bgMj7.png) But most odd is that selecting them is impossible - as seen HERE. For a while this seemed to me like having something to do with this error (update duplicate source):               W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ precise-security/restricted i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_restricted_binary-i386_Packages)     W: Duplicate sources.list entry http://security.ubuntu.com/ubuntu/ precise-security/main i386 Packages (/var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_main_binary-i386_Packages)      I have commented the entries involved in /etc/apt/sources.list and now `sudo apt-get update` gives no errors anymore. But the odd behavior continues. **In fact the cause>effect relation was the other way around: it was not the duplicates that created that behavior, but with each click on that check-boxes a source was added and in this way duplicates were created.** \- Eliminating them from the sources list through the GUI seemed inefficient because I was re-creating the duplicates in this way. Now I have eliminated all duplicates and the odd behavior is there. A vicious circle.


title: Fast access to often used document

text: For several applications I maintain my personal cheatsheets. I use them mostly for vim, latex, vim latex-suite and bash. For example, when I forget a key combination in vim, I browse to the directory where I the keep the PDF of my cheatsheet, and then I open it with Acrobat Reader. I have two monitors. I always work on the left, so I use the mouse to drag Acrobat Reader with the cheatsheet to the right screen. Then I close the file browser. This I do many times a day. Opening an extra window (the file browser) and dragging the window around is distractive and time consuming. How can I access my cheatsheets more efficiently? I suppose there are several ways, but I'm not that familiar with the features of GNOME 3. All suggestions are appreciated. Please also provide some clue of how to implement your solution.


title: ~/.mysql_history size limit

text: My .mysql_history file size is limited to 300 lines. I would like to keep the mysql history unlimited. However, I couldn't find any way to do it (in man page, and in google) Can somebody please advise how to increase the size limitof .mysql_history from the default 300 to more (or unlimited) I am using Debian Wheezy


title: How to boot FreeBSD system with broken bootcode?

text: I have an HDD (or SSD, or flash drive) with FreeBSD installed on it, and somehow I broke the bootcode (first 446 bytes of MBR). How could I boot into this FreeBSD?


title: Launching nautilus file browser launches gnome desktop, how to suppress it

text: Currently I'm using `i3` window manager (but I guess that this applies to other non-standard window managers as well). Whenever I run nautilus it also starts a full screen desktop, which I have to close. Possible solution is to start nautilus with: `nautilus --browser --no- desktop`, which solves this problem only partially, as sometimes nautilus is launched automatically by other applications and in this case it would be launched without `--browser --no-desktop` options. Is there any gnome3 config option that allows me to suppress desktop launching?


title: Is there a Linux file permission that allows the app to read a file but not a user?

text: I need `/var/www/config/config.json` to be read by my app but not by users calling `myapp.com/config/config.json`. How would I do that?


title: USB keyboard doesn't work with Debian installer

text: I have a wired USB keyboard. I've written the latest netinstall Wheezy image on my USB pendrive (using `dd`). It boots but the installer doesn't recognize the keyboard! (The same pendrive works on my laptop) I am guessing my motherboard is no longer supported by this installer. How can I make the keyboard work with the installer?


title: Sequence of errors leads to init failure and subsequent kernel panic

text: We have one Redhat test server installed on Vmware ESXI. And when I boot the server it gave this error. ![enter image description here](http://i.stack.imgur.com/4b0Fo.png) How to solve this issue because due to this error it doesn't boot.


title: Using "preseed" to specify partitions in an ubiquity install

text: For some reason every time I start ubiquity and get to the manual partitioning, ubi-partman abruptly exits and drags ubiquity with it. ( Off a USB stick. ) I've read that there is a mechanism for specifying the partitions, formats and layout ahead of time using "preseed" files. Unfortunately I can't make head or tails of the documentation I have found. Can some please describe the process for and format for making and using preseed files to do an ubiquity install with the partioning scheme already described?


title: Thinkpad T420s Intel HD 3000 poor performance

text: just installed crunchbang, and find it a bit laggy so checked glxinfo and it seems that i have no OpenGL-Support:               OpenGL vendor string: Tungsten Graphics, Inc     OpenGL renderer string:      Mesa DRI Intel(R) Sandybridge Mobile      OpenGL version string: 3.0 Mesa 8.0.5     OpenGL shading language version string: 1.30     OpenGL extensions:`      could somebody please help me out, I googled but just don't get it, and don't know whats causing the Problem, or how to fix it...               sudo lshw -C video     PCI (sysfs)         *-display                           description: VGA compatible controller            product: 2nd Generation Core Processor Family Integrated Graphics Controller            vendor: Intel Corporation            physical id: 2            bus info: pci@0000:00:02.0            version: 09            width: 64 bits            clock: 33MHz            capabilities: msi pm vga_controller bus_master cap_list rom            configuration: driver=i915 latency=0            resources: irq:49 memory:f0000000-f03fffff memory:e0000000-efffffff ioport:4000(size=64)


title: Ubuntu 10.10 network connection cut down after few minutes of starting

text: Ubuntu 10.10 network connection works fine at the start, but few minutes later the network manager pops up a message saying `disconnected you are offline` and Chrome browser returns an error message like `name not resolved`. This works fine in Windows 7. It was fine too in Ubuntu, until I updated it with 300 MB worth of updates.


title: Remap keys on GNOME3.8 using xmodmap?

text: I want to remap some keys on my keyboard, specifically: page up key to home and page down to end. On previous versions of GNOME 3 I just created a `.xinitrc` file that contained:               cat .xinitrc      xmodmap -e "keycode  117 = End"     xmodmap -e "keycode  112 = Home"      and that was all. On GNOME 3.8.4 this file takes no effect, and I have to manually: `bash .xinitrc`, moreover `xmodmap` settings are lost when I restart gnome shell (which I do sometimes because of a GNOME 3 bug), and also are lost spuriously from time to time. What is the proper way to remap keys when using GNOME 3.8?


title: How can I find and replace with a new line?

text: I have a CSV delimited by commas and I want to delimit it by newlines instead. Input:               a, b, c      Output:               a     b     c      I've written Java parsers that do this stuff, but couldn't this be done with `vim` or some other tool? `sed` isn't working for me:               #!/bin/sh          # Start     cat > infile.csv << __EOF__     a, b, c     __EOF__     cat infile.csv     sed 's/, /\n/g' infile.csv > outfile.csv          cat outfile.csv


title: Fedora 18 VirtualBox Resolution Guest Additions

text: I've installed Fedora 18 64-bit guest into a VirtualBox VM running on a Max OS X host. Previously I've installed Fedora 17 and after installing guest additions from the RPM Fusion repo full screen mode worked by resizing to the same resolution as the host machine. However on Fedora 18 after installing guest additions and running in full screen mode the guest runs at 1024x768. The host is running at 1366x768. This results in two large black bars on the left and right of the guest when in full screen mode. Is there a way to alleviate this? Perhaps to get Fedora to run a custom resolution? **Edit** The root of the problem was that GuestAdditions was failing to install. After trying to build it manually and using the version from RPM Fusion I was unable to solve this. I've downloaded Fedora 17 and the version of GuestAdditions from RPM Fusion works fine with it.


title: how can I install flash plugin in Fedora core 3 machine?

text: Latest flash rpm and tarball has forsaken my machine with fedora core 3 OS. There are two browsers currently installed in the System. Firefox 2.0.x and Opera 10.11. Those two browsers do not display flash content. I tried to install the latest FlashPlayer plugin in the browsers. But Installing RPM displayed a list of missing dependencies. And even after I copied the libflashplayer.so file into the plugin path of the browsers they wont show me flash content. Since I am not permitted to upgrade the OS, which would result in loss of important data, I only want the earlier version of Flash player rpm or tarball for Linux(fedora Core 3).   1. From where can I find oldest FlashPlayer rpm or tarball, for Linux?   2. If it is not possible to install the flash plugin, then what are the other alternatives? Thanks.


title: how to make system service out of .jar file? (linux)

text: i wrote a little java server which i'm running on my CentOS 5 VPS server. currently i just ssh onto the server and start the jar through commandline. How an i turn this jar into a system service and set it such that it starts automatically when the system starts and also that it restarts automatically if it crashes?


title: Zenity refuses to work in background

text: I'm trying to create a background bash script which creates a popup in certain circumstances, however, my code only works when run manually in a terminal (e.g. not in the background). I've tried various things such as; `screen env DISPLAY=:0.0 su $USER -c 'zenity --warning --text "Warning message here"'` `screen zenity --warning --text "Warning message here"` I've spent hours trying various different things, and I feel like there must be a simple solution and I'm just missing something. Nothing I've tried works while the script is run in the background with cron. I'm running Lubuntu 12.04, LXDE. Any ideas to why I can't get it working?


title: What is the "mintsystem" service setting and when would I want to activate it?

text: In hunting around my GUI for a place to enable sshd I clicked on "Services" from the Administration section of the Linux Mint (16) menu. It opened a window titled "Service Settings" and inside it I came across a service called "mintsystem". Googling / Duck Duck Going produced references to the package, but no good descriptions of function. What does this service do? When would I want to enable it?


title: Is CDPATH behavior broken in bourne shell (/bin/sh)

text: I have the following script:               #!/bin/sh          mkdir -p /tmp/test/foo          cd /tmp/test          unset CDPATH     echo "TEST1: Current working directory: ${PWD}"     echo "TEST1: attempting to 'cd foo'"     cd foo     echo "TEST1: Current working directory: ${PWD}"          cd /tmp/test     CDPATH=/tmp     echo "TEST2: Current working directory: ${PWD}"     echo "TEST2: attempting to 'cd foo'"     cd foo     echo "TEST2: Current working directory: ${PWD}"      Which prints out:               $ ./cdpath.sh     TEST1: Current working directory: /tmp/test     TEST1: attempting to 'cd foo'     TEST1: Current working directory: /tmp/test/foo     TEST2: Current working directory: /tmp/test     TEST2: attempting to 'cd foo'     ./cdpath.sh: line 17: cd: foo: No such file or directory     TEST2: Current working directory: /tmp/test      However, if I run it as `/bin/bash cdpath.sh` there is no error, and the `TEST2` output is identical to `TEST1`. The error only occurs if I run it with `/bin/sh`. I haven't found any documentation about bourne and bourne again shells interpreting CDPATH differently: http://tldp.org/LDP/abs/html/internalvariables.html#CDPATHREF http://tldp.org/LDP/abs/html/internal.html#CDREF


title: My gnuplot-pdflatex plot script produces a pdf with a bug

text: I have written a script in bash to easily make gnuplot multiplots via the epslatex terminal and then automatically make a pdf file via pdflatex. However when I open the pdf file with evince (on Ubuntu 12.04) I get the follow error               In pixman_region32_init_rect: Invalid rectangle passed     Set a breakpoint on '_pixman_log_error' to debug      although the pdf is looking perfect. When I open the same pdf on Fedora with Okular no error pops up. When I keep the terminal open which I used to open the file, this error keeps popping up every 30 seconds or something which is extremely annoying. Could anybody point me out which might cause this error or how I can find it? I have no idea how to debug a pdf file, like the error message tells me. Nor have I any clue if this is coming from the gnuplot part of the script, or the conversion with pdflatex, or simply from evince itself. The script I used to make the plots is the following               filename=$(basename "$0")     file="${filename%.*}"          basedir=`pwd`          echo $file          gnuplot << ??          mpl_top    = 0.1     #inch  outer top margin, title goes here     mpl_bot    = 0.60    #inch  outer bottom margin, x label goes here     mpl_left   = 0.9     #inch  outer left margin, y label goes here     mpl_right  = 0.25    #inch  outer right margin, y2 label goes here     mpl_height = 1.5*2.4 #inch  height of individual plots     mpl_width  = 1.5*3.2 #inch  width of individual plots     mpl_dx     = 0.7     #inch  inter-plot horizontal spacing     mpl_dy     = 0.4     #inch  inter-plot vertical spacing     mpl_ny     = 2       #number of rows     mpl_nx     = 2       #number of columns          # calculate full dimensions     xsize = mpl_left+mpl_right+(mpl_width*mpl_nx)+(mpl_nx-1)*mpl_dx     ysize = mpl_top+mpl_bot+(mpl_ny*mpl_height)+(mpl_ny-1)*mpl_dy          # placement functions     #   rows are numbered from bottom to top     bot(n) = (mpl_bot+(n-1)*mpl_height+(n-1)*mpl_dy)/ysize     top(n) = 1-((mpl_top+(mpl_ny-n)*(mpl_height+mpl_dy))/ysize)     #   columns are numbered from left to right     left(n)  = (mpl_left+(n-1)*mpl_width+(n-1)*mpl_dx)/xsize     right(n) = 1-((mpl_right+(mpl_nx-n)*(mpl_width+mpl_dx))/xsize)          set term epslatex standalone color  ",bx," 17 dl 3  size xsize,ysize header '\usepackage{bm}'     set output "$file".".tex"          # General settings     set offsets     set autoscale     set size 1,1     set border lw 4     set tics scale 2,1     set macros          # define axis setting for all subplots     #set xr[0:600]     #set xtics 0,100,600 offset 0,0.3     set mxtics 2          XXX = "set xtics offset -0.3,0.3; set xlabel '\$\\\bm{\\\omega \\\textrm{(MeV)}}\$' offset 0.0,0.6"     NOX = "set xtics offset -0.3,0.3; unset xlabel"          # define y-axis setting for all subplots     set ytics offset 0.5,0.0     set mytics 2          YYY = "set ytics offset 0.5,0.0; set ylabel '\$\\\bm{\\\textrm{d}\\\sigma/\\\textrm{d}E_e \\\textrm{d}\\\Omega_e } \\\bm{(10^{-33}\\\textrm{cm}^2/\\\textrm{MeV})}\$' offset 1.5"     NOY = "set ytics offset 0.5,0.0; unset ylabel"          set multiplot           #--------------------------------------------------     #  set horizontal margins for first column     set lmargin at screen left(1)     set rmargin at screen right(1)     #  set horizontal margins for lasts row (top)     set tmargin at screen top(2)     set bmargin at screen bot(2)          unset label     set title "\$\\\bm{E_e=680 \\\textrm{ MeV, } \\\theta_e=60^\\\circ}\$" offset 6.0,-15.5          @NOX ; @YYY          set xr[0:550]          p "$basedir/fort.652" u 1:9 w l t "Shift",\       "$basedir/fort.652" u 1:10 w l t "Shift+CVC",\       "$basedir/elec_680_36.dat" u (1000*(\$5)):(0.001*(\$6)):(0.001*(\$7)) w yerrorbars lt 15 notitle          #--------------------------------------------------     #  set horizontal margins for first column     set lmargin at screen left(1)     set rmargin at screen right(1)     #  set horizontal margins for lasts row (top)     set tmargin at screen top(1)     set bmargin at screen bot(1)          unset label     set title "\$\\\bm{E_e=730 \\\textrm{ MeV, } \\\theta_e=37^\\\circ}\$" offset 6.0,-15.5          @XXX ; @YYY          set xr[0:600]          p "$basedir/fort.652" u 1:9 w l t "Shift",\       "$basedir/fort.652" u 1:10 w l t "Shift+CVC",\       "$basedir/elec_680_36.dat" u (1000*(\$5)):(0.001*(\$6)):(0.001*(\$7)) w yerrorbars lt 15 notitle          #--------------------------------------------------     #  set horizontal margins for first column     set lmargin at screen left(2)     set rmargin at screen right(2)     #  set horizontal margins for lasts row (top)     set tmargin at screen top(2)     set bmargin at screen bot(2)          unset label     set title "\$\\\bm{E_e=1108 \\\textrm{ MeV, } \\\theta_e=37^\\\circ}\$" offset 6.0,-15.5          @NOX ; @NOY          p "$basedir/fort.652" u 1:9 w l t "Shift",\       "$basedir/fort.652" u 1:10 w l t "Shift+CVC",\       "$basedir/elec_680_36.dat" u (1000*(\$5)):(0.001*(\$6)):(0.001*(\$7)) w yerrorbars lt 15 notitle          #--------------------------------------------------     #  set horizontal margins for first column     set lmargin at screen left(2)     set rmargin at screen right(2)     #  set horizontal margins for lasts row (top)     set tmargin at screen top(1)     set bmargin at screen bot(1)          unset label     set title "\$\\\bm{E_e=1299 \\\textrm{ MeV, } \\\theta_e=37^\\\circ}\$" offset 6.0,-15.5          @XXX ; @NOY          p "$basedir/fort.652" u 1:9 w l t "Shift",\       "$basedir/fort.652" u 1:10 w l t "Shift+CVC",\       "$basedir/elec_680_36.dat" u (1000*(\$5)):(0.001*(\$6)):(0.001*(\$7)) w yerrorbars lt 15 notitle          unset multiplot          ??          pdflatex -synctex=1 -interaction=nonstopmode -shell-escape $file     rm $file-inc-eps-converted-to.pdf     rm $file-inc.eps     rm $file.{tex,aux,log,synctex.gz}      And this should produce the following result (sadly I had to convert to .png) ![enter image description here](http://i.stack.imgur.com/U9lgu.png) PS: Any other tips to improve this script are always welcome!


title: Lose gnome3 wallpaper

text: My wallpaper is now white, the icons are displayed, but the app in parameters/background does not launch. In gconf, /desktop/gnome/background/picture_filename is set to a valid image (I can see my wallpaper when I'm under the Activity mode) I'm using debian testing updated today. Any clue? Need other Infos? See the ![screenshot](http://i.stack.imgur.com/0soMX.png)


title: How to completely hide stuff from a user?

text: I want to let some of my friends access my computer by making them user accounts. They will mostly access my computer by sftp and ssh, but they could also sometimes access it at my home. However I don't want them to be able to see all my file (not my personal files from my home directory, I mean files that reside outside of the user directory, like etc, lib...) I asked the question recently: OpenSSH, chroot user: Root need to own the user directory, is there any consequence? And the awnser that was given to me was that if I chroot the user, I will need to create a complete environment for every user. Is there a way to actually prevent users from going outside of their home directory and preventing them from an passing argument to a program like `cp` that would point outside of their home directory, or any way to actually keep my system private? What is the best solution? I want them to be able to fully use all my programs, but unable to copy or read files, or use programs to read or copy file outside of their home directory.


title: Can you change timestamp format for history command on tcsh

text: When I run `history` command (on tcsh), it only prints the TIME portion of the timestamp and omits the date:                3  15:07   echo $PATH      4  15:07   ls -la      In bash, you can use `HISTTIMEFORMAT` environmental variable to affect the timestamp forman printed by `history` command. E.g. `set HISTTIMEFORMAT="[%F %T %Z] "` Is there a way to do this in tcsh and if so, which version of tcsh is required? We have tcsh 6.17.00. Environment: Red Har Linux 4.4, but I assume the answer shouldn't be affected since `history` is a shell built-in and not OS-supplied binary.


title: Safenet Authentication Client Tools error when Reboot or restart the eTSrv- and pcscd-services

text: Command: sudo /etc/init.d/eTSrv start   * Starting eTSrv daemon eTSrv /usr/bin/eTSrv:  error while loading shared libraries: libeToken.so.8: cannot open shared object file: No such file or directory


title: How to use Caja (file manager) to organize files and folders online?

text: The default file manager of `Linux Mint 15 (Mate)` is `Caja`. In the about screen of `Caja`, it says: > Caja lets you organize files and folders, both on your computer and > **online**. My question is, how could `Caja` be used to organize files and folders online? Does it mean it can be used as an FTP client? ![enter image description here](http://i.stack.imgur.com/dvSEA.png)


title: Is the "computer:///" address only something symbolic, or can it be used somewhere?

text: I am using `Linux Mint 15 (Mate)`. When I double click the `Computer` icon on my desktop to see the available drives, the address bar of file manager (Caja 1.6.1) shows this address: `computer:///`. Is this address just something symbolic, or can it be used somewhere? (like in the command line, or whatever). And why does this address have three `/` characters? Why not two? Any specific reason behind that? ![enter image description here](http://i.stack.imgur.com/xSFcW.png)


title: Exposing NFS mount via USB

text: I know enough linux to be dangerous - apologies if my terminology is incorrect. I have an electronic drumkit that has USB into which I can plug a flash drive with MP3s on it. The drumkit has no network connectivity. This means whenever I want to play along to a new song, I have to unplug the flash drive, plug it into a computer on my network, copy the MP3 from my NAS to the thumb drive, and plug it back into the drumkit. This is clearly a hassle. I was thinking of getting a raspberry pi with wifi and mounting my music via NFS. I could then run a USB cord from the pi to the drumkit and....somehow have the drumkit "see" the contents of the NFS mount (would need to be FAT32, I'd imagine). Thing is, I don't really know how to do this bit. I'd imagine being able to mount the NFS at the USB mount point, so to speak, but that's probably naive. Can anyone explain what I'd need to be able to pull this off?


title: Is it safe to resize a partition while writing to it?

text: I'm working on a script for automatically setting up Amazon Linux servers. I create them with 100gb virtual disks, but the main partition is always 8gb. No problem, I call `sudo resize2fs /dev/sda1` at the start of the script to expand it to the full 100gb. The process is fairly slow, though. Later on in my script I download various tools and components and set them up. I was wondering if it's safe to do that in parallel with the resize. Intuitively it seems like it would not be safe to write to a partition that's in the process of getting resized, but I thought I'd ask in case there's some clever magic Linux does that makes this ok.


title: Configure port 1935 in iptables for media

text: On CentOs 6.4 I cannot connect to the media server from port 1935 only 5080. I have read you can edit the `iptables` files with following.   1. Open flle /etc/sysconfig/iptables:              $ sudo vi /etc/sysconfig/iptables        2. Append rule as follows:              -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport XY -j    ACCEPT        3. Save and close the file. Restart iptables:              $ sudo /etc/init.d/iptables restart      How would I specifically configure port 1935? The above seems to be open to all ports, is this correct? Do I replace XY with 1935?


title: What is "userdel --root?" supposed to do

text: On a GNU/Linux system, I found the following, (for me very confusing seeming entry) about an option for `userdel` in the German version of its man page: ![found this in the German version of man 8 userdelbut can't find this option in, say, English ](http://i.stack.imgur.com/3IO4D.png) I'm truly sorry, but I can't really provide you with a translation because a) I don't understand what it means (even with German as mother-tongue) and b) I don't understand what this option is supposed to do. I couldn't find anything on this option and begin to wonder it this really exists. How come?


title: When I type vim in terminal my bodhi linux complains emacs is not installed (bodhi linux)

text: jcress@jcress$  vim     The program 'emacs' can be found in the following packages:      * emacs23      * emacs23-nox      * e3      * emacs23-lucid      * jove     Try: sudo apt-get install <selected package>      I can't figure out why. I assumed something was wrong with .vimrc or ~/.vim so I moved these away from ~/ and still cant run vim. I'm running bodhi linux               jcress@jcress$  uname -r     3.8.0-19-generic               jcress@jcress$  type vim     vim is aliased to `emacs'


title: How to redirect HTTP request to different local web servers

text: I have a Linux machine and some applications are running web interfaces. I'd like to create a web server, opened to the Internet, in order to access these local web interfaces (or web interface on others local machines). Example, from the Internet:               http(s)://mywebserver/webmin  --> redirects to localhost:10000  (webmin interface)     http(s)://mywebserver/bitt   --> redirects to localhost:1234  (bittorrent client interface)     http(s)://mywebserver/httpd   --> redirects to localhost:88  (mini http server)     http(s)://mywebserver/ddwrt  --> redirects to 192.168.0.254:80  (dd-wrt interface) etc... Do you know a way to do this? I tried "pound" reverse proxy, but it doesn't work.


title: Installing video driver on Arch Linux

text: I have Arch Linux installed in console mode on an Intel-PC machine. My task is to write and run an OpenGL display program on the machine to check whether it meets the following conditions:   * It would take at most 10% of total CPU usage   * It would take at most 20% of total RAM Here are more info about the device:               uname -a          3.6.5-1-ARCH #1 SMP PREEMPT Wed Oct 31 .. x86_64 GNU/Linux      cpu MHz: 1866.717 RAM: 2GB Preemptible: YES               lspci -v | grep -i graphic*          VGA compatible controller: intel corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) (prog-if 00 [VGA controller])     (same for Subsystem and Graphics Controller)      Now, what I want if to install the relevant graphics driver. However, I cannot do anything as it is run in console mode. It has no X window. I try ALT+F8 but it does not start X window. also tried startx,but I get               -bash:startx: command not found      Could anyone guide me how to install the graphics driver please. Considering that I think the kernel is compiled in preemptive mode.


title: why gentoo livecd can not detect the linked network card?

text: The original os is Ubuntu 12.04, machine has 4 network cards, and the first netcard is linked. If use `ethtool`, will get `Link detected: yes`. When I use `gentoo livecd` to start, and config network, I found in gentoo livecd, the network card is `Link detected: no` by ethtool, so I can't up the network, I have tried all the four network cards. I don't know why in gentoo livecd, the first network card is deteched not linked? Does it related to the network driver?


title: Is it possible to manually manage a Solid State Hybrid Drive?

text: I'm about to buy a new laptop which has a SSHD. It stands for Solid State Hybrid Drive, which means it has a big, regular HDD with a small, usually 8GB SSD to cache frequently accessed files. Now since I'm a Linux user and I want pure SSD speed, so I thought it would be awesome if I could detach the SSD from the HDD and use it completely separate. I've googled for this topic, but could not find anything useful. According to Wikipedia there is a standard to communicate with the drives separately, but I may have misunderstood. Does anyone know anything about this topic?


title: How do I create a bash script that sums any number of command line arguments?

text: How would I create a bash script that the user can use to sum any amount of command line arguments? For example, say my script is called sum:               sum 3      3               sum 3 5      8               sum 9 8 21      38 And so on.. I realize that I will have to loop through the command line arguments and increment them to the total, but I am not really sure how to do that. I am not sure how to reference say the 2nd command line argument to a specific variable or how to get the number of total command line arguments.


title: Insert a space before the first comma in a csv file

text: I have a huge CSV file which contains 100000 rows. However, I need to do some processing and so for that I need to have a single space before the first comma. My current data is something like below.               123456,5,4,3,2,1      I need a space before the first comma for some internal processing. So, after the command execution, I need the file to be like below.               123456 ,5,4,3,2,1      I tried the gawk command to get the first column alone using $1. However, $1 gives me the entire row. Is there another way to do the above task?


title: Can't create a minimal chroot jail

text: Was trying to create a minimal `chroot` jail. The steps followed was:   1. Created a folder `chroot`   2. Copied bash to the folder `chroot`   3. Run `ldd bash` to know the dependencies              ldd /bin/bash   linux-vdso.so.1 =>  (0x00007fff645e2000)         libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f9155f75000)         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9155d71000)         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f91559e6000)         /lib64/ld-linux-x86-64.so.2 (0x00007f91561bb000)        4. Then I created folder like               ls chroot/          bash  lib  lib64          ls chroot/lib          x86_64-linux-gnu        5. When I run               chroot chroot/          chroot: failed to run command `/bin/bash': No such file or directory


title: Open file from particular position?

text: I was wondering, if you had a particularly large file, saying 64 MB, is it possible to figure out the physical hard drive location of the file, and then read bytes from a particular offset into the file? Let's say I'm interested in 100 bytes with an offset of 60 MB from the start of the file. I don't want the inefficiencies of the hundreds of disk seeks it would take to get from the start of the file to the end of the file if I used some application level seek() function. Is there a solution? Thanks so much!


title: Bugzilla email_in.pl script will take 111 hours to complete - how can I change that?

text: I have an old Bug tracking system, with about 20k bugs. We have installed a new bugzilla system, and part of the initiation will be to import all the bugs from the old system to the new. I am able to use the email_in.pl process to read a file from an NFS shared folder (where I can save my CSV-->single files. email_in.pl format http://www.bugzilla.org/docs/3.0/html/api/email_in.html bug fields format http://www.bugzilla.org/docs/3.0/html/api/Bugzilla/WebService/Bug.html#Create However, while testing, each execution of the script takes rouglhy 20 seconds - rough estimation will be 111 hours for the entire database to import. I am not very familiar with perl, and want to know is there a way I can actually make this happen in less time?   Has anyone had experiance with such? *to note: i see that bugzilla is NOT a known tag here. Bugzilla is NOT the main issue. It's pure perl


title: Trouble Installing APT on Centos 6 64 bit

text: Can someone help me get apt-get installed? I followed these instructions to try and install APT on Centos 6 64 bit:   1. wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm   2. rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt   3. rpm -K rpmforge-release-0.5.3-1.el6.rf.*.rpm   4. rpm -i rpmforge-release-0.5.3-1.el6.rf.*.rpm   5. **yum install apt** On step 5 I get this output and error:               Loaded plugins: fastestmirror, priorities, security     Loading mirror speeds from cached hostfile      * rpmforge: mirror.team-cymru.org     27 packages excluded due to repository priority protections     Setting up Install Process     No package apt available.     Error: Nothing to do      I'm a Linux newb, but I think I looked at the listing of packages here: http://pkgs.repoforge.org/apt/ and there is no Centos 6 64 bit package. Looking at their build logs it seems there is an error building for Centos 6.


title: Installing AMD GPU drivers on Fedora 18

text: How can I install the AMD graphics drivers on Fedora 18? I downloaded the driver from the amd website. I unpacked the driver and ran the "amd-driver- installer-catalyst-13.1-linux-x86.x86_64.run" script. But that gives me an error. During the installation I get this error:               Supported adapter detected.     Check if system has the tools required for installation.     fglrx installation requires that the system have kernel headers.  /lib/modules/3.6.10-4.fc18.x86_64/build/include/linux/version.h cannot be found on this system.     One or more tools required for installation cannot be found on the system. Install the required tools before installing the fglrx driver.     Optionally, run the installer with --force option to install without the tools.     Forcing install will disable AMD hardware acceleration and may make your system unstable. Not recommended.      Where can I find the kernel headers? I already did a yum install kernel- headers (kernel-headers.x86_64), but that doesn't solve the problem.


title: Running multiple nohup commands in background

text: Got two commands cmd1 and cmd2. Of the two, cmd2 takes longer to finish. Need to run cmd2 and then cmd1. Tried to run them in following way:               bash$ (nohup ./cmd2>result2 &) && nohup ./cmd1>result1 &      or               bash$ (nohup ./cmd2>result2 &) ; nohup ./cmd1>result1 &      But both time I can see cmd1 is not waiting for cmd2 to finish and result1 gets filled. How to make cmd1 run after cmd2 when both should be nohup process and run in background?


title: Variable expansion did not happen in /etc/environment

text: I changed the `/etc/environment` to add more directories to the `PATH` variable. But looks like `$PATH` in double quotes were not expanded and I could find any command from the shell and `/usr/bin/command-not-found` is run.               $ cat /etc/environment      PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"     PATH="$PATH:/home/user/technical/java/maven/bin"     JAVA_HOME="/home/user/technical/java/jdk7"      so from the tty,               $ echo $PATH     $PATH:/home/user/technical/java/maven/bin      why did not the expansion happen?


title: xrandr --pos doesn't do anything

text: I hooked up a tv to my linux computer. I noticed the screen was offset by about 200px to the right, leaving behind a black vertical strip on the left of the screen and cutting off a portion of the right of hte screen. So I executed the command `sudo xrandr --output VGA1 --pos -200x0` but all that did was blink the tv for a split second without changing anything. I tried repeating the xrandr with the --pos option on another computer. I noticed that the screen reposition as expected for just a fraction of a second before returning to it's original position. How do I get xrandr to re-position screens ? What's wrong with my commands?


title: No sound in Ubuntu minimal + xbmc. Possible bug?

text: I'm running Ubuntu 12.04 minimal+XBMC with no gnome interface.               lspci | grep -i audio     00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)          aplay -l     **** List of PLAYBACK Hardware Devices ****     card 0: Intel [HDA Intel], device 0: ALC268 Analog [ALC268 Analog]     Subdevices: 1/1     Subdevice #0: subdevice #0      I have tried speaker-test, alsamixer is at maximum of everything, AutoMute disabled, xbmc recognizes (on System -> Settings -> Audio Output) Audio Output Device : Playback/recording through the PulseAudio sound s... (There are no other options). I have tried also to turn off navigation sound (which i never heard) but someone posted it works. I've tried with oss4 instead of alsasound, doesn't work for me. Does anybody have any idea what's going on?


How to get a Finepoint Digitizer Tablet to work under Fedora Core 16? The hardware in question is a Gateway m285-E. It uses an active pen (has a battery in the pen).                   cat /dev/ttyS0       returns input characters to the screen when the pen is close to the monitor. However, if I don't cat /dev/ttyS0 – say I'm just on the desktop, and press the pen to the screen, it crashes me back out to the Fedora login screen. How do I get this laptop to handle pen input properly? Let me recap what we've tried so far: Here's the modified contents of xorg.conf:                 Section "ServerLayout"         Identifier     "X.org Configured"         Screen      0  "Screen0" 0 0         Screen      1  "Screen1" RightOf "Screen0"         Screen      2  "Screen2" RightOf "Screen1"         InputDevice    "Mouse0" "CorePointer"         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Tablet"       EndSection            Section "InputDevice"         Identifier "Tablet"         Driver "fpit"         Option "Device" "/dev/ttyS0"         Option "AlwaysCore" "on"         Option "InvertY"         Option "MaximumXPosition" "12550"         Option "MaximumYPosition" "7650"         Option "MinimumXPosition" "400"         Option "MinimumYPosition" "400"         Option "SendCoreEvents"       EndSection      Here's the contents of her /home/[user]/.xinitrc:                   xsetpointer TOUCHSCREEN         xmodmap -e "pointer = 1 3 2"      Here's the contents of /etc/serial.conf                   /dev/ttyS0 uart 16550A port 0x06a8 irq 4 baud_base 38400 spd_normal skip_test      This configuration setting came from a user the same hardware who was having trouble on the Fedora forums. http://forums.fedoraforum.org/archive/index.php/t-270181.html We've also tried serial.conf with these parameters, as described in the linuxquestions.org site. (http://www.linuxquestions.org/questions/linux- laptop-and-netbook-25/howto-get-your-gateway-or-finepoint-pen-working-497879/)                   /dev/ttyS0 port 0x03F8 irq 4 baud_base 38400       There is a challenge with getting the fpit driver to run under Fedora. It's been cut out of the main branch, and on 19/20 you can no longer just yum install fpit. To get a functioning driver, we dove back into version 16. The ISO is here:                   http://archive.fedoraproject.org/pub/archive/fedora/linux/releases/16/Fedora/i386/iso/Fedora-16-i386-DVD.iso      From there, we were able to download an RPM of fpit driver 1.4.0 for fedora from this URL. http://rpm.pbone.net/index.php3/stat/4/idpl/17319852/dir/fedora_16/com/xorg-x11-drv- fpit-1.4.0-2.fc16.i686.rpm.html I know it's a shot in the dark to ask about an older distro and a super- specific piece of hardware, but any insight would be MUCH appreciated!


title: w command: same output with(out) -u option?

text: According to the `man`page for `w`: > `-u`   Ignores the username while figuring out the current process and cpu > times. To demonstrate this, do a "su" and do a "w" and a "w -u". I've tried this with(out) the `-u` option, both as `root` and as regular user, and get quite the same results. I don't think I get this option at all:   * The headline provides the average load during the last 5, 10 and 15 minutes. Of all users, summed up, I guess.   * Each line under the headers represents one account and its idle time as well as the average load and the CPU load of the current process. ## Question As I don't see any difference between the outputs and have no idea where something should be ignored: **Where am I stuck here**?!      ![The output of w command with\(out\) the -u option and – for me – not much difference…](http://i.stack.imgur.com/M9NoA.png) (P.S.: I think to feel a massive facepalm gathering here…)


title: Gnome doesn't work in new kernel (Fedora16)

text: I'm using Fedora 16. The kernel version is > 3.6.7-4.fc16.x86_64 where GNOME graphics works fine and I have also installed the Nvidia graphics driver. When I update yum then new kernel > 3.6.10-2.fc16.x86_64 has been updated. When I select this kernel loading window occurs but after loading gnome graphical window doesn't open. Why?


title: How to know if you're in a typescript?

text: I'm using the `script` command to save all the output from the terminal to a file called `typescript`. Or `script foo` to save to the file `foo`. Now, let's say I'm going along typing command after command and I forget whether or not I'm in a typescript or not. How can I find out if I'm within a typescript or not?


title: ext2 fs inode error

text: I got "block bitmap differences" when doing e2fsck. I do e2fsck after i unmount that partition. My question is: what exactly is "bitmap difference". The difference is between what to what? Thank you!               ~ # e2fsck -c /dev/sda1     e2fsck 1.42.5 (29-Jul-2012)     ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /dev/sda1 is mounted.     Checking for bad blocks (read-only test): done     /dev/sda1: Updating bad block inode.     Pass 1: Checking inodes, blocks, and sizes     Inode 81738, i_blocks is 16, should be 8.  Fix<y>? yes     Pass 2: Checking directory structure     Entry 'collector_prof.txt' in /etc/idirect (81624) has deleted/unused inode 81762.  Clear<y>? yes     Pass 3: Checking directory connectivity     Pass 4: Checking reference counts     Pass 5: Checking group summary information     Block bitmap differences:  -(346115--346116)     Fix<y>? yes     Free blocks count wrong for group #10 (32124, counted=32126).     Fix<y>? yes     Free blocks count wrong (435610, counted=435612).     Fix<y>? yes     Inode bitmap differences:  -81762     Fix<y>? yes     Free inodes count wrong for group #10 (7998, counted=7999).     Fix<y>? yes     Free inodes count wrong (121381, counted=121382).     Fix<y>? yes          /dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****     /dev/sda1: 1018/122400 files (0.1% non-contiguous), 53599/489211 blocks


title: how to create a script to backup MySQL databases on separate files?

text: I need to create a script so to automate the backup process for my database server. Today there are 19 databases on the server and to prevent some schema is created and not contemplated by the script, I'd like it to backup all the databases listed by the "show schemas" query. My idea is that each schema is dumped twice (i.e., at 0h00 and at 12h00) a day, compressed and saved to the folder /home/{user}/database_backup/daily/[day_of_week]. Once a week all [day_of_week] folders are compressed and saved to /home/{user}/database_backup/weekly/[week_of_month]. Finally, once a month, all [week_of_month] would be compressed an saved to /home/{user}/database_backup/monthly/ and left there so another application can back it up to tape. Today, this tape backup application backs up /var/lib/mysql on a daily basis, but should need be, restoring these files or using them on a different database server is somewhat difficult. I know this is a muck too open question, but help is, as always, appreciated.


title: Modifying PDF files

text: I need to do some basic editing on existing PDF file. I.e. I need to:   * Add chapters/bookmarks   * Change some page numbering However I cannot find any tool - GUI or commandline - which would offer this functionality. Is there any alternative to just write such tool myself? PS. I look only for free tools. Preferably open.


title: How do I set the group (gid) of a process I'm about to launch?

text: I'm porting a Debian init.d script to CentOS. In the Debian script, it uses start-stop-daemon for launching the process. The script uses start-stop- daemon's --group flag to change to a different group-id when starting the daemon process. How do I set the group-id of the daemon process in the init script on CentOS?


title: How do I cp the folder, not just the folder content?

text: Let's say I have folder structure like this:               /parentFolder/       folder1/         folder1.1/           file1       folder2/         file2      How do I copy folder2 inside folder1.1 so that file2 is also in               /parentFolder/folder1/folder1.1/folder2/file2      ie so that the folder structure looks like this:               /parentFolder/       folder1/         folder1.1/           folder2/             file2           file1       folder2/         file2      ? If I just go `cp -R /parentFolder/folder2 /parentFolder/folder1/folder1.1` then it copies the _content_ of the folder2, but I want to copy folder2 as well. Related question: would the answer applies to `mv` as well?


title: Preventing binary planting attacks in Linux

text: If a user account on a Linux machine is compromised, clearly, all files owned by that user are compromised. Unfortunately, if the compromised user also has sudo privileges, it seems that binary planting can be used to trivially gain the sudo password and therefore escalate the attack to root privileges (bad). Are there any good defences against this attack, or is it generally accepted that root will be compromised if sudo is in use? * * * Previous question on a related note: zsh - fully expand binary path on <tab> This does not solve the problem, because even if your shell .rc file is owned by root, it can be removed by the local user and replaced with one containing a malicious $PATH variable, or the keyboard shortcut to open a terminal could be replaced by a malicious one.


title: Bind specific usb out

text: How can I bind specific usb out to specific `/dev/sd*` value? Each time that I plugged in some device in specific usb out it binds to different `/dev/sd*` location. How can I avoid it to set mounting option in `fstab`?


title: Mount device with r/w access to specific user

text: How can I mount some device with read-write access to specific user?


title: Calling script from bash has problem with arguments

text: I have a script that generates an xml file and then executes a perl script, passing a series of arguments to it. Here's the key code:               CMD="./dnscurl.pl --keyname $KEYNAME  -- -X POST -H \"Content-Type: text/xml; charset=UTF-8\" --upload-file /tmp/file.xml https://route53.amazonaws.com/2010-10-01/hostedzone/$HZID/rrset"     echo "Executing..."     echo $CMD     RESULT=`$CMD`      When this executes, the result indicates that something is happening to the embedded arguments after the -H param sent to the dnscurl.pl script: > curl: (6) Couldn't resolve host 'text' However, I can take the exact command I echo out, and run it from the shell prompt, and the script operates correctly. It seems that when I run it with backtic using RESULT=`$CMD` the parameters are not getting passed with the double quotes around the "Content-Type: etc...". The command I'm running is this one (only the keyname and hostid params were changed)               ./dnscurl.pl --keyname mykey -- -X POST -H "Content-Type: text/xml; charset=UTF-8" --upload-file /tmp/file.xml https://route53.amazonaws.com/2010-10-01/hostedzone/ZZZZZZZ/rrset      One thing I'm curious about is the use of the '--' they are passing. I realize that is specific to the dnscurl.pl script handling, but I'm not clear on why that is being passed. Is that due to get around positional argument handling? The script was written to handle 3 different use cases. I don't think it's relevant, but just for completeness, this script is being used to make calls to AWS's route 53 rest api.


title: Is there a way to make sure only one systemd@.service instance is running resp. gets started

text: I would like to use one .service file for starting a service from varying directories but it would be nice if there was a way to automatically stop any running instance with a different instance name (or even the same) or at least to prevent starting a second instance. Say I have a unit file `special_service@.service` that contains               WorkingDirectory=/var/special_service/%i      and then call `systemctl start special_service@try_one` and later I issue `systemctl start special_service@try_two` then this second instance should either fail to start with an appropriate message or even better stop `special_service@try_one` and start `special_service@try_two`.


title: cinnamon crashes after installing nvidia driver

text: I installed the new nvidia driver with opengl 4.5 capabilities after a fresh install of linux mint (the usual way: stopping mdm, disabling nouveau, installing, starting mdm, nvidia-xconfig). But now cinnamon crashes and I only have a resolution of 640x480. Also I get an error that it can't get the correct configuration of the monitors or something similar to that. How do I fix that? Edit: the error message started with "could not apply stored configuration to monitors" **Edit2:**   I have the following errors in /var/log/Xorg.0.log: > > (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the   >  (EE) NVIDIA: system's kernel log for additional error messages and   >  (EE) NVIDIA: consult the NVIDIA README for details.   >  (EE) No devices detected.   >  (EE) Failed to initialize GLX extension (Compatible NVIDIA X driver not > found) **Edit3:** lsmod shows > > video 19476 1 nouveau so that's odd, I guess Nouveau loads before the nvidia drivers get a chance to do so? **Edit4:** Ok, I disabled nouveau bei blacklisting it and updating initramfs. Now it seems to work! Thanks!


title: TigerVNC Cinnamon session on Fedora 17

text: I'm trying to properly start a Cinnamon (2D) session in `tigervnc-server` on Fedora 17 "Beefy Miracle". The only way I currently know to accomplish this is to modify the file `/etc/X11/xinit/Xclients`. The first line originally looks like this:               GSESSION="$(type -p gnome-session)"      and I'm changing it to               GSESSION="$(type -p gnome-session-cinnamon2d)"      The problem with this approach is, that this change is reverted if the `xorg-x11-xinit` package is updated, which already happened to me. Is there a better way to do this, without having to reset it each time I update my system?


title: How can I use a variable from a script?

text: A bash script is running as I defined it in Startup Applications. It is possible to display on terminal a variable used in that script? If yes, how?


title: ATI Graphics in Slackware not working at command line

text: I installed ATI radeon's proprietary drivers on Slackware. Prior to install: Output from boot process displayed fine on HDMI out, and upon logging out, I returned to the command line just fine. But in the desktop environment, graphics were lacking. After install: Install seemed to work fine, no errors, and it showed in the desktop environment: a lot smoother graphics now. However, during boot and at the command line before using startx, there is no HDMI output (I have to switch to VGA to login) and when I exit the desktop environment the font is oversized and doesn't scroll so I can't see what I'm doing (on both VGA and HDMI after startx). Of course, in the desktop envrionment, everything is fine. I'm using fluxbox desktop environment.


title: Good free intro to Ubuntu?

text: So a friend asked me if I knew of a good Ubuntu tutorial or book. I remembered one from a while ago: the Ubuntu Pocket Guide, but it turns out it's from 2008, so it's not really ideal any more. Are there any others out there that are updated for 10.4 or 10.10?


title: Anacron job complains "Gtk-WARNING **: cannot open display"

text: I'm trying to make a simple weekly Anacron job that backs up my computer if I click yes on the dialog. The script I wrote works fine if run manually, but when Anacron runs it, nothing happens and I see `Gtk-WARNING **: cannot open display` in the logs. Apparently the script is run at a stage where graphical operations cannot be run. Is there any way to get this dialog to open from an Anacron job? Code:               #!/bin/sh     # Backs up the local filesystem on the external HDD          sleep 60          DISPLAY=:0.0          zenity --question --text "Do you want to backup? Be sure to turn on the HDD."     if [ $? -ne 0 ]         then exit 1     fi          *Do backup stuff here*      Error:               (zenity:2351): Gtk-WARNING **: cannot open display:      run-parts: /etc/cron.daily/backup-on-external exited with return code 1


title: apt-get doesn't stop on Ctrl-c, what to do?

text: Occasionally I have connection problem with apt-get (typically because I use it behind a proxy and try to install/upgrade flash). I have been trying sending `Ctrl``c` but it would not stop. I thought it was something wrong with synaptic but obviously I just tried with a terminal and don't know how to stop it now.


title: Lightweight isolated linux environment

text: I want an isolated (guest) Linux environment on my computer that I can mess up without worrying about the host. E.g. install a lot of stuff from source without package management, pollute environment environment variables etc., then spawn another guest environment when the old guest gets too cluttered. I've had some fun using Virtualbox with Tinycore linux, but at least the way I use it, I don't think the Virtualbox overhead is entirely necessary. For one thing, if possible, I would like to use the same kernel as my host. Also, as I've run through the Linux From Scratch tutorial, I learned a little about `chroot`, which seemed like it might be what I am looking for. To be honest though, there was a lot I didn't really understand in LFS, chroot being one of them. I would try playing around with `chroot` if I wasn't so afraid it might mess up my current environment. So I'm looking for a virtualization program that uses the fact that I'm on a linuxbox (I'm using PinguyOS btw), to speed up virtualization, or a newbie friendly reference on how to use chroot as an isolated playground.


title: Show files from the last 2 days on a mounted ntfs system?

text: What's exactly the command to show files younger than 2 days? I thought about something like this:               $ find / -mtime -2      ...but I'm not sure how to print the date of the found files. My target is to find file on a mounted ntfs system which are new or changed within the last days. Moreover it would be very helpful to sort the results from the newst to the oldest. Is that possible?


title: How to use a USB device instead of a hard drive

text: Recently I setup a webcam that uses ftp, which uploads the current frame every 0.33 seconds. This creates thousands of images on my hard drives. I have a daily cron job deleting anything past 10 days old, so the space doesn't get out of hand. I was wondering if it's safer to store all the images on a USB drive attached to my server, so that the hard drives don't have such a load on them. If I have my ftp user's home directory pointed to a mount on the usb, will the hard drives be affected? I'm asking because my hard drives are really old, and I don't want to wear them out faster then needed.


title: set tab width for less output

text: Is it possible for `less` output to set the tab width to a number `X` as it is for cat?


title: How to use top with only showing CMD name

text: How do you use `top` with just showing the CMD name? I have used `top` with just showing the running process that I want; for example:               $ top -p 19745      And if I want more than one PID, I would use:               $ top -p 19745 -p 19746 -p 19747      I have Googled it, but they don't say how you can do it, even when I try looking at the help in `top` it still doesn't show you. Is there a way you can filter by the CMD name only? There are certain files that I am running through Apache2, and I want to monitor them only.               afile1.abc     afile2.abc     afile3.abc     afile4.abc      **Update** I see this in the `man top` page:               x: Command  --  Command line or Program name           Display the command line used to start a task or the name of the associated           program.   You toggle between command line and name with 'c', which is both           a command-line option and an interactive command.                When you've chosen to display command lines, processes  without  a  command           line  (like  kernel  threads)  will  be shown with only the program name in           parentheses, as in this example:                 ( mdrecoveryd )                Either form of display is subject to potential truncation if it's too  long           to fit in this field's current width.  That width depends upon other fields           selected, their order and the current screen width.                Note: The 'Command' field/column is unique, in that it is not  fixed-width.           When  displayed,  this  column will be allocated all remaining screen width           (up to the maximum 512 characters) to provide for the potential  growth  of           program names into command lines.      Will that do anything for me?


title: ssh private key stops accepting my passphrase

text: When booting my laptop today I found that `ssh` (openssh) simply refuses to accept my passphrase when reading my private key. My only idea of how that could've happened is if the HDD has somehow corrupted the key, but I figure that if that is the case I'd probably notice system instability in other ways too. This isn't that much of a chore for me, since I can access all the places where that key is used using some other means, and I've been meaning to generate a new (bigger) key anyway. I'd still like to figure out what happened though, so any ideas on what could've caused this are welcome. I'm absolutely sure that I'm not typoing the passphrase.


title: Is this ddrescue command doing anything?

text: In the course of trying to recover data from a failing hard drive, I am running the command `ddrescue`. The command has been running for 9 days, and I thought from the sound of disk activity that maybe it was doing something. The command line output has looked more or less static all this time:               $ sudo ddrescue -r3 /dev/sdb /home/dave/RECOVERY/usb500.image /home/dave/recovery_usb500.logfile          Press Ctrl-C to interrupt     Initial status (read from logfile)     rescued:         0 B,  errsize:       0 B,  errors:       0     Current status     rescued:         0 B,  errsize:    500 GB,  current rate:        0 B/s        ipos:     2539 MB,   errors:       1,    average rate:        0 B/s        opos:     2539 MB,     time from last successful read:     9.7 d     Splitting failed blocks...       The one part that has been changing is where it says `ipos` and `opos`. It took 9 days to get up to around `500000 MB`, which is the size of the failing disk drive. When it got there, though, it then dropped back down to `0` and started rising again. As I write this, it's at about `2580 MB` and counting. The image file being created is 0 bytes in length. The log file is about 3MB in size and looks like this:               # Rescue Logfile. Created by GNU ddrescue version 1.14     # Command line: ddrescue -r3 /dev/sdb /home/dave/RECOVERY/usb500.image /home/dave/recovery_usb500.logfile     # current_pos  current_status     0x975C3000     /     #      pos        size  status     0x00000000  0x00862000  -     0x00862000  0x00014800  /     0x00876800  0x00800400  -     ~~~~~~edited for brevity ~~~~~~~~     0x74702CCE00  0x00320000  -     0x74705ECE00  0x00025800  /     0x7470612600  0x005F3A00  -      I'm starting to be concerned that this is just a waste of time and no data is being recovered at all. Is there any indication from this output that anything useful is happening? Is there any reason to let the `ddrescue` command continue as is, or should I stop it and do something else? * * * This is the most recent contents of `/var/log/syslog`               Jun 10 07:29:17 homebase-i3 kernel: [568470.316436] sd 5:0:0:0: [sdb]  Sense Key : Medium Error [current]      Jun 10 07:29:17 homebase-i3 kernel: [568470.316443] sd 5:0:0:0: [sdb]  Add. Sense: Unrecovered read error     Jun 10 07:29:17 homebase-i3 kernel: [568470.316450] sd 5:0:0:0: [sdb] CDB: Read(10): 28 00 11 ff 02 98 00 00 08 00     Jun 10 07:29:17 homebase-i3 kernel: [568470.316465] end_request: critical target error, dev sdb, sector 301925016     Jun 10 07:29:17 homebase-i3 kernel: [568470.346640] sd 5:0:0:0: [sdb] Unhandled sense code     Jun 10 07:29:17 homebase-i3 kernel: [568470.346646] sd 5:0:0:0: [sdb]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE     Jun 10 07:29:17 homebase-i3 kernel: [568470.346651] sd 5:0:0:0: [sdb]  Sense Key : Medium Error [current]      Jun 10 07:29:17 homebase-i3 kernel: [568470.346656] sd 5:0:0:0: [sdb]  Add. Sense: Unrecovered read error     Jun 10 07:29:17 homebase-i3 kernel: [568470.346662] sd 5:0:0:0: [sdb] CDB: Read(10): 28 00 11 ff 02 98 00 00 08 00


title: Why are there both, an Upstart script and an init.d script, for several daemons?

text: I am running Ubuntu 12.04.3 LTS and installed several services like Samba, DHCP server, ... I receive the following warning when I run "halt now", "telinit 6" or similar:               Since the script you are attempting to invoke has been converted     to an Upstart job, you may also use the...      I can see that the affected services try to stop/start twice. Once through the Upstart job and again through the S/K symlinks in the /etc/rcN.d folder which target the init.d script. Probably I can simply remove the symlink in the /etc/rcN.d folder. Example flow:   1. Run 'halt now' from shell   2. Upstart stops Samba (because there is a Upstart conf file for Samba)   3. SysV tries to stop Samba again (because there is also a /etc/rc0.d/K20smbd symlink) I don't understand/want step 3 as it seems unnecessary and shows an ugly warning. Why are there both, the Upstart script and and the symlinks to the init.d script, for several daemons? Is it the correct way that I have to manually clean up the duplicate symlinks in each /etc/rcN.d folder?


title: sudo askpass: ask from other tty

text: # Context I want to setup `rsync` backups of my server, so I run the following command               rsync -r -e ssh --rsync-path="sudo rsync" rsyncuser@example.com:/ /backup/      Ideally, that command would ask my private ssh key password, then connect, then ask the sudo password for rsyncuser, and then run rsync on the server. But I got the infamous error:               sudo: no tty present and no askpass program specified      So I had to add this to `/etc/sudoers` (using `sudo visudo`), which basically gives passwordless full read-write access to the system to the user `rsyncuser`, which is not to my taste:               rsyncuser ALL= NOPASSWD:/usr/bin/rsync      # Question **How can I instead tell sudo to read its password from, say, another TTY ?** That way, I could run `rsync` in one terminal window on my local machine, and use another terminal window to open a (possibly separate) ssh connexion to the server, and supply the sudo password there. The only way I think of doing something like that would be to use an `expect` script around sudo, which reads the password from a named pipe, and I would write to that pipe from the other terminal. Note: this is more for the sake of exeprimentation and learning than any practical purpose, _I'm not trying to find out how to use sudo with rsync_ , I've already read all I could find about that.