title: Query Firefox password database

text: Braiam said that Firefox stores the password data for login websites in `~/.mozilla/firefox/key3.db` and `~/.mozilla/firefox/signons.sqlite` files. These files can be read with some sqlite editor. I try to query for my username and password of a website (e.g. https://sourceforge.net/account/login.php) from the Firefox's database. I can't do it through Firefox, because my Firefox GUI is not working, and I am fairly new to and also interested in learning using databases to do the job.   1. what are the different roles of `key3.db` and `signons.sqlite`?   2. I searched on the internet, and is it correct that I should use `sqlite3` to open a database?              $ sqlite3 key3.db      SQLite version 3.7.9 2011-11-01 00:52:41     Enter ".help" for instructions     Enter SQL statements terminated with a ";"     sqlite> .tables     Error: file is encrypted or is not a database      I guess the reason of failure is that, in Firefox, I set up a master keyword to access the passwords it stores. How should I proceed to query the password of a given website? Btw, my OS is Ubuntu, and if it helps, here is the file type of `key3.db` :              $ file key3.db      key3.db: Berkeley DB 1.85 (Hash, version 2, native byte-order)        3. What shall I read and learn in order to query the password from a given website name?  Will reading http://www.sqlite.org/cli.html help? * * * To garethTheRed: I tried your command. ~~Not return anything however.~~ The output is abysmal:               $ sqlite3 signons.sqlite     SQLite version 3.7.9 2011-11-01 00:52:41     Enter ".help" for instructions     Enter SQL statements terminated with a ";"     sqlite> .tables     moz_deleted_logins  moz_disabledHosts   moz_logins             sqlite> select * from moz_logins;     ...     55|https://sourceforge.net||https://sourceforge.net|form_loginname|form_pw|MDIEEPgAAAAAAAAAAAAAAAAAAAEwF\AYIKoZIhvcNAwcECCPrVdOzWamBBAjPs0DI8FrUnQ==|MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECCnZved1LRQMBBBV\DtXpOvAp0TQHibFeX3NL|{16e782de-4c65-426f-81dc-ee0361816262}|1|1327675445094|1403706275829|1327675445094|\4     ...      Does Firefox encrypt passwords regardless of if there is a master key? If yes, can we decrypte them in command line (my firefox CLI may still work)? Alternatively, is it possible that Chrome browser can read and import the passwords stored by Firefox?


title: Point program without garbaging up alias (~/.bashrc)

text: What is the correct way to point to a program/script without passing the command through aliases in the bashrc? For example: I create a custom script _MyScript.sh_.   I wish to create a command that can be run globally from shell by typing `scripty`, which would point to my script ( _MyScript.sh_ ). Is there a way to accomplish this? (The only way I know is creating aliases) If there is a "more correct way" to do this I would appreciate knowing how.


title: wget internal buffer size

text: I'm constantly using `wget` to download many files over 1GB each. I'm getting concerned about how this may be straining my HDD. Can `wget`'s internal buffer size be modified so that it writes to my HDD less often? What about `curl`?


title: Run a program when start an activity

text: Is there a way to run a program when specific activity starts on KDE 4.8.9? PD.: KDE has a feature called Activity. It is designed for change your desktop settings. For example, KDE has some Activities by default like Desktop, Desktop Icons, Photos Activity, ... and each takes different Energy Saving Settings, wallpaper, ...


title: Installing Steam on Debian Wheezy

text: I downloaded the .deb file from the Steam website, but couldn't install it as it complained about having and "outdated" version of libc6. I look around and apparently I have to add jessie sources to my sources.list to make it work, and so I do. The package installs but itself is a front to install steam's dependencies. I run it, and instead of simply installing the three dependencies described (libgl1-mesa-dri:i386, libgl1-mesa-glx:i386 and libc6:i386), it instead wants to do all this:               The following packages were automatically installed and are no longer required:       blt cups-daemon cups-server-common dconf-cli empathy-common geoclue-2.0 gir1.2-gck-1 gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0       gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-notify-0.7 gnome-panel-data gnome-session-common gnome-themes-standard-data gstreamer1.0-nice       gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio hp-ppd libarchive13 libasound2-dev libassuan0 libavahi-client-dev       libavahi-common-dev libavcodec55 libavformat55 libbz2-1.0:i386 libcaca-dev libcamel-1.2-49 libcaribou-common libchromaprint0 libdb5.3:i386       libdbus-1-dev libdirectfb-dev libdirectfb-extra libdrm-dev libdrm-nouveau1a libebackend-1.2-7 libebook-1.2-14 libebook-contacts-1.2-0       libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23 libedataserver-1.2-18 libfluidsynth1 libfontembed1 libfreetype6-dev libgadu3       libgcr-base-3-1 libgd3 libgexiv2-2 libgl1-mesa-dev libglu1-mesa-dev libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-bad1.0-0       libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libibus-1.0-5 libical1 libinput0 libjpeg8-dev libjson0 liblzma5:i386 libmjpegutils-2.1-0       libmozjs-24-0 libmpdec2 libmpdec2:i386 libmpeg2encpp-2.1-0 libmpg123-0 libmplex2-2.1-0 libmx-common libncursesw5:i386 libnm-gtk-common       libopencv-core2.4 libopencv-flann2.4 libopencv-imgproc2.4 libopencv-ml2.4 libopencv-video2.4 libpackagekit-glib2-16 libpcre3-dev libpcrecpp0       libpng12-dev libpthread-stubs0 libpthread-stubs0-dev libpython3-stdlib libpython3-stdlib:i386 libpython3.4-minimal libpython3.4-minimal:i386       libpython3.4-stdlib libpython3.4-stdlib:i386 libqpdf13 libreadline6:i386 librtmp1 libsbc1 libslang2-dev libsqlite3-0:i386 libsrtp0       libssl1.0.0:i386 libtbb2 libtotem-plparser18 libtracker-sparql-1.0-0 libts-dev libwayland-cursor0 libwebp5 libx11-dev libx11-doc libx11-xcb-dev       libx264-142 libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-present-dev libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev       libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxkbcommon0       libxshmfence-dev libxxf86vm-dev mesa-common-dev pkg-config python-aptdaemon python-defer python-pkg-resources python3.4:i386       python3.4-minimal:i386 x11proto-core-dev x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev       x11proto-kb-dev x11proto-xext-dev x11proto-xf86vidmode-dev xorg-sgml-doctools xtrans-dev zlib1g-dev     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:       bzip2 colord colord-data cups-bsd cups-client cups-common cups-daemon cups-ppdc cups-server-common cupsddk dbus-x11 dconf-cli       dconf-gsettings-backend dconf-service empathy-common evince-common evolution-data-server-common folks-common fontconfig-config gcc-4.9-base       gcc-4.9-base:i386 geoclue-2.0 gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gck-1 gir1.2-gdesktopenums-3.0 gir1.2-glib-2.0       gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-notify-0.7 gir1.2-soup-2.4       gir1.2-telepathylogger-0.2 gir1.2-upowerglib-1.0 glib-networking glib-networking-common glib-networking-services gnome-desktop3-data       gnome-packagekit-data gnome-panel-data gnome-session-common gnome-shell-common gnome-themes-standard-data gsettings-desktop-schemas       gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio gvfs gvfs-bin gvfs-common gvfs-daemons gvfs-libs init-system-helpers       libarchive13 libassuan0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libaudit-common libaudit1 libavcodec55 libavformat55 libavutil53 libburn4       libbz2-1.0 libc6:i386 libc6-i686:i386 libcairo-perl libcairo2 libcamel-1.2-49 libcaribou-common libcolord2 libcolorhug2 libcups2 libcupscgi1       libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1 libdb5.3 libdbus-glib-1-2 libdconf1 libdjvulibre-text libdjvulibre21 libdrm-dev       libdrm-intel1 libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1 libdrm-radeon1:i386 libdrm2 libdrm2:i386 libebackend-1.2-7       libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23 libedataserver-1.2-18 libegl1-mesa       libegl1-mesa-drivers libelf1 libelf1:i386 libelfg0 libepoxy0 libevdev2 libexpat1 libexpat1:i386 libffi6 libffi6:i386 libfftw3-3 libfftw3-double3       libfftw3-long3 libfftw3-single3 libflac8 libfolks-telepathy25 libfolks25 libfontconfig1 libfontembed1 libgbm1 libgcc1 libgcc1:i386 libgck-1-0       libgcr-base-3-1 libgcrypt11 libgcrypt20 libgd3 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgee-0.8-2 libgeocode-glib0 libgexiv2-2       libgirepository-1.0-1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib-perl libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a       libgmp10 libgnomekbd-common libgnutls-deb0-28 libgomp1 libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-base1.0-0       libgstreamer1.0-0 libgtk-3-common libgutenprint2 libgweather-common libhogweed2 libhtml-parser-perl libibus-1.0-5 libical1 libicu52       libimobiledevice4 libinput0 libjavascriptcoregtk-3.0-0 libjson-c2 liblcms2-2 libllvm3.4 libllvm3.4:i386 liblocale-gettext-perl libmagickcore5       libmm-glib0 libmozjs-24-0 libmpdec2 libmx-common libncurses5 libncursesw5 libndp0 libnet-dbus-perl libnet-ssleay-perl libnettle4 libnl-3-200       libnl-genl-3-200 libnl-route-3-200 libnm-glib4 libnm-gtk-common libnm-util2 libopenjpeg5 libopenvg1-mesa libopus0 liborc-0.4-0 libp11-kit0       libpackagekit-glib2-16 libpam-systemd libparted2 libpciaccess0 libpciaccess0:i386 libpcre3 libpcre3-dev libpcrecpp0 libperl4-corelibs-perl       libperl5.18 libpixman-1-0 libplist2 libpoppler-glib8 libpoppler46 libproxy1 libpulse-mainloop-glib0 libpulse0 libpulsedsp libpurple0       libpython3-stdlib libpython3.4-minimal libpython3.4-stdlib libqpdf13 libreadline6 librtmp1 libsdl1.2debian libsecret-1-0 libsecret-common       libsocket-perl libsoundtouch0 libsoup2.4-1 libsqlite3-0 libssl1.0.0 libstdc++6 libstdc++6:i386 libswscale2 libsystemd-daemon0 libsystemd-id128-0       libsystemd-journal0 libsystemd-login0 libtasn1-6 libtelepathy-glib0 libtelepathy-logger3 libtext-charwidth-perl libtext-iconv-perl libtiff5       libtinfo5 libtinfo5:i386 libtotem-plparser18 libtracker-sparql-1.0-0 libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libudev1 libudisks2-0       libupower-glib2 libusbmuxd2 libuuid-perl libva1 libvpx1 libwacom-common libwacom2 libwayland-client0 libwayland-cursor0 libwayland-egl1-mesa       libwayland-server0 libwebp5 libx11-6 libx11-dev libx11-xcb-dev libx11-xcb1 libx264-142 libxatracker2 libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0       libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-present0 libxcb-randr0       libxcb-randr0-dev libxcb-render0 libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xf86dri0 libxcb-xfixes0       libxcb-xfixes0-dev libxcb-xv0 libxcb1 libxcb1-dev libxdamage-dev libxdamage1 libxfixes-dev libxfixes3 libxi6 libxkbcommon0 libxml-parser-perl       libxml2 libxshmfence-dev libxshmfence1 libxxf86vm-dev libxxf86vm1 libzeitgeist-2.0-0 mesa-common-dev mime-support nautilus-data network-manager       parted perl perl-base perl-modules perlmagick policykit-1 ppp printer-driver-c2esp pulseaudio pulseaudio-module-x11 pulseaudio-utils       python-aptdaemon python-gi python-gi-cairo systemd systemd-sysv udisks2 upower usbmuxd x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev       x11proto-gl-dev x11proto-xf86vidmode-dev xserver-common xserver-xephyr xserver-xorg-core xserver-xorg-input-evdev xserver-xorg-input-mouse       xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom xserver-xorg-video-all xserver-xorg-video-ati       xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga       xserver-xorg-video-modesetting xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome xserver-xorg-video-r128       xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx       xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware zlib1g zlib1g:i386 zlib1g-dev     Suggested packages:       bzip2-doc xpp cups-pdf lrzip glibc-doc:i386 locales:i386 libfont-freetype-perl libfftw3-bin libfftw3-dev rng-tools libgd-tools libglide3       libglide3:i386 gnutls-bin gphoto2 gtkam grilo-plugins-0.2 gstreamer-codec-install gnome-codec-install gstreamer1.0-tools gutenprint-locales       libdata-dump-perl libusbmuxd-tools liblcms2-utils opus-tools libparted-dev libparted-i18n libxcb-doc parted-doc perl-doc libterm-readline-gnu-perl       libterm-readline-perl-perl make libb-lint-perl libcpanplus-dist-build-perl libcpanplus-perl libfile-checktree-perl liblog-message-simple-perl       liblog-message-perl libobject-accessor-perl imagemagick-doc pavumeter pavucontrol paman paprefs systemd-ui xfsprogs reiserfsprogs exfat-utils       btrfs-tools mdadm gpointing-device-settings touchfreeze xinput firmware-linux     Recommended packages:       cups-browsed gstreamer1.0-x qpdf va-driver-all va-driver rename libarchive-extract-perl libmodule-pluggable-perl libpod-latex-perl libterm-ui-perl       libtext-soundex-perl gdisk xserver-xorg-video-qxl     The following packages will be REMOVED:       aisleriot alacarte aptdaemon baobab bluez-cups brasero caribou caribou-antler cheese cups dconf-tools empathy eog evince evolution       evolution-data-server evolution-plugins evolution-webcal file-roller gcalctool gcr gdebi gdm3 gedit gedit-plugins gir1.2-caribou-1.0       gir1.2-clutter-1.0 gir1.2-clutter-gst-1.0 gir1.2-evince-3.0 gir1.2-gcr-3 gir1.2-gkbd-3.0 gir1.2-gnomebluetooth-1.0 gir1.2-goa-1.0 gir1.2-gtk-3.0       gir1.2-gtkclutter-1.0 gir1.2-gtksource-3.0 gir1.2-gucharmap-2.90 gir1.2-mutter-3.0 gir1.2-panelapplet-4.0 gir1.2-peas-1.0 gir1.2-rb-3.0       gir1.2-totem-1.0 gir1.2-vte-2.90 gir1.2-webkit-3.0 gir1.2-wnck-3.0 gkbd-capplet glchess glines gnect gnibbles gnobots2 gnome gnome-applets       gnome-bluetooth gnome-color-manager gnome-contacts gnome-control-center gnome-core gnome-dictionary gnome-disk-utility gnome-documents       gnome-font-viewer gnome-games gnome-icon-theme gnome-icon-theme-extras gnome-icon-theme-symbolic gnome-keyring gnome-media gnome-nettool       gnome-online-accounts gnome-orca gnome-packagekit gnome-panel gnome-power-manager gnome-screensaver gnome-screenshot gnome-session       gnome-session-bin gnome-session-fallback gnome-settings-daemon gnome-shell gnome-shell-extensions gnome-sudoku gnome-sushi gnome-system-log       gnome-system-monitor gnome-terminal gnome-themes-standard gnome-tweak-tool gnome-user-guide gnome-user-share gnomine gnotravex gnotski gtali       gucharmap gvfs-backends hpijs hplip iagno idle-python3.2 idle3 libaudit0 libavahi-ui-gtk3-0 libbrasero-media3-1 libcanberra-gtk3-0       libcanberra-gtk3-module libcaribou-gtk3-module libcaribou0 libchamplain-0.12-0 libchamplain-gtk-0.12-0 libcheese-gtk21 libcheese3 libclutter-1.0-0       libclutter-gst-1.0-0 libclutter-gtk-1.0-0 libclutter-imcontext-0.1-0 libclutter-imcontext-0.1-bin libcluttergesture-0.0.2-0 libcupsdriver1       libedata-book-1.2-13 libedataserverui-3.0-1 libepc-ui-1.0-3 libevdocument3-4 libevolution libevview3-3 libfolks-eds25 libgail-3-0 libgcr-3-1       libgdict-1.0-6 libgdu-gtk0 libglib2.0-dev libgnome-bluetooth10 libgnome-desktop-3-2 libgnome-media-profiles-3.0-0 libgnomekbd7 libgoa-1.0-0       libgtk-3-0 libgtk-3-bin libgtk-vnc-2.0-0 libgtk2-perl libgtkhtml-4.0-0 libgtkhtml-4.0-common libgtkhtml-editor-4.0-0 libgtkmm-3.0-1       libgtksourceview-3.0-0 libgucharmap-2-90-7 libgweather-3-0 libhpmud0 libmutter0 libmx-1.0-2 libnautilus-extension1a libnm-gtk0 libpanel-applet-4-0       libpango-perl libpeas-1.0-0 libperl5.14 libpulse-dev librhythmbox-core6 libsane-hpaio libsdl1.2-dev libseed-gtk3-0 libsnmp15 libtotem0       libunique-3.0-0 libvte-2.90-9 libwebkitgtk-3.0-0 libwnck-3-0 libyelp0 lightsoff mahjongg metacity mousetweaks nautilus nautilus-sendto       nautilus-sendto-empathy network-manager-gnome notification-daemon policykit-1-gnome printer-driver-gutenprint printer-driver-hpcups       printer-driver-hpijs printer-driver-postscript-hp printer-driver-splix python-aptdaemon.gtk3widgets python3 python3-tk quadrapassel rhythmbox       rhythmbox-plugin-cdrecorder rhythmbox-plugins rygel-preferences seahorse shotwell simple-scan software-properties-gtk sound-juicer steam-launcher       swell-foop task-gnome-desktop task-print-server totem totem-plugins tracker-gui transmission-gtk vinagre vino xdg-user-dirs-gtk       xserver-xorg-video-apm xserver-xorg-video-ark xserver-xorg-video-chips xserver-xorg-video-i128 xserver-xorg-video-rendition xserver-xorg-video-s3       xserver-xorg-video-s3virge xserver-xorg-video-sis xserver-xorg-video-tseng xserver-xorg-video-voodoo yelp zenity     The following NEW packages will be installed:       colord-data cups-daemon cups-server-common cupsddk dconf-cli gcc-4.9-base gcc-4.9-base:i386 geoclue-2.0 gir1.2-gst-plugins-base-1.0       gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-notify-0.7 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio       init-system-helpers libarchive13 libassuan0 libaudit-common libaudit1 libavcodec55 libavformat55 libavutil53 libc6:i386 libc6-i686:i386       libcamel-1.2-49 libcolord2 libcolorhug2 libdb5.3 libdconf1 libdrm-dev libdrm-intel1:i386 libdrm-nouveau2 libdrm-nouveau2:i386 libdrm-radeon1:i386       libdrm2:i386 libebackend-1.2-7 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-16 libedata-book-1.2-20 libedata-cal-1.2-23       libedataserver-1.2-18 libegl1-mesa libegl1-mesa-drivers libelf1:i386 libelfg0 libepoxy0 libevdev2 libexpat1:i386 libffi6 libffi6:i386       libfftw3-double3 libfftw3-long3 libfftw3-single3 libfontembed1 libgbm1 libgcc1:i386 libgcr-base-3-1 libgcrypt20 libgd3 libgee-0.8-2 libgexiv2-2       libgl1-mesa-dri:i386 libgnutls-deb0-28 libgphoto2-6 libgphoto2-port10 libgrilo-0.2-1 libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libhogweed2       libibus-1.0-5 libical1 libicu52 libimobiledevice4 libinput0 libjson-c2 libllvm3.4 libllvm3.4:i386 libmm-glib0 libmozjs-24-0 libmpdec2 libndp0       libopenjpeg5 libopenvg1-mesa libpackagekit-glib2-16 libpam-systemd libparted2 libpciaccess0:i386 libperl4-corelibs-perl libperl5.18 libplist2       libpoppler46 libproxy1 libpulsedsp libpython3-stdlib libpython3.4-minimal libpython3.4-stdlib libqpdf13 librtmp1 libsecret-1-0 libsecret-common       libstdc++6:i386 libsystemd-id128-0 libsystemd-journal0 libtasn1-6 libtelepathy-logger3 libtiff5 libtinfo5:i386 libtotem-plparser18       libtracker-sparql-1.0-0 libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libudev1 libudisks2-0 libupower-glib2 libusbmuxd2 libwayland-client0       libwayland-cursor0 libwayland-egl1-mesa libwayland-server0 libwebp5 libx11-xcb-dev libx264-142 libxatracker2 libxcb-dri2-0-dev libxcb-dri3-0       libxcb-dri3-dev libxcb-glx0-dev libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-present-dev libxcb-present0 libxcb-randr0 libxcb-randr0-dev       libxcb-render0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-sync1 libxcb-xf86dri0 libxcb-xfixes0 libxcb-xfixes0-dev libxcb-xv0 libxdamage-dev       libxfixes-dev libxkbcommon0 libxshmfence-dev libxshmfence1 libxxf86vm-dev libzeitgeist-2.0-0 parted systemd systemd-sysv udisks2       x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev x11proto-xf86vidmode-dev xserver-xorg-video-modesetting zlib1g:i386     The following packages will be upgraded:       bzip2 colord cups-bsd cups-client cups-common cups-ppdc dbus-x11 dconf-gsettings-backend dconf-service empathy-common evince-common       evolution-data-server-common folks-common fontconfig-config gir1.2-atspi-2.0 gir1.2-freedesktop gir1.2-gck-1 gir1.2-gdesktopenums-3.0       gir1.2-glib-2.0 gir1.2-javascriptcoregtk-3.0 gir1.2-soup-2.4 gir1.2-telepathylogger-0.2 gir1.2-upowerglib-1.0 glib-networking       glib-networking-common glib-networking-services gnome-desktop3-data gnome-packagekit-data gnome-panel-data gnome-session-common gnome-shell-common       gnome-themes-standard-data gsettings-desktop-schemas gvfs gvfs-bin gvfs-common gvfs-daemons gvfs-libs libatk1.0-0 libatk1.0-data libatspi2.0-0       libburn4 libbz2-1.0 libcairo-perl libcairo2 libcaribou-common libcups2 libcupscgi1 libcupsfilters1 libcupsimage2 libcupsmime1 libcupsppdc1       libdbus-glib-1-2 libdjvulibre-text libdjvulibre21 libdrm-intel1 libdrm-radeon1 libdrm2 libelf1 libexpat1 libfftw3-3 libflac8 libfolks-telepathy25       libfolks25 libfontconfig1 libgcc1 libgck-1-0 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgeocode-glib0 libgirepository-1.0-1       libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libglib-perl libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a libgmp10       libgnomekbd-common libgomp1 libgtk-3-common libgutenprint2 libgweather-common libhtml-parser-perl libjavascriptcoregtk-3.0-0 liblcms2-2       liblocale-gettext-perl libmagickcore5 libmx-common libncurses5 libncursesw5 libnet-dbus-perl libnet-ssleay-perl libnettle4 libnl-3-200       libnl-genl-3-200 libnl-route-3-200 libnm-glib4 libnm-gtk-common libnm-util2 libopus0 liborc-0.4-0 libp11-kit0 libpciaccess0 libpcre3 libpcre3-dev       libpcrecpp0 libpixman-1-0 libpoppler-glib8 libpulse-mainloop-glib0 libpulse0 libpurple0 libreadline6 libsdl1.2debian libsocket-perl libsoundtouch0       libsoup2.4-1 libsqlite3-0 libssl1.0.0 libstdc++6 libswscale2 libsystemd-daemon0 libsystemd-login0 libtelepathy-glib0 libtext-charwidth-perl       libtext-iconv-perl libtinfo5 libuuid-perl libva1 libvpx1 libwacom-common libwacom2 libx11-6 libx11-dev libx11-xcb1 libxcb-dri2-0 libxcb-glx0       libxcb-render0 libxcb-shape0 libxcb1 libxcb1-dev libxdamage1 libxfixes3 libxi6 libxml-parser-perl libxml2 libxxf86vm1 mesa-common-dev mime-support       nautilus-data network-manager perl perl-base perl-modules perlmagick policykit-1 ppp printer-driver-c2esp pulseaudio pulseaudio-module-x11       pulseaudio-utils python-aptdaemon python-gi python-gi-cairo upower usbmuxd xserver-common xserver-xephyr xserver-xorg-core       xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-synaptics xserver-xorg-input-vmmouse xserver-xorg-input-wacom       xserver-xorg-video-all xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev xserver-xorg-video-intel       xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-nouveau xserver-xorg-video-openchrome       xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb       xserver-xorg-video-tdfx xserver-xorg-video-trident xserver-xorg-video-vesa xserver-xorg-video-vmware zlib1g zlib1g-dev     198 upgraded, 162 newly installed, 220 to remove and 916 not upgraded.     Need to get 163 MB of archives.     After this operation, 167 MB disk space will be freed.      I assume this is it wanting to upgrade to all the new Jessie stuff. I take it just letting this run will break my system? Is there any way to just install what Steam needs, or to go about installing steam some other way? (I got it working before somehow, and this is basically a fresh debian install).


title: How to find and empty some directories

text: I'd like to find and delete the contents while leaving the directories themselves intact. The following               find /data1 -name MyTargetDir -type d -exec rm -rv {} \;      and               find /data1 -name MyTargetDir -type d | xargs -r rm -vfr      delete all files and directories under 'MyTargetDir' and 'MyTargetDir' as well. I'd like to leave the directory, but empty.


title: How to copy with SCP between two servers using key auth?

text: I can log in via SSH using key authentication to SERVER1 and SERVER2. However, I can't copy files between the two servers. Why? How can I copy between them? (the data that I have to copy is bigger than my notebooks HDD) My notebook runs Ubuntu 10.04 LTS and the two servers are AIX 5300-10-02-0943. My `~/.ssh/known_hosts` file on my notebook contains the public keys for these two servers. I use `tsocks` because I have to use an SSH tunnel to reach these two servers. The two servers can ping each other.               [USER@NOTEBOOK ~] tsocks scp -v -i /home/USER/.ssh/id_rsa -p -r root@SERVER1:/PATH/TO/DIR root@SERVER2:/PATH/TO/DIR     Executing: /usr/bin/ssh '-v' '-x' '-oClearAllForwardings yes' '-n' '-l' 'root' 'SERVER1' 'scp -v -r -p' '/PATH/TO/DIR' 'root@SERVER2:/PATH/TO/DIR'     OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug1: Connecting to SERVER1 [SERVER1] port 22.     debug1: Connection established.     debug1: identity file /home/USER/.ssh/identity type -1     debug1: identity file /home/USER/.ssh/id_rsa type 1     debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-1024     debug1: Checking blacklist file /etc/ssh/blacklist.RSA-1024     debug1: identity file /home/USER/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2p1+sas     debug1: match: OpenSSH_5.2p1+sas pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Host 'SERVER1' is known and matches the RSA host key.     debug1: Found key in /home/USER/.ssh/known_hosts:59     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,password     debug1: Next authentication method: publickey     debug1: Offering public key: /home/USER/.ssh/id_rsa     debug1: Server accepts key: pkalg ssh-rsa blen 151     debug1: Authentication succeeded (publickey).     debug1: channel 0: new [client-session]     debug1: Requesting no-more-sessions@openssh.com     debug1: Entering interactive session.     debug1: Sending environment.     debug1: Sending env LANG = en_US.utf8     debug1: Sending command: scp -v -r -p /PATH/TO/DIR root@SERVER2:/PATH/TO/DIR     Executing: program /applications/ssh/5.20.15.0/bin/ssh host SERVER2, user root, command scp -v -r -p -t /PATH/TO/DIR     OpenSSH_5.2p1+sas, OpenSSL 0.9.8k 25 Mar 2009     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Connecting to SERVER2 [SERVER2] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/identity type -1     debug1: identity file /root/.ssh/id_rsa type -1     debug1: identity file /root/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2p1+sas     debug1: match: OpenSSH_5.2p1+sas pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.2     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-ctr hmac-md5 none     debug1: kex: client->server aes128-ctr hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: read_passphrase: can't open /dev/tty: No such device or address     Host key verification failed.     lost connection     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: channel 0: free: client-session, nchannels 1     Transferred: sent 1984, received 3848 bytes, in 0.3 seconds     Bytes per second: sent 6903.4, received 13389.2     debug1: Exit status 1               [USER@NOTEBOOK ~] tsocks scp -i /home/USER/.ssh/id_rsa -p -r root@SERVER1:/PATH/TO/DIR root@SERVER2:/PATH/TO/DIR     Host key verification failed.     lost connection     [USER@NOTEBOOK ~]


title: Why do Mono applications only start from their own directory?

text: If I want to run the application `monodevelop`, I need to chdir to `/usr/lib/monodevelop/Bin` and then execute `./MonoDevelop.exe`. This is the same for all other Mono applications such as `banshee`, `tomboy`, etc. If I attempt to run the Mono applications from another location by simply running `monodevelop`, or even from their own directory, I get _TypeInitializationExceptions_ like this: > behrooz@behrooz:/usr/lib/monodevelop/bin$ monodevelop   >  FATAL ERROR [2012-05-04 11:24:39Z]: MonoDevelop failed to start. Some   >  of the assemblies required to run MonoDevelop (for example gtk-sharp,   >  gnome-sharp or gtkhtml-sharp) may not be properly installed in the   >  GAC. System.TypeInitializationException: An exception was thrown by   >  the type initializer for Gtk.Application --->   >  System.EntryPointNotFoundException: glibsharp_g_thread_supported at   >  (wrapper managed-to-native) GLib.Thread:glibsharp_g_thread_supported   >  () at GLib.Thread.get_Supported () [0x00000] in :0   >  at Gtk.Application..cctor () [0x00000] in :0 ---   >  End of inner exception stack trace --- at   >  MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions   >  options) [0x0007e] in   > > /home/behrooz/Desktop/Monodevelop/monodevelop-2.8.6.5/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:95   >  at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x0004f] in   > > /home/behrooz/Desktop/Monodevelop/monodevelop-2.8.6.5/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:503 Why is that? I have tried reinstalling all Mono, Wine, GTK, Glib, X, Gnome packages. > apt-get --purge --reinstall install $(dpkg --get-selections| grep mono |grep > install |grep -v deinstall |awk'{print $1}') I also tried starce on "open" and got nothing by myself System Configuration:   - Debian 6.0-updates 64 bit   - Kernel 3.2.0-2, 3.2.0-1, 3.1 and 3 EDIT: not a kernel thing - Gnome 3.4 EDIT:but a gnome thing - Mono 2.10.5   TLS: __thread   SIGSEGV: altstack   Notifications: epoll   Architecture: amd64   Disabled: none   Misc: softdebug   LLVM: supported, not enabled.   GC: Included Boehm (with typed GC and Parallel Mark) update: with upgrading to the new monodevelop 3.0.2 and latest mono, I can run monodevelop with command "monodevelop" in terminal,no chdir.but gnome-shell cannot run it. Finally found it:   as root:                cd /usr/local/      find | grep mono|xargs rm -rf      # Use with caution/some applications may get messed up(stellarium has MONOchrome images...)


title: Why can't ld find this library?

text: I'm not very knowledgeable on this topic, and therefore can't figure out why the following command does not work:                $ gfortran -o dsimpletest -O  dsimpletest.o ../lib/libdmumps.a \       ../lib/libmumps_common.a  -L/usr -lparmetis -lmetis -L../PORD/lib/ \      -lpord -L/home/eiser/src/scotch_5.1.12_esmumps/lib -lptesmumps -lptscotch \      -lptscotcherr /opt/scalapack/lib/libscalapack.a   -L/usr/lib/openmpi/ \       -lmpi -L/opt/scalapack/lib/librefblas.a -lrefblas -lpthread      /usr/bin/ld: cannot find -lrefblas      collect2: ld returned 1 exit status      This happens when compiling the mumps library. The above command is executed by make. I've got the librefblas.a in the correct path:               $ ls /opt/scalapack/lib/ -l     total 20728     -rw-r--r-- 1 root root   619584 May  3 14:56 librefblas.a     -rw-r--r-- 1 root root  9828686 May  3 14:59 libreflapack.a     -rw-r--r-- 1 root root 10113810 May  3 15:06 libscalapack.a     -rw-r--r-- 1 root root   653924 May  3 14:59 libtmg.a      _Question 1:_ I thought the `-L` switch of `ld` takes directories, why does it refer to the file directly here? If I remove the librefblas.a from the -L argument, I get a lot of "undefined reference" errors. _Question 2:_ `-l` should imply looking for `.a` and then looking for `.so`, if I recall correctly. Is it a problem that I don't have the `.so` file? I tried to find out by using `gfortran -v ...`, but this didn't help me debugging it.


title: How to get an specific amount of lines in the console with less?

text: Can I get the specified number lines at a time by using the less command? I want just ex. show 20 lines even if my screen allows more.


title: What happens if I use vi on large files?

text: Though we were instructed not to, a colleague of mine used vi to view a large text file (server.log 3.5 GB). This filled up /var/tmp and caused some problems on the server. What caused this? Why shouldn't we use vi for large files?


title: Unable to move files with SFTP

text: I'm trying to move files from one location to another on the remote server using sftp below:               for i in a b c d     do     sftp $REMUSR <<EOM>>$OUT 2>&1     rename $SOURDIR/sample_${i}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz $REMDIR     quit     EOM     :     :     done      But I get the message: > Couldn't rename file > "/source/sample_a_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz" to > "/destin/": No such file or directory Though this file exists under the `/source` directory which I've verified:               $ ls -l sample_a_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].gz     -rw-r--r--  1 prd admin 112 May 23 09:16 sample_a_20140330.gz


title: Can't insert spaces in code editors

text: Since i recently installed CodeBlocks, I can't insert spaces in codeblocks, codelite or mysql-workbench editors. When i press space the editor interprets it as a completion key unless there is no word to complete. The only way to insert a blank space is to press "Supper+Space". I tried to remove CodeBlocks and CodeLite but the problem persists in Mysql Workbench. Configuration : uname -a :               Linux slxpc 3.2.0-57-generic #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      cat /proc/version               Linux version 3.2.0-57-generic (buildd@toyol) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #87-Ubuntu SMP Tue Nov 12 21:35:10 UTC 2013      mysql-workbench --version               MySQL Workbench CE (GPL) 6.0.8 11354  build 833      CodeBlocks version : 10.05 **FYI** : I don't have this problem in geany and leafpad.


title: What is a pager?

text: I saw "pager" in several places: > `less` is a terminal pager program on Unix > > option `-P` for `man` Specify which output pager to use. What is a pager? How is it related to and different from a terminal? Thanks.


title: How can average run queue length be 1 but load average is almost zero

text: (I originally posted this on Stack Overflow - advised to move it to here). On fedora 17 when i run the sar command to view the load average activity it almost always shows a run queue length of 1 even though the system is idle and the load averages are practically zero. My understanding of run queue length and how it relates to linux load average would suggest that if the run queue length is truly 1 on average over a period of time then for my quad core system the load average should be ~25% load average i.e. in my case read around the 1.00 mark:               $ sar -q 30 60     Linux 3.9.10-100.fc17.i686 (blah)   22/05/14    _i686_  (4 CPU)          16:29:10      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked     16:29:40            1       547      0.02      0.07      0.57         0     16:30:10            1       548      0.09      0.08      0.56         0     16:30:40            1       547      0.05      0.07      0.54         0     16:31:10            1       547      0.03      0.06      0.52         0     16:31:40            0       547      0.02      0.06      0.51         0     16:32:10            1       547      0.01      0.05      0.49         0     16:32:40            1       547      0.13      0.08      0.49         0     16:33:10            1       547      0.08      0.07      0.47         0     16:33:40            1       547      0.05      0.07      0.46         0      If i then poll often for runnable tasks i very occasionally see the odd process pop up (i do this with ps r -A | grep -v 'ps r -A'). I would have expected to see one process pop up regularly to be in line with the sar output. Then if i kick of a single threaded process that consumes as much CPU as it can the run queue size immediately jumps to 2 (which is to be expected in the circumstances) but strangely after a while the run queue drops back to 1 again?               Linux 3.9.10-100.fc17.i686 (blah)   22/05/14    _i686_  (4 CPU)          16:32:40      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15   blocked     16:33:10            1       547      0.08      0.07      0.47         0     16:33:40            1       547      0.05      0.07      0.46         0          START SCRIPT          16:34:10            2       548      0.11      0.08      0.45         0     16:34:40            2       548      0.51      0.18      0.47         0     16:35:10            2       548      0.70      0.26      0.49         0     16:35:40            2       548      0.82      0.33      0.50         0     16:36:10            2       548      0.89      0.39      0.52         0     16:36:40            2       548      0.93      0.45      0.53         0     16:37:10            2       548      0.96      0.50      0.55         0     16:37:40            2       548      1.04      0.57      0.57         0     16:38:10            2       548      1.02      0.61      0.58         0     16:38:40            2       548      1.01      0.64      0.60         0     16:39:10            2       548      1.09      0.70      0.61         0     16:39:40            2       548      1.05      0.72      0.63         0     16:40:10            3       550      1.11      0.77      0.64         0     16:40:40            3       549      1.06      0.79      0.65         0     16:41:10            3       549      1.04      0.81      0.67         0     16:41:40            3       549      1.02      0.83      0.68         0     16:42:10            2       549      1.01      0.84      0.69         0     16:42:40            2       549      1.01      0.86      0.70         0     16:43:10            1       549      1.07      0.89      0.71         0     16:43:40            1       549      1.04      0.90      0.72         0     16:44:10            1       549      1.03      0.91      0.73         0     16:44:40            1       549      1.02      0.92      0.74         0     16:45:10            1       548      1.01      0.93      0.75         0     16:45:40            1       548      1.01      0.93      0.75         0     16:46:10            1       548      1.00      0.94      0.76         0     16:46:40            1       548      1.00      0.94      0.77         0     16:47:10            1       548      1.00      0.95      0.78         0     16:47:40            1       548      1.00      0.96      0.78         0     16:48:10            1       548      1.00      0.96      0.79         0      Can anyone explain what is going on here? The only explanation i can think of is that there is some special system task that can utilize the CPU if nothing else is but:   1. Is not included in the load average calculations and    2. Will give up its CPU time if a process does come along that needs it OR When the sar command samples the run queue it sees itself, but then this would not explain why the run queue eventually remains at one with the cpu load script running? OR I misunderstand the load average / run queue concept. Any suggestions much appreciated! UPDATE: So i tried again on a different machine with the same version of fedora and sar etc. This time i am seeing a consistent run queue length of 0 when the system is idle. Also tried on a centos 5.7 machine, again, run queue length is consistently 0 when idle. So presumably sar doesn't instantaneously see itself in the run queue. Still at a loss to explain why this machine reports ~0 for load average yet consistently measures 1 for run queue length.


title: iptables blocking email from my wordpress site

text: I cant seem to send email from my Wordpress site. Here is what my iptables script looks like. Ports 25 and 110 are commented but even uncommented the send email does not work.               #!/bin/bash     # A Linux Shell Script with common rules for IPTABLES Firewall.          set -x          # flush existing set of rules     iptables --flush          # as a temporary measure accept everything from every port     iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT          # Save to disk and restart firewall service     service iptables save     service iptables restart          # enable unlimited traffic on the loopback (127.0.0.1) in order to provide access from the localhost     iptables -A INPUT -i lo -j ACCEPT     iptables -A OUTPUT -o lo -j ACCEPT          # enable both ICMP and STATE     iptables -A INPUT -p icmp --icmp-type any -j ACCEPT     iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT          # open both the domain and SSH ports     iptables -A INPUT -p tcp --dport 53 -j ACCEPT     iptables -A INPUT -p udp --dport 53 -j ACCEPT     iptables -A INPUT -p tcp -m tcp --dport 2134 -j ACCEPT          # allow HTTP on ports 80 and 143     iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT     iptables -A INPUT -p tcp --dport 80 -j ACCEPT     iptables -A OUTPUT -p tcp --dport 143 -j ACCEPT     iptables -A INPUT -p tcp --dport 143 -j ACCEPT          # allow FTP on ports 20/21     iptables -A OUTPUT -p tcp --dport 20:21 -j ACCEPT     iptables -A INPUT -p tcp --dport 20:21 -j ACCEPT          # allow SMTP and POP3 on ports 25 and 110     #iptables -I INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     #iptables -A INPUT -p tcp --dport 25 -j ACCEPT     #iptables -A OUTPUT -p tcp --dport 25 -j ACCEPT     #iptables -A INPUT -p tcp --dport 110 -j ACCEPT     #iptables -A OUTPUT -p tcp --dport 110 -j ACCEPT          # allow NTP on port 123     iptables -A OUTPUT -p udp --dport 123 -j ACCEPT          # lock it down and deny unwanted access     iptables -P INPUT DROP && iptables -P FORWARD DROP && iptables -P OUTPUT ACCEPT          # Save to disk and restart firewall service     service iptables save     service iptables restart          # list rules     iptables -n -L -v --line-numbers


title: How to invoke root privileges from my custom app?

text: In a GUI-environment, I want to be able to ask the user for the root/sudo password and then execute an app that requires root privileges from within my app. As an example, say I want to run an editor to edit `/etc/fstab`, I need to start the editor via `exec()` or something with root privileges... how do I do this? **Note:** gksu, gksudo is not an option - may not be available/installed


title: Why use `chmod 644` instead of `chmod u=rw,go=r,...`?

text: I've been working on *nix for a few years now, and one of the things I just can't get used to is octal permissions in code. Is there some other reason than line length to prefer `chmod 644 ...` over `chmod u=rw,go=r ...`? PS: _I'm not looking for an explanation of octal permissions._ I know how they work, and it's well explained in the manual. I'm asking why octal seems to be preferred over the more human-readable form.


title: Deleting a samba user: pbdedit vs. smbpasswd, what's the difference?

text: What is the difference between               $ pdbedit -x      and               $ smbpasswd -x      to delete samba users?


title: Can I use `apt-get` to upgrade to the latest version of Nagios?

text: At the time of this writing the latest version of Nagios is 3.3.1. I am running Ubuntu 10.04 and have used `apt-get update; apt-get install nagios3` to end up with version 3.2.0. I know there are a lot of instructions out there for manually compiling and installing the latest version of Nagios, but is there a way that I can have use `apt-get` to do it - perhaps editing the `/etc/apt/sources.list` file or something like that? ### Update It's been a little while since I asked this question, now I'm using Ubuntu 12.04 instead of 10.04 but I'm disappointed to report that an older version of Nagios (3.2.3) is loaded on the system instead of the current release (3.4.1) if you use the `apt-get` install method. I've opened a bounty hoping for more information. Please see the notes below in the bounty block.


title: Mac OS X LDAP query via dscl yields different results for same user with same datasource

text: Where is the `NFSHomeDirectory` attribute stored for a Mac user who authenticates via LDAP? It doesn't seem to be in the LDAP database on the backend so I assume Open Directory is involved. I have 2 servers, one is 10.5.8 and one is 10.7. Each is an Open Directory Master. We also have Sun LDAP which is the authoritative LDAP for our entire environment. When I do `dscl /LDAPv3/our.ldap.server read /Users/ouruser` I get a different result for the `NFSHomeDirectory` attribute on the two servers, but I'm querying the same LDAP server in both instances. How could this be? What am I not understanding? I assume the attributes are all stored in LDAP since that is what I'm querying. Could it be caching? ### Some history The newer server was created by cloning the old one with Carbon Copy Cloner and then updating it. Pinging the LDAP server results in the same IP on both machines.


title: Obtain exclusive read/write lock on a file for atomic updates

text: I want to have a file that is used as a counter. User A will write and increment this number, while User B requests to read the file. Is it possible that User A can lock this file so no one can read or write to it until User A's write is finished? I've looked into `flock` but can't seem to get it to work as I expect it.               flock -x -w 5 /dev/shm/counter.txt echo "4" >  /dev/shm/counter.txt && sleep 5      If there's a more appropriate way to get this atomic-like incrementing file that'd be great to hear too! My goal is:               LOCK counter.txt; write to counter.txt;      while at the same time               Read counter.txt; realize it's locked so wait until that lock is finished.


title: Navigating the CLI: Go back N words

text: I'm a Vim user, so I'm learning Emacs commands for use in the Bash CLI. I know that on _my_ systems I can use Vim-keybindings in Bash but I'd like to learn how to use it effectively in its default configuration. First order of business: Moving around. Let us assume that I've got the following on the CLI:               $ mv some_long_file_name.txt some_long_file_name_with_slight_change.txt      I'm at the end of the line and I'd like to go back 4 words. In Emacs one would `Ctrl`+`U`, `4`, `Alt`+`B` however on the Bash CLI `Ctrl`+`U` erases to the beginning of the line. How to perform the motion, then? Add auxiliary question, if I may? Assuming that I had successfully completed a move command and I'd like to do it again. How might I do that? So if I contorted my fingers on 5 keypresses to move back 4 words, how might I move back another 4 words? Note that I am interested in learning how to use the default configuration. I don't want to configure Zsh, Vim keybindings, or `.bash_profile`.


title: How to force ALSA output as single-channel?

text: My speakers are broken and play at different loudness from time to time. This means that the off-center parts of music sound wrong. How can I force all sound to be centered, so that the two speakers have the same output? I'm using ALSA.


title: How to check a particular directory is mounted?

text: How to check a particular directory is mounted on the Linux machine. For instance there is a folder named test, I want to check if it is mounted or not.


title: How can I have more than one possibility in a script's shebang line?

text: I'm in a bit of an interesting situation where I have a Python script that can theoretically be run by a variety of users with a variety of environments (and PATHs) and on a variety of Linux systems. I want this script to be executable on as many of these as possible without artificial restrictions. Here are some known setups:   * Python 2.6 is the system Python version, so python, python2, and python2.6 all exist in /usr/bin (and are equivalent).   * Python 2.6 is the system Python version, as above, but Python 2.7 is installed alongside it as python2.7.   * Python 2.4 is the system Python version, which my script does not support. In /usr/bin we have python, python2, and python2.4 which are equivalent, and python2.5, which the script supports. I want to run the same executable python script on all three of these. It would be nice if it tried to use /usr/bin/python2.7 first, if it exists, then fall back to /usr/bin/python2.6, then fall back to /usr/bin/python2.5, then simply error out if none of those were present. I'm not too hung up on it using the most recent 2.x possible, though, as long as it's able to find one of the correct interpreters if present. My first inclination was to change the shebang line from:               #!/usr/bin/python      to               #!/usr/bin/python2.[5-7]      since this works fine in bash. But running the script gives:               /usr/bin/python2.[5-7]: bad interpreter: No such file or directory      Okay, so I try the following, which also works in bash:               #!/bin/bash -c /usr/bin/python2.[5-7]      But again, this fails with:               /bin/bash: - : invalid option      Okay, obviously I could just write a separate shell script that finds the correct interpreter and runs the python script using whatever interpreter it found. I'd just find it a hassle to distribute two files where one should suffice as long as it's run with the most up-to-date python 2 interpreter installed. Asking people to invoke the interpreter explicitly (e.g., `$ python2.5 script.py`) is not an option. Relying on the user's PATH being set up a certain way is also not an option. ## Edit: Version checking within the Python script is **not** going to work since I'm using the "with" statement which exists as of Python 2.6 (and can be used in 2.5 with `from __future__ import with_statement`). This causes the script to fail immediately with a user-unfriendly SyntaxError, and prevents me from ever having an opportunity to check the version first and emit an appropriate error. **Example:** (try this with a Python interpreter less than 2.6)               #!/usr/bin/env python          import sys          print "You'll never see this!"     sys.exit()          with open('/dev/null', 'w') as out:         out.write('something')


title: What does "DMA: Out of SW-IOMMU space" error mean?

text: First the link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1060268 Since this affects the kernel and other Distros, what does this type of error mean and why it happens?


title: How can I save as Excel files (.xls) in Calligra sheets?

text: Would someone tell me if it is possible to save as Microsoft Excel (`.xls`) in Calligra sheets?


title: Asus Bluetooth Dongle with Atheros (ath3k) chip - OpenSUSE - probe failed with error -5

text: I'm trying to use an Asus USB Bluetooth Dongle in OpenSUSE. Unfortunately when I plug it in, dmesg gives me the following output:               usb 8-2: new full speed USB device using uhci_hcd and address 3     usb 8-2: New USB device found, idVendor=0cf3, idProduct=3000     usb 8-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0     ath3k: probe of 8-2:1.0 failed with error -5      lsusb gives the following output:               Bus 005 Device 004: ID 0cf3:3005 Atheros Communications, Inc.      The modules ath3k and bluetooth are loaded, but neither bluedevil nor the OpenSUSE bluetooth adapter tool detect the stick. I'm using the 2.6.37.6-0.20-desktop kernel from the OpenSUSE repositories under openSUSE 11.4 32bit. The following packages are installed:   * bluedevil   * bluez    * bluez   * compat    * bluez-firmware   * bluez-gstreamer    * bluez-hcidump   * bluez-test   * gnome-bluetooth   * libbluedevil1    * libbluetooth3   * libgnome-bluetooth8


title: How to prevent a Qt/GTK app (Calibre) from using colors defined in .Xresources?

text: I have colors defined in .Xresources. They look lovely on urxvt, and utterly ghastly on Calibre. Calibre does not appear to have any way to disable or override those colors, so is there any way I can invoke Calibre that would ignore my color scheme?


title: what is commit=0 for ext4? does mdadm not support it?

text: I see this in my dmesg log               EXT4-fs (md1): re-mounted. Opts: commit=0     EXT4-fs (md2): re-mounted. Opts: commit=0     EXT4-fs (md3): re-mounted. Opts: commit=0      I think that means that dealloc is disabled? does mdadm not support dealloc?


title: what's the best way to chainload this

text: I have two disks. One contains windows and is a SATA-drive. The other one contains Foresight Linux and is a IDE-drive. Now I have installed extlinux as the bootloader for Foresight Linux. Now I want to chainload it with the windows bootloader so I can boot both. In the bios I can only choose the SATA-drive to boot. Can this be working and if so, how can I do this. I tried to use Easybsd but then the only thing I can see is boot error.


title: Is it possible to use named colors in Zsh beyond ANSI names?

text: I know there are ways to use ANSI color names in Zsh (such as red), but Zsh supports 256 colors by number. I'm curious if there's any way to refer to the non-ANSI colors by a name? (Without just sticking them in a variable)


title: Why must swap partition be nested when created as an extended partition?

text: I did not want to use up my last primary partition so I created my new swap partition as an extended partition. However, somewhat redundantly, it is created under sda4. This makes little sense as sda5 is the only partition in ext4. Why is it forced to be nested? Why can it not be created at the same level as the primary partitions, but it must be made a "child" partition? Do you understand what I am saying? This is an unnecessary distinction, as it is the only partition occupying the extended partition. I'd rather my swap be called sda4 and not be subordinated as sda5... ![enter image description here](http://i.stack.imgur.com/IniNQ.png)


title: Compare set of values from two files and print the output in third file in awk

text: Hi friends i have problem with comparing two files.I'll try my best to explain.I have two file f1 and f2 which i have to compare on basis of two sets Parameter(p) and Value(v). Basically f1 contains list of Values and Time Stamp for the each Parameters                 f1.csv       P,V,TS       p1,12,10:10:00       p2,34,10:21:00       p1,12,10:21:00       p2,34,10:22:00        p1,60,10:35:00       p3,60,10:36:00       p4,22,10:38:00       p4,42,10:40:00           p1,60,10:41:00       p3,58,10:42:00       p2,55,10:45:00       p3,58,10:55:00      File f2 contains previous latest value and time stamp for each parameter and every parameter has only one occurrence in this file.RTS(Real Time Stamp) & UTS(Updated Time Stamp)                 f2.csv       P,V,RTS,UTS       p1,12,10:00:00,10:05:00       p2,34,10:07:00,10:15:00       p3,60,10:25:00,10:30:00       p4,22,10:30:00,10:32:00      Now ill try to explain the output in two parts. First part is easy,for similar (P,V) in f1 & f2 change the UTS with latest TS.Here's pseudo code                 for each (P, V) in f1       {       #if value exists in f2       if ((P, V) exists in f2)       {         f2.RTS(P,V)=f2.RTS(P,V)        f2.UTS(P, V) = f1.TS(P, V)       }        }      For the value which exists in f2 and f1 first part of the o/p file f3 in []:-                f3.csv           [ P,V,RTS,UTS        p1,12,10:00:00,10:10:00        p2,34,10:07:00,10:21:00        p1,12,10:00:00,10:21:00        p2,34,10:07:00,10:22:00         p3,60,10:25:00,10:36:00        p4,22,10:30:00,10:38:00]      Second part is difficult.It deals only with f1 file.Values which do not exists in f2. For values from f1 (p4,42,10:40:00)(p2,55,10:45:00) which occur only once and are not in f2 should have RTS=UTS=TS as given in o/p below. Ex:-For single occurrence                  p4,42,10:40:00,10:40:00      For values (p3,58,10:42:00),(p3,58,10:55:00),(p1,60,10:35:00)(p1,60,10:41:00) which occur twice and are not in f2,the first occurrence should have RTS=UTS=TS and the second occurrence for same (P,V) should have RTS=(TS of first occurrence of (P,V)) and UTS=TS of second occurrence of (P,V). Ex First occurrence (p1,60) in f1.                p1,60,10:35:00,10:35:00      Second occurrence (p1,60) in f1                p1,60,10:35:00,10:41:00      The second part expected o/p                 f3.csv      [ P,V,RTS,UTS        p1,60,10:35:00,10:35:00        p4,42,10:40:00,10:40:00        p1,60,10:35:00,10:41:00        p3,58,10:42:00,10:42:00        p2,55,10:45:00,10:45:00        p3,58,10:42:00,10:55:00]      Final o/p is appending both the o/p CSV.thank you any help will be appreciated


title: "The GPG keys listed for the "atomicrocketturtle.com" repository are already installed but they are not correct for this package."

text: When running this on CentOS 6:               yum update      I accept the transaction summary that it presents and am then immediately presented with this:               Downloading Packages:     warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY     Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY.art.txt          The GPG keys listed for the "CentOS / Red Hat Enterprise Linux 6 - atomicrocketturtle.com" repository are already installed but they are not correct for this package.     Check that the correct key URLs are configured for this repository.      How can I fix this issue? When I run this:               rpm -q --queryformat "%{SUMMARY}\n" gpg-pubkey      I get this response:               gpg(CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>)     gpg(EPEL (6) <epel@fedoraproject.org>)     gpg(Atomic Rocket Turtle <admin@atomicrocketturtle.com>)     gpg(New Relic <support@newrelic.com>)


title: Mount a Windows network drive

text: I want to mount a netword drive on the server (SBS2008). I have two options: Either using a fedora which already mounts on a CentOS server or directly on the CentOS server. Here is the command I tried on the fedora machine:               mount -t cifs //192.168.xx.xx/abc /mnt/lan -o username=usernameofwindowsmachine,pass=xyz      If I use this command nothing happens and if I press enter it goes in the next line and make nothing. I also tried to mount on the CentOS directly but no command worked (mount -t smbfs, smbclient, smbmount, ...). Smbmount is not installed. smbclient gets a timeout and fedora use cifs and not smbfs ... The fedora machine already has a mount on a Windows 2003 Server, but I don't know how this has been made. I don't want to install something because I only want to transfer a big file from CentOS to SBS2008. Because I'm a beginner I'm missing knowledge in Linux .. **Edit** :   So it is not that easy to mount a network drive ... I went another way: I saw that WinSCP was installed on the SBS2008 and connected on the machine and managed to transfer the file. The speed is not that good (1,8 MB/sec.) but hey it works.


title: Simplest way of forwarding all mail from server?

text: > **Possible Duplicate:**   >  Lightweight outgoing SMTP server I am looking for a minimal mail solution (MTA) for a headless server which generate e-mails for local users and and fully qualified addresses from cron- jobs, etc. Ideally all mails to local user `foo` should be mapped to `foo@mydomain`, with possible modifications for `uid`<1024, and sent off to an external smtp server without involving `/var/mail`. Some years ago, I used sSMTP for a similar task, and I was wondering if this is still the way ahead? Also, how much of the default debian mail system should/could I remove? * * * **Update** Ended up Googling a bit, and the obvious candidates seem to be   * sSMTP: Not actively developed    * eSMTP: Not actively developed according to home page   * mSMTP: Recommended in front of sSMTP at http://www.scottro.net/qnd/qnd-ssmtp.html   * nullmailer: Suggested by Gilles Even though eSMTP is not developed anymore, it seems to have the nicest documentation. It doesn't quite fit my needs though, at it seems to insist on delivering mail to local user `foo` via a Mail Delivery Agent (MDA) instead of pushing it out over smtp to `foo@some.domain`. Or maybe it does do the mapping if I add `qualify_domain` to the config. Might have to try it out...   nullmailer appears to be running a queue in `/var`, which is not something I want. Does anybody have experience with any of these?


title: Version Control System similar to Bazaar needed for CentOS 4.8 dedicated hosting server

text: I have recently had to have our dedicated server rebuilt as core system files were deleted. But that's another story... Before the rebuild, we were merging, branching, and committing changes to a number of different projects with Bazaar. Now it seems that the hosting company has rebuilt the server at CentOs 4.8 rather than 5.0, which I guess it was before. According to the support staff, Bazaar is not compatible with the new OS. The support staff have said: > I have installed all of the Bazaar Dependencies, however the missing > dependencies for example; > >   * Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package bzr > > > Is for a higher version of CentOS. My question is. Is this entirely true and is there any way to get Bazaar working on Centos 4.8? If not, are there any other version control systems similar to Bazaar? Below is the log for the attempted installation of Bazaar.               Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package bzr     Error: Missing Dependency: python(abi) = 2.4 is needed by package bzr     Error: Missing Dependency: rtld(GNU_HASH) is needed by package bzr     Error: Missing Dependency: libcrypto.so.6 is needed by package python-pycurl     Error: Missing Dependency: python(abi) = 2.4 is needed by package python-paramiko     Error: Missing Dependency: rtld(GNU_HASH) is needed by package python-pycurl     Error: Missing Dependency: python(abi) = 2.4 is needed by package python-pycurl     Error: Missing Dependency: libssl.so.6 is needed by package python-pycurl     Error: Missing Dependency: rtld(GNU_HASH) is needed by package python-crypto     Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package python-crypto     Error: Missing Dependency: python(abi) = 2.4 is needed by package python-crypto     Error: Missing Dependency: python-abi = 2.4 is needed by package python-crypto


title: Find links and their positions in a PDF

text: I need to find all links in a PDF file, along with the page they're on and their X/Y position. Is there any tool or combination of tools I can use to do that?


title: How let `sort  | uniq -c` separate the number of occurrences by a tab charactor?

text: `uniq -c` separate the occurrence number by spaces, which is hard for to `cut` or `awk` to separate it out later.               1000_A1\tB1\n     ___1_A2\tB2\n      I can solve this problem using `sed -r 's/^ *([0-9]+)/\1\t/'` to change the delimiter to tab. Then `cut -f1` could return:               1000\tA1\tB1\n     1\tA2\tB2\n      But it seems a common usage to have `uniq -c` separate the number by tab. Why is this feature missing? Is there any other easier way to do so?


title: Rsync ssh include & exclude

text: Here is my current rsync shell script upload.sh               SOURCEDIR=/Users/thomas/sites/dreamhost/     DESTDIR=******@reggi.com:/home/thomasreggi/sites/     ##rsync -avzL --delete --include '*/' --include-from=list.txt --exclude '*' $DESTDIR $SOURCEDIR          SOURCEDIR=/Users/thomas/sites/dreamhost/     DESTDIR=******@reggi.com:/home/thomasreggi/sites/     rsync -avzL --delete --exclude=".DS_Store" --exclude-from=list.txt $SOURCEDIR $DESTDIR      list.txt               reggi.com/assets/dailybooth/img/original/     reggi.com/assets/dailybooth/img/spritesheets/     reggi.com/assets/dailybooth/sprite.css     reggi.com/assets/thumb/cache/     reggi.com/wordpress/wp-content/plugins/     reggi.com/wordpress/wp-content/uploads/      What I am trying to accomplish here is a rsync download of the list directories then an upload of everything except the list directories. The second script works and avoids the list files but the first doesn't do what I want completely. I've gotten it to work if I append ** to the end of the directories but I'm not sure this works for the second script. I am looking for the optimal way of doing this.


title: Pull Metadata from a video in the terminal

text: I am writing a bash script that I want to echo out metadata (length, resolution etc.) of a set of videos (mp4) into a file. Is there a simple way to get this information from a MP4 file?


title: "invoke-rc.d: initscript cups, action "start" failed." while configure cups

text: When I run `apt-get -f install`, I get the following abnormal output:               Setting up cups (1.5.0-8) ...     start: Job failed to start     invoke-rc.d: initscript cups, action "start" failed.     dpkg: error processing cups (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      cups     E: Sub-process /usr/bin/dpkg returned an error code (1)      I'm running under **Ubuntu Oneiric Ocelot, x64**. I'm not sure where to start to debug this. I appreciate any suggestions any of you may have.


title: How to move a file without preserving permissions

text: The problem is I want to be able to see errors when moving a file, but not see errors with permissions problem. In other words - I care if the file is not fully transmitted, but don't want to see errors like this: > mv: failed to preserve ownership for `/home/blah/backup/pgsql.tar.gz': > Operation not permitted So I want something like: `mv $backupfile $destination --ignore-permissions`. The backup file can be anything from 1 MiB to 5 GiB and is transfered through NFS.


title: mysql console, keeps outputting garbled text if 'b' key is pressed

text: mysql -u username -p mysql> Now in the console whenever I press the `b` key the screen goes berserk with garbled text: ![enter image description here](http://i.stack.imgur.com/bqdRM.png) Google doesn't help here. Edit: using ubuntu 12.10 with xterm or the default terminal Output of mysql --version               mysql  Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (i686) using readline 6.2


title: Use grub rescue to boot from Windows XP partition, CD or USB

text: I just attempted to reinstall Lubuntu using my own guide. However, my LiveCD was (appearantly) damaged, which caused installation to fail. Now, when I restart the PC, I get dropped into a `grub rescue>` prompt. Now how can I use that prompt to:   1. Boot to the Windows XP partition that is on the hard drive or   2. Boot from a (new) LiveCD/LiveUSB to fix everything. The boot order is set to prefer the HDD, and I can't change it due to a password I don't know.


title: dns resolve for 2 IPs with same reference

text: We having following situations: On a server, we have to set 2 IPs which will be refereed to the same fqdn. in the application which is running on the server, we are configuring the FQDN. Once there is problem with access to one IP (based on the FQDN), the server will use the second IP assigned to the same FQDN: example: `/etc/hosts` will contain               1.1.1.1 server1.google.com     1.1.2.1 server1.google.com      once there is problem to access to 1.1.1.1, the server will use the server1.google.com as 1.1.2.1 Can we use such a thing? Is there some other option?


title: How to write a shell script to run multiple command in different screen sessions?

text: My goal is to write a `zsh` script in order to create multiple `screen` sessions and run separate commands on each of them. I would also like to check at the beginning of my script if there are any screens with running jobs and terminate all of them that sit idle. Furthermore, if possible I would like to have a way to record the stdout of the individual screen and get their ID number. So far I have tried the following:               ### Script for running everything in screens ###     killall -15 screen ## We make sure that no screens are running for now     #bkg_array = ("TopJets" "BosonJets" "DiBoson" "TTbar")          screen -dmS "MYSCREEN"     screen -S "MYSCREEN" -p 0 -X stuff 'echo "The array has of elements."\n'      However, I cannot seem to send the keystroke for pressing `Enter`; how can I achieve that effect? Additionally without the `-p` option the command is not sent to the screen. After pressing `Ctrl+V+Enter` the characters `^M` were pasted on the screen and it pressed enter in the screen session, but I have no idea why that worked. Thanks for your help, feel free to point out any ambiguities.


title: Understanding ls -l output

text: When I run `ls -lrt` command on a Unix folder , I get the following output               MyServer> ls -lrt     total 10     drwxr-x---   3 UnixUser  other        512 Jul 22  2011 FolderA     lrwxrwxrwx   1 UnixUser  other         42 Aug 23  2011 BEA -> ../../../Some/Folder/SOLARIS/BEA      I am not sure what are BEA and Perlx.x in these folders. They do not seem to be files nor folders. Why is there a arrow besides them pointing to somewhere else?


title: How to verify if tmux is properly installed on Mac OSX

text: I've just tried installing tmux from source (via installing libevent first). The installation seemed fine, without throwing any obvious error. But when I typed `tmux` in iTerm2, it returned "command not found". However, there is clearly an executable named `tmux` in `/opt/bin/`. So I am a bit puzzled that whether I have successfully installed `tmux` on my mac. How do I get it work with iTerm2?


title: Veritas Volume Manager on OpenSolaris

text: I downloaded: http://download.oracle.com/otn/solaris/11/OracleSolaris11_11-11_VM.zip and succesfully booted it! :) only two things needed to be changed: 512 MByte RAM and VBox Processor Execution Cap to 80%. But. I can't find any packages regarding Veritas Volume manager! I searched: http://pkg.oracle.com/solaris/release/en/index.shtml with no luck. I tried a:               pkginfo | grep VRTS      as http://www.unix.com/solaris/154779-vxvm-cluster-information.html states, but I can't find any packages having "vx" in their names. **Q:** How can I Install/use the Veritas Volume Manager on OpenSolaris? Wikipedia states that Vertias is available on OpenSolaris too, not just Solaris!


title: Can not edit .vimrc file

text: I have just installed spf13 plugin for vim and I want to customize .vimrc file. When ever I try to save the edits it says: ".vimrc" E166: Can't open linked file for writing syntastic: info: no active checkers for filetype vim Press ENTER or type command to continue I have tried saving with w! and everything that says here How can I edit .vimrc?


title: How can I solve the issue about mounting my Windows 8 NTFS partition on Linux Mint?

text: I used **Ubuntu** for long even along **Windows** and SOMETIMES I got this problem for mounting the corresponding **NTFS** partition at the beginning, however with a pair of command lines to the console I got it fixed. However, I moved to Linux Mint MATE 15 and I'm ALWAYS getting this problem, I've looked up and I know there's this new use for the hibernation file in Windows 8 which enables fast start up. _**Why_** can't I just mount my NTFS partition ignoring the hibernation file? Is this even possible? And, again, **_why_** would this get worse with Linux Mint? I really like the quicker boot of Windows 8 so I don't really consider disabling Windows hibernation and going to Windows to restart and log to Linux is cumbersome...


title: Application displaying latest blog posts on desktop

text: Is there an application for Linux which is able to put rss feed directly on desktop? I've seen lots of standalone programs, but I'd like to have a window in the corner of my desktop always showing latest n entries (like a desklet). I'm using Linux Mint with KDE.


title: How to redirect user to Android Market in Apache?

text: On my website I should redirect Android users to my application on Android Market. What is the optimal way to do this? My first idea was                      RewriteCond %{HTTP_USER_AGENT}  Android [NC]            RewriteRule ^/$         market://details?id=......      But it doesn't work.


title: Is there any pattern to specify target triples in GCC?

text: The gcc compiler use target-triplets for cross-compilation. I see some of these target triples like "x86_64-pc-linux-gnu" (the most common). I understand what means but I don't know how specify another unix-like system instead "linux-gnu". Is there any document for it? and the "pc" seems be optional (should I care about this?), when I run a "config.guess" script, it returns me "x86_64-unknown-linux-gnu".


title: How to automatically start and shut down VirtualBox machines?

text: I need to run a software system that is intended to be installed as an appliance on a dedicated machine. In order to save energy, I plan to run the system on a VirtualBox VM instead. The host is a standard Linux box with a SysV-Init system, the guest is a heavily modified Linux and I would prefer not to have to alter it further. VirtualBox is used in the OSE version. I have already figured out how to start the VM when the host boots ( _Edit:_ this is done, as Nikhil mentioned below, through the command `VBoxManager startvm`), but how can I gracefully shut down the VM? Any script running on the host would need to wait until the guest has fully shut down. Can anyone suggest how, for example, a service file doing this would have to look?


title: How can I lock my screen in Gnome 3.8 without GDM?

text: There is no "Lock" option showing up in the user menu, and the standard shortcuts (`Ctrl`+`L` or `Ctrl`+`Alt`+`L`) don't do anything. I'm running Fedora 19 with Gnome Shell 3.8.3, and XDM 1.1.11. I'm using XDM because of broken XDMCP support in GDM - but before I upgraded to Fedora 19, I did have the lock option, even when using XDM. > I've posted an answer reflecting the results of my own research. It > basically says that it's not possible to have screen-lock integrated into > Gnome 3.8 without running GDM. > > I really hope there's a better answer available though - so please add your > own answer if there's any way to do this that I overlooked.


title: Easy way to push data into MongoDB from Bash shell script?

text: I know you can create a Javascript file that the MongoDB shell will execute upon startup. But I'm hoping for something more "lightweight" than that. I am using a Linux program that has a scripting language built in it. But the scripting language can not do operations like opening sockets, etc. It does have a "system" command to shell out to a Linux process. I would like to be able to push data into MongoDB via a Bash shell script and immediately return to the Linux process that spawned it, and quickly if I can since I intend to do this a few times a second (but not much more than that). It seems to me that shelling to the MongoDB shell and then have it execute a startup Javascript file would be a heavyweight operation relatively speaking? Is there a command line that I could craft from a bash script that would do a few quick MongoDB database operations and the exit? I have the MongoDB daemon running at all times on the default port.


title: How to take 'password' like input in shell script?

text: > **Possible Duplicate:**   >  How to hide commands typed in a Linux shell?   >  Reading passwords without showing on screen in Bash Scripts I would like to take a password as input, but I want user to be able to enter it just like other utilities handle it i.e. the characters doesn't appear on the screen. I tried searching regarding this, but found no exact answer. I need to take in a variable, and then I would match the input with a pre- defined standalone password hard-coded variable sourced from one of the config files at the beginning of the script. ### Expected behaviour               $./startScript     username: mtk     password: ********      `*` shown as placeholders. I need this part to be invisible. Currently the password is displayed as the user types it. How to do this?


title: Reading passwords without showing on screen in Bash Scripts

text: How to read passwords in bash scripts in a way like tools which are not showing it on terminal ? (Changing font to black on black might be tricky by easy to copy&paste - so it's not solution)


title: Regex to find NFS filesystems that aren't being mounted with nosuid, except for ones with special needs

text: I have a script that runs the command `mount -v 2>/some/file`, which I then parse with another script using the following regex: `^.*[\ \t]+type[\ \t]+nfs(?![\ \t]+.*\b(?:nosuid|nosetuid)\b).*` The problem I am having is this: there are a few NFS mounts that have waivers excluding them from being mounted with `nosuid` (they're Solaris 11 IPS repositories). Now I need to modify my regex to exclude a known mount... To provide a point of reference, here's some sample output from `mount -v`:               $ mount -v     /dev/dsk/c1t0d0s0                 on  /                  type  ufs      read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840000  on  Fri  Sep  6   12:10:35  2013     /devices                          on  /devices           type  devfs    read/write/setuid/devices/rstchown/dev=4c00000                                             on  Fri  Sep  6   12:10:25  2013     ctfs                              on  /system/contract   type  ctfs     read/write/setuid/devices/rstchown/dev=4c80001                                             on  Fri  Sep  6   12:10:25  2013     proc                              on  /proc              type  proc     read/write/setuid/devices/rstchown/dev=4c40000                                             on  Fri  Sep  6   12:10:25  2013     mnttab                            on  /etc/mnttab        type  mntfs    read/write/setuid/devices/rstchown/dev=4cc0001                                             on  Fri  Sep  6   12:10:25  2013     swap                              on  /etc/svc/volatile  type  tmpfs    read/write/setuid/devices/rstchown/xattr/dev=4d00001                                       on  Fri  Sep  6   12:10:25  2013     objfs                             on  /system/object     type  objfs    read/write/setuid/devices/rstchown/dev=4d40001                                             on  Fri  Sep  6   12:10:25  2013     sharefs                           on  /etc/dfs/sharetab  type  sharefs  read/write/setuid/devices/rstchown/dev=4d80001                                             on  Fri  Sep  6   12:10:25  2013     /usr/lib/libc/libc_hwcap1.so.1    on  /lib/libc.so.1     type  lofs     read/write/setuid/devices/rstchown/dev=840000                                              on  Fri  Sep  6   12:10:31  2013     fd                                on  /dev/fd            type  fd       read/write/setuid/devices/rstchown/dev=4f00001                                             on  Fri  Sep  6   12:10:35  2013     swap                              on  /tmp               type  tmpfs    read/write/setuid/devices/rstchown/xattr/dev=4d00002                                       on  Fri  Sep  6   12:10:38  2013     swap                              on  /var/run           type  tmpfs    read/write/setuid/devices/rstchown/xattr/dev=4d00003                                       on  Fri  Sep  6   12:10:38  2013     /dev/dsk/c1t0d0s7                 on  /export/home       type  ufs      read/write/setuid/devices/rstchown/intr/largefiles/logging/xattr/onerror=panic/dev=840007  on  Fri  Sep  6   12:10:44  2013     sample-ips:/ips/blargSolaris11.1  on  /blargSolaris11.1  type  nfs      remote/read/write/setuid/devices/rstchown/soft/xattr/dev=8c00001                           on  Tue  Sep  10  12:07:46  2013      I had tried modifying the regex to exclude the IP's mount based on matching the mount at the beginning of the line like this: `^(.*|[^sample])[\ \t]+type[\ \t]+nfs(?![\ \t]+.*\b(?:nosuid|nosetuid)\b).*` But it's not working...


title: couchdb doesn't start

text: I installed couchDB under Sabayon with help of Rigo and followed this instruction ( http://guide.couchdb.org/draft/source.html ):               xyz@wp01 ~ $ su     Password:      wp01 xyz # chown -R couchdb:couchdb /etc/couchdb     wp01 xyz # chown -R couchdb:couchdb /var/lib/couchdb     wp01 xyz # chown -R couchdb:couchdb /var/log/couchdb     wp01 xyz # chown -R couchdb:couchdb /var/run/couchdb     chown: cannot access ‘/var/run/couchdb’: No such file or directory     wp01 xyz # chmod -R 0770 /etc/couchdb     wp01 xyz # chmod -R 0770 /var/lib/couchdb     wp01 xyz # chmod -R 0770 /var/log/couchdb     wp01 xyz # chmod -R 0770 /var/run/couchdb     chmod: cannot access ‘/var/run/couchdb’: No such file or directory          $ sudo -i -u couchdb couchdb -b     Password:      Sorry, user xyz is not allowed to execute '/sbin/nologin -c couchdb -b' as couchdb on wp01.      What did I do wrong?


title: USB hard drive boot problem

text: I have a HP Probook 4525s laptop with Windows 7 and Ubuntu installed on it and an external USB Toshiba hard disk(320GB); I've tried to install for several times various linux distros on the USB HD (Ubuntu, Backtrack, Suse 11, Scientific Linux) but I have problems booting it. The instalation went well but, when it comes to boot the external HD, everything stops to a dash blinking forever on a black background. I've tried changing the boot order and manually select the booting device but doesn't solve the problem. If I remove the external HD when the dash blinks, the laptop boots the internal HD and I get the ubuntu boot menu. I've tried booting from other computers and everything works fine, so it seems that my machine has a problem. What should I do in this case? Any suggestion may be useful.


title: Can't open Gajim

text: When I try to open Gajim using terminal on gnome I get the following:               Traceback (most recent call last):       File "gajim.py", line 106, in <module>         import common.configpaths       File "/usr/share/gajim/src/common/configpaths.py", line 27, in <module>         import tempfile       File "/usr/lib64/python2.6/tempfile.py", line 34, in <module>         from random import Random as _Random       File "/usr/lib64/python2.6/random.py", line 47, in <module>         from os import urandom as _urandom     ImportError: cannot import name urandom      Any idea how to fix this? My OS is Mandriva 2010.1, Python is v2.6 upgraded from v2.4


title: Default directory permissions over NFS

text: I have two servers, `client` and `server` in fairly obvious roles: `server` hosts the NFS share and `client` has it mounted. There is a shared group among several users on `client` called `shared` which also exists on `server`. My permissions on `server` for the share look like this:               user@server $ ls -al /export/share/     drwxrwsr-x+ 3 shared shared    4096 Apr 19 01:25 .     drwxr-xr-x  3 root  root       4096 Apr 12 20:10 ..      The goal is pretty clearly displayed, I'd like all members of the `shared` group to be able to create, write, and delete files in this directory. On client, a `ls -la` of the mounted directory leads the same results. The NFS exports file on `server` looks like this:               /export/share 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async)      The mount on `client` in `/etc/fstab` looks like this:               10.0.0.1:/export/share /mnt/share nfs _netdev,noatime,intr,auto 0 0       The output of `mount` from `client`:               10.0.0.1:/export/share on /mnt/streams type nfs (rw,noatime,intr,vers=4,addr=10.0.0.1,clientaddr=10.0.0.2)      However, I still can't seem to be able to create files in that directory using a user in the group. For instance, a user `jack`:               user@server $ id jack     uid=1001(jack) gid=1001(jack) groups=1001(jack),1010(shared)      If I try touching a file in the mounted folder on `client`, permission is denied:               user@client $ sudo -u jack touch /mnt/share/a     touch: cannot touch `/mnt/share/a': Permission denied      Why isn't this working as expected? Shouldn't I be able to create files and folders as `jack` in this folder since he's a member of the `shared` group?


title: how to open player in html if in /usr/bin location?

text: My VLC player is in `/usr/bin` but I don't know how to link it to embed it in a page.


title: How to restore folders to their original destination using duplicity?

text: After performing a backup of a couple of directories like so:               # duplicity\      --exclude /home/user/Documents/test1/file\      --include /home/user/Documents/test1\      --include /tmp/test2\      --exclude '**'\      / file:///home/user/Backup      I wanted to test how the restoration works by deleting the backed up directories:               # rm -rf /home/user/Documents/test1 /tmp/test2      And then, restoring the backup,               # duplicity file:///home/user/Backup /      But I got the error,               Restore destination directory / already exists.     Will not overwrite.      So it appears that I can't restore to the original destination without emptying the root folder even though the destination of these included folders have already been cleared. Is there a better way than to restore it to another location and then moving each folder one by one?               # duplicity --file-to-restore home/user/Documents/test1 file:///home/user/Backup /home/user/Restore1     # mv /home/user/Restore1/home/user/Documents/test1 /home/user/Documents/test1     # duplicity --file-to-restore tmp/test2 file:///home/user/Backup /home/user/Restore2     # mv /home/user/Restore2/tmp/test2 /tmp/test2


title: Finding all .cpp and .h files and moving them to ~/junk

text: I created a folder on my home directory call junk, and let's say I want to move all .cpp and .h files to it. How would I do it? My first thought is to start with find ~ -name *.cpp -print, but I don't know how to put in multiple patterns into the find argument, and I'm fairly lost after that.


title: How do I convert a MKV file to H.264/AVC with a resolution of 640x360 using FFMPEG?

text: I have a MKV video which I want to put in my mobile (a Nokia XM 5800) and based on this I can play H.264/AVC format videos on it. Based on what I have read, the container should be MP4 and I can encode it using XVID codec. The problem is I don't know how. Since I am using Linux (Arch), I was wondering if I can achieve this using FFMPEG. If so, please enlighten me on how to do this. I want the video to use the native screen size of the device, 640x360, with a reasonably good video and audio quality. If you can also suggest other tools that will make it easier, please suggest. I also prefer command line tools over GUI ones.


title: How to run Dropbox daemon in background?

text: I'm using Debian 6 and Dropbox. I followed these commands to install it. When I run `~/.dropbox-dist/dropboxd` — Dropbox works and stuff. Problem is that when I close terminal or, even worse, — reboot... Dropbox stops to work and I need to run that deamon again. Are there any way I say to computer to automatically start that daeamon in background?


title: Pushdown Terminal Output

text: Is there a standard way to reverse the output order of a terminal output, ie:               ~/Developer $ command0      -bash: comman0: command not found      ~/Developer $ command2      -bash: command2: command not found      ~/Developer $ command3      -bash: command3: command not found      ~/Developer $       would be displayed as:               ~/Developer $      -bash: command3: command not found      ~/Developer $ command3      -bash: command2: command not found      ~/Developer $ command2      -bash: comman0: command not found      ~/Developer $ comman0      I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?


title: Using --exclude with the du command

text: This is probably something basic but I'm not able to make it work. I'm trying to use DU to get a total size of files minus certain directories. I need to exclude one specific directory called `uploads` but not every directory called `uploads`. For example, my file structure looks a bit like this:               /store       /uploads         /junk_to_ignore         /more_junk_to_ignore       /user_one         /uploads       /user_two      I can run the following command:               du -ch --exclude=uploads*       and it gives me the file size minus all the "uploads" directories. However, in trying to exclude certain directories (and all its sub-directories) I fail. I've tried variations of:               du -ch --exclude=./uploads*     du -ch --exclude='/full/path/to/uploads/*'      but can't seem to figure it out. How do I exclude a specific directory?


title: Eclipse error on opening: Linux Mint 12

text: I've installed Eclipse with the command:               sudo apt-get install eclipse      or when I install via the synaptic manager. Unfortunately, when I open up Eclipse I get this error:               org.eclipse.ui.PartInitException: No editor descriptor for id org.eclipse.jdt.ui.CompilationUnitEditor         at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:601)         at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)         at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)         at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271)         at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1459)         at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:972)         at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)         at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)         at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)         at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)         at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)         at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1595)         at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)         at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)         at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)         at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)         at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)         at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)         at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)         at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)         at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:616)         at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)         at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)         at org.eclipse.equinox.launcher.Main.run(Main.java:1410) Has anyone else seen this issue?


title: How to update Debian kernel to latest in backports

text: I have a machine running Debian stable, and I'd like to update the stock kernel to the latest kernel available in the backports repository. There are many kernel-related packages and virtual packages--what is the right way to do this and get the appropriate packages upgraded?


title: Low-level bluetooth utility

text: What's a bluetooth utility for Linux that will let me pair and unpair devices, display messages coming from a device, send messages to a device (hopefully done using the filesystem!), and set any available flags? The application in mind is that I just want to have say 10 tiny bluetooth keyboards and map each key on each keyboard to send a MIDI message (obviously the midi part is not part of this OP).


title: What is a subshell (in the context of the documentation of make)?

text: I'm reading a book about the `make` command and there is a paragraph: > If any of the prerequisites has an associated rule, make attempts to update > those first. Next, the target file is considered. If any prerequisite is > newer than the target, the target is remade by executing the commands. Each > command line is passed to the shell and is executed in its own subshell. Could you explain the concept of subshell used there and why is it necessary to use such a subshell?


title: how do I decrease font size in Eclipse (Linux Mint)

text: How do I decrease the font size of tabs' title bar (see screenshot )? I use Eclipse Mobile Juno, and Linux Mint 13 Mate. I tried both going to Eclipse Preferences and Mate preferences. The mate preferences worked but only the font family changed, the size did not.


title: Debian Linux is not starting because no bootable device was found

text: I have installed Debian with the Gnome Live CD on my notebook. Because there are still some applications which I need, it was necessary that I also have a Windows 7 system installed. Based on some tutorials I installed Windows 7 first and then Debian. After the Debian Installer from the live cd was finished, I tried to reboot my notebook. Directly after the BIOS screen I see the output that no BootDevice was found. The output of `fdisk -l` is:               Device Boot      Start         End      Blocks   Id  System     /dev/sda1               1          13      102400    7  HPFS/NTFS     Partition 1 does not end on cylinder boundary.     /dev/sda2              13        4961    39743488    7  HPFS/NTFS     /dev/sda3            4961       15567    85186561    5  Extended     /dev/sda5   *        4961       15131    81689600   83  Linux     /dev/sda6           15131       15567     3495936   82  Linux swap / Solaris      According to the partition table, my Linux partition should be bootable, but I cannot start Windows 7 or Debian.


title: Linux RDP with audio and mic

text: I've been trying to establish an RDP conexion with a Windows 7 machine from Linux with sound AND microphone redirection, I have tried rdesktop, remmina and freerdp with no use. Finally, with freerdp I have finally managed to get sound and microphone redirection but from different sessions. I mean `xfreerdp -u user -d domain -p password --plugin drdynvc --data audin -- server` Allows me to send the microphone to the remote machine. `xfreerdp -u user -d domain -p password --plugin rdpsnd --data pulse -- server` Allows me to get the sound from the remote machine, but I can't manage to get both within the same session. Any ideas?


title: Use of variables in Apache configuration

text: I have a number of largely identical configuration files in my Apache2 configuration, for configuring various subdomains. In most of these configuration files, only the name of the subdomain itself is different from the other files and thus I am trying to figure out if it is possible to set some sort of variable at the top of the config file to easily set things like `ServerName`, `DocumentRoot`, `ErrorLog`, `CustomLog` A bit like (which obviously doesn't work):               subdomain=blog          <VirtualHost *:80>             ServerAdmin webmaster@localhost             ServerName ${subdomain}.example.com             DocumentRoot /var/www/${subdomain}.example.com/htdocs                  # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.             LogLevel warn             ErrorLog /var/log/apache2/${subdomain}.example.com_error.log             CustomLog /var/log/apache2/${subdomain}.example.com_access.log combined                  RewriteEngine On             RewriteCond %{HTTPS} off             RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}     </VirtualHost>      An even smarter solution would be if the `subdomain` variable can be set through a regex from filename of the configfile. I did find Dynamically configured mass virtual hosting, but it just doesn't describe exactly what I want. Running Apache 2.2 on Linux.


title: Diff, show modified line from right file only

text: I have file `a` and `b` and I would like to output lines of `b` that changed since it was cloned from `a`. Just the modified lines, no surrounding context, no diff offset marks. How can I do that using shell scripting? (No Python/Perl/PHP/...) Sed and awk are acceptable solutions. For now, what I am doing is diff -y with --suppress-common-lines and sed using regex backreferences to just fetch the right part after the whitespace. There must be a better way? Using perl (which is forbidden), I´d do something like this:               diff -y --suppress-common-lines -W $COLUMNS Eclipse_Preferences_Export_*.epf | perl -pe 's/.*\t|\t(.*)$/\1/g'