title: Using regex in ls and mv

text: I have a directory structure like this               ├── UK     │   ├── BuyBand_go_UK.png     │   ├── BuyBand_go_UK.svg     │   ├── BuyBand_K.png     │   ├── BuyBand_K.svg     │   ├── BuyBago_UK.png     │   ├── BuyBago_UK.svg     │   ├── BuyBand_ch_Logo_UK.png     │   └── BuyBand_ch_Logo_UK.svg     └── US         ├── BuyBand_go_US.png         ├── BuyBand_go_US.svg         ├── BuyBand_S.png         ├── BuyBand_S.svg         ├── BuyBago_UK.png         ├── BuyBago_UK.svg         ├── BuyBand_ch_Logo_US.png         └── BuyBand_ch_Logo_US.svg      How can I move all files in bot `UK` and `US` directory in parent directory in one command? This is what I've tried:                  mv (US|UK)/* .


title: Why am I getting git error "remote: error: unable to create temporary file: No such file or directory" on push?

text: This problem is getting weirder. My original post follows, but here is the new thing I discovered: I executed               git push      and it gave me its usual error:               Counting objects: 9, done.     Delta compression using up to 8 threads.     Compressing objects: 100% (5/5), done.     Writing objects: 100% (5/5), 588 bytes, done.     Total 5 (delta 4), reused 0 (delta 0)     remote: error: unable to create temporary file: No such file or directory     remote: fatal: failed to write object     error: unpack failed: unpack-objects abnormal exit     To USER@REMOTE:/git/PROJECT.git      ! [remote rejected] master -> master (unpacker error)     error: failed to push some refs to 'USER@REMOTE:/git/PROJECT.git'      So being overly optimistic, I thought maybe the "--verbose" option would give me some details, so I immediately tried again:               git push --verbose      and this time it worked:               Pushing to USER@REMOTE:/git/PROJECT.git     Counting objects: 9, done.     Delta compression using up to 8 threads.     Compressing objects: 100% (5/5), done.     Writing objects: 100% (5/5), 588 bytes, done.     Total 5 (delta 4), reused 0 (delta 0)     To USER@REMOTE:/git/PROJECT.git         87d6996..1cae8b3  master -> master     updating local tracking ref 'refs/remotes/origin/master'      so it's just totally flaky. I'm starting to suspect that git just doesn't like LDAP. **Original post:** We're transitioning from cvs to git, and I have a test setup where I have a git server that authenticates users with LDAP, let's call it REMOTE, and then my personal machine, let's call it LOCAL. Both machines are Macs. All employees of the company (including me) are members of a group I'll cleverly call GROUP. I ssh'd to REMOTE as me and created a git repository there in a folder named /git/PROJECT.git using cvs2git. Then, back on LOCAL, I did:               git clone USER@REMOTE:/git/PROJECT.git      which was fine. On my Mac ("LOCAL") I then edited a few files, deleted a couple, and did               git -a FILES     git rm FILES     git commit -m 'COMMENT'      and life was good. Then (still on LOCAL) I executed:               git push      to push my changes from LOCAL back to REMOTE and got this:               Counting objects: 19, done.     Delta compression using up to 8 threads.     Compressing objects: 100% (9/9), done.     Writing objects: 100% (10/10), 1.46 KiB, done.     Total 10 (delta 8), reused 0 (delta 0)     remote: error: unable to create temporary file: No such file or directory     remote: fatal: failed to write object     error: unpack failed: unpack-objects abnormal exit     To USER@git-server-co.local:/git/PROJECT.git      ! [remote rejected] master -> master (unpacker error)     error: failed to push some refs to 'USER@git-server-co.local:/git/PROJECT.git'      I researched this problem and it sounded like it might be that might $TMPDIR is wrong, so I ssh'ed to REMOTE, created a directory named /git/tmp, made sure it had write permissions, edited my .bashrc, and set $TMPDIR to /git/tmp. Back on LOCAL, if I execute               ssh USER@REMOTE echo \$TMPDIR      I correctly see the response               /git/tmp      If I ssh to REMOTE and check file permissions, here's what I see:               ls -l /git     drwxrwxrwx  USER GROUP   tmp     drwxrwsr-x  USER  GROUP   PROJECT.git          ls -l /git/PROJECT.git      _all files are rw for owner (me) and group_ What else could be causing this error? p.s. As is the standard on Macs, if I execute:               ssh ADMIN@REMOTE     cd /     ls -l      I see symbolic links: tmp -> /private/tmp, var -> /private/var, and etc -> /private/etc. I adjusted the permissions and ownership so now they are set to:               lrwxr-xr-x   USER   GROUP   etc -> /private/etc     lrwxr-xr-x   USER   GROUP   tmp -> /private/tmp     lrwxr-xr-x   USER   GROUP   var -> /private/var      I also updated the permissions of the actual folders, so if I execute:               cd /private     ls -al      I see:               drwxr-xr-x   USER   GROUP   etc     drwxrwxrwt   USER   GROUP   tmp     drwxr-xr-x   USER   GROUP   var      And finally, if I :               cd /private/var     ls -al      I see:               drwxrwxrwt    USER   GROUP   tmp


title: building Debian package fails at dh_auto_install stage

text: I'm trying to build a very simple debian package. I have two files, `main_file` and `functions`, they are both shell scripts, `functions` is sourced by `main_file`. There are no dependencies on any external packages, the code simply uses `echo`. I have a `Makefile` that looks like this:               install:         cp main_file $(DESTDIR)/usr/bin/main_file         cp functions $(DESTDIR)/usr/bin/functions      I also have a control file in the debian directory, that looks like this:               Source: ad     Section: unknown     Priority: extra     Maintainer: James Kelly <james.kelly@email.com>     Build-Depends: debhelper (>= 7)     Standards-Version: 3.8.3     Homepage: <insert the upstream URL, if relevant>     Package: ad     Architecture: any     Depends: ${shlibs:Depends}, ${misc:Depends}     Description: Just messing around      Playing with debian packages      I have a tar.gz file in the directory above the one which contains the code and debian folder containing the code and the `Makefile`. If I run `$ dpkg-depcheck -d ./configure` I get an error:               strace: ./configure: command not found     Running strace failed (command line:     strace -e trace=open,execve -f -q -o /tmp/depchwOSqtO ./configure      I didn't think that would matter as there are no dependencies, then if I run `dpkg-buildpackage -rfakeroot` I get an error:               dh_auto_clean     dh_auto_clean: failed to write to debian/ad.debhelper.log: Permission denied     END failed--call queue aborted.     make: *** [clean] Error 13     dpkg-buildpackage: error: fakeroot debian/rules clean gave error exit status 2      Finally if I run `sudo dpkg-buildpackage -rfakeroot` the process gets further but then gives me an error:               dh_auto_install     make[1]: Entering directory `/home/james/Dummy_Debian/ad-1.0'     cp main_file /home/james/Dummy_Debian/ad-1.0/debian/ad/usr/bin/main_file     cp: cannot create regular file `/home/james/Dummy_Debian/ad-1.0/debian/ad/usr/bin/main_file': No such file or directory     make[1]: *** [install] Error 1     make[1]: Leaving directory `/home/james/Dummy_Debian/ad-1.0'     dh_auto_install: make -j1 install DESTDIR=/home/james/Dummy_Debian/ad-1.0/debian/ad returned exit code 2     make: *** [binary] Error 29     dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2      I've been banging my head against this all day and I feel that it's probably something simple that I'm doing wrong, if anyone could give me some help I'd be eternally grateful! EDIT: My rules file is here:               #!/usr/bin/make -f     # -*- makefile -*-     # Sample debian/rules that uses debhelper.     # This file was originally written by Joey Hess and Craig Small.     # As a special exception, when this file is copied by dh-make into a     # dh-make output file, you may use that output file without restriction.     # This special exception was added by Craig Small in version 0.37 of dh-make.          # Uncomment this to turn on verbose mode.     #export DH_VERBOSE=1          %:         dh  $@      and a link to a zip file containing my sample code.


title: Running Python on ChromeOS

text: Is it possible to run the Python interpreter on a ChromeOS machine? I've found various editors you can use, but I would like the ability to run python applications as well. I would like to purchase the Samsung Chromebook, and being a computer science student, I'd love to be able to do my CS homework on it instead of carrying around my 15 inch Macbook or Toshiba.


title: Install PIL/Pillow via pip in Debian testing (Jessie)

text: On Debian testing (Jessie), when I try to install PIL or Pillow (python imaging libs) in a `virtualenv` via `pip` I get the following error:               running egg_info     writing Pillow.egg-info/PKG-INFO     writing top-level names to Pillow.egg-info/top_level.txt     writing dependency_links to Pillow.egg-info/dependency_links.txt     warning: manifest_maker: standard file '-c' not found          reading manifest file 'Pillow.egg-info/SOURCES.txt'     reading manifest template 'MANIFEST.in'     writing manifest file 'Pillow.egg-info/SOURCES.txt'     running build_ext     building 'PIL._imaging' extension     creating build/temp.linux-x86_64-2.7/libImaging     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -IlibImaging -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imaging.c -o build/temp.linux-x86_64-2.7/_imaging.o     _imaging.c:76:20: fatal error: Python.h: No such file or directory      #include "Python.h"                         ^     compilation terminated.     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1      I have installed all dependencies for Pillow, based on my experience with Wheezy, but it seems something is different with testing. Any suggestions? **EDIT** In fact I discovered another problem with libc6. The version I had was from experimental. After downgrading it to testing's version, I reinstalled all dependencies but now I get a different error:               building 'PIL._imagingft' extension     x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/freetype2 -IlibImaging -I/usr/include/tcl8.5 -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu -c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o     _imagingft.c:62:31: fatal error: freetype/fterrors.h: No such file or directory      #include <freetype/fterrors.h>                                    ^     compilation terminated.     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1      It seems the experimental version of `libc6` messed things up, but I can't figure out what's wrong. Aptitude doesn't show any unmet dependencies and `aptitude install -f` does nothing. Also, if indeed the linux-headers are relevant, the ones I have installed are:   * `linux-headers-3.11-2-all`   * `linux-headers-3.11-2-all-amd64`   * `linux-headers-3.11-2-amd64`   * `linux-headers-3.11-2-common`   * `linux-headers-3.2.0-4-amd64`   * `linux-headers-3.2.0-4-common`   * `linux-headers-amd64`


title: Can't stream both audio sources, only mic works

text: Why does the following code not stream both audio sources?               #!/bin/bash          INRES="1920x1080"     OUTRES="1280x720"     FPS="20"     QUAL="medium"          STREAM_KEY=$(cat ~/.twitch_key)          avconv -g 0 \     -f x11grab -s $INRES  -r "$FPS" -i :0.0+0,768 \     -f pulse -i "alsa_input.pci-0000_00_1b.0.analog-stereo" \     -f pulse -i "alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" \     -vcodec libx264 -s $OUTRES -preset $QUAL \     -acodec libmp3lame -ar 44100 -threads 4 -qscale 1 -b 712k -bufsize 1024k \     -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"


title: how to fix default sound device for a user

text: when I "play" (with SoX) a .wav file using my own account on Debian it plays fine:               jcomeau@aspire:~$ play ~petalumarentals/7077809525.1396808357.711.wav           /home/petalumarentals/7077809525.1396808357.711.wav:           File Size: 120k      Bit Rate: 128k       Encoding: Signed PCM           Channels: 1 @ 16-bit        Samplerate: 8000Hz            Replaygain: off                Duration: 00:00:07.52            In:100%  00:00:07.52 [00:00:00.00] Out:361k  [      |      ]        Clip:0     Done.      however, when I attempt to play it on the same computer after `sudo`ing to another account, it makes no sound, and shows a much smaller number for "Out:" when done: petalumarentals@aspire:~$ play 7077809525.1396808357.711.wav               7077809525.1396808357.711.wav:           File Size: 120k      Bit Rate: 128k       Encoding: Signed PCM           Channels: 1 @ 16-bit        Samplerate: 8000Hz            Replaygain: off                Duration: 00:00:07.52            In:100%  00:00:07.52 [00:00:00.00] Out:60.2k [     -|-     ]        Clip:0         Done.      a hint was gained when looking at the strace results of both:               petalumarentals@aspire:~$ strace -eopen play 7077809525.1396808357.711.wav 2>&1 | grep /dev/     open("/dev/shm/pulse-shm-757337927", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = 7     open("/dev/urandom", O_RDONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 6     open("/dev/shm/pulse-shm-3973466970", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0700) = 6     open("/dev/shm/pulse-shm-757337927", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = 9     open("/dev/urandom", O_RDONLY|O_NOCTTY|O_LARGEFILE|O_CLOEXEC) = 8     open("/dev/shm/pulse-shm-3705645700", O_RDWR|O_CREAT|O_EXCL|O_NOFOLLOW|O_CLOEXEC, 0700) = 8      and               jcomeau@aspire:~$ strace -eopen play ~petalumarentals/7077809525.1396808357.711.wav 2>&1 | grep /dev/     [snipped]     open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 4     open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 4     open("/dev/snd/pcmC0D0p", O_RDWR|O_APPEND|O_NONBLOCK|O_CLOEXEC) = 5     open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 4     open("/dev/snd/timer", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 4     open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 6     open("/dev/snd/controlC0", O_RDONLY|O_CLOEXEC) = 6     open("/dev/snd/controlC0", O_RDWR|O_CLOEXEC) = 6      also, when I run `alsamixer` with no args as the new user, `PulseAudio` comes up as the "card", whereas when I run it from my account, `HDA Intel` shows by default. Googling with various related keywords brings up lots of advice on uninstalling or reinstalling PulseAudio, or configuring things as root, but after about an hour still haven't found some simple solution for per-user setting of the default sound card in Debian. there has to be some stupid thing I'm overlooking, but so far nothing has come to mind, other than add the `audio` group to the new user, which I did early on.


title: How to use agetty from the command line

text: Is it possible to use `agetty` from the command line? I tried the command               sudo agetty -s 34800 tty8 linux      but it returns after a few seconds and `tty8` is not open. Is it the expected behaviour? Also, trying to start it in the background with               sudo agetty -s 34800 tty8 linux &> /dev/null &      returns immediately. Why?


title: s3cmd: how to use exclude-from with a file list of excluded directories

text: I cannot seem to get the `\--exclude-from=` option to work with my exclude GLOB file when synchronizing with my s3 bucket. Here is a trivial example to demonstrate: I create the following file tree under my `/home/user`:               syncTest         includeTest              includeFile.txt         excludeTest              excludeFile.txt         exclude-list.txt      The contents of my `exclude-list.txt`:               syncTest/excludeTest      Then I use the following `s3cmd` command, called under `/home/user`:               [lucas@lucas-ThinkPad-W520]~$ s3cmd sync --exclude-from=syncTest/exclude-list.txt syncTest s3://my.bucket/lucas/      but my `excludeTest` directory is not excluded:               [lucas@lucas-ThinkPad-W520]~$ s3cmd ls s3://lucas.backup/lucas/syncTest/                        DIR   s3://lucas.backup/lucas/syncTest/excludeTest/                        DIR   s3://lucas.backup/lucas/syncTest/includeTest/     2014-04-06 12:18        21   s3://lucas.backup/lucas/syncTest/exclude-list.txt      I also tried using the following contents for my `exclude-list.txt` file:                excludeTest      /syncTest/excludeTest      But it does not work either. Any suggestions? In this example, I just want to sync my `syncTest` folder, but not the `excludeTest` subfolder, using a file with the `\--exclude- from=FILE` option. I am trying to follow the same format as `rsync`'s `\--exclude-from=FILE` option, assuming that it is the same, because there is not much help for `s3cmd`.


title: Launch RDP silently?

text: I currently use the following command to launch an RDP session which works fine:               rds@rds:~/Downloads/FreeRDP$ xfreerdp /v:farm.company.com /d:company.com /g:rds.company.com /f /u:username /p:      At the moment, it displays all the following and I have to accept the certificate twice.               creating directory /home/rds/.config/freerdp     creating directory /home/rds/.config/freerdp/certs     creating directory /home/rds/.config/freerdp/server     Certificate details:         Subject: OU = Domain Control Validated, CN = *.company.com         Issuer: C = US, ST = Arizona, L = Scottsdale, O = "GoDaddy.com, Inc.", OU = http://certs.godaddy.com/repository/, CN = Go Daddy Secure Certificate Authority - G2         Thumbprint: ab:5a:03:f5:23:06:ad:76:57:e0:4a:2c:1f:be:04:b8:13:5c:32:55     The above X.509 certificate could not be verified, possibly because you do not have the CA certificate in your certificate store, or the certificate has expired. Please look at the documentation on how to create local certificate store for a private CA.     Do you trust the above certificate? (Y/N) Y     Password:      Certificate details:         Subject: OU = Domain Control Validated, CN = *.company.com         Issuer: C = US, ST = Arizona, L = Scottsdale, O = "GoDaddy.com, Inc.", OU = http://certs.godaddy.com/repository/, CN = Go Daddy Secure Certificate Authority - G2         Thumbprint: ab:5a:03:f5:23:06:ad:76:57:e0:4a:2c:1f:be:04:b8:13:5c:32:55     The above X.509 certificate could not be verified, possibly because you do not have the CA certificate in your certificate store, or the certificate has expired. Please look at the documentation on how to create local certificate store for a private CA.     Do you trust the above certificate? (Y/N)      Do you trust the above certificate? (Y/N) Y      Can this be changed so I only get prompted for the password?


title: How to install a downloaded deb file

text: I am new to Ubuntu and I am trying to install Compiz-Config-Manager, but it will not let me. This computer is not connected to the Internet, so I downloaded the .deb file onto a USB and transferred it and tried installing it from there. It pops up with a window saying               dependency is not satisfiable: python central(>=0.6.11)      And I'm not exactly sure what that means. I am assuming python is not up to date for the program to work properly? EDIT: The machine can not connect to the Internet. EDIT: I think I've hunted down at least some of the dependencies. But now when I try to install python 2.7 it says Breaks existing package. What does that mean?


title: What email features/functionality are baked into a typical Linux/GNU distro?

text: I am curious how system daemons on a local Linux host send email.   * Is there some type of email framework already built in?   * Do I need a MTA or a MUA?   * What part does "Sendmail" play and is it a requirement?   * How would I configure the server to be able to send via another host?   * How does the “mail” command fit into this?   * How does /home/user/maildir fit into the picture?


title: per-instance application settings in Openbox

text: I need to run two instances of the same program, and have different Openbox properties for each. Lets say, I want to run two instances of Thunderbird. Even when I create two symlinks, i.e.               /usr/bin/icedove-1     /usr/bin/icedove-2      both instances still have the same NAME and TITLE:               $ obxprop | egrep '_OB_APP'     _OB_APP_TYPE(UTF8_STRING) = "normal"     _OB_APP_TITLE(UTF8_STRING) = "Icedove Mail/News"     _OB_APP_CLASS(UTF8_STRING) = "Icedove"     _OB_APP_NAME(UTF8_STRING) = "Mail"     _OB_APP_ROLE(UTF8_STRING) = "3pane"      How can I distinquish between two instances of the same program? Can I start a program with a parameter, which will change the `TITLE` or `NAME` ?


title: What encryption does vim -x use?

text: I read `man vim`, `:h -x` and `:h encryption` none of this actually says what algorithm it's encrypted with.


title: Setting System Timezone based on a timestamp

text: I want to set the system date and timezone based on a string that looks like this (output of Javascript `new Date().toString()`):               Fri Aug 01 2014 12:13:27 GMT+0200 (CEST)      The standard way to set timezone on a Debian system is to run `tzselect` or to symlink a zone file from `/usr/share/zoneinfo` onto `/etc/localtime`. In both cases, I need to know the timezone by continent/city. Is there an easy way to set the timezone based on GMT offset only?


title: KMail: Search for messages with attachment

text: How can I search for messages with one or more attachments in KMail? The search filters don't show such an option, and when selecting "Message Status" there also isn't a criteria for attachments. ![KMail search dialog](http://i.stack.imgur.com/7gGY7.png) I'm using KMail 4.13.3.


title: How to capture INFORMIX DB errors in shell script?

text: I need to capture the informix DB errors like `Update failed`, `Insert failed` using the shell script. I am using ksh shell.


I'm getting the following error on a Solaris machine when logged in via VNC.               The application gnome-panel has quit unexpectedly.      The two options I see are `Restart Application` and `Close`. I would highly appreciate if anyone can throw more light on this.


title: For loop in bash scripting

text: The following for loop in bash gives an error -               line 42: 1     2     3     4     5 + 1: syntax error in expression (error token is "2     3     4     5 + 1")      line 42 is statement - **num1=$[$i1 + 1]**               for i1 in `seq 1 5`         do         num1=$[$i1 + 1]             for k1 in `seq $num1 5`             do             ky1="${team_two[i1]}_${team_two[k1]}"             pair_score[$ky1]=$[${pair_score[$ky1]}+1]             done         done      What is wrong with the code?      **EDIT**      I get the following output on debugging               ++ seq 1 5     + for i1 in '`seq 1 5`'     /home/ashwin/bin/calculate_power: line 43: 1     2     3     4     5 + 1: syntax error in expression (error token is "2     3     4     5 + 1")      Again it is the same statement that line 43 - **num1=$[$i+1]**


title: find n most frequent words in a file

text: I want to find, say, 10 most common word in a text file. Firstly, solution should be optimized for keystrokes (in other words - my time). Secondly, for the performance. Here is what I have so far to get top 10:               cat test.txt | tr -c '[:alnum:]' '[\n*]' | uniq -c | sort -nr | head  -10       6 k       2 g       2 e       2 a       1 r       1 k22       1 k       1 f       1 eeeeeeeeeeeeeeeeeeeee       1 d      I could make a java, python etc. program where I store (word, numberOfOccurences) in a dictionary and sort the value or I could use MapReduce, but I optimize for keystrokes. Are there any false positives? Is there a better way?


title: copying files with particular names to another folder

text: I have a folder with a lot of files. I want to copy all files which begin with of these names (separated by space):               abc abd aer ab-x ate      to another folder. How can I do that?


title: What causes files to lose permissions?

text: There's been more than one occasion where something has gone with system because all the sudden there were permision changes to certain key files (sometimes taking a long time to find which file is the culprit) becomes `-rw-------`. Once I do a `chmod 777 filename`, then everything appears to be fine. For example, I was trying to Install vncserver on an Ubuntu machine. For whatever reason, vncserver failed to start so I rebooted the machine and then. Then I was unable to log into Xcfe session because the `/home/user/.Xauthority` was file `-rw-------` instead of `-rwxrwxrwx`. Did `chmod 777 /home/user/.Xauthority` and it corrected my issue. This wasn't the only time I've experience something along these lines. So my question is, what cuases this to happen? Do I need to be watch as to what install?


title: View man page of not installed package?

text: On Debian-based systems, can one view the man page of packages that aren't yet installed? I want to check what they are capable first, before installing them.


title: Automatically update a Debian system

text: I want to automatically update a Debian system (actually Debian Wheezy on Raspberry Pi, though that shouldn't make much a difference). I've already seen that there is `cron-apt`, probably a good choice, as it also includes mail notifications on errors. I am however not sure about updates involving reboots like e.g. new kernel updates? Does `cron-apt` automatically reboot a system after a new kernel image was installed? Or can it at least notify me on update of specific packages?


title: What is the difference between ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.gnomerc, /etc/bash_bashrc, /etc/screenrc ...?

text: Answers to the questions on SO and askubuntu, along with poking through (and reading headers of) `$HOME` and `/etc/`, indicate a number of files that can be used to set environment variables, including:   * ~/.profile    * ~/.bashrc    * ~/.bash_profile    * ~/.gnomerc   * ~/.Rprofile    * /etc/bash_bashrc    * /etc/profile   * /etc/screenrc  I gather that files in `/etc/` work for all users whereas files in `$HOME` are user-specific. I also gather that `.profile` is loaded at login whereas `.bashrc` loaded when `/bin/bash` is executed. I also understand that different programs have different settings files (e.g. `.Rprofile` for R). But I would appreciate some clarification:   * Are `*rc` and `*profile` files fundamentally different?   * What is the scope of such files (e.g. which files are are commonly used with Linux)   * Is there a hierarchy (e.g. `.bashrc` overwrites variables set in `.settings`)   * What is a good reference for this class of files? For the options in these files? ### References   * "How to access a bash environment variable from within R in emacs-ess?"   * "Difference between launching an application from a keyboard shortcut vs the terminal?"


title: Opening a PDF file by typing its name

text: I am on Mac OS X and I usually open PDF files from the terminal (using bash)               open myfile.pdf      Now I'd be able to type only               myfile.pdf      and have that opened with the command above. Is there any chance to configure bash to run that command for me? I'd be happy if that works only for PDF files, but of course a more general solution is welcome. Actually it is not purely for saving a few keystrokes. If a solution takes me two hours, I doubt that I will save so much time by having two key presses less the next years. I'd like to learn if this is possible and how.


title: Advantages (or downsides) of GVim over Vim to edit code

text: Should I install vim or GVim ? I develop mainly Ruby on Rails (I also use IDE's, but different topic). ![enter image description here](http://i.stack.imgur.com/cmQNy.png) Are there any differences or advantage of using Gvim vs vim ?


title: How to reduce temperature on a Dell XPS (L502X)?

text: **Problem** My Laptop is running quite hot (sensors reports ~50-60°C) during normal usage. In my opinion this is too high to work comfortably over long periods. Especially the region where I rest my palms is quite warm. I already use some mechanisms to conserve power (see below). **Things tried** I already use the settings from Dell XPS 15 runs hot on linux . Additionally I use **TLP** and intels **pstate** driver for frequency control (using the powersave governor by default). The NVIDIA card is disabled by using **bumblebee**. At this point **powertop** reports that almost everything is running in their deepest sleep modes for most of the time. I tried to setup **i8kutil** to have control over the fans, but there is an open bug that makes the system hang every other second (see https://bugs.launchpad.net/i8kutils/+bug/1179282). I tried downvolting via the **intel-phc** driver, but while the module compiles fine it doesn't seem to be compatible with _pstate_ (I can't load the module). The last thing I tried was to install some daemon (by Intel?) that is supposed to insert NUL commands to regulate the CPU load/temperature. I deinstalled that and by now can't find it again. **The Question** Is there anything else I could try to reduce the temperature of the laptop? Or anything else I overlooked when trying to get _i8kutils_ and/or _intel-phc_ working?


title: Script to "remount" a partition (umount then mount)

text: Im doing some experiences with NTFS(-3G) and fstab. For every change i do to fstab, I need to issue:               sudo umount /mountpoint     sudo mount /mountpoint      To check the results. Since Im doing a LOT of tests, its gets really annoying to issue umount/mount combo every time. Is there any way I could combine these 2 commands in a single `remount`script? Is there already any switch to mount that do that?   * Im using Ubuntu 10.10   * All command-line parameters passed to the script must be "re-passed" to `mount` comand (so I can use `-a`, `-t type`, etc)   * Preferably, only the _last_ parameter should be passed to `umount`


title: How to edit all Apache's error codes DIRECTLY instead of using httpd.conf?

text: When a page does not exist.. this is what   i see on the web :               Not Found          The requested URL /test was not found on this server.      i know about :               ErrorDocument 404 /test.html      but i rather not use that. i rather find where this above is originating from.. and modify that directly. perhaps it would be faster + more efficient this way. given that it would be a more "direct" dealing. (transaction )


title: Creating multiple temporary aliases

text: I am not a root user & I don't have access to the global alias file which has all the aliases created. But I want to create some aliases which remain active only for the session I am logged in. I use the command alias x='cd /parent/child' to create an alias which will enable me to just type x on the console & I change dir to /Parent/Child However I want to create multiple aliases & I dont want to type each alias I create every time. I tried putting all the alias='do this' lines in a file(gave it 777 permission) hoping that on running the file all these aliases would be created every time I login. But that didn't happen. ex :               alias x='cd /parent/child'     alias y='cd /a/b/c'     alias z='tail -0f some.log'      I also tried this in the file but in vain               alias x='cd /parent/child';alias y='cd /a/b/c';alias z='tail -0f some.log'      None of the alias names I tried were already present in the global alias. (I typed alias & saw the output on the screen)


title: Find ".git" dirs but ignore some paths; or how does `find -not` work

text: I cant figure out how the find -not works. Let's say that I would like to locate all .git dirs in the tree.               find -type d -iname .git      No problems, but then let's say that I have some dirs that I don't like to be included, in question they can be called "old" and "backup". I could pipe to grep -v and that will work just fine.               find -type d -iname .git | grep -v old | grep -v backup      But when I browsed the man page for find I noticed that there is a -not, but I cant figure out how it is intended to work. I tried like this, but he does not exclude the old dir...               find -type d -iname .git -not -iname old       How does the find -not work? Can I use it for this find of problem?


title: Opening .eml files with mutt

text: How should one open .eml files in linux ? I'm not sure if `mutt` can handle it ? **UPDATE** I worked it out partially , by creating a new mailbox: `mkdir -p a/{cur,tmp,new}` And place the eml file in a/cur , I could read it with: `mutt -f` But that's not exactly what I want yet


title: get CPU usage of a VM (linux) using java

text: Is there an API for Java in getting the CPU usage of a VM in KVM? I want to know how I could get the CPU usage of a guest (from the host's perspective) using Java. Also, does anybody know where I could find the source of `virt-manager` so I could learn how it gets/computes the CPU usage it displays in Virtual Machine Manager?


title: Alt+tab key not working in NX client for linux

text: I am using NX clinet-3.5.0-7 version running on ubuntu 12.04. I am trying to use `Alt`+`Tab` key to switch between different terminals on my NX client but I am unable to do so. When ever I use `Alt`+`Tab`, it switches the different panels open on my Ubuntu 12.04 instead. I tried to follow this link but that didn't help as there is no "Grab the keyboard when the client has focus" option in Advance Tab. I also tried link but nothing comes out. Seeking suggestions.


title: Linux Mint 12 claims to come with Gnome 3 but gnome-about says it is Gnome 2

text: Can anyone help me explain this? ![](http://i.imgur.com/YIpKo.png) Just installed a fresh copy of Linux Mint 12 downloaded from their website only a few days ago. They claim that it uses Gnome 3 but gnome-about says it is Gnome 2.


title: What happens if I put these directories chmod 000?

text: I have this server I administer. I have some users that have email accounts on that server and use stuff like horde to read their emails on that server. The server have a limited space and these users are relapse and never empty their trashes or remove unnecessary stuff from their accounts and the server are always getting full of crap. Running the server periodically I see that mailboxes like `.Trash`, `.spam` and `.junk` under `/mail/myserver.com/theirAccounts` are never emptied. I have no terminal access to that server, just FTP. My idea was to put directories like these with `chmod 000`, so their web mailers or even the system will unable to store stuff on their trash or on spam folders, discarding them automatically. Can I do that without risking crashing the system? What more can I do to prevent stuff from accumulating on those directories. Again I remember that I do not have `ssh` to that server, so I cannot install `cron` or anything to empty these directories periodically.


title: How to transform a text file into a picture

text: If I have a plain text file, how can I convert it to an image file through the command line? (and preserve the layout of the ASCII art in it)


title: Monitor SSH data transmission, and close connection if no data is flowing

text: For our file transmission and manual storage we have a simple RHEL server on which all other Linux clients are connecting by SSH. Whenever any client wants to access/store data, they connect to the server via `nautilus` and the connection remain established even if data transmission ceases, until its unmounted manually OR the client shuts down their system. When I monitored the CPU usage on the server, most of CPU usage is due to these established connections.               [root@server]# top          top - 11:22:13 up  2:36,  6 users,  load average: 2.79, 2.19, 1.90            PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                17247 share     20   0 55640 1924  972 S 26.7  0.1   7:36.72 sftp-server                                                                                17900 share     20   0 55640 1932  972 S 17.5  0.1  10:16.45 sftp-server                                                                                26152 share     20   0 55596 1872  972 S 17.5  0.1   8:12.04 sftp-server                                                                                17487 share     20   0 55636 1864  972 R 15.5  0.1   9:58.56 sftp-server                                                                                2852 root      20   0  195m  55m 7872 R 13.8  2.7  17:01.72 X                                                                                11768 share     20   0 55560 1684  832 S  8.9  0.1   3:12.00 sftp-server                                                                                17486 share     20   0 98172 1884  784 R  8.2  0.1   4:48.35 sshd                                                                                26151 share     20   0 98236 1872  784 S  7.9  0.1   4:03.29 sshd                                                                                17899 share     20   0 98204 1916  784 S  7.2  0.1   5:00.17 sshd                                                                                12569 tejas     20   0  322m  11m 7808 S  5.9  0.6   0:28.12 gnome-system-mo                                                                                17246 share     20   0 98204 1840  784 S  5.9  0.1   3:33.18 sshd                                                                                11767 share     20   0 98008 1716  772 S  4.3  0.1   1:28.73 sshd                                                                                15168 tejas     20   0  989m  64m  18m S  0.7  3.2   0:01.31 chrome                                                                                4077 tejas     20   0  109m 9312 5584 S  0.3  0.5  24:26.08 App                                                                                11360 tejas     20   0  304m  10m 5144 S  0.3  0.5   0:05.23 gnome-terminal                                                                                14236 root      20   0 15168 1380  928 R  0.3  0.1   0:00.36 top                                                                                1 root      20   0 19324 1056  844 S  0.0  0.1   0:00.67 init                                                                                2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd                                                                                So I am looking for a automatic way to unmount that ssh connection if no data is flowing say for 10 minutes or so, Or any other idea to minimize this CPU usage.   **EDIT:** After slm's comment,`can you explain how they're connecting from Nautilus?`   Here is how clients normally connected to the server by SSH.   * Enter required Fields and enter Password :  ![enter image description here](http://i.stack.imgur.com/1Tmld.png) ![enter image description here](http://i.stack.imgur.com/3wl90.png)   * Transfer/Create File/s.  ![enter image description here](http://i.stack.imgur.com/MxggE.png)   * Wait for 30 Min after closing the directory.    * Still showing connection...  ![enter image description here](http://i.stack.imgur.com/0Ijd2.png)


title: No lockfile creation in NFS setup

text: I recently set up a new fileserver for our research group. The old one was running SuSE linux and, although small harddrives and a slow machine, worked fine. The clients are mostly Gentoo machines mounting the NFS shares via `autofs`. The home directories of the machines are on the fileserver. The new fileserver is a virtual machine on some department computer running `Debian squeeze`. After setting up (several times) we had major problems with the `rpc.statd` and/or `rpc.lockd` not responding as soon as more than one computer mounted their home directories. We updated the kernel from `2.6.32` to `3.2` what seemed to fix that issue. However, **it seems as if lockfiles are still not created at all**. For example, our xdm desktop manager on the clients falls back to creating the `.Xauthority` file somewhere locally in `/tmp` instead of in the home directory on the NFS share. Also, heavy programs that use lock files, like `Firefox, Thunderbird, Libreoffice` etc. are somewhat slow and so is the xdm login. We use (at least that's what I think) NFS4, which to my knowledge doesn't need `rpc.lockd` and so on anymore. The only error message related to this that I can find since the kernel update is the following:               sm-notify[540]: nsm_parse_reply: [0x515dce2e] RPC status 1      I can not find out on the internet what that means. The server is (currently) not protected at all, the `/etc/default/nfs-kernel-server` looks like this               RPCNFSDCOUNT=32     RPCNFSDPRIORITY=0     RPCMOUNTDOPTS="--manage-gids -p 32767"     NEED_SVCGSSD=     RPCSVCGSSDOPTS=      and on the clients, the `hosts.allow` contains an entry for `rpcbind` of the server. I have several questions related to this:   * How can I check, using a small python or bash script, whether lock file creation works normally on NFS shares?   * How do I find out which NFS version a client uses?   * How can I track down NFS errors, when nothing appears in the log files?   * What could be the reason for our problems with the `Xauthority` and the applications mentioned above?


title: Highlighting command in terminal

text: I am running long builds with lots of data that I need to read through after each build. But I have to start from bottom up to reach to top and it takes lot of time as all the text looks same. I was just wondering if it is possible that I can leave a command in terminal highlighted after it has been executed so that I can reach to it immediately and start downwards from there. i saw the colors supported by terminal but I think that won't do.


title: Why does modinfo say “could not find module”, yet lsmod claims the module is loaded?

text: According to the man page of `lsmod` the command shows “what kernel modules are currently loaded”. I wrote a script that uses `modinfo` to show what kernel object (.ko) files are actually in use:               #!/bin/sh     for i in `lsmod | awk '{print $1}' | sed -n '1!p'`; do     echo "###############################$i###############################"     echo ""     modinfo $i     echo ""     echo ""     done      Now I found out that `modinfo nvidia` shows the following output: `ERROR: modinfo: could not find module nvidia` Do you guys have any explanation for this?


title: Minimal Java installation for Linux with no GUI

text: I'm working on a CentOS 6.3 x86_64 minimal OS (installed using the netinstall ISO). This system is not expected to run anything beyond console apps/services and Tomcat7. When I attempt to install OpenJDK 1.7, it lists some x11 packages as dependencies. For my purpose, not even awt is needed. And therefore, if possible, I would like to avoid installing all the fonts, x11, etc. Does there exist a Java/JRE version that comes without the UI pieces?


title: Mysql server remove/install problem - horribily broken

text: I'm having the same issue as Ken did on this post. And I did pretty much what Ken did except to different packages. Now, I'm stuck with unclean hooks. I've detailed my problem here and the attempts I've made so far. Any suggestion is appreciated. Note: If cross referencing is prohibited I'm willing to re-post them here although I'm **not** associated with the site I'm referencing to.


title: How to count recursively for the number of files in several directories?

text: I have a directory, containing a lot of files and directories. I am trying to get the number of files (and directories) contained recursively in every directory. I tried the following approach:               for dir in $(find -maxdepth 1 -type d); do echo "$dir"; echo find "$dir" | wc -l; done      But this returns "1" as result for every directory. I know there are several other questions with a similar question, but I would really like to know what my mistake is in the code above.


title: Advantages of using set -o vi

text: I have seen many developers using this command to set the option to vi. I never understood the real use of this? When using bash commands, what help does switching to vi provide?


title: Is there a way to speed up boot time by loading things into RAM immediately?

text: I'm looking to lower my boot time by whatever means possible. I have about 8GB of RAM in my laptop, and if there's any way I could leverage that into faster boot time, that'd be awesome. Is there a way to make the kernel load itself and all modules immediately into RAM to make things faster? Does the Linux kernel already do this?


title: How to solve "/usr/bin/ld: cannot -lodbcinst" problem during FreeTDS installation

text: I have installed unixodbc for Microsoft SQL Server support in Linux. I want to connect PHP on Linux to a MS SQL server. I tried to install FreeTDS opensource , but it gives me following error.               /usr/bin/ld: cannot -lodbcinst      What is best way to install FreeTDS?


title: Virtual machines on different X servers

text: Is it a good idea to run virtual machine on a different X server? I can switch between them using Ctrl + Alt + Fx shortcuts. If my default X server hangs/crashes, I can still continue to work with the virtual machine. Are there any drawbacks/issues I should be aware of? I didn't face any issue so far. What is the cost of running an additional X server for virtual machine in terms of cpu, gpu, memory, disk etc,.? Is it same as running them inside the same X server? Edit: Basically I am trying to understand which one is better?               XServer      |-----> Virtual Machine 1     |-----> Virtual Machine 2     |-----> Virtual Machine 3      vs               XServer1 --> Virtual Machine 1     XServer2 --> Virtual Machine 2     XServer3 --> Virtual Machine 3


title: Writing a Bash script to run and end at specific times

text: I'd like to create a script that will do the following. Start at a given time during the day and end at another given time. So for example, I have a program I'd like to test, so my script would be set to start at say 10:00pm and continue to run until 9:00am. This follows on from my other question about running programs again and again. I have the following:               #!/bin/bash          trap "echo manual abort; exit 1"  1 2 3 15;     RUNS=0;     while open  -W /Path/to/Program.app     do         RUNS=$((RUNS+1));         echo $RUNS > /temp/autotest_run_count.txt;     done          exit 0      This script essentially runs my program (in Mac OSX) and catches any failures, otherwise it will re-run the program when it closes. I'd like to be able to run this like I mentioned above. Start at 10:00pm. Finish at 9:00am. Your advice is always useful. Thanks! Euden


title: A shell tool to "tablify" input data

text: A long time ago I remember using a command that makes its input into a nicely formatted table. For example, for this input,               apple 1 100     orange 20 19     pineapple 1000 87     avocado 4 30      The output will be similar to this:               apple     1    100     orange    20   19     pineapple 1000 87     avocado   4    30      I'd like to know the name of this tool.


title: Suse 11 vs. Suse 10 difference impacting terminal colors?

text: I have my dotfiles versioned on github (shameless fork of other people's fine work). At work, I have them on a central linux server (SuSE Enterprise Linux 10). I rsync them from a central management server to target servers (they often don't have external http access). We've rolled out SuSE Enterprise Linux 11 and I'm noticing on those servers "red" or magenta bash prompt colors from my profile settings don't seem to be working. Similarly, my vim colorscheme settings don't work - for example instead of search-term highlighting, the word disappears. Reds and yellows aren't honored. Can someone point me to an env var or setting that might be different on these SLES 11 boxes? Below are screenshots of my SLES10 vs SLES11 logins with dotfiles in sync (e.g. .bash_profile, .bash_prompt, .vimrc, etc). `$TERM` on both servers is `xterm-256color`. **see update notes From a SLES10 server: ![vim session, sles 10, color scheme honored](http://i.stack.imgur.com/MQpQK.png) Same dotfiles, but on a SLES11 server: ![vim session, sles 11, color scheme partially honored](http://i.stack.imgur.com/lJWuh.png) **Update**   * I noticed $TERM was different if I SSHed directly from my workstation versus from the SLES10 utility server. I believe TERM is being forwarded from the utility server.   * The .bash_prompt init script sets `$TERM` based on the output of `infocmp` which comes from the `ncurses-devel` package which I've confirmed isn't on the SLES11 server image. If `infocmp` doesn't run or isn't available, `$TERM` is left unset or _whatever it was before the script ran_.   * In the event that `$TERM` is inherited (already set), the .bash_prompt script conditional logic currently leaves it untouched when `infocmp` doesn't run.   * The .bash_prompt script then uses `tput` commands to initialize several vars with color codes - values far above the 8 color default. `tput` is influenced by `$TERM`. My current theory: my `PS1` setup script may be emitting some unsupported terminal values - set earlier from conditional logic based on commands that are influenced by the incorrect/unsupported `$TERM`. This then “messes up” subsequent commands like `vim`. Can anyone confirm this theory based on their understanding of `tput` and the influence of `ncurses` on the system? I've noticed articles about how ncurses enables more color values in the terminal.


title: How can I print a conditional header BEFORE stdout, if there is any output on stdout

text: I have a process that filters a list of files from a directory (having `find` check to see if there are files older than a certain period to show a queue is stuck). It may or may not return anything, and if it does, it is mailed to be by `cron`. What I would like to know is if there is a program or simple `bash` method to pipe this output to, and if there is _any_ output through it, prepend a header line (like "These are the files stuck in the queue").


title: Are there any screen locking solutions for openbox?

text: If I want to use OpenBox then how can I lock my "monitor" when I leave the PC for a few minutes? Like the gnome-screensaver under GNOME.


title: Gnome3: How to add more search options

text: In gnome3, when I hit Windows button a new view with windows/applications appear. I can also do some search there and can choose from two options: wiki and google. Is there any way to add some other choices there, together with code that would make proper search? For example I would like to add some torrent search there through btjunkie, so I would need to make a post to btjunkie and open the result page in a browser. I am happy to code such stuff, but I have no idea where to start looking.


title: Why jobs aren't killed at logout when executed with "> /dev/null 2>&1 &"?

text: When you run jobs like the example below, they're killed when you logout:               $ ./job.sh &      However, when you execute them as in the below example, redirecting stdout to `/dev/null` and stderr to stdout as well as putting the job in the background, they're not killed when you log out. It's somewhat like nohup, except that the output goes to `/dev/null` instead of a file.               $ ./job.sh > /dev/null 2>&1 &      I noticed that some daemons work like that and then I got curious to know the reason why they aren't killed at logout. Can someone explain me why? ### EDIT 1: As suggested by @Patrick on his comment, I tried the same with the simplest job ever and the result is the same: the job does not die when I log out.               # while true; do sleep 1; done > /dev/null 2>&1 &     [1] 4320     # logout          luis-macbook:~ luis$     luis-macbook:Downloads luis$ ssh server     luis.alen@server's password:      # jobs     #     # ps -ef | grep 4320     root      4320     1  0 01:17 ?        00:00:00 -bash      ### EDIT 2: As requested by Patrick again, I did the same test without redirecting the streams and, to my surprise, the process didn't die. Now I'm completely confused... I swear I remember processes put in background dying when you logged out. Am I absolutely wrong?               # while true; do sleep 1; done &     [1] 20720     # logout     luis-macbook:~ luis$ ssh server     # jobs     #     # ps -ef | grep 20720     root     20720     1  0 23:31 ?        00:00:00 -bash


title: How close is cdebconf able to serve as a drop-in replacement for debconf?

text: Most of the internet information around cdebconf is circa 06`, or I was just unable to find its location. Please mention if recent documentation, or FAQ, is available. Is cdebconf able to serve as a drop-in replacement for debconf? As of 06` it apparently was not, but it's been about 6 years from that time. I would assume the status has changes since then, but by how much? **NOTE:** Please refrain from answering these questions, plenty of available grounded opinions exist.   1. Why the community needs cdebconf?   2. Why debconf needs a replacement?


title: Permanently switching to zsh in a script, without being root and without being asked for the password

text: Is there any way to run `chsh -s /bin/zsh` without being root and without being asked for the password? I want to put it into a non-interactive script that isn't called by root.


title: Process VSS and Size: entry in /proc/pid/smaps

text: I was wondering why the sum of all 'Size:' entries in /proc/pid/smaps does not equal the process VSS as reported by top, ps, /proc/pid/status VmSize, /proc/pid/statm 1st entry? Any clues?


title: How can I use two bash commands in -exec of find command?

text: Is it possible to use 2 commands in the `-exec` part of `find` command ? I've tried something like:               find . -name "*" -exec  chgrp -v new_group {}  ; chmod -v 770 {}  \;      and I get: > find: missing argument to -exec   >  chmod: cannot access {}: No such file or directory   >  chmod: cannot access ;: No such file or directory


title: Lightdm won't start automatically on boot

text: Every time I boot my PC Ubuntu keeps dropping me to TTY 1 where I have to log in and then do               sudo lightdm start      just to log in again, which is very annoying I have already tried removing and re-adding it to `update-rc.d`               update-rc.d lightdm defaults      but it just does not work. Anyone got an idea which logfiles to check or what to do get it working again? I use Mint 12 with Gnome3.


title: How do I let bash autocomplete wildcards?

text: If I have directory containing the files               foo.bar.a.cat     foo.bar.a.hat      and I type `ls f`+`TAB` the bash shell autocompletes to `ls foo.bar.a.`. If I type `ls *bar*`+ `TAB` I would like it to autocomplete to `*bar*.a.`. Is this possible? This looks similar to the question How to enable tab completion of wildcards in bash? but the suggested answer, "it works out of the box for me", does not. I've also tried `TAB` `TAB`, with no effect. The command ``bash --version` gives `GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)`.


title: How to programmatically determine the highest version kernel RPM installed?

text: What I want to script is something along the lines of:               if [ uname -r is not == highest version of kernel RPM installed ]     then       echo "You need to reboot to use the latest kernel"     fi      The problem is, if the output of `rpm -q kernel` is something like:               kernel-2.6.32-358.10.2.el6.x86_64     kernel-2.6.32-358.6.1.el6.x86_64      … how do I determine which is higher? I know a simple string sort is not reliable (it will be backwards with this example). Is there a shortcut with rpm or do I have to parse out everything and compare it myself?


title: Unable to successfully format 64G USB flash drive on centos 6.2/ centos 6.3

text: I have unsuccessfully tried to format and mount a 64 G USB flash drive. The error when I try to mount with the command mount -t extfs /dev/sda /mnt               **"JBD: no valid journal superblock found     EXT4-fs (sda1): error loading journal"**      I am wondering if this is due to the large size of the USB disk. This is a new disk and was working well with Windows NTFS system. I deleted the partition and then tried to use it with centos but it does not work I followed the instructions on Formatting USB drive on Linux                  1. fdisk -l says /dev/sda        2. partition gets created properly with fdisk /dev/sda.         3. I did n and then chose primary partition         4. I also did p to print and also did v to verify the partition table.         5. I did w to write the partition.         6. I did mkfs.ext4 /dev/sda1 . And it does not show any problems      **Output for fdisk /dev/sda**               *"Command (m for help): n     Command action        e   extended        p   primary partition (1-4)     p     Partition number (1-4): 1     First cylinder (1-64000, default 1):      Using default value 1     Last cylinder, +cylinders or +size{K,M,G} (1-64000, default 64000):      Using default value 64000     Command (m for help): p     Disk /dev/sda: 67.1 GB, 67108864000 bytes     64 heads, 32 sectors/track, 64000 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: 0x2fea756a        Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1       64000    65535984   83  Linux     "*      **Output of mkfs.ext4**               *"[root@rverma ~]# mkfs.ext4  /dev/sdc1     mke2fs 1.41.12 (17-May-2010)     Filesystem label=     OS type: Linux     Block size=4096 (log=2)     Fragment size=4096 (log=2)     Stride=0 blocks, Stripe width=0 blocks     4096000 inodes, 16383996 blocks     819199 blocks (5.00%) reserved for the super user     First data block=0     Maximum filesystem blocks=4294967296     500 block groups     32768 blocks per group, 32768 fragments per group     8192 inodes per group     Superblock backups stored on blocks:          32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,          4096000, 7962624, 11239424     Writing inode tables: done                                 Creating journal (32768 blocks): done     Writing superblocks and filesystem accounting information: done     This filesystem will be automatically checked every 27 mounts or     180 days, whichever comes first.  Use tune2fs -c or -i to override."*


title: Screenshot of non active window

text: How to take a screen shot of non active window? If I have 2 windows, I want to capture the screenshot of the one which is running in the background.


title: Hiding Command Messages in a Shell Script

text: In a `bash` script, I'm using tools like `conntrack` and `tcpdump` to output results to a file, but wish to hide the standard message displayed on the first output line on the command line after executing the command/script. message: `conntrack v1.0.0 (conntrack-tools): 6 flow entries have been shown.` After reading the `bash` man page, I've tried things like:               conntrack -L|grep "dport=6439" &> /tmp/file      No matter what redirect option I try, the `conntrack` message stating the number of flow entries is always displayed in the shell where I execute the script. Same thing goes for `tcpdump` where it lists the capturing device and number of packets captured, etc. Of course, I could add `clear` after the `conntrack` or `tcpdump` commands to quickly hide the output, but that solution is ugly. How can I hide these kinds of messages?


title: Ubuntu Server goes to standby mode

text: I am using Ubuntu Server 12.04 in a virtual machine (VMware Workstation) and it seems like the system goes to standby, at least the first request on a webserver installed on it takes quite long and the "virtual monitor" goes to standby. How can I disable this sleep mode? Please note I alraedy searched for this problem and had a look at Ubuntu Server goes to standby mode, however that didn't help in my case ): Thanks for any hint!


title: How can I setup ~/.tidyrc file for XML?

text: How do you configure `tidy` to parse XML instead of HTML? **Explanation** :   A while ago, a co-worker showed me a trick to use `tidy` to clean up XML. Apparently, you create a `tidyrc` file like so:               input-xml: yes     quiet: yes     indent: yes     indent-attributes: yes     indent-spaces: 4     char-encoding: utf8     wrap: 0     wrap-asp: no     wrap-jste: no     wrap-php: no     wrap-sections: no      Even after adding this to `~/.tidyrc` , `tidy` is still attempting to parse as the default HTML, and not XML:               $ cat -v foo.out | tidy > foo.xml     line 3 column 1 - Error: <data> is not recognized!     line 3 column 1 - Warning: missing <!DOCTYPE> declaration     line 3 column 1 - Warning: discarding unexpected <data>      I've tried various permissions:               [root@mongo-test3 tmp]# ls -ial ~      51562 -rw-------  1 root root 11550 Jul 16 02:17 .bash_history      50973 -rw-r--r--  1 root root    18 May  1 00:40 .bash_logout      51538 -rw-r--r--  1 root root   176 May  1 00:40 .bash_profile      51537 -rw-r--r--  1 root root   124 May  1 00:40 .bashrc      51561 -rwxr-xr-x  1 root root   164 Jul 16 22:16 .tidyrc      I've tried naming the file `.tidyrc` and just `tidyrc` **Versions** :   I've tried this on both MacOS and Cent 6.4 Mac OSX 10.8.4 > Darwin spuders-macbook-pro 12.4.0 Darwin Kernel Version 12.4.0: Wed May 1 > 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64 CentOS 6.4 > Linux mongo-test3 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC > 2013 x86_64 x86_64 x86_64 GNU/Linux **Research** :   Normally I would ask the person who taught me this trick, but they are incommunicable.   * http://tidy.sourceforge.net/docs/release-notes.html   * http://linux.die.net/man/1/tidy **Workaround** :   As a work around, I can use the `-xml` flag, but I would prefer to get the `tidyrc` working:               $ cat -v foo.out | tidy -xml foo.xml


title: How can I look at recent system activity to figure out what caused a huge slowdown?

text: I'm running CrunchBang Waldorf with OpenBox on a Lenovo e420. I made the switch from Windows a few months ago, and have had no problems with performance since then. Everything runs nice & fast. Today I was geeking around experimenting with some new options for my work setup. I installed XFCE, logged in from SLiM & played around with it a bit. Returned to OpenBox, and messed with a new terminal emulator (rxvt-Unicode). I played around with the command line options to see what visual appearance I liked. At some point after doing this for a while, terminal windows started loading slowly. I used ARandR to switch to a dual-screen setup, and at that point the system slowed to a crawl for several minutes. This has never happened before. I had configured my rxvt windows to open with the Fish shell, and also played around with transparency effects, so I figure any of several factors could have caused the slow performance: transparency, something new XFCE installed without my knowledge, Fish, etc. (Frankly though, none of those programs ought to cause that kind of slowdown... right?) The long story short is, if this happens in the future, how would I go about tracking it down? Any tips? I am hoping there is some logfile that will tell me what background processes were run at what times in say the last thirty minutes.


title: Optimizing a `while` loop

text: I have created a mini script to reboot my Raspberry Pi upon the push of a button. The script simply uses wiringPi (gpio command) to set pin 0 (pin 17 in Raspberry Pi standard numbering order) to input, and then reads the value until it's one (that's, when the button is pushed or held down). Here's my script:               gpio mode 0 in          while (true)     do             if [ `gpio read 0` -eq 1 ]             then                     echo password | sudo -S reboot                     break             fi     done &      The script works fine and everything. However, for those of you not familiar with the Pi, it comes with very limited hardware resources (including 512 MB of memory) which can be easily consumed by a loop like the one I'm using. What I'm trying to achieve here is to find another way for bash to find out when the value has changed from `0` to `1` without having to dedicate a more like an unconditional loop for it. Is this doable? Please share your ideas.


title: How can I pass a command line argument into a shell script?

text: I know that shell scripts just run commands as if they were executed in at the command prompt. I'd like to be able to run shell scripts as if they were functions... That is, taking an input value or string into the script. How do I approach doing this?


title: Cannot control brightness with Fedora 14 on Compaq CQ42

text: I've done the primary searching of similar questions, Found some, tried the solutions and they didn't work for me. So asking again. All the keys of my Fn combination works except the brightness ones. And there are no options to control brightness in Monitor or Power Management settings. Update: If I boot without those two `acpi_osi` and `acpi_brightness` parameters, and run `acpi_listen` on terminal and press those brightness keys, I get these outputs -               video/brightnessdown BRTDN 00000087 00000000     video/brightnessup BRTUP 00000086 00000000      if I run `acpi_listen` after booting with those two acpi parameters, `acpi_listen` gives me nothing when I press those keys. Update: There is no `backlight` folder under `/sys/devices/virtual/`.


title: PHP interface to manage linux user accounts

text: I have a linux web & samba server. I need to give administrators access to manage minor accounts & groups. Is there a secure php web interface that can do this? I don't want to give them shell access, but they need to be able to change passwords, create, & manage accounts\groups. Thanks!


title: How can I reset the default font (because of blurred characters)?

text: I've recently installed some fonts and now all system menus are screwed: ![enter image description here](http://i.stack.imgur.com/Fa7B4.png) Some single characters (`P`, `b`, `t`, `o`, `w`, `B`, `p` ... that seem to be all characters) are blurred out. I don't know why. How can I fix that? I currently run "Linux Mint 16 Petra" with MATE (which is based on Ubuntu 13.10).


title: RSync - Excluding a particular subdirectory and its children where the subdirectory exists at different levels

text: G'Day, I am using rsync to recursively sync a remote folder tree that looks something like the following:               /folderA/a1/cache     /folderA/a1/cache/A1     /folderA/a1/cache/A2     /folderA/a1/somefolder     /folderA/a1/someotherfolder     /folderA/a2/somefolder/cache     /folderB/cache/     /folderB/b1/somefolder/cache     /folderB/b1/somefolder/yetanotherfolder/cache     /folderB/b1/somefolder/yetanotherfolder/cache/B1     /folderB/b1/somefolder/yetanotherfolder/cache/B2      I don't know what the folder tree will look like and it will change over time. So what I want to be able to do is recursively rsync the above but _exclude_ the folder "cache" and any sub folders it contains so that I ultimately end up syncing:               /folderA/a1     /folderA/a1/somefolder     /folderA/a1/someotherfolder     /folderA/a2/somefolder     /folderB/     /folderB/b1/somefolder     /folderB/b1/somefolder/yetanotherfolder/      Any suggestions?


title: How to select specific processes with 'top'?

text: In case of one program having multiple instances, running `pidof program` gives:               `1 2 3`      `top -p` accepts comma-delimited arguments: `1, 2, 3`. This means that `top -p `pidof program`` won't work:                   top: unknown argument '1'     usage:  top -hv | -bcisSH -d delay -n iterations [-u user | -U user] -p pid [,pid ...]      Can you show me how to do this. I'm not familiar with awk, sed, etc...


title: how to use the eval command in order to print the value of parameter

text: Please advice how to use the eval command in order to print the parameter value for example ## bash               a=1     b=2     c=3               for i in ` echo a b c `     > do     > echo "$i=` eval $i ` "     > done          bash: a: command not found     a=      bash: b: command not found     b=      bash: c: command not found     c=       why I don’t get the requested output (from `for` loop command)                a=1      b=2      c=3


title: yumdownloader can't find packages with extended local version

text: Background: I asked this question a long time ago, trying to figure out the RedHat convention of `package-1.2.3.el6_1.x86_64.rpm`. I was told that the `el6_1` portion is the "local version" -- it's usually `el6` initially, then if it's rebuilt for some reason (for example, built against a different `glibc`) it would be `el6_1`, `el6_2`, etc). Now: I'm using `yumdownloader` to grab RPMs from a Yum server. This works great, _except_ if I ask for a package that has been rebuilt, and thus has an `el6_1` (`el6_2`, etc) version. I can go to `http://path/to/my/repo/x86_64/Packages` in my browser, then look at the resulting file list and find, for example, `bash-4.1.2-15.el6_4.x86_64.rpm`. But `yumdownloader bash` tells me it finds "No Match". Is this a known issue? Is there a flag I'm missing to enable downloading rebuilt packages? If not, is there another tool I could use to download RPMs (from another architecture...) _with dependencies_?


title: Real-time executive approach, can be run in desktop Linux?

text: With the real-time executive approach, a small real-time kernel coexists with the Linux kernel. This real-time core uses a simple real-time executive that runs the non-real-time Linux kernel as its lowest priority task and routes interrupts to the Linux kernel through a virtual interrupt layer. All interrupts are initially handled by the core and are passed to standard Linux only when there are no real-time tasks to run. Real-time applications are loaded in kernel space and receive interrupts immediately, giving near hardware speeds for interrupt processing. I wonder how to test this in ordinary desktop Linux, e.g. Ubuntu? If it's even possible?


title: Can I `yum search` for an architecture other than my own?

text: I'm trying to grab some packages from a yum server with `yumdownloader`. I can pass the `\--archlist=` argument to grab packages for a different architecture -- I need to in this case, as the target machine is running a 64-bit OS and my machine is 32-bit. This works great, but `yum search` does not have a similar argument, as far as I can tell. Is there any way to do wildcard search for the "wrong" architecture?


title: Remove All NVIDIA Files

text: **Background** : I bought an NVIDIA graphics card and tried to install its driver. Somewhere along the way I messed up and now I'm running my computer on Cinnamon backup mode (I have Ubuntu but I removed Unity and replaced it with Cinnamon). I want to start back from scratch (prior to this, I was using a core i3 and no graphics card). **Problem** : When I enter `sudo dpkg -l | grep -i nvidia` I get a list of results: ![Results](http://i.stack.imgur.com/6VYBj.png) But when I enter `sudo apt-get remove --purge nvidia-*` it says I have no matches found. I've tried a couple of other different ways with similar results. Again, I want to start fresh by removing all unnecessary files. How do I remove all unnecessary nvidia files?


title: How to edit hotspot settings in Linux mint 14.04?

text: I am trying to create a soft hotspot in Linux Mint 17, but when I try I am not able to edit username/password for the created hotpsot moreover it is not detected by my mobile. Below is the screenshot of Networking window. ![enter image description here](http://i.stack.imgur.com/pooWe.png) **How can I get the options to configure my hotspot?** **Or is there any other package available to do it better?**


title: How does rsync encode filenames?

text: By using strace on the active rsync process, I can see output like:               read(4, "9\0\0\7\1\10\0\1\10\0\1\10\0\1\10\0\1\10\0\1\10\0\1\10\0\1\10\0\1\10\0\1"..., 16384) = 61     write(3, "\357\265mD0e\233:\337\250\241\363\255 \307\5\213\224d\322\323\203i\2671\222m'\252\354\n\211"..., 96) = 96      I've done some googling and didn't come up with a good answer, but could anyone explain to me how to make sense of the encoding above? I assume it's some kind of encoding where each single character is escaped, and that the read and write calls above are using file-names. So what does it all mean, and how could I convert it easily to human readable strings? My apologies for not providing more detailed information in the initial posting! What I was doing is to run a command like: `/usr/bin/time /usr/bin/ionice -c3 /usr/bin/rsync -cavzP --fake-super --exclude=' bla bla...' --bwlimit=40000 / backup@backup:/mnt/storagedisk/workstation-backup/` `ps aux | grep rsync` would then show something like: `root 7875 0.0 0.0 4064 348 pts/5 S+ 20:29 0:00 /usr/bin/time /usr/bin/ionice -c3 /usr/bin/rsync -cavzP --fake-super --exclude=... --bwlimit=40000 / backup@backup:/mnt/storagedisk/workstation-backup root 7876 15.3 0.2 52656 8384 pts/5 D+ 20:29 0:02 /usr/bin/rsync -cavzP --fake-super --exclude=... --bwlimit=40000 / backup@backup:/mnt/storagedisk/workstation-backup/ root 7877 0.0 0.0 41680 3252 pts/5 S+ 20:29 0:00 ssh -l backup backup rsync --server -vlogDtprcze.iLsf --bwlimit=40000 --partial . /mnt/storagedisk/workstation- backup/` To be honest, at this point I'm not entirely sure if it was process number 2 or 3 in that list I connected to with strace. I think it was process number 2 in that list, and I was a bit surprised I didn't see filenames in the strace output there, but it might as well have been process 3, and then it makes sense that the read/writes are content transferred over the network. My appologies again for not providing detailed information the first time asking, and my initial question now seems a bit far out, as I didn't understand quite what I was looking at, so either the whole question should be rephrased, or deleted entirely as it wasn't very specific. I let the mods decide. :) Thanks for the help guys!


title: Xfce4-panel default layout without asking a user (during the first login)

text: I was browsing through the Internet and Xfce4 Docs and couldn't find the answer. When a user log in for the first time, he/she is asked for the desired panel layout. I would like to set "Default layout" for panels (in a multiuser system) without asking a user during the first login. Is there a system wide option to set this default? New users are confused often when they see the popup and click "Cancel", which results in an empty screen with icons :) So, when a user login for the first time he/she should see the default panel layout and no question popup. Best Regards,   Kamil


title: wmakerconf fails to build despite having a dependency installed

text: I'm running Debian Jessie (testing) for AMD64 and I'm trying to build wmakerconf, and the included `configure` script won't detect the libwraster3 build headers despite them being already installed. There is no Debian package for it, so I must build it from source. What am I missing? Here's a quick example of what I mean:               black@rockshooter:~/Downloads/wmakerconf_instalacion/wmakerconf-2.12$ sudo apt-get install libwraster3-dev     Reading package lists... Done     Building dependency tree            Reading state information... Done     libwraster3-dev is already the newest version.     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     [1]+  Done                    gksu synaptic     black@rockshooter:~/Downloads/wmakerconf_instalacion/wmakerconf-2.12$ ./configurechecking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for gawk... no     checking for mawk... mawk     checking whether make sets $(MAKE)... yes     checking whether to enable maintainer-specific portions of Makefiles... no     checking for FreeBSD system... no (Linux system found)     checking for Window Maker data directory... /usr/share/WindowMaker     checking for Window Maker sysconfig directory... missing     configure: WARNING: file 'menu' not found in /usr/etc/WindowMaker.     Use option --with-wmakeretcprefix=PFX to find Window Maker sysconfig directory     checking for gcc... gcc     checking for C compiler default output file name... a.out     checking whether the C compiler works... yes     checking whether we are cross compiling... no     checking for suffix of executables...      checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ANSI C... none needed     checking for style of include used by make... GNU     checking dependency style of gcc... gcc3     checking for library containing strerror... none required     checking for ranlib... ranlib     checking for gethostbyname in -lnsl... yes     checking for socket in -lsocket... no     checking for cos in -lm... yes     checking for get-wings-flags... no     configure: error: *** WRASTER >= 0.80.0 not installed - please install first ***


title: What's the difference between mdadm state "active" and state "clean"

text: I have two different computers with different RAID5 arrays. When I run the command               mdadm --detail /dev/md0      one drive reports "active" while the other reports "clean" for the "state" field. What is the difference? Should I worry about either state? Both seem to work fine.


title: Install packages in $HOME/usr

text: I'm looking to script use of `rpm --relocate`. How to change the default location packages are installed to - from `user/local` to `$HOME/usr`? Do I need to do it all manually (removing and reinstaling to a new location)?


title: Assignment to variables

text: I was trying to devise a solution to a different question asked on the site and came across this curious issue. Here is the set of commands that I issued:               $ foo=82a9948422     $ echo $foo     82a9948422     $ echo $foo | sed 's/./&\     /g' | sort | uniq -c | sort -n -r | head -1 | awk '{print $1}'     3     $ count=`echo $foo | sed 's/./&\     /g' | sort | uniq -c | sort -n -r | head -1 | awk '{print $1}'`     $ echo $count     1     $      Notice how the number of unique characters in the variable is 3 but when I assign it to a variable, it reports the count as 1. I'm puzzled. Can someone explain the discrepancy please?


title: What does TAB do (no other things typed)

text: Just push TAB, the terminal gives me this:               Display all 2637 possibilities? (y or n)      What indeed does the TAB do for me?


title: Saving a kernel config file through menuconfig results with different options?

text: I'm experimenting with different kernel configuration files and wanted to keep a log on the ones I used. Here is the situation:   * There is configuration file called `my_config` which i want to use as a template   * I do `make menuconfig`, load `my_config` make NO changes and save as `.config`.   * When i do `diff .config my_config`, there are differences in the files Why would here be differences between the old file and the new file?


title: Shell scripting: -z and -n options with if

text: I have a shell script where we have following lines `if [ -z "$xyz" ]` and `if [ -n "$abc" ]`, but I am not sure what their purpose is. Can anyone please explain?


title: How accurate is Conky?

text: I'm on Crunchbang 64 bit, Conky shows that I'm using 4% of my CPU. But I can feel the CPU burning so hot, got Spotify, Chrome and couple other apps running. On windows 7 chrome uses about half of the CPU, how come everything uses only 4% on Crunchbang (I'm using the same chrome version and same plugins and everything on Windows and Crunchbang), sometimes I see the CPU usage like 6% or 8%, even that is too low. I know that Crunchbang is lightweight that's why I installed it but the numbers I'm seeing are hard to believe, something isn't right. **Edit** My Conky.conf and my Conkyrc. As of right now, CPU usage between 2% and 4%, CPU temp between 84 and 86 degrees Celsius. (Between 183 and 186 degrees Fahrenheit), I'm using `lm- sensors` to monitor the CPU temperature.


title: Is there a command which displays options like `errexit` and `braceexpand` other than `help set`?

text: If you type `help set`, then - among other things - a list of shell options is displayed. But these options are not the same as those displayed with `shopt`. And different also from those displayed with `set` and `env`. Is there a command which displays options such as `errexit` and `braceexpand` and their current values? Also, what is the connection between the different option commands? What does `set` display that `env` doesn't / what does `shopt` display that `set` doesn't / etc ? (bash 3.2.51 on Mac OS X 10.9.1)


title: Redundant and Load Balanced storage on FreeBSD?

text: Back from: Load balanced & Redundant Storage on FreeBSD How do I create a (Redundant and Load Balanced) Storage based on FreeBSD?   * Storage should be located on (2 or more servers) providing Redundancy and Load Balancing (round robin) at the same time.   * Storage needs to be accessible over network for other BSD machines as one folder (i.e. /storage) (NFS?). Any solutions are welcome, except for `master-slave HAST` and `CARP`. **Please don't post these: they are not related to this question.**


title: Settings value in /sys/devices/platform/i8042/serio1/serio2/speed as no effect

text: I'm following this tutorial to ajust the TrackPoint speed for my Lenovo T420. However, setting a value in `/sys/devices/platform/i8042/serio1/serio2/speed` has no effect. The trackpoint is unaffected and `cat`ing the file after executing the `echo -n` shows the old value.


title: Replacing the end of a few hundred files

text: I need to change the way a few hundred Perl modules end. Currently they end as               1;      However I need to modify this so that they all have this on their last few lines.               BEGIN {         # VERSION     }     1;     # ABSTRACT: table definition      Of course I'm sure I could do this with Perl probably using PPI, but it also seems that I might just be able to `sed` or `awk` the end of these files. Can anyone provide any suggestions as to how this might be accomplished?


title: What does it mean for an email message to be "old"?

text: I just recently converted my mbox over to Maildir, and when I opened up mutt, I saw an 'O' flag on some messages. Looking this up, I find that it means the message is marked as "Old". However as soon as I read the message, the flag disappears. This seemed rather strange to me. What does it mean for a message to be "Old", and why would it no longer be old if I have read it?


title: Filesystem for Gentoo root?

text: I need a fast and space eficient filesystem for my Gentoo workstation. I have some expirience with ext4 and found it very slow on lots of small files inside the filesystem. I am considering another filesystem, but don't know what to use: suggestions?


title: Photoshop CS5 in Fedora 15

text: I'm working on a project, which implies that I use photoshop design files. So far I haven't figured out the best way to deal with it in Fedora 15. I installed GIMP, but layers don't look as they do in Photoshop version (shades, blurs are missing) - are there any improvements for this case? I think additional packages might boost GIMP's rendering. I tried installing Photoshop CS5 in Wine, but got > fixme:file:MoveFileWithProgressW MOVEFILE_WRITE_THROUGH unimplemented And the installer itself told: > The Setup encountered an error(-1) during install. Please restart the > machine and try again. I think KVM (Windows XP) + SAMBA (in order to save designed stuff on fedora) might work. What is my best choice in this situation?


title: UDF and fstab (no UUID)

text: In my search for the ideal filesystem to share files between a lot of computer with a lot of different OS'es I accepted this answer and installed a UDF filesystem on my USB stick. First I blanked the disk, to make sure there are no leftovers to confuse a system that's reading the drive:               dd if=/dev/zero of=/dev/sdb bs=1M      Then I formatted the drive, using `udftools` from arch linux's AUR:               sudo mkudffs --media-type=hd --blocksize=512 /dev/sdb      Obviously, the drive was in `/dev/sdb`. Now my question is, since the drive doesn't have any traditional partitions or even a partition table as far as I know, it does not have a UUID. Therefore, I can not add it to the fstab, which I find rather annoying. What can I do to fix this (e.g. is there an alternative way to set default mount point and options, or an alternate partitioning option)?


title: rsync giving "Directory has vanished" when there are multiple (existing) source directories

text: This is happening to me:               $ rsync -av ./foo ./bar $DEST     sending incremental file list     directory has vanished: "/path/to/foo"      `foo` exists and is regular a regular dir, and `rsync -av ./foo $DEST` works, same for `bar`. Is "directory has vanished" just how rsync tells me that it doesn't know how to work with multiple sources? Or am I importantly misinterpretting the ( _long_ ) man page?


title: Why can a system become unresponsive?

text: I just executed `dot` (a program for drawing directed graphs) with an input file that was so big that it couldn't be rendered in a reasonable amount of time. My whole system froze. I could barely make it to a text console with `Ctrl`+`Alt`+`F1` to kill `dot`, but it took several minutes. Why does the system allow something like this? Why does it give a non-critical program such as `dot` 99% of the system and use the remaining 1% for staying responsive?


title: How to make linux 'perf record' work for libc and libstdc++ symbols?

text: I'm using `perf record -g` on x86-64 Linux to profile a program. Several symbols in libc or libstdc++ have `0` as a parent: `__GI___strcmp_ssse3` (libc) and `strcmp@plt` (libstdc++) for example. (I can actually break on these symbols in the debugger and get a backtrace.) I'd love to know what the major callers of these functions are, and why they are not recorded. Is this because libc and libstdc++ do not have frame pointers on x86_64? And, more practically, is there some way around this?


title: How to run a script with systemd right before shutdown?

text: What do I need to put in the `[install]` section, so that systemd runs `/home/me/so.pl` right before shutdown and also before `/proc/self/net/dev` gets destroyed?               [Unit]     Description=Log Traffic          [Service]     ExecStart=/home/me/so.pl          [Install]     ?


title: How can I run a command for a list of packages?

text: I tried to install Gnome 3 on Debian Testing following this explanation. However, this didn't work and left me without any graphical user interface. At the moment I try to fix that and I realised there is a long list of packages marked as manually installed. I stored a (line-break seperated) list of the packages that - in my opinion - should be marked as auto installed (nearly all of them). Now I want to run `apt-mark auto` for this list. How do I do that? P.S.: I also would appreciate if somebody tells me that this is not a good idea (if it isn't).


title: What does raw/unraw keyboard mode mean?

text: In the magic sysrq key combinations, there is the combination `alt+sysrq+r` which, according to wikipedia, does the following: > Switch the keyboard from raw mode, the mode used by programs such as X11 and > svgalib, to XLATE mode What is raw mode? and what is XLATE mode? Can I switch back to raw mode once I have switched to XLATE mode? How can I tell which mode my keyboard is in?


title: Extended attribute on symbolic link

text: I'm trying to set some extended attributes on a symbolic link on Fedora 15. According to `setfattr`'s usage, there is an option `-h` for such purpose:               setfattr 2.4.44 -- set extended attributes     Usage: setfattr {-n name} [-v value] [-h] file...            setfattr {-x name} [-h] file...       -n, --name=name         set the value of the named extended attribute       -x, --remove=name       remove the named extended attribute       -v, --value=value       use value as the attribute value       -h, --no-dereference    do not dereference symbolic links           --restore=file      restore extended attributes           --version           print version and exit           --help              this help text      However, the option doesn't seem to work. Using `-h` on symlink files just reports `Operation not permitted` without setting the extended attribute. For example:               [dummy@notebook test]$ ls -l     total 0     -rw-rw-r-- 1 dummy dummy 0 Jul 12 14:35 file     lrwxrwxrwx 1 dummy dummy 6 Jul 12 14:35 link -> ./file     [dummy@notebook test]$ setfattr -n user.name -v value1 file     [dummy@notebook test]$ getfattr -n user.name file     # file: file     user.name="value1"          [dummy@notebook test]$ setfattr -n user.name -v value2 link     [dummy@notebook test]$ getfattr -n user.name file     # file: file     user.name="value2"          [dummy@notebook test]$ setfattr -n user.name -v value3 -h link     setfattr: link: Operation not permitted     [dummy@notebook test]$ getfattr -n user.name -h link     link: user.name: Operation not permitted      Why is this?


title: How to print from iPad to CUPS?

text: I would like to print from an iPad2 to the office printer running on CUPS. After following a couple of cookbook style cheat sheets, printing from the iPad still does not work. the iPad sees the printer entry I made and offers it as an option, but nothing appears on the queue and there is no printer output. Local print jobs on the server work, so CUPS recognizes and works with the printer. Avahi-discover lists the printer and will dump the associated XML file. The server is Ubuntu 10.10. The procedure used is outlined here. This page had a simpler recipe. Any tips appreciated. **Edit:** Today, I disabled the firewall on the server. Now this message shows up in the CUPS error_log repeatedly when trying to print:               E [13/Jul/2011:10:17:15 -0400] Request from "192.168.x.y" using invalid Host: field "server.local"      The name of the server is server.local, which can be reached using that name. The address "192.168.x.y" is that of the iPad.


title: Mounting LVM2 volume gives me 'mount: you must specify the filesystem type'

text: I have a LVM2 Volume Group 'vgXEN' with a Logical Volume in it called 'test- disk'.   This is the output of **lvdisplay** :               --- Logical volume ---     LV Path                /dev/vgXEN/test-disk     LV Name                test-disk     VG Name                vgXEN     LV UUID                lHSgfx-wnY2-OtRO-zw7l-9SFA-mnht-KgK9MO     LV Write Access        read/write     LV Creation host, time DRAKE, 2013-08-26 12:02:08 +0200     LV Status              available     # open                 0     LV Size                10.00 GiB     Current LE             2560     Segments               1     Allocation             inherit     Read ahead sectors     auto     - currently set to     4096     Block device           253:4      And this is the output of **lvscan** :               ACTIVE            '/dev/vgXEN/test-disk' [10.00 GiB] inherit      Now when i try to mount this logical volume with the command i get an error:               mount /dev/vgXEN/test-disk /mnt/test     mount: you must specify the filesystem type      My operating system is 'Linux DRAKE 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux'.   Searched the Internet but couldn't find anything useful. Can anybody point me in the right direction please ? Thx ! _UPDATE_ The whole problem is related to storing XEN images and the way i want to backup them (via snapshot / mounting). Below you can read what i did wrong and the way it should be done. **What i did wrong**   I've created 1 logical volume per XEN image, thus storing the disk and swap partition into 1 LV: > LogicalVolume-A > >> xvda1 (disk)   >  xvda2 (swap) When you try to mount this LV it tells you 'mount: you must specify the filesystem type' and nothing happens of course. This is because the mount program doesn't know how to read partition tables inside a LV as the people stated in the answers below. **The way to do it**   Create 1 logical volume per partition, thus storing the disk into 1 LV and the partition into 1 LV: > LogicalVolume-A > >> xvda1 (disk) > > LogicalVolume-B > >> xvda2 (swap) It's now possible to format these logical volumes and use them into your images as storage. Once formatted you are also able to mount them with this simple command               mount /dev/vgXEN/test-disk /mnt/test


title: Using MJPG stream as a webcam source

text: I would like to use my Android smartphone as a webcam and found the app "IP webcam", which creates various outputs of the camera. One such output is a MJPG stream, and I want to know if there is a way to get this stream to work as a webcam-source on my Arch Linux I know there is Droidcam, but I just can't get it to work on my machine.


title: Does du or df perform caching?

text: I was wondering if there is any caching done with these utilities. I assume not, but not positive. Are there any typical similar utilities that do use caching to speed up results on subsequent runs?


title: Conflict between cron.deny and allow who wins?

text: which one wins in conflict deny or allow? Is the behavior the same for hosts.allow and all the other similar files?


title: Why does this regex find a match for \x63 with a pattern [\80-\BF]

text: I am trying to filter valid/invalid UTF-8 bytes, but I get strange results from the following regex (which is intended to handle a 3 byte form of UTF-8). I have intended the pattern should **not** match the test bytes `'\xE0\xA1\x63'`, but it does...   What am I missing?               showmatch() {       echo -ne "    --> "       echo -ne "$bytes" |          # strip whitespace from the pattern         perl -l -ne '/^'${1// /}'$/x and print' |           tr -d '\n' |             xxd -p |               tr -d '\n'       echo;      }          bytes='\xE0\xA1\x63'     echo -n "before: "; echo -ne "$bytes" |xxd -p     # Note: all whitespace is stripped from each regex pattern.     #           Bytes 1 and 2 and 3     #          (---------------------------------------------------------------------------------------------------)     #              Bytes 1 and 2     #             (------------------------------------------------------------------------------)                       #                [byt1][byt2-----]  |  [byt1][byt2-----]  |  [byte-1------------][byt2-----]      [byt3----]                                                               #                =================     =================     ===============================      ==========                                 showmatch '(  ( ([\xE0][\xA0-\xBF]) | ([\xED][\x80-\x9F]) | ([\xE1-\xEC\xEE-\xEF][\x80-\xBF]) )  ([\80-\xBF])  )'     #     # witout spaces:     showmatch '((([\xE0][\xA0-\xBF])|([\xED][\x80-\x9F])|([\xE1-\xEC\xEE-\xEF][\x80-\xBF]))([\80-\xBF]))'     #     exit      * * * Here is the output               before: e0a163         --> e0a163         --> e0a163


title: Creating an iso from the virtual machine

text: I have openSuse installed as a virtual machine on Oracle Virtual Box, and I have configured some softwares with the way I require. I need to replicate the similar environment on a new Server (NOT the Virtual Machine). I was thinking if its possible to create an iso image from the virtual machine, that can be used as a bootable image for my server? If there is, then how can be achieved? Thanks


title: useradd --no-log-init [comprehension question]

text: **TLDR** : How is `useradd --no-log-init` actually used [in GNU/Linux [Debian]? I read the command's `man` and `info` page about this option as: » _user will not be listed in the`lastlog` and `faillog` files ⁄ output_«. I know that the `PAM` module took over most of the actual login work. I understand the `lastlog` and the `faillog` commands, and I'm aware that via the latter e.g. the number of login attempts and such can be set. I also know that bad login attempts are recorded in `/var/log/utmp`. This strengthens my _suspicion_ that this command is »leftover« from back then before `PAM` module took over the job.


title: How can I start a process using cpulimit?

text: I am trying to use `cpulimit` for testing an app I'm developing under low resource conditions, and I need the process to start under the influence of `cpulimit`. It is not sufficient to start the program and later apply `cpulimit`. The example on the cpulimit page does not work for me. The example is this:               cpulimit --limit 40 /etc/rc.d/rc.boinc start      And I'm doing this:               cpulimit --limit 40 a.out start


title: Why CONFIG_NO_HZ is not set by default

text: In the Linux Kernel `CONFIG_NO_HZ` is not set. But an initial reading suggests that setting that option would be nice from a performance point of view. But reading some posts like this made me think again. Why `CONFIG_NO_HZ` is not set by default or why no performance improvement when it is enabled?


title: equivs-build / apt-get: how to preserve directory

text: I'm building some packages for a private repository using `equivs-build`. The files are installing ok using `apt-get install` but when I go to remove them they are trying to delete the whole folder structure they are installed to. In the equivs file I have the line:               Files: <file to copy> /usr/local/sbin/<file>      When I run `apt-get remove` there are messages about '.. directory /usr/local not empty so not removed.' The 'sbin' folder is removed. Is there some way to prevent this?


title: How to convert UTF-8 txt files to all uppercase in bash?

text: I have some UTF-8 .txt files which I would like to convert to all uppercase. If it was just ASCII, I could use:               tr [:lower:] [:upper:]      But since I'm working with diacritics and stuff, it doesn't seem to work. I guess it might work if I set the appropriate locale, but I need this script to be portable.


title: How to enable scroll of PS/2 mouse in Ubuntu 13.10?

text: My mouse scroll doesn't work at all. There are other questions regarding mouse scroll, but not appropriate in my context. It used to work fine in Windows XP.