How do I reload ~/.dir_colors?

I copied `/etc/DIR_COLORS` to `~/.dir_colors` because `/etc/DIR_COLORS.xterm` was being used and colours in `ls --color=auto` were too dark. Now, how do I get this file to take effect immediately? (i.e. Without restarting the shell?) Is there something like what `Ctrl`-`X` `Ctrl`-`R` does for `~/.inputrc`?


Why is my inotifywait loop exiting after removing some subdirectories?

i have the following bash script:               #!/bin/sh     dir1=/source/dir/path/     while inotifywait -qqre modify "$dir1"; do        rm -r /destination/dir/path        find /source/dir/path/ -name .svn -exec rm -rf '{}' \;        cp -ruv /source/dir/path/* /destination/dir/path/     done      the thing is that the first 2 commands are working well but the process is killed after executing (successfully) the "find -exec" command. Any thoughts? BTW- if i remove the "find -exec" everything goes well.


how to uninstall notepad from Ubuntu 13.04?

There is a program named `notepad` on my Ubuntu which I want to remove as I never use it. I have got update for notepad of 80 MB from `software updater`. And I don't want to download that 80 MB. I entered `.wine` folder of my home directory & there deleted the program named `notepad`. Still when I run the command `notepad` on terminal, the notepad window opens. To find where this program is, I did:               ravbholua@ravbholua-Aspire-5315:~$ which notepad     /usr/bin/notepad     ravbholua@ravbholua-Aspire-5315:~$ sudo apt-get purge notepad     [sudo] password for ravbholua:      Reading package lists... Done     Building dependency tree            Reading state information... Done     E: Unable to locate package notepad     ravbholua@ravbholua-Aspire-5315:~$       So, whats the package name for this program? This program runs on wine (this I came to know after seeing the menu item named 'about notepad' for this program). How come this run on wine as the program name wine I deleted from the directory tree under `~/.wine` and there is no other program named notepad under this folder? ### EDIT #1 W.R.T. to an answer, I'm posting the below:               ravbholua@ravbholua-Aspire-5315:~$ dpkg-query --search notepad     wine1.7: /usr/share/icons/hicolor/24x24/apps/wine-notepad.png     wine1.7: /usr/share/icons/hicolor/22x22/apps/wine-notepad.png     wine1.7: /usr/share/applications/wine-notepad.desktop     wine1.7-i386: /usr/lib/i386-linux-gnu/wine/fakedlls/notepad.exe     wine1.7: /usr/share/icons/hicolor/32x32/apps/wine-notepad.png     wine1.7: /usr/share/man/man1/notepad.1.gz     wine1.7: /usr/bin/notepad     wine1.7-i386: /usr/lib/i386-linux-gnu/wine/notepad.exe.so     wine1.7: /usr/share/icons/hicolor/16x16/apps/wine-notepad.png     wine1.7: /usr/share/icons/hicolor/48x48/apps/wine-notepad.png     wine1.7: /usr/share/icons/hicolor/scalable/apps/notepad-48.svg     kdelibs5-plugins: /usr/lib/kde4/notepadpart.so     ravbholua@ravbholua-Aspire-5315:~$       From this, whats the package name of notepad? > EDIT#2 The answer wrote by @slm has worked with the following note. Earlier I was getting an update for wine for 80.2 MB. Then after holding `wine1.7` using command `sudo apt-mark hold wine1.7`, I got update for ~50MB. So, I understood it's working. Now to hold everything on wine, I did the following.               ravbholua@ravbholua-Aspire-5315:~$ dpkg --get-selections | grep wine     wine-gecko2.24:i386                                 install     wine-mono0.0.8                                      install     wine1.4                                             install     wine1.4-i386                                        install     wine1.7                                             hold     wine1.7-i386                                        install     winetricks                                          install      I see here that the package `wine1.7` which I had held from update is only marked as hold. So, I ran the below to hold all these.               $ sudo apt-mark hold wine-gecko2.24:i386 wine-mono0.0.8 wine1.4 wine1.4-i386 wine1.7 wine1.7-i386 winetricks      And now I'm not getting the update at all.


Can't boot any Linux except Ubuntu

Hello I wanted to switch to Linux, but the only distro so far I could even boot from a live USB was Ubuntu. I've tried Xubuntu, Manjaro, Linux Mint, and Elementary OS and none could boot, thought when I tried booting them on my old laptop , everything went fine. The laptop I'm using is a Lenovo Y500 and yeah I tried disabling secure boot but nothing worked. So is there a way to fix this or do I have to use Ubuntu?


mutt: ask for confirmation before moving message to archive

I have following macro defined in my `muttrc`:               macro  index s ":set confirmappend=no delete=yes auto_tag=yes\n\         <save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      When I press `s` on a message, it will immediately be moved into my `archive` folder. I would like to modify my macro, so that I will be asked for confirmation before the message is moved. But when I change `confirmappend=yes`:               macro index s ":set confirmappend=yes delete=yes auto_tag=yes\n\         <save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"      and when I press `s`, mutt becomes immediately unresponsive, all keys stop working, I cannot even exit. The cpu runs at 100% and I have to log in from another console to kill mutt. Can somebody please advise how to correctly modify my macro?


Preserving owner/group on OS X-provided CIFS shares

I read the attached StackExchange link: Automatically disable Linux extensions for Samba mounts about disabling CIFS Unix Extensions in order to mount OS X CIFS shares. However, my understanding is that this also disables the server from being able to set the owner/group of the files. Is this correct? Is there a way to override this, or preserve owner/group information? Update: I thought, perhaps, the multiuser option would help. Apparently OS X doesn't allow that either unless someone else has gotten that to work?


Streaming video with VLC / WinTV has no audio

I'm trying to stream video between two PCs with a WinTV card. I can stream video, but the stream contains no audio.               # lspci -v:     06:04.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)         Subsystem: Hauppauge computer works Inc. WinTV Series         Flags: bus master, medium devsel, latency 32, IRQ 16         Memory at fb9ff000 (32-bit, prefetchable) [size=4K]         Capabilities: [44] Vital Product Data         Capabilities: [4c] Power Management version 2         Kernel driver in use: bttv          06:04.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)         Subsystem: Hauppauge computer works Inc. WinTV Series         Flags: bus master, medium devsel, latency 32, IRQ 16         Memory at fb9fe000 (32-bit, prefetchable) [size=4K]         Capabilities: [44] Vital Product Data         Capabilities: [4c] Power Management version 2         Kernel driver in use: snd_bt87x      Video is working with those vlc lines:               server:     vlc v4l2:///dev/video0 --sout '#transcode{vcodec=mp4v,acodec=mp3,vb=400,ab=128}:standard{access=http,mux=ts,dst=192.168.1.1:8080}'          client:     vlc http://192.168.1.1:8080      Scanning the logs I can find the following message:               [0xb2607160] v4l2 demux debug: tuning required: tuner 0     [0xb2607160] v4l2 demux debug: tuner Television (0) is Analog TV     [0xb2607160] v4l2 demux debug:  ranges from 44000.0 kHz to 958000.0 kHz     [0xb2607160] v4l2 demux debug:  supports primary audio language     [0xb2607160] v4l2 demux debug:  supports secondary audio language or program     [0xb2607160] v4l2 demux debug:  supports stereo audio     [0xb2607160] v4l2 demux debug: tuner 0 audio mode 3 set     [0xb2607160] v4l2 demux debug: tuner not tuned     [0xb2607160] v4l2 demux debug: no audio input available      I can watch TV with this card using mplayer, so I suspect there must be a way to get sound output:               player tv:// -tv driver=v4l2:width=768:height=576:outfmt=rgb24:channel=e9:device=/dev/video0      What am I doing wrong? Do I somehow have to set an additional sound input? If so, how? Using `lsof` shows me that mplayer is just holding `/dev/video0` as open file descriptor in `/dev`.


Can't block google logo in squid

I wanted to block google logo via Squid proxy: ![enter image description here](http://i.stack.imgur.com/FWiAj.png) So I added this line to block.acl:               google\..+/logos/.+      in squid.conf I have this:               acl bad_domain dstdom_regex "/etc/squid/block.acl"     acl good_domain dstdom_regex "/etc/squid/white.acl"          http_access deny bad_domain     http_access allow good_domain     http_access deny all      But the image is still not blocked: https://www.google.ru/logos/doodles/2013/doctor-whos-50th- anniversary-6317003539218432-res.png. What to do?


debootstrap terminates partway through with "stdin: not in compressed format"

I'm on an Arch GNU/Linux system, fully up-to-date (both official repositories and from the AUR). I'm attempting to install a copy of Debian Wheezy so that I can chroot into it and work with the system. However, `debootstrap` (installed from the Arch User Repository, along with `gpg1` and `debian-archive-keyring`) is giving me weird results. Versions:               $ debootstrap --version     debootstrap 1.0.60~bpo70+1          $ tar --version     tar (GNU tar) 1.27.1     Copyright (C) 2013 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.     This is free software: you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.          Written by John Gilmore and Jay Fenlason.          $ ar --version     GNU ar (GNU Binutils) 2.24     Copyright 2013 Free Software Foundation, Inc.     This program is free software; you may redistribute it under the terms of     the GNU General Public License version 3 or (at your option) any later version.     This program has absolutely no warranty.          $ sh --version     GNU bash, version 4.3.18(1)-release (x86_64-unknown-linux-gnu)     Copyright (C) 2013 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>          This is free software; you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.       Working directory:               $ pwd     /home/alex/Development      Environment:               $ env     LC_MESSAGES=en_US.UTF-8     USER=alex     LC_TELEPHONE=en_US.UTF-8     LANG=en_US.UTF-8     SHLVL=1     XDG_VTNR=1     LOGNAME=alex     PWD=/home/alex/Development     XDG_RUNTIME_DIR=/run/user/1000     LC_CTYPE=en_US.UTF-8     DISPLAY=:0     LC_NAME=en_US.UTF-8     MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins     XAUTHORITY=/var/run/gdm/auth-for-alex-eNzAWR/database     GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/terminator.desktop     GIO_LAUNCHED_DESKTOP_FILE_PID=1617     COLORTERM=gnome-terminal     XDG_SESSION_ID=c2     JAVA_HOME=/usr/lib/jvm/java-7-openjdk     DESKTOP_SESSION=gnome     XDG_SESSION_DESKTOP=gnome     GDMSESSION=gnome     USERNAME=alex     LC_IDENTIFICATION=en_US.UTF-8     LC_NUMERIC=en_US.UTF-8     ANDROID_SWT=/usr/share/java     LC_PAPER=en_US.UTF-8     LC_MONETARY=en_US.UTF-8     DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-oFjTGqs5Bd,guid=321f3c380c7ed3446e9fb41f53bb8307     LC_MEASUREMENT=en_US.UTF-8     MAIL=/var/spool/mail/alex     GJS_DEBUG_TOPICS=JS ERROR;JS LOG     GNOME_DESKTOP_SESSION_ID=this-is-deprecated     XDG_MENU_PREFIX=gnome-     SHELL=/usr/bin/zsh     QT_IM_MODULE=ibus     GJS_DEBUG_OUTPUT=stderr     LC_TIME=en_US.UTF-8     WINDOWID=50331652     TERM=xterm     SESSION_MANAGER=local/null-ptr-exception:@/tmp/.ICE-unix/1082,unix/null-ptr-exception:/tmp/.ICE-unix/1082     SSH_AUTH_SOCK=/run/user/1000/keyring/ssh     XDG_CURRENT_DESKTOP=GNOME     PATH=/home/alex/bin:/home/alex/bin:/usr/local/bin:/home/alex/bin:/home/alex/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/tools:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/android-sdk/platform-tools:/opt/android-sdk/platform-tools     LC_COLLATE=en_US.UTF-8     ANDROID_HOME=/opt/android-sdk     XDG_SEAT=seat0     BROWSER=firefox     HOME=/home/alex     LC_ADDRESS=en_US.UTF-8     SSH_ASKPASS=/usr/lib/seahorse/seahorse-ssh-askpass     GPG_AGENT_INFO=/run/user/1000/keyring/gpg:0:1     TERMINATOR_UUID=urn:uuid:48777400-553b-46fe-ac51-6e52dfb1454f     XMODIFIERS=@im=ibus     OLDPWD=/home/alex/Development     GREP_OPTIONS=--color=auto --exclude-dir=.cvs --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn     GREP_COLOR=1;32     PAGER=less     LESS=-R     LSCOLORS=Gxfxcxdxbxegedabagacad     ANTIGEN_DEFAULT_REPO_URL=https://github.com/robbyrussell/oh-my-zsh.git     ADOTDIR=/home/alex/.antigen     _=/usr/bin/env              $ sudo env     [sudo] password for alex:      LC_MESSAGES=en_US.UTF-8     LC_TELEPHONE=en_US.UTF-8     LANG=en_US.UTF-8     LC_CTYPE=en_US.UTF-8     DISPLAY=:0     LC_NAME=en_US.UTF-8     XAUTHORITY=/var/run/gdm/auth-for-alex-eNzAWR/database     COLORTERM=gnome-terminal     LC_IDENTIFICATION=en_US.UTF-8     LC_NUMERIC=en_US.UTF-8     LC_PAPER=en_US.UTF-8     LC_MONETARY=en_US.UTF-8     LC_MEASUREMENT=en_US.UTF-8     LC_TIME=en_US.UTF-8     TERM=xterm     PATH=/home/alex/bin:/home/alex/bin:/usr/local/bin:/home/alex/bin:/home/alex/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/tools:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/android-sdk/platform-tools:/opt/android-sdk/platform-tools     LC_COLLATE=en_US.UTF-8     LC_ADDRESS=en_US.UTF-8     SHELL=/usr/bin/zsh     MAIL=/var/mail/root     LOGNAME=root     USER=root     USERNAME=root     HOME=/root     SUDO_COMMAND=/usr/bin/env     SUDO_USER=alex     SUDO_UID=1000     SUDO_GID=1000      And, of course, `debootstrap` itself:               $ sudo rm -r Debian/wheezy-amd64 # nuke a previous attempt from orbit          $ sudo sh -xe debootstrap --arch amd64 --foreign wheezy /home/alex/Development/Debian/wheezy-amd64 http://http.debian.net/debian     + VERSION=1.0.60~bpo70+1     + unset TMP TEMP TMPDIR     + export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jre/bin:/usr/bin/vendor_perl:/usr/bin/core_perl     + PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/java/jre/bin:/usr/bin/vendor_perl:/usr/bin/core_perl     + '[' -z '' ']'     + '[' -x /debootstrap/debootstrap ']'     + DEBOOTSTRAP_DIR=/usr/share/debootstrap     + DEVICES_TARGZ=/usr/share/debootstrap/devices.tar.gz     + . /usr/share/debootstrap/functions     ++ PROGRESS_NOW=0     ++ PROGRESS_END=0     ++ PROGRESS_NEXT=     ++ PROGRESS_WHAT=     ++ FINDDEBS_NEEDS_INDICES=false     ++ SUPPORTED_VARIANTS=-     ++ EXTRACTORS_SUPPORTED='dpkg-deb ar'     ++ UMOUNT_DIRS=     ++ in_path perl     ++ local 'OLD_IFS=       '     ++ IFS=:     ++ for dir in '$PATH'     ++ '[' -x /usr/local/bin/perl ']'     ++ for dir in '$PATH'     ++ '[' -x /usr/bin/perl ']'     ++ IFS='         '     ++ return 0     ++ PKGDETAILS=pkgdetails_perl     ++ N_EXIT_THINGS=0     ++ trap exit_function 0     ++ trap 'exit 129' 1     ++ trap 'error 130 INTERRUPTED "Interrupt caught ... exiting"' 2     ++ trap 'exit 131' 3     ++ trap 'exit 143' 15     + exec     + LANG=C     + USE_COMPONENTS=main     + KEYRING=     + DISABLE_KEYRING=     + VARIANT=     + ARCH=     + HOST_ARCH=     + HOST_OS=     + KEEP_DEBOOTSTRAP_DIR=     + USE_DEBIANINSTALLER_INTERACTION=     + SECOND_STAGE_ONLY=     + PRINT_DEBS=     + CHROOTDIR=     + MAKE_TARBALL=     + KEEP_DEBOOTSTRAP_DIR=     + EXTRACTOR_OVERRIDE=     + UNPACK_TARBALL=     + ADDITIONAL=     + EXCLUDE=     + VERBOSE=     + CERTIFICATE=     + CHECKCERTIF=     + PRIVATEKEY=     + DEF_MIRROR=http://ftp.us.debian.org/debian     + DEF_HTTPS_MIRROR=https://mirrors.kernel.org/debian     + export LANG USE_COMPONENTS     + umask 022     + RESOLVE_DEPS=true     + WHAT_TO_DO='finddebs dldebs first_stage second_stage'     + '[' -z pkgdetails_perl ']'     + '[' 6 '!=' 0 ']'     + true     + case "$1" in     + '[' --arch = --arch -a -n amd64 ']'     + ARCH=amd64     + shift 2     + true     + case "$1" in     + '[' '' '!=' true ']'     + WHAT_TO_DO='finddebs dldebs first_stage'     + shift     + true     + case "$1" in     + break     + '[' '' = true ']'     + '[' -z wheezy ']'     + '[' -z /home/alex/Development/Debian/wheezy-amd64 ']'     + SUITE=wheezy     + TARGET=/home/alex/Development/Debian/wheezy-amd64     + USER_MIRROR=http://http.debian.net/debian     + TARGET=/home/alex/Development/Debian/wheezy-amd64     + '[' home/alex/Development/Debian/wheezy-amd64 = /home/alex/Development/Debian/wheezy-amd64 ']'     + SCRIPT=/usr/share/debootstrap/scripts/wheezy     + '[' -n '' ']'     + '[' '' '!=' '' ']'     + in_path dpkg     + local 'OLD_IFS=        '     + IFS=:     + for dir in '$PATH'     + '[' -x /usr/local/bin/dpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/dpkg ']'     + for dir in '$PATH'     + '[' -x /bin/dpkg ']'     + for dir in '$PATH'     + '[' -x /usr/local/sbin/dpkg ']'     + for dir in '$PATH'     + '[' -x /usr/sbin/dpkg ']'     + for dir in '$PATH'     + '[' -x /sbin/dpkg ']'     + for dir in '$PATH'     + '[' -x /opt/java/jre/bin/dpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/vendor_perl/dpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/core_perl/dpkg ']'     + IFS='          '     + return 1     + in_path udpkg     + local 'OLD_IFS=        '     + IFS=:     + for dir in '$PATH'     + '[' -x /usr/local/bin/udpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/udpkg ']'     + for dir in '$PATH'     + '[' -x /bin/udpkg ']'     + for dir in '$PATH'     + '[' -x /usr/local/sbin/udpkg ']'     + for dir in '$PATH'     + '[' -x /usr/sbin/udpkg ']'     + for dir in '$PATH'     + '[' -x /sbin/udpkg ']'     + for dir in '$PATH'     + '[' -x /opt/java/jre/bin/udpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/vendor_perl/udpkg ']'     + for dir in '$PATH'     + '[' -x /usr/bin/core_perl/udpkg ']'     + IFS='          '     + return 1     + '[' -e /usr/share/debootstrap/arch ']'     ++ cat /usr/share/debootstrap/arch     + HOST_ARCH=amd64     + HOST_OS=amd64     + '[' -z amd64 ']'     + '[' -z amd64 ']'     + '[' -z amd64 ']'     + '[' -z amd64 ']'     + '[' amd64 = kfreebsd ']'     + '[' amd64 = freebsd ']'     + '[' /home/alex/Development/Debian/wheezy-amd64 = / ']'     + doing_variant scratchbox     + '[' scratchbox = '' ']'     + '[' scratchbox = - ']'     + return 1     + CHROOT_CMD='chroot /home/alex/Development/Debian/wheezy-amd64'     + '[' -z '' ']'     + SHA_SIZE=256     + in_path sha256sum     + local 'OLD_IFS=        '     + IFS=:     + for dir in '$PATH'     + '[' -x /usr/local/bin/sha256sum ']'     + for dir in '$PATH'     + '[' -x /usr/bin/sha256sum ']'     + IFS='          '     + return 0     + DEBOOTSTRAP_CHECKSUM_FIELD=SHA256     + export ARCH SUITE TARGET CHROOT_CMD SHA_SIZE DEBOOTSTRAP_CHECKSUM_FIELD     + am_doing_phase first_stage second_stage     + local x     + for x in '"$@"'     + echo ' finddebs dldebs first_stage '     + grep -q ' first_stage '     + return 0     + in_path id     + local 'OLD_IFS=        '     + IFS=:     + for dir in '$PATH'     + '[' -x /usr/local/bin/id ']'     + for dir in '$PATH'     + '[' -x /usr/bin/id ']'     + IFS='          '     + return 0     ++ id -u     + '[' 0 -ne 0 ']'     + check_sane_mount /home/alex/Development/Debian/wheezy-amd64     + mkdir -p /home/alex/Development/Debian/wheezy-amd64     + case "$HOST_OS" in     + mknod /home/alex/Development/Debian/wheezy-amd64/test-dev-null c 1 3     + echo test     + rm -f /home/alex/Development/Debian/wheezy-amd64/test-dev-null     + SH=/bin/sh     + '[' -x /bin/sh ']'     + cat     + chmod +x /home/alex/Development/Debian/wheezy-amd64/test-exec     + /home/alex/Development/Debian/wheezy-amd64/test-exec     + rm -f /home/alex/Development/Debian/wheezy-amd64/test-exec     + return 0     + '[' '!' -e /usr/share/debootstrap/scripts/wheezy ']'     + '[' /home/alex/Development/Debian/wheezy-amd64 '!=' '' ']'     + mkdir -p /home/alex/Development/Debian/wheezy-amd64/debootstrap     + '[' '' = yes ']'     + am_doing_phase printdebs     + local x     + for x in '"$@"'     + echo ' finddebs dldebs first_stage '     + grep -q ' printdebs '     + return 1     + exec     + exec     + exec     I: Retrieving Release      I: Retrieving Release.gpg      I: Checking Release signature     I: Valid Release signature (key id ED6D65271AACF0FF15D123036FB2A1C265FFB764)     I: Retrieving Packages      I: Validating Packages      I: Resolving dependencies of required packages...     I: Resolving dependencies of base packages...     I: Found additional required dependencies: insserv libbz2-1.0 libdb5.1 libsemanage1 libsemanage-common libslang2 libustr-1.0-1      I: Found additional base dependencies: libept1.4.12 libgcrypt11 libgnutls26 libgpg-error0 libidn11 libnfnetlink0 libp11-kit0 libsqlite3-0 libtasn1-3 libxapian22      I: Checking component main on http://http.debian.net/debian...     I: Retrieving libacl1 2.2.51-8     I: Validating libacl1 2.2.51-8     I: Retrieving adduser 3.113+nmu3     I: Validating adduser 3.113+nmu3     I: Retrieving apt 0.9.7.9+deb7u1     I: Validating apt 0.9.7.9+deb7u1     I: Retrieving apt-utils 0.9.7.9+deb7u1     I: Validating apt-utils 0.9.7.9+deb7u1     I: Retrieving libapt-inst1.5 0.9.7.9+deb7u1     I: Validating libapt-inst1.5 0.9.7.9+deb7u1     I: Retrieving libapt-pkg4.12 0.9.7.9+deb7u1     I: Validating libapt-pkg4.12 0.9.7.9+deb7u1     I: Retrieving aptitude 0.6.8.2-1     I: Validating aptitude 0.6.8.2-1     I: Retrieving aptitude-common 0.6.8.2-1     I: Validating aptitude-common 0.6.8.2-1     I: Retrieving libattr1 1%3a2.4.46-8     I: Validating libattr1 1%3a2.4.46-8     I: Retrieving base-files 7.1wheezy5     I: Validating base-files 7.1wheezy5     I: Retrieving base-passwd 3.5.26     I: Validating base-passwd 3.5.26     I: Retrieving bash 4.2+dfsg-0.1     I: Validating bash 4.2+dfsg-0.1     I: Retrieving libboost-iostreams1.49.0 1.49.0-3.2     I: Validating libboost-iostreams1.49.0 1.49.0-3.2     I: Retrieving bsdmainutils 9.0.3     I: Validating bsdmainutils 9.0.3     I: Retrieving libbz2-1.0 1.0.6-4     I: Validating libbz2-1.0 1.0.6-4     I: Retrieving coreutils 8.13-3.5     I: Validating coreutils 8.13-3.5     I: Retrieving cpio 2.11+dfsg-0.1     I: Validating cpio 2.11+dfsg-0.1     I: Retrieving cron 3.0pl1-124     I: Validating cron 3.0pl1-124     I: Retrieving libcwidget3 0.5.16-3.4     I: Validating libcwidget3 0.5.16-3.4     I: Retrieving dash 0.5.7-3     I: Validating dash 0.5.7-3     I: Retrieving libdb5.1 5.1.29-5     I: Validating libdb5.1 5.1.29-5     I: Retrieving debconf 1.5.49     I: Validating debconf 1.5.49     I: Retrieving debconf-i18n 1.5.49     I: Validating debconf-i18n 1.5.49     I: Retrieving debian-archive-keyring 2012.4     I: Validating debian-archive-keyring 2012.4     I: Retrieving debianutils 4.3.2     I: Validating debianutils 4.3.2     I: Retrieving diffutils 1%3a3.2-6     I: Validating diffutils 1%3a3.2-6     I: Retrieving dmidecode 2.11-9     I: Validating dmidecode 2.11-9     I: Retrieving dpkg 1.16.12     I: Validating dpkg 1.16.12     I: Retrieving e2fslibs 1.42.5-1.1     I: Validating e2fslibs 1.42.5-1.1     I: Retrieving e2fsprogs 1.42.5-1.1     I: Validating e2fsprogs 1.42.5-1.1     I: Retrieving libcomerr2 1.42.5-1.1     I: Validating libcomerr2 1.42.5-1.1     I: Retrieving libss2 1.42.5-1.1     I: Validating libss2 1.42.5-1.1     I: Retrieving libc-bin 2.13-38+deb7u1     I: Validating libc-bin 2.13-38+deb7u1     I: Retrieving libc6 2.13-38+deb7u1     I: Validating libc6 2.13-38+deb7u1     I: Retrieving multiarch-support 2.13-38+deb7u1     I: Validating multiarch-support 2.13-38+deb7u1     I: Retrieving findutils 4.4.2-4     I: Validating findutils 4.4.2-4     I: Retrieving gcc-4.7-base 4.7.2-5     I: Validating gcc-4.7-base 4.7.2-5     I: Retrieving libgcc1 1%3a4.7.2-5     I: Validating libgcc1 1%3a4.7.2-5     I: Retrieving libstdc++6 4.7.2-5     I: Validating libstdc++6 4.7.2-5     I: Retrieving libgdbm3 1.8.3-11     I: Validating libgdbm3 1.8.3-11     I: Retrieving gnupg 1.4.12-7+deb7u3     I: Validating gnupg 1.4.12-7+deb7u3     I: Retrieving gpgv 1.4.12-7+deb7u3     I: Validating gpgv 1.4.12-7+deb7u3     I: Retrieving libgnutls26 2.12.20-8+deb7u1     I: Validating libgnutls26 2.12.20-8+deb7u1     I: Retrieving grep 2.12-2     I: Validating grep 2.12-2     I: Retrieving groff-base 1.21-9     I: Validating groff-base 1.21-9     I: Retrieving gzip 1.5-1.1     I: Validating gzip 1.5-1.1     I: Retrieving hostname 3.11     I: Validating hostname 3.11     I: Retrieving ifupdown 0.7.8     I: Validating ifupdown 0.7.8     I: Retrieving insserv 1.14.0-5     I: Validating insserv 1.14.0-5     I: Retrieving iproute 20120521-3+b3     I: Validating iproute 20120521-3+b3     I: Retrieving iptables 1.4.14-3.1     I: Validating iptables 1.4.14-3.1     I: Retrieving iputils-ping 3%3a20101006-1+b1     I: Validating iputils-ping 3%3a20101006-1+b1     I: Retrieving isc-dhcp-client 4.2.2.dfsg.1-5+deb70u6     I: Validating isc-dhcp-client 4.2.2.dfsg.1-5+deb70u6     I: Retrieving isc-dhcp-common 4.2.2.dfsg.1-5+deb70u6     I: Validating isc-dhcp-common 4.2.2.dfsg.1-5+deb70u6     I: Retrieving kmod 9-3     I: Validating kmod 9-3     I: Retrieving libkmod2 9-3     I: Validating libkmod2 9-3     I: Retrieving libept1.4.12 1.0.9     I: Validating libept1.4.12 1.0.9     I: Retrieving libgcrypt11 1.5.0-5+deb7u1     I: Validating libgcrypt11 1.5.0-5+deb7u1     I: Retrieving libgpg-error0 1.10-3.1     I: Validating libgpg-error0 1.10-3.1     I: Retrieving libidn11 1.25-2     I: Validating libidn11 1.25-2     I: Retrieving liblocale-gettext-perl 1.05-7+b1     I: Validating liblocale-gettext-perl 1.05-7+b1     I: Retrieving libnfnetlink0 1.0.0-1.1     I: Validating libnfnetlink0 1.0.0-1.1     I: Retrieving libpipeline1 1.2.1-1     I: Validating libpipeline1 1.2.1-1     I: Retrieving libselinux1 2.1.9-5     I: Validating libselinux1 2.1.9-5     I: Retrieving libsemanage-common 2.1.6-6     I: Validating libsemanage-common 2.1.6-6     I: Retrieving libsemanage1 2.1.6-6     I: Validating libsemanage1 2.1.6-6     I: Retrieving libsepol1 2.1.4-3     I: Validating libsepol1 2.1.4-3     I: Retrieving libsigc++-2.0-0c2a 2.2.10-0.2     I: Validating libsigc++-2.0-0c2a 2.2.10-0.2     I: Retrieving libtasn1-3 2.13-2     I: Validating libtasn1-3 2.13-2     I: Retrieving libtext-charwidth-perl 0.04-7+b1     I: Validating libtext-charwidth-perl 0.04-7+b1     I: Retrieving libtext-iconv-perl 1.7-5     I: Validating libtext-iconv-perl 1.7-5     I: Retrieving libtext-wrapi18n-perl 0.06-7     I: Validating libtext-wrapi18n-perl 0.06-7     I: Retrieving libusb-0.1-4 2%3a0.1.12-20+nmu1     I: Validating libusb-0.1-4 2%3a0.1.12-20+nmu1     I: Retrieving logrotate 3.8.1-4     I: Validating logrotate 3.8.1-4     I: Retrieving lsb-base 4.1+Debian8+deb7u1     I: Validating lsb-base 4.1+Debian8+deb7u1     I: Retrieving man-db 2.6.2-1     I: Validating man-db 2.6.2-1     I: Retrieving manpages 3.44-1     I: Validating manpages 3.44-1     I: Retrieving mawk 1.3.3-17     I: Validating mawk 1.3.3-17     I: Retrieving nano 2.2.6-1+b1     I: Validating nano 2.2.6-1+b1     I: Retrieving libncurses5 5.9-10     I: Validating libncurses5 5.9-10     I: Retrieving libncursesw5 5.9-10     I: Validating libncursesw5 5.9-10     I: Retrieving libtinfo5 5.9-10     I: Validating libtinfo5 5.9-10     I: Retrieving ncurses-base 5.9-10     I: Validating ncurses-base 5.9-10     I: Retrieving ncurses-bin 5.9-10     I: Validating ncurses-bin 5.9-10     I: Retrieving net-tools 1.60-24.2     I: Validating net-tools 1.60-24.2     I: Retrieving netbase 5.0     I: Validating netbase 5.0     I: Retrieving netcat-traditional 1.10-40     I: Validating netcat-traditional 1.10-40     I: Retrieving libnewt0.52 0.52.14-11.1     I: Validating libnewt0.52 0.52.14-11.1     I: Retrieving whiptail 0.52.14-11.1     I: Validating whiptail 0.52.14-11.1     I: Retrieving libssl1.0.0 1.0.1e-2+deb7u7     I: Validating libssl1.0.0 1.0.1e-2+deb7u7     I: Retrieving libp11-kit0 0.12-3     I: Validating libp11-kit0 0.12-3     I: Retrieving libpam-modules 1.1.3-7.1     I: Validating libpam-modules 1.1.3-7.1     I: Retrieving libpam-modules-bin 1.1.3-7.1     I: Validating libpam-modules-bin 1.1.3-7.1     I: Retrieving libpam-runtime 1.1.3-7.1     I: Validating libpam-runtime 1.1.3-7.1     I: Retrieving libpam0g 1.1.3-7.1     I: Validating libpam0g 1.1.3-7.1     I: Retrieving perl-base 5.14.2-21+deb7u1     I: Validating perl-base 5.14.2-21+deb7u1     I: Retrieving libpopt0 1.16-7     I: Validating libpopt0 1.16-7     I: Retrieving libprocps0 1%3a3.3.3-3     I: Validating libprocps0 1%3a3.3.3-3     I: Retrieving procps 1%3a3.3.3-3     I: Validating procps 1%3a3.3.3-3     I: Retrieving libreadline6 6.2+dfsg-0.1     I: Validating libreadline6 6.2+dfsg-0.1     I: Retrieving readline-common 6.2+dfsg-0.1     I: Validating readline-common 6.2+dfsg-0.1     I: Retrieving rsyslog 5.8.11-3     I: Validating rsyslog 5.8.11-3     I: Retrieving sed 4.2.1-10     I: Validating sed 4.2.1-10     I: Retrieving sensible-utils 0.0.7     I: Validating sensible-utils 0.0.7     I: Retrieving login 1%3a4.1.5.1-1     I: Validating login 1%3a4.1.5.1-1     I: Retrieving passwd 1%3a4.1.5.1-1     I: Validating passwd 1%3a4.1.5.1-1     I: Retrieving libslang2 2.2.4-15     I: Validating libslang2 2.2.4-15     I: Retrieving libsqlite3-0 3.7.13-1+deb7u1     I: Validating libsqlite3-0 3.7.13-1+deb7u1     I: Retrieving initscripts 2.88dsf-41+deb7u1     I: Validating initscripts 2.88dsf-41+deb7u1     I: Retrieving sysv-rc 2.88dsf-41+deb7u1     I: Validating sysv-rc 2.88dsf-41+deb7u1     I: Retrieving sysvinit 2.88dsf-41+deb7u1     I: Validating sysvinit 2.88dsf-41+deb7u1     I: Retrieving sysvinit-utils 2.88dsf-41+deb7u1     I: Validating sysvinit-utils 2.88dsf-41+deb7u1     I: Retrieving tar 1.26+dfsg-0.1     I: Validating tar 1.26+dfsg-0.1     I: Retrieving tasksel 3.14.1     I: Validating tasksel 3.14.1     I: Retrieving tasksel-data 3.14.1     I: Validating tasksel-data 3.14.1     I: Retrieving info 4.13a.dfsg.1-10     I: Validating info 4.13a.dfsg.1-10     I: Retrieving install-info 4.13a.dfsg.1-10     I: Validating install-info 4.13a.dfsg.1-10     I: Retrieving traceroute 1%3a2.0.18-3     I: Validating traceroute 1%3a2.0.18-3     I: Retrieving tzdata 2014a-0wheezy1     I: Validating tzdata 2014a-0wheezy1     I: Retrieving libudev0 175-7.2     I: Validating libudev0 175-7.2     I: Retrieving udev 175-7.2     I: Validating udev 175-7.2     I: Retrieving libustr-1.0-1 1.0.4-3     I: Validating libustr-1.0-1 1.0.4-3     I: Retrieving bsdutils 1%3a2.20.1-5.3     I: Validating bsdutils 1%3a2.20.1-5.3     I: Retrieving libblkid1 2.20.1-5.3     I: Validating libblkid1 2.20.1-5.3     I: Retrieving libmount1 2.20.1-5.3     I: Validating libmount1 2.20.1-5.3     I: Retrieving libuuid1 2.20.1-5.3     I: Validating libuuid1 2.20.1-5.3     I: Retrieving mount 2.20.1-5.3     I: Validating mount 2.20.1-5.3     I: Retrieving util-linux 2.20.1-5.3     I: Validating util-linux 2.20.1-5.3     I: Retrieving vim-common 2%3a7.3.547-7     I: Validating vim-common 2%3a7.3.547-7     I: Retrieving vim-tiny 2%3a7.3.547-7     I: Validating vim-tiny 2%3a7.3.547-7     I: Retrieving wget 1.13.4-3+deb7u1     I: Validating wget 1.13.4-3+deb7u1     I: Retrieving libxapian22 1.2.12-2     I: Validating libxapian22 1.2.12-2     I: Retrieving liblzma5 5.1.1alpha+20120614-2     I: Validating liblzma5 5.1.1alpha+20120614-2     I: Retrieving xz-utils 5.1.1alpha+20120614-2     I: Validating xz-utils 5.1.1alpha+20120614-2     I: Retrieving zlib1g 1%3a1.2.7.dfsg-13     I: Validating zlib1g 1%3a1.2.7.dfsg-13     I: Chosen extractor for .deb packages: ar     I: Extracting libacl1...      Unfortunately, I've run out of characters in this question. So: here is the output of `cat Debian/wheezy-amd64/debootstrap/debootstrap.log` (warning: 2MB!), and here is the output of `tree Debian/wheezy-amd64`. Here are the last few lines of the debootstrap log. The file `libacl1_2.2.51-8_amd64.deb` is downloaded from http://http.debian.net/debian/pool/main/a/acl/libacl1_2.2.51-8_amd64.deb.               + printf 'I: Extracting %s...\n' libacl1     + extract_deb_data .//var/cache/apt/archives/libacl1_2.2.51-8_amd64.deb     + extract_ar_deb_data .//var/cache/apt/archives/libacl1_2.2.51-8_amd64.deb     + local pkg=.//var/cache/apt/archives/libacl1_2.2.51-8_amd64.deb     ++ ar -t .//var/cache/apt/archives/libacl1_2.2.51-8_amd64.deb     ++ grep '^data.tar'     + local tarball=data.tar.gz     + case "$tarball" in     + cat_cmd=zcat     + type zcat     + ar -p .//var/cache/apt/archives/libacl1_2.2.51-8_amd64.deb data.tar.gz     + zcat     + tar -xf -     stdin: not in compressed format     tar: This does not look like a tar archive     tar: Exiting with failure status due to previous errors     + exit_function     + local n=0     + '[' 0 -lt 0 ']'     + N_EXIT_THINGS=0      What is causing `debootstrap` to fail like this? How can I fix it?


What's the safest way to pipe an email to a script via procmail?

I have a simple procmailrc recipe that hands mail off to a script:               LOGFILE=/home/foouser/procmail-log     VERBOSE=yes     MAILDIR=/var/spool/mail/foouser     DEFAULT=/var/spool/mail/foouser     SHELL=/bin/sh     DELIVERED=yes     COMSAT=no          :0     | `/home/foouser/scripts/footool/footool.sh`      The script itself is pretty resilient and reasonably safe. My concern is that the procmail recipe itself might not sanitize correctly and in the process of piping it over, an email that contains, say, `; rm -rf /` could wreak havoc. Should I use double-quotes? ## MORE INFORMATION Based on some feedback here, it sounds like I might want to temporarily disable shell metas and use double-quotes. So that would perhaps change the recommended code implementation to:               LOGFILE=/home/foouser/procmail-log     VERBOSE=yes     MAILDIR=/var/spool/mail/foouser     DEFAULT=/var/spool/mail/foouser     SHELL=/bin/sh     DELIVERED=yes     COMSAT=no     savedMetas  = $SHELLMETAS     SHELLMETAS    # Kill variable          :0     | "/home/foouser/scripts/footool/footool.sh"     SHELLMETAS  = $savedMetas          Does that look better?


How to use Sed to replace all characters before colon?

How do I replace the following string               hd_ma_prod_customer_ro:*:123456789:john.doe      with john.doe Basically I need to look for the last colon (:) and delete everything before and including it.


Moving an open file to a different device

I have an application running that is generating a large (~200GB) output file, and takes about 35 hours to run (currently I'm about 12 hours in). The application just opens the file once then keeps it open as it is writing until it is complete; the application also does a lot of random access writes to the file (i.e. not sequential writes). Right now the file is being saved to my local hard drive but I just decided that when it's done, I'm going to move it to a different device instead (a network drive, NTFS mounted via CIFS). To save time instead of moving the file later, is there some way I can suspend the program and somehow move the current partially complete file to the other device, do some tricks, and resume the program so it is now using the new location? I'm pretty much positive that the answer is no but I thought I'd ask, sometimes there are surprising tricks out there...


Why can't I write on External Hard disk?

I am using Arch Linux. I am not able to write on my external hard disk. I have tried to change the permission manually through properties but not allowed to do so. How can I fix this problem? Here is the output of `fsck -l` and `mount`:               [root@localhost shravan]# fsck -l     fsck from util-linux 2.24.1     e2fsck 1.42.9 (28-Dec-2013)     /dev/sda1 is mounted.     e2fsck: Cannot continue, aborting.               [root@localhost shravan]# mount     proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)     sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     dev on /dev type devtmpfs (rw,nosuid,relatime,size=1996364k,nr_inodes=499091,mode=755)     run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)     /dev/sda1 on / type ext4 (rw,relatime,data=ordered)     securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)     tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)     cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)     pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)     cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)     cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)     cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)     cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)     cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)     cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)     cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)     systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)     configfs on /sys/kernel/config type configfs (rw,relatime)     hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)     tmpfs on /tmp type tmpfs (rw)     debugfs on /sys/kernel/debug type debugfs (rw,relatime)     mqueue on /dev/mqueue type mqueue (rw,relatime)     tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=399844k,mode=700,uid=1000,gid=1000)     fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)     gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)     /dev/sdb1 on /run/media/shravan/6FA6C3EC7A96B1D0 type ntfs (ro,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1,uhelper=udisks2)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)


Partition is out of space

When I was trying to resolve the issue as seen in this question, I figured out that a specific partition is out of space. I have a specified folder which I allow all ftp uploading of multimedia files from all users -- located at "/srv/media" and owned by apache. I did not notice the storage allocation until I began receiving errors; so how do I ensure files are being saved to the larger partition? Must the media folder be located under home??               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup-lv_root                            50G   47G     0 100% /     tmpfs                 7.8G     0  7.8G   0% /dev/shm     /dev/sda1             485M   54M  406M  12% /boot     /dev/mapper/VolGroup-lv_home                           860G  200M  816G   1% /home      Any guidance in this matter is greatly appreciated.


Virtual Memory Usage Exceeding Physical Drive Space

I have a machine running Ubuntu on Amazon EC2. The machine has a 43 Gb root drive and 30 Gb of RAM. I am running a processor and memory intensive process and I've noticed that it sometimes stalls for no apparent reason. I'm looking at the system usage via the `htop` program. I've included a screenshot below. Does it make sense that the VIRT column adds up to more than the physical drive space of the system? My understanding is that is virtual memory usage. Essentially I'm trying to understand whether my process is freezing because it's running out of resources, and which resources it's running out of. ![System usage. Virtual memory is exceeding the root drive space.](http://i.stack.imgur.com/jU6kB.png)


Bandwidth speed test with nginx

I have server with nginx-1.4.1. I want to test bandwidth between my desktop and server. Incoming speed I can test by simple download file with size 10M from server and count time what I need to this. But also I need test upload speed, but nginx by default can`t upload file. I try with this config:               location /upload {             client_max_body_size 100M;             return 200 ok;     }      But when I try upload some file to server with `curl "http://server_name/upload" --data @downloads/smric-6_0_3.tar.gz -i -v -H 'Content-Length: 20490365'` I see what nginx answer before get body of request. Can I realize upload speed test only with nginx and curl or I need use some programing language?


Can't get golang working on Fedora 19

I've installed the `golang` package on Fedora 19. Go also needs the the `GOPATH` variable. I added to my `~/.bashrc`:               GOPATH=$HOME/.go/      But `go env` didn't see it (after the `source ~/.bashrc`):               GOARCH="386"     GOBIN=""     GOCHAR="8"     GOEXE=""     GOHOSTARCH="386"     GOHOSTOS="linux"     GOOS="linux"     GOPATH=""     GORACE=""     GOROOT="/usr/lib/golang"     GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_386"     CC="gcc"     GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread"     CGO_ENABLED="1"      Why it didn't see my `GOPATH`? PS: `echo $GOPATH`:               /home/m0nhawk/.go/


How to install Python 3.x on Debian?

Being new to Linux, I chose Debian for my Linode because it seemed stable and secure. Now I want to write some sysadmin-type scripts in Python to teach myself the language. Based on this SO question I've decided to go with Python 3. At very least, I'd like my Linode to have 2.6 or 2.7 because that's what's installed on my home machines. But the default for Debian is still 2.5. That's fine, but _for the life of me_ I cannot figure out how to get the python3.1 package!! It's driving me nuts! Here's a sample of what I've tried (after running `apt-get update` to make sure my package index was up to date):               $ apt-cache search ^python$     python - An interactive high-level object-oriented language (default version)     $ apt-cache search ^python3$     $ apt-cache search ^python*$     python - An interactive high-level object-oriented language (default version)     $ apt-cache -a search ^python*$     python - An interactive high-level object-oriented language (default version)     $ apt-cache search ^python2\.4$     python2.4 - An interactive high-level object-oriented language (version 2.4)      I know that this package is available because I can see it right there on debian.org. How do I find it and install it? And after I finally figure out how to install the latest Python, am I still going to have trouble from my package manager when installing things that depend on Python? Are they going to point to the default python instead of the one I want? I'd much rather use the native package manager than use easy_install (see the reason I care about packages here). Oh, and I am looking for a command-line-only answer.


Having trouble with LVM snapshot

I have a funtoo linux machine which I am trying to add ubuntu to (thats a whole other issue). It is encrypted with luks and has lvm on top of that. I have a 2 TB harddrive (sdb) which I would like to use to take lvm snapshots of the important logical volumes on the machine. I don't need the whole external drive, so I split it up into 3 ~600G partitions. I formatted them with linux LVM, then added one partition (sdb2) to the same volume group of the logical volumes I want to back up on the funtoo machine (e.g. I want to backup /dev/cr/root, /dev/cr/portage...) Heres where things are weird. When I normally create an logical volume, it doesn't work. However, I can get it to work by specifying maximum verbosity when using lvcreate: `lvcreate -vvv`. Super weird. Unfortunately, this strange workaround doesn't work when I am trying to create a snapshot. Here is the end of the output after running `sudo lvcreate -vvv --size 35G --snapshot --name snaproot /dev/cr/root`                   Creating volume group backup "/etc/lvm/backup/cr" (seqno 21).             Writing cr metadata to /etc/lvm/backup/.lvm_agamemnon_5516_1152467130             Committing cr metadata (21)             Renaming /etc/lvm/backup/cr.tmp to /etc/lvm/backup/cr             Unlock: Memlock counters: locked:0 critical:0 daemon:0 suspended:0             Syncing device names       semid 1343490: semop failed for cookie 0xd4de368: incorrect semaphore state       Failed to set a proper state for notification semaphore identified by cookie value 223208296 (0xd4de368) to initialize waiting for incoming notifications.             Udev cookie 0xd4de368 (semid 1343490) destroyed             cr-snaproot: Skipping NODE_DEL [trust_udev]           Unlocking /var/lock/lvm/V_cr             _undo_flock /var/lock/lvm/V_cr             Closed /dev/mapper/root             Closed /dev/sdb2             Freeing VG cr at 0x7543d0.      Anyone ever seen this error before? I am running LVM version: 2.02.95(2) (2012-03-06) and udev version 171.. Should I upgrade udev? I could backup my disk another way, I just thought this would be the cleanest. Any better ideas?


Trying to hear audio coming from LINE IN using ALSA on Debian

I have a netbook with Debian sid, command line only, using it for a server. I am trying to configure it so that the speakers play back what is going in through the netbook's line in audio port. I can not find a simple way to do that. As far as I know, I am using ALSA for all audio, no jack and no pulse audio. I use alsamixer to manage audio levels, but I can not find a 'capture' mode in the PLAYBACK settings to turn on. Card: HDA Intel   Chip: Realtek ID 268 Note: All other audio seems to work. Line in does record (although just cant figure out how to route it live to speakers) and speakers do work themselves. Tested by doing arecord then aplay. Here is my 'aplay -L' output:               null         Discard all samples (playback) or generate zero samples (capture)     default:CARD=Intel         HDA Intel, ID 268 Analog         Default Audio Device     sysdefault:CARD=Intel         HDA Intel, ID 268 Analog         Default Audio Device     front:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         Front speakers     surround40:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         4.0 Surround output to Front and Rear speakers     surround41:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         4.1 Surround output to Front, Rear and Subwoofer speakers     surround50:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         5.0 Surround output to Front, Center and Rear speakers     surround51:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         5.1 Surround output to Front, Center, Rear and Subwoofer speakers     surround71:CARD=Intel,DEV=0         HDA Intel, ID 268 Analog         7.1 Surround output to Front, Center, Side, Rear and Woofer speakers


add newlines in .cshrc command output

I'm trying to set up a "dynamic" motd for users when they log in on FreeBSD 10. I've got it set up so that it uses .cshrc and has a few commands to output some info. However one of those prints as a single line instead of adding newlines.               echo 'Uptime: '`uptime`     echo ''`who -H | awk '{print $0,"\n"}'`      The output of **who** comes out as a single line instead separated out. How can I accomplish it so that it adds a newline **\n** at the end of each line? I've tried a few alterations of **sed** as well, but it all comes up with the same result. I am testing with tcsh.


How to write conditional if statement in bash shell script?

I have a below shell script which will get the latest folder from my current directory in machineB and machineC. So I came up with the below command which will find me the latest folder inside - `/bat/data/snapshot` And that latest folder will be in the form of YYYYMMDD. Below is my shell script -               #!/bin/bash          readonly FILERS_LOCATION=(machineB machineC)     readonly MAPPED_LOCATION=/bat/data/snapshot          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          length1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} "ls '$dir1' | wc -l")     length2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} "ls '$dir2' | wc -l")          echo $length1     echo $length2          if [ $dir1 eq $dir2 ] && [length1 > 0] && [length2 > 0]     then         echo "Hello World"      Now I need to write conditional if statement. I need to check whether `dir1` is equal to `dir2` and `length1` is greater than `0` and `length2` is also greater than `0` then only print outs `Hello World` But somehow my above if statement doesn't work. Any idea what wrong I am doing here? I am little bit rusty in bash scripting..


Touchpad utility

I'm new in the Linux area. I just installed Elementary OS, which is related to Ubuntu, and I want to know if there is a utility for my mouse pad. In Windows I had Synaptics that allowed me to scroll with my mouse pad using 2 fingers and other tricks like this. Is there a utility like this one on Linux?


How to see buffered and cached data

~$ free                  total       used       free     shared    buffers     cached     Mem:       3891076    1044972    2846104          0      82744     463876     -/+ buffers/cache:     498352    3392724     Swap:      4035580          0    4035580        1. How to investigate what kind of data is `buffered` and `cached`.(not answered yet)    2. How to clear `buffers` and `cached`? (answered) **EDIT** This command provided by Chris did the trick:               sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches && sleep 2 && free'


How can I open a file that results from grep?

I often grep a bunch of files to find a line, and then grep returns one result. Rather than copying and pasting the filename into a new command, I'd like to be able to open that one result with an editor. Something like: `grep foo | vim`. Is there a way to do that in BASH?


Which Linux distributions offer a stable release based on the 3.10 kernel?

I'm looking for a stable Linux distribution (preferably a well-known one) based on the 3.10 kernel. So far I have identified Gentoo as one such distribution. But I'm having trouble finding any others. What other distributions currently offer a _stable_ release based on the 3.10 series kernel?


impact of allowing Apache to execute some commands on the server

I have an Ubuntu 12 web server running apache2, I developed a graphic interface using PHP to make users able to create their own email account by themselves ( exec() function), so I used visudo to let apache only execute some commands ( useradd) with root privileges as follow > www-data ALL=NOPASSWD:/usr/sbin/useradd I wonder if someone can show me security impact on the server of such manipulation


Standard and portable way to send email from console?

What is the most portable or standard way to send an email from the console or a script on Linux, and possibly Unix?


not able to install jabber with emacs

i downloaded emacs-jabber from git and it created a directory called emacs- jabber and it had files like jabber.el , configure.ac etc. installation guide told me to use `./configure and make and make install` to install jabber.el but when i did `./configure` i did this in emacs-jabber folder that was created it shows no such file or directory and please tell how to integrate facebook with emacs-jabber Thanks


How do you copy the public key to a ssh-server?

Here is what I have tried, and I got an error:               $ cat /home/tim/.ssh/id_rsa.pub | ssh tim@just.some.other.server 'cat >> .ssh/authorized_keys'     Password:      cat: >>: No such file or directory     cat: .ssh/authorized_keys: No such file or directory


How do I recursively apply PKGREPOSITORY when calling make package-recursive in FreeBSD?

I'm trying to create a package of Apache and its dependencies:               sudo make package-recursive \     __MAKE_CONF=~/make.apache22.conf \     PKGREPSOITORY=/usr/home/gvkv      Everything works fine; Apache and its dependencies compile and install and `apache22.tbz` is in `gvkv`. The problem is that the dependency packages are built in their respective `ports/<package>` directories! There are about fifteen of them and while it's easy enough to retrieve them with `find` and a `perl` one-liner, surely there must be a way to tell `make` to run in an environment such that the dependency packages end up in `gvkv`.


Process list: /bin/sh -e /proc/self/fd/11

I got this:                 PID TTY      STAT   TIME COMMAND         2 ?        S      0:00 [kthreadd]         3 ?        S      0:00  \_ [migration/0]                 :       844 ?        S      0:00  \_ [vmmemctl]         1 ?        Ss     0:02 /sbin/init       306 ?        S      0:00 upstart-udev-bridge --daemon       309 ?        S<s    0:00 udevd --daemon       445 ?        S<     0:00  \_ udevd --daemon       446 ?        S<     0:00  \_ udevd --daemon       668 ?        Ss     0:00 dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0       713 ?        Sl     0:00 rsyslogd -c4       717 ?        Ss     0:00 dbus-daemon --system --fork       947 ?        S      0:03 /usr/sbin/vmtoolsd       991 tty2     Ss+    0:00 /sbin/getty -8 38400 tty2      1000 ?        Ss     0:00 cron      1001 ?        Ss     0:00 atd      1137 ?        Sl     0:00 /usr/sbin/console-kit-daemon --no-daemon      1476 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1      9939 ?        Ss     0:00 /bin/sh -e /proc/self/fd/11      9993 ?        S      0:00  \_ sleep 1      Any idea what's with that last process 9939? I've never seen anything like it before... It just keeps spawning a new PID on its own.


Preventing access blocking while external HDD spins up?

I have an old laptop where I installed Debian along with a samba server which I am using to share read-write access to 4 external hard drives, which I use to stream my media from. All works fine, except for when the other 3 drives have spun down and a request is sent to a file on one of them. The file system seems to block all access to any device until the drive has spun up. So, my question is, is it possible to prevent the blocking from occurring while the drive is spinning up?


Is there any command to enable/disable a php extension from command line?

Is there any command to enable/disable a php extension easily from command line? (php.ini)


Redhat: non-root user needs to copy files to a NFS share

Typically non-root users cannot mount directories. Running Redhat Have 6GB tar.gz (/dir/somefile.tar.gz) Need to move to a NFS share on another box (//somebox/somefolder/) We have no other access. Any ideas?


Overriding amended time stamps

I need to make it so the files in current directory get amended with a timestamp. It works fine for the first time, but once I run it again it adds another timestamp to the file. I need a way to replace the timestamp, not just add to it.               #!/bin/sh     IFS='     '          time=$(date)          for file in *     do          mv $file "$file""$time"     done      I'm trying to think of how to overwrite the old files, but because the name changes when it gets amended with the timestamp I can't think of a way.


Specify consistent week boundaries using date

I need to run a certain program passing it the week boundaries. (I use `CentOS release 6.4`, so a `bash`/`gnu date` solution is fine). I tried this yesterday (on Monday):               for ((w=1;w<=6;w++)) do        week=$(date --date "$w weeks ago" +"%G-%V")       beg=$(date --date "monday $w weeks ago" +"%F")       end=$(date --date "sunday $w weeks ago" +"%F")       echo "$week beg=$beg end=$end" $(( ($(date --date $end +"%s") - $(date --date $beg +"%s")) / 86400 ) + 1) "days"     done     2014-02 beg=2014-01-06 end=2014-01-12 7 days     2014-01 beg=2013-12-30 end=2014-01-05 7 days     2013-52 beg=2013-12-23 end=2013-12-29 7 days     2013-51 beg=2013-12-16 end=2013-12-22 7 days     2013-50 beg=2013-12-09 end=2013-12-15 7 days     2013-49 beg=2013-12-02 end=2013-12-08 7 days      looks good, but when I do the same thing today (Tuesday), I get this:               2014-02 beg=2014-01-13 end=2014-01-12 0 days     2014-01 beg=2014-01-06 end=2014-01-05 0 days     2013-52 beg=2013-12-30 end=2013-12-29 0 days     2013-51 beg=2013-12-23 end=2013-12-22 0 days     2013-50 beg=2013-12-16 end=2013-12-15 0 days     2013-49 beg=2013-12-09 end=2013-12-08 0 days      which does not look good. So, how do call `date` to get the week boundaries in the past?


grep to find instances of "Foo" where "Bar" does not appear within 10 lines

Suppose I want to search an entire tree for all CPP files where "Foo" occurs. I might do:               find . -name "*.cpp" | xargs grep "Foo"      Now suppose I want to list _only_ those instances where some other string, say "Bar" does _not_ occur within 3 lines of the previous result. So given two files: ## a.cpp               1 Foo     2 qwerty     3 qwerty      ## b.cpp               1 Foo     2 Bar     3 qwerty      I would like to construct a simple search where "Foo" from a.cpp is found, but "Foo" from b.cpp is not. Is there a way to accomplish this in a fairly simple way?


Use find result without ./

I'm trying to use find to create a bunch of symlinks but using the result with {} includes ./ before each filename. How can I avoid that?               find . -type l -name '*.h' -exec ln -s /sourcedir/{} /destinationdir/{} \;


Why below script is not able to find and delete files

Why below `find` command does not find and delete files ? I am launching it like this ./script.sh 1 MYFOLDER               days_period=$1     myuser=$(whoami)     folder_prefix=$2          LOGS_DIR=~/$folder_prefix/logs     if [ $# -eq 2  ]     then     df -k /users/$myuser            if [ -d "$LOGS_DIR" ]; then         cd $LOGS_DIR         find . -mtime +$days_period -type f -exec ls -la {} \;              find . -mtime +$days_period -type f -exec rm -rf {} \;       fi          fi


Recommendations for replacing a GFS cluster?

I have a couple of CentOS GFS-clusters (GFS as in Global File System) using a shared disk in a Fibre Channel SAN. They are mature now, and the time has come to start planning for their replacement. They are an odd number of nodes (3 or 5) with fencing of faulty nodes set up with APC (PDU) power switches. The nodes are all active and read and write simultaneously on the same shared filesystem. The filesystem is small, currently less than a TB, and will never grow larger than would fit on a commodity hard drive. I have two exclusive IP-address resources which relocate when a node is down. (1 on the 3-node cluster). Everything works very well, but the performance is not very good when there is a lot of activity. So, what could I do differently in my next generation cluster? **What I need is service uptime and data availability.** Possibly scalability as well, but probably not. I don't expect the load to grow very much. I also need to be able to read and write the files like regular files on a regular filesystem. There is no need for quotas or ACLs. Just regular unix permissions, ownership, mtime, size in bytes, and the ability to use `ln` to make a lock file in a way that fails on all but 1 node, should they try it at the same time. I don't want to increase the number of physical servers (which means that I want to use the storage on the actual servers themselves). It's not mandatory, but I think it would be good if I weren't dependent on the Shared disk. I've been through two incidents with Enterprise class SAN storage being unavailable in the last 5 years, so however improbable that is, I'd like to be one step ahead. Since uptime is very important, 1 physical server with 1 running kernel is too little. Virtual machines are dependent on the SAN in our environment. My thoughts so far:   * All nodes could be plain NFSv3 clients (Would `ln` work the way I expect? What would be the NFS server then?)   * Ceph with CephFS (When will the FS be production ready?)   * XtreemFS (Why are there so little written about it compared to Ceph?) As you see, I'm interested in distributed storage, but need advice from experienced gurus. Especially recommendations or advice about Ceph or XtreemFS would be welcome. This is not a HPC with insane bandwidth demands. Just need the availability and reliability, and hopefully flexibility of my old solution, ideally in a "better" configuration than the current. **EDIT** (see Nils comment) The main reason I think about replacing this solution is that I want to see if it is possible to eliminate the single point of failure that the SAN storage cabinet is. Or should I instead use LVM mirroring to keep the data on two different storage systems in the same SAN fabric? Two FC-HBAs and double switches should be enough I think. Oh, I almost forgot... It should be as cheap as Open Source... :-)


New local user can't login to vsftpd

I'm a bit puzzled with this one and could really use some help. We have a CentOS 6 box running VSFTPD as a dropbox for our customers. Each customer gets a local user and is chrooted to their home dir. Connections are made with explicit SSL. VSFTPD config as follows:               anonymous_enable=NO     local_enable=YES     write_enable=YES     local_umask=022     dirmessage_enable=YES     xferlog_enable=YES     connect_from_port_20=YES     xferlog_std_format=YES     chroot_local_user=YES     listen=YES     pam_service_name=vsftpd     userlist_enable=YES     tcp_wrappers=YES     rsa_cert_file=/etc/ssl/private/vsftpd.pem     rsa_private_key_file=/etc/ssl/private/vsftpd.pem     ssl_enable=YES     allow_anon_ssl=NO     force_local_data_ssl=YES     force_local_logins_ssl=YES     ssl_tlsv1=YES     ssl_sslv2=YES     ssl_sslv3=YES     require_ssl_reuse=NO     ssl_ciphers=HIGH     check_shell=NO      So far we have added 3 users, each in the same way.               useradd -s /sbin/nologin username     passwd username      The first 2 users work perfectly. The 3rd gets a `Login Incorrect` message from VSFTPD. I've change the 3rd users password to `test` just to check there wasn't a typo in the connection but get the same thing. Message in `/var/log/secure` for the 3rd user attempt is               pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=user3 rhost=127.0.0.1  user=user3      Anyone have any suggestions. ### EDIT: In response to comments The SELinux status is disabled The output from `ls -lZd` in each directory is Working user: `drwx------ user1 user1 ? .` Non-working user: `drwxr-xr-x user2 user2 ? .` So there is an obvious difference in permissions, but the working user is _less_ permissive?


Zram does not start at start-up

I am using pinguyos 11.10. Pinguyos is a variant of Ubuntu 11.10. I have installed zram like this:               sudo add-apt-repository ppa:shnatsel/zram     sudo apt-get update     sudo apt-get install zramswap-enabler      But zram doesnot start automatically upon startup. I have to manually say: `service zramswap start` to make it start. Before and after enabling zramswap manually `free` gives this: Before:                            total       used       free     shared    buffers     cached     Mem:       2061184    1165240     895944          0      31632     559816     -/+ buffers/cache:     573792    1487392     Swap:            0          0          0      After:                            total       used       free     shared    buffers     cached     Mem:       2061184    1217888     843296          0      33136     567232     -/+ buffers/cache:     617520    1443664     Swap:      2061176          0    2061176      And I have no physical swap partitions enabled.. so does this make any difference? Is a swap partition necessary for zramswap to work? P.S Until I start the service manually, there is no `zram0`,`zram1` in `/dev` Thanks for any help in advance.


Kernel recognizes USB device but then I can't find it in /sys or /dev

When I connect my Samsung 390G (a cheap cell phone!) to Ubuntu 13.04, dmesg seems to indicate that the storage device thereon is recognizable:               [Sun Dec 29 01:26:10 2013] scsi16 : usb-storage 2-1.2:1.0     [Sun Dec 29 01:26:11 2013] scsi 16:0:0:0: Direct-Access     SAMSUNG  MMC Storage      2.31 PQ: 0 ANSI: 2     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: Attached scsi generic sg2 type 0     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] 61497344 512-byte logical blocks: (31.4 GB/29.3 GiB)     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] Write Protect is off     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] Mode Sense: 0f 0e 00 00     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     [Sun Dec 29 01:26:11 2013]  sdb: sdb1     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] Attached SCSI removable disk     [Sun Dec 29 01:26:11 2013] sd 16:0:0:0: [sdb] Synchronizing SCSI cache      But the problem is that no device shows up for this (i.e. no /dev/sdb or /dev/sdb1). I'm speculating that I need to do some udev rulemaking here, but don't I need to be able to find the parent node in /sys for that? And I can't find anything -- not completely sure where to look, but so far my reasonable- sounding guesses haven't yielded anything. Note for reference that this device does mount as a drive in Windows Explorer, so I'm confident that the phone works as expected.


Ubuntu 11.10 with gnome shell - suspend wake up sound

I would like to be able to enable some sound file to play whenever I suspend and wake up my netbook (MSI Wind u100) but I can't found a way to do this in gnome shell. I'm using PinguyOS 11.10, which is Ubuntu 11.10 based distro. The idea is to make my netbook to basically greet me every time I wake up from suspend. Something like "Welcome back, Master" announced by a sexy robotic voice.


stop Xserver in Xubuntu 11

I want to shutdown my X to be able to install proprietary NVidia driver, but I couldn't find out how. There are some suggestions that didn't work for me. I neither have `/etc/init.d/gdm` nor `/etc/init.d/kdm` nor `/etc/init.d/xdm`, on which I could call stop or start. `/etc/init.d/x11-common` commands seem to have no effect, neither does `init 2`. What can I try next?


What does GNOME do with multimedia keys?

GNOME makes multimedia keys, such as fn+directional keys on my laptop, maybe dedicated keys on your keyboard, into very useful keys. They seem to work with a large number of application. What can I do to recreate this using something like xbindkeys?


List installed meta packages in APT

Meta packages are packages that do not install anything by themselfs, but are dependent on other packages. How do I list the installed meta packages on my system?


Quick directory navigation in the terminal

I would like to frequently switch between directories that are in totally unrelated paths, for example `/Project/Warnest/docs/` and `~/Dropbox/Projects/ds/test/`. But I don't want to type `cd /[full-path]/` all the time. Are there any shortcut commands to switch to previously worked directories? One solution I could think of is to add environment variables to `.profile` for the frequently used directories and `cd` to them using those variables. But is there any other solution to this?


Icon not showing in applications on OSX

![thumbnail](http://i.stack.imgur.com/ZqEbO.png) I just re-installed Firefox, but the thumbnail is not showing in the dock applications folder. The icon DOES show both in dock and in finder. I have tried to re-install Firefox again but without success. Any advice?


sdio_driver in kernel: Just 1 sdio_driver in "linux-2.6-daf54f1\drivers\mmc\card" (sdio_uart) There are some in linux-2.6-daf54f1\drivers\net\wireless. My questions are:   1. Is there any user space SDIO driver in Linux?   2. Is it possible?


List (recursive) dependencies of the installed packages in APT

For each package I have installed I would like to know which packages would be installed if I uninstall it. An example of the output I need is (`package: list of deps`):               abc: foo bar     bcd: baz abc     bdd: baz fuubar      **Append** If I check what really would be removed if I remove the package `ppp` using `apt-get`:               $ echo $(apt-get --dry-run remove ppp | grep '^Remv ' | cut -d' ' -f2)     gnome-ppp mint-meta-xfce network-manager-pptp-gnome network-manager-pptp wvdial pppoeconf pppoe pptp-linux pppconfig ppp      I see that it is different from what `apt-cache` show gives me (which I do not think include recursive dependencies):               $ apt-cache show ppp | grep '^Breaks: '     Breaks: network-manager (<= 0.8.0.999-1), network-manager-pptp (<= 0.8.0.999-1), pppdcapiplugin (<= 1:3.9.20060704+dfsg.1-1)      **Append 2** Is `dpkg --get-selections | cut -f1` a reliable way to get a list of installed packages to iterate over?


Block a package from being uninstalled in APT

In short, I want to be able to set package `abc` so that:   1. `apt-get remove abc` should fail.   2. `apt-get purge abc` should fail.   3. `apt-get upgrade abc` should work. If the package dependencies change so that `abc` should be uninstalled during an `dist-upgrade` I am happy to being forced to do something and then `dist- upgrade` again.


Is CTRL+C incorrect to use to return to command line?

When I'm using `tail -f` and I want to return to the shell, I always use `CTRL+C`. Or when I am typing a command and feel like aborting it and starting over, I simply `CTRL+C` to get back to an empty command line prompt. Is this considered bad practice? I sometimes feel there might be a better way to break away from something, but really have no idea.


Why does truncate fail for sizes above 2043G in ext3?

Why does this work:               truncate -s 2043G foo      ...while this fails:               truncate -s 2044G foo      Why 2043 gigabytes, of all values?


Cannot mount eCryptfs

I tried to install eCryptfs on my server to open an eCryptfs I did on my home computer. I got these errors. > $ sudo mount -t ecryptfs /home/(place)/enc/ /home/(place)/enc/ > > Unable to get the version number of the kernel module. Please make sure that > you have the eCryptfs kernel module loaded, you have sysfs mounted, and the > sysfs mount point is in /etc/mtab. This is necessary so that the mount > helper knows which kernel options are supported. > > Make sure that your system is set up to auto-load your filesystem kernel > module on mount. > > Enabling passphrase-mode only for now. > > Unable to link the KEY_SPEC_USER_KEYRING into the KEY_SPEC_SESSION_KEYRING; > there is something wrong with your kernel keyring. Did you build key > retention support into your kernel? I have no idea what that means. My server has Debian on it. Should I do something?


Compare two data streams without both being stored as files

I have these two files:-               [root@localhost base_filters]# cat aix_old     joe     amadeus     image     bill     juliet     charlie     romeo     ftp               [root@localhost base_filters]# cut -d: -f1 passwd2     henry     amadeus     image     bill     julie     jennifer     charlie     romeo     harry      I am trying to find out the differences between two files; so I am using the following command:-               [root@localhost base_filters]# cut -d: -f1 passwd2 | sort | diff `sort aix_old` -      But getting this following error:               diff: extra operand `charlie'     diff: Try `diff --help' for more information.      I know I can use another temporary file for sorting the contents in `aix_old` but I don't want another temporary file; so tried with command substitution. Any idea, what I might be doing wrong.


I'm able to remotely ssh into Cygwin on XP, but it warns "Could not chdir to home directory" and my /bin is almost empty

I've made a firewall exception, opened ports 22 through 443 to the correct internal IP (I think), and am able to log in using my external IP, but it's like I have very limited view access to almost any commands or files. /home only has .bash_profile /bin only has about 20 commands, half of which start with cyg. but I'm at a loss as to why all my directories are empty. Any one point me in the right direction?


convert man output to ebook format

I **can** convert `man` output to PDF. First, `man -t grep >grep.ps` (grep is just an example; I am _not_ looking for mobile version of grep man page). Then Adobe Distiller converts PostScript to PDF. However, PDF looks terrible on the tablet (can't re-size, etc). I see several programs that convert to mobi and epub formats, but none of them take Postscript as input. Some take PDF as input, but output is usually very difficult to read - even worse than original PDF. So, how can I convert man output to mobile format (epub, mobi, or fb2)?   * Change man / groff output to produce something that mobile generators like; or   * Convert PS to mobile format; or   * Some other way that I can't think of...


How do I view files as a tree structure?

I would like to view files exactly like I can view proccess using `pstree`. So is there something like:               treeview --maxdepth 2       that would give me what I need?


Is it possible to view media on the console?

I know the console (outside X11, e.g. `/dev/tty1`) works in text-mode, but I think if it is possible to play music using programs like `cvlc` and `mplayer`, it should be possible to view pictures and watch videos by launching the viewer program in a single process too. I am aware of some programs that convert media to ASCII or display media in terminals, but I am only interested about a graphical display in the console without any conversion to ASCII art.


Software Center not opening in Linux Mint

I'm a Linux Mint 14 user. I'm not able to open the software center.               $ software-center     ERROR:root:DebFileApplication import Traceback (most recent call last): File "/usr/share/software-center/softwarecenter/db/init.py",     line 4, in from debfile import DebFileApplication, DebFileOpenError File "/usr/share/software-center/softwarecenter/db/debfile.py",     line 25, in from softwarecenter.db.application import Application, AppDetails File "/usr/share/software-center/softwarecenter/db/application.py",     line 27, in import softwarecenter.distro File "/usr/share/software-center/softwarecenter/distro/init.py",     line 197, in distro_instance = _get_distro() File "/usr/share/software-center/softwarecenter/distro/init.py",     line 172, in _get_distro module = import(distro_module_name, globals(), locals(), [], -1) ImportError: No module named linuxmint Traceback (most recent call last): File "/usr/bin/software-center",     line 128, in from softwarecenter.ui.gtk3.app import SoftwareCenterAppGtk3 File "/usr/share/software-center/softwarecenter/ui/gtk3/app.py",     line 53, in from softwarecenter.db.application import Application File "/usr/share/software-center/softwarecenter/db/application.py",     line 27, in import softwarecenter.distro File "/usr/share/software-center/softwarecenter/distro/init.py",     line 197, in distro_instance = _get_distro() File "/usr/share/software-center/softwarecenter/distro/init.py",     line 172, in _get_distro module = import(distro_module_name, globals(), locals(), [], -1) ImportError: No module named linuxmint


Calling latex from vim stopped working

When I try to compile my latex document from within `vim` by issuing: `:w|!lualatex %` (leaving out the `w` command does not solve the problem) it compiles but it does not save any files. If I call `lualatex` directly from the command line `lualatex FILE.tex` it compiles and saves the files as expected. The behaviour is especially strange since I never had this problem before. So basically I cannot point to what the problem may be. I'm on an `archlinux` box. Does anyone have any suggestion how to solve this problem or at least has some ideas what tests might allow me to find possible causes?


How can I solve this make error when building gcc-4.7.2 for LFS?

Everything was going so well... I'm trying to build gcc-4.7.2, following the instructions in the LFS book. When I run make, I get the following:               checking for MPFR... no     configure: error: libmpfr not found or uses a different ABI (including static vs shared).     make[1]: *** [configure-mpc] Error 1     make[1]: Leaving directory `/mnt/lfs/sources/gcc-4.7.2'     make: *** [all] Error 2      My question is this: wut? (If you require further info, please ask in the comments.)


Setting the default profile in Thunderbird

I have two Thunderbird profiles, and my `profiles.ini` looks like this:               [General]     StartWithLastProfile=1          [Profile0]     Name=default     IsRelative=1     Path=e17id64t.default          [Profile1]     Name=custom     IsRelative=1     Path=l48ojhgn.custom     Default=1      `Profile1` is marked as default, but that is only because it was started last. If I start `Profile0`, it will became the default instead. How can I set `Profile0` to be always the default profile, regardless of which profile was started as last time?


Add in `whois` servers

Does anyone know how to configure the `whois` command to add in whois servers for the `whois` command? FYI: it's not `whois`, the one that's on OSX. Would have posted in Apple version but figured I'd get more success here...


Lubuntu IP conflict

I have this friend who recently installed Lubuntu on his Asus Netbook to try it out. Problem is that even though he can find all network connections and after trying to connect to two of them (giving password etc.) nothing happens and he cannot connect to the net. I'm assuming there is nothing wrong with both his net adapter or the networks trying to connect as well. I was looking for the Ubuntu equivalent commands of Windows like `ipconfig` `ipconf -release` `-renew` which might help but I haven't yet found a clear answer. **Edit:** It took me some time but as it seems that there is a problem with the gateway access, since the command `ip route show` shows nothing. How can I fix this and then proceed to establishing a connection? Any thoughts?


pacman could not find database

I want to install `sudo`. So I type in `pacman -S sudo`. But then I get the following errors:               warning: database file for 'extra' does not exist     warning: database file for 'community' does not exist     error: failed to prepare transaction (could not find database)      How do I install the database files for `'extra'` and `'community'`? I am in Arch Linux.


ssh -D to my server

I want to route my `localhost:1500` to my server in US, my command is:               ssh -D 1500 192.241.79.124     password : ...      but this error appears :               cannot listen to port 1500     could not request local forwarding      what would I do?


Bridging on boot causes system to hang

Whenever I set br0 to automatically start up on boot, it causes the system to hang - usually on a line that says something like "waiting 2 seconds for br0 to get ready" or "bound to x.x.x.x to br0 - renewal in xxxx" (i.e. during the boot sequence, before any graphical interfaces have initialised). Using Debian Sid with KVM and virt-manager. I have no issues getting the bridge up an running once it's booted, and it works like a charm. The issue is that I want it automatically connect br0, just like you would a normal interface. I don't think this is such a ridiculous idea, but then again I don't have much experience in Linux networking. I've tried just about every /etc/network/interfaces configuration that I've found, and all of them cause it to hang at boot, or don't start br0 automatically. The only thing I haven't explored extensively is the "pre-up" and "post-down" commands that I've seen occasionally, but I get the impression that these aren't necessarily needed. Because the system completely hangs and refuses to boot any further, it's quite a pain to force it to restart, boot up a rescue distro and remove any configuration in the interfaces file each time. I've successfully been able to make it automatically start up by putting "ifup br0" in /etc/rc.local, but this causes a few other issues like shares not connecting and VNC not starting up. While I'm not quite at that stage yet, my worry is that my guests will be prevented from booting once I set them to automatically start up if I'm using this method.


Why is bash's printf faster than /usr/bin/printf?

I have two ways of calling `printf` on my system:               $ type -a printf     printf is a shell builtin     printf is /usr/bin/printf     $ file /usr/bin/printf     /usr/bin/printf: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically     linked (uses shared libs), for GNU/Linux 2.6.32,     BuildID[sha1]=d663d220e5c2a2fc57462668d84d2f72d0563c33, stripped      So, one is a bash built in command and the other is a proper compiled executable. I would have expected a program whose only job is `pritnf` to be much faster than the shell function. Granted, the builtin is already loaded into memory but the actual execution time should be faster in a dedicated program right? It would be optimized to do one thing very well in the best of Unix philosophy. Apparently not:               $ >/tmp/foo; time for i in `seq 1 3000`; do printf '%s ' "$i" >> /tmp/foo; done;     real    0m0.065s     user    0m0.036s     sys     0m0.024s          $ >/tmp/foo; time for i in `seq 1 3000`; do /usr/bin/printf '%s ' "$i" >> /tmp/foo; done;        real    0m18.097s     user    0m1.048s     sys     0m7.124s      A lot of this, as @Guru points out is because of the cost of creating threads which is only incurred by `/usr/bin/printf`. If that were all, I would expect the executable to be faster than the builtin if run outside a loop. Unfortunately, `/usr/bin/printf` has a limit to the size of a variable that it can take, so I could only test this with a relatively short string:               $ i=$(seq 1 28000 | awk '{k=k$1}END{print k}'); time /usr/bin/printf '%s ' "$i" > /dev/null;           real    0m0.035s     user    0m0.004s     sys     0m0.028s          $ i=$(seq 1 28000 | awk '{k=k$1}END{print k}'); time printf '%s ' "$i" > /dev/null;           real    0m0.008s     user    0m0.008s     sys     0m0.000s      The builtin is still consistently and significantly faster. To make it even clearer, lets make both start new processes:               $ time for i in `seq 1 1000`; do /usr/bin/printf '%s ' "$i" >/dev/null; done;        real    0m33.695s     user    0m0.636s     sys     0m30.628s          $ time for i in `seq 1 1000`; do bash -c "printf '%s ' $i" >/dev/null; done;             real    0m3.557s     user    0m0.380s     sys     0m0.508s      The only reason I can think of is that the variable being printed is internal to `bash` and can be passed directly to the builtin. Is that enough to explain the difference in speed? What other factors are at play?


Transform an UDP unicast packet into broadcast?

We need to wake-up some computers on our internal LAN, from the Internet.   We have a somewhat closed router. Very few ways to configure it.   I'd like to use netfilter (iptables) to do this because it doesn't involve a daemon or so, but other solutions are okay. What I have in mind:   * the external computer issues a WOL (Wake-On-LAN) packet to the public IP address (with the correct MAC inside)   * the correct port is open on the router (say 1234), redirecting the datas to a Linux box   * the Linux box transform the UDP unicast packet into a broadcast packet (exact same content, only destination address is modified to 255.255.255.255 or 192.168.0.255)   * the multicast packet comes to every NICs, and the desired computer is now awake For that, a very simple netfilter rule is:   `iptables --table nat --append PREROUTING --in-interface eth+ --protocol udp --destination-port 1234 --jump DNAT --to-destination 192.168.0.255` Alas netfilter seems to ignore transformation to broadcast. 192.168.0.255 and 255.255.255.255 gives nothing. Also tested with 192.168.0.0 and 0.0.0.0   I used tcpdump to see what happens:   `tcpdump -n dst port 1234`   `13:54:28.583556 IP www.xxx.yyy.zzz.43852 > 192.168.0.100.1234: UDP, length 102 `   and nothing else. I should have a second line like:   `13:54:28.xxxxxx IP www.xxx.yyy.zzz.43852 > 192.168.0.255.1234: UDP, length 102 ` If I redirect to a non-multicast address, everything is okay. I have the 2 expected lines. But obviously this don't work for WOL. Is their a way to tell netfilter to issue broadcast packets ? Other methods I think about:   * use iptables to match the desired packets, log them, and use a daemon to monitor the log file and fire the broadcast packet    * use iptable to redirect the desired packets to a local daemon, which fire the broadcast packet (simplier)   * use socat (how ?)


How can I tell if a TCP port is open or not?

I am trying to implement socket programming in C. When I try to connect from a client to a server (Ubuntu), it shows an error like "connection failed". So I think the problem is with the port. I am using the 5454/tcp port for socket programming. How can I know if 5454 port is listening or not? If it is not, then which are the ports that I can use for TCP socket programming using C in Ubuntu? Is that the problem with port only or is there anything wrong in my code or any settings is required in LINUX Ubuntu? **EDIT:** Snippet of code:                 int socket_send;        struct sockaddr_in address;     printf("\n Initialization Socket....");          socket_send = socket(AF_INET,SOCK_STREAM,0);     if(socket_send == -1)     {         perror("\n Socket not created.Error:");         return 1;     }     printf("\n Socket created");          address.sin_family=AF_INET;     address.sin_addr.s_addr=inet_addr(ip);     address.sin_port=htons(5454);          if(connect(socket_send,(struct sockaddr*)&address,sizeof(struct sockaddr))<0)     {         perror("\nConnetion failed.Error:");         return 1;     }     printf("\n Connected");          if(send(socket_send,(char*)buffer,size,flag)<0)     {         perror("\nSending failed.Error:");         return 1;     }     printf("\n Data successfully sent");      close(socket_send);      **EDIT** : Problem is in port, so I just re installed Ubuntu, and it's working. Thank you all of you.


.bashrc overwritten but still sourced -- how can it be recovered?

Usually when I find a command I want to alias, I echo it to my .bashrc like so:               [up button pressed to last command, then line edited so that it reads]     $echo "command-i-just-did" >> ~/.bashrc      There may be a better way to do this. But anyway, just now I overwrote the entire .rc file by using a single chevron. However, since the .bashrc is still current, it's still accepting my old aliases (for now of course). So is there a way to recover it?


Can a program detect it is running in a detached screen?

I am running an interactive curses program in a screen session on quite weak hardware. Most of the time, the screen is detached. Is there a way for this program to detect this situation, and basically stop painting on the screen?


"INIT: version 2.86 reloading" - cause and fix?

> INIT: version 2.86 reloading appears on screen. Encountered this error and it seems there is no other way to fix this other than rebooting the system.   * unable to ssh in,   * unable to login via console. Any other way to fix this issue without rebooting it?


join files with numbered index

I am trying this command:               join -a1 -11 file1 file2 > file3      file1 looks like:               1     2     3     4     5     6     7     8     9     10     11      file2:               1    lkj    klj    lkj     2    lkj    lkj    lkj     3     7    lkj    lkj    lkj     8     9     11    lkk    kll    lkk      The output skips the row numbered 11. While Googling I saw that `join` only understands alphabetical sorting but there must be a way to do this. My aim is to join five 60,000,000 line files for a genetic project. How can I do this? Are there other tools or options to `join` to make it work?


ESC-q doesn't work in tmux with zsh

The title says it all. I use `Esc``q` a lot (stashing the current line while I execute another command), and it works fine with Gnome Terminal 3.6.0 + zsh. However, if I start `tmux`, then it stops working: the cursor just moves one character to the left and stays there. `Alt``q` does not work either. I don't set `TERM` in .zshrc, in `.tmux.conf` I use: `set -g default-terminal "screen-256color"`.


Continuous use of mutt

I would like to use `mutt` continuously, allow me to explain what I mean with an example. My typical workflow is this:   * Open up `mutt`   * Compose a message   * Press `y` to confirm send action   * ... **wait!**   * Compose another message   * Press `y` to confirm send action   * ... **wait!** I am connected to my Gmail over IMAPS. The problem is that often I need to reply to many messages in sequence and the pattern above is obviously unacceptable because the program does not return control to me whilst it is trying to deliver the message in the background. My time is valuable and I can't be waiting for a machine to do its job after I expressed my intent (to send) to it already, can I? * * *   * Can I configure `mutt` so that it does the message delivery in the background, immediately returning control to me to compose more messages? * * * My current workaround to this is running `mutt` within a `tmux` session with multiple windows, all running `tmux` and switching to another window to compose the next message as the previous is being delivered. This is a bad kind of "hack", I say. My settings:   * smtp_url="smtps://robottinosino@smtp.googlemail.com:465/" * * *               # Gmail configuration     set  folder            =  "imaps://imap.googlemail.com:993"     set  spoolfile         =  "imaps://imap.googlemail.com:993/[Gmail]/All Mail"     set  postponed         =  "imaps://imap.googlemail.com:993/[Gmail]/Drafts"     # set  record          =  "imaps://imap.googlemail.com/[Gmail]/Sent Mail"     set  record            =  "/home/tinosino/Sent_Messages.txt"     set  realname          =  "Tino Sino"     set  imap_user         =  "robottinosino@gmail.com"     set  imap_pass         =  ""     set  smtp_url          =  "smtps://robottinosino@smtp.googlemail.com:465/"     set  smtp_pass         =  ""     set  from              =  "robottinosino@gmail.com"     set  sort              =  threads     set  editor            =  "vim"      * * * ### What I have tried already:   * I set `sendmail_wait = -1` but the delay in sending a message remains


Reading through a csv file

I have a file `Books.txt` which contains the names of books and the people who have borrowed it . BOOKXXXX is the name of the book and XXXX are digits. Here is an example.               BOOK2592,1,2,3,4,5,22     BOOK1234,3,4,5     BOOK0999,4,5,6,7     BOOK0666,10,33,4,5     BOOK2222,1,3,4,5,6,7,88,98,3      With this file I need to find out if a given account Number has borrowed the book. I was not able to think of any solution because I was wondering how to find out the number of times the book was borrowed?


Fix symbolic links after version change

Say I have a symbolic link to a file, which has its version in its name. (The file is actually a jar file) Now say, that the version changes, i.e the old file I linked to is deleted and a new one is generated with a different version in its name. How do I generate a new link with the new name pointing to the newly generated jar file and delete the old link in a bash script. What I have working this far is something like that:               cd $THE_FOLDER_OF_BROKEN_LINKS     find . -type l -exec test ! -e {} \; -print0 | xargs -0 -i readlink "{}" | sed -r "s#(.*/).*\.jar#\1#g"      Which gets me, for each of the broken links, a folder where the new jar file is located. What I tried doing next, is find the new jar files, like that:               cd $THE_FOLDER_OF_BROKEN_LINKS     find . -type l -exec test ! -e {} \; -print0 | xargs -0 -i find `readlink "{}" | sed -r "s#(.*/).*\.jar#\1#g"` -name "prefix*.jar"      Which should get me the new jars, and it does, but it works recursively, so I can't use it. I don't know if there's anything else matching this pattern in the recursive folders, all I know, that in this current folder there is only one jar matching the regex `prefix*.jar`, which is what I need to link to. After that I need to actually create the link, which I suppose is not hard depending on how to find this one file I'm looking for, because the filename can stay the same (i.e. no second argument needed for `ln`). But I have no idea how to delete the broken links without calling the initial find command again. Been at this problem for a while now, because I'm relatively new to Linux, but finally resorted to asking for help, because I really shouldn't spend that much time on such a trivial problem.


Emacs and Trac Integration

Is there a way to integrate Trac and Emacs? e.g. edit Wiki pages in org mode, edit and manage tickets from within emacs?