Connecting to host by SSH client in Linux by proxy

I am really struggling with this. > My host (A) is behind a proxy/firewall (PF) and needs to connect to host H. The proxy has HTTP/FTP/SOCK proxy configured and I have no issue to configure in web browser, wget etc. But when I use...               ssh H //to connect my host       I have no success to pass over the proxy. It seems to try to connect directly instead of going via the PF. I am using Ubuntu 12.10.


Do I need a desktop to run a GUI?

I am setting up a lightweight VM, following the guide in the Ubuntu Documentation What I want to be able to do is ssh into the VM and then launch a GUI application. I don't need / want a desktop. First I installed xorg. But I can't launch a gui. The next step in the documentation is to install a "Window Manager", but it is not clear why this is necessary. What is the smallest program that will run a gui? I asked this on ubuntu.SE, but all of the answers required installing a window manager, all of which provide a desktop. The best answer was to go ahead and install a window manager and then limit what startx does with the .xintrc file. Installing openbox increased the size of my original VM from 0.9 to 2.2GB. I want to minimize the size of my VM. What is the smallest group of programs that will allow me to launch a GUI?


Convert all text from uppercase to lowercase and vice versa?

My question is how can I convert all text from uppercase to lowercase and vice versa? That is to change the cases of all the letters. It has to be done with a `sed` replacement somehow.


Help with assigning output of grep to a variable

I hope someone can help me here. I'm trying to assign the output of a grep command to a variable in a bash script and the variable comes up empty. When I run the following:               el_value=$(grep '<$2>.*<$2>' $1 | sed -e 's/^.*<$2/<$2/' | cut -f2 -d'>'| cut -f1 -d':')     echo "DEBUG: The value of el_value is '$el_value'"      The output is:               DEBUG: The value of el_value is ''      If I run the grep command outside of the script (and substitute the variables for real values) I get the output I'm expecting. * * * Sorry, I guess you need a little more information than that. Here is a snippet of script. Use this script and add the values listed above.               #!/bin/bash          if [ $# -ne 3 ]; then     echo 1>&2 'This script replaces xml element’s value with the one provided as a command parameter \n\n\tUsage: $0 <xml filename> <element name> <new value>'     exit 127     fi          el_value=`grep "<$2>.*<$2>" $1 | sed -e "s/^.*<$2/<$2/" | cut -f2 -d'>'| cut -f1 -d':'`     echo "DEBUG: The value of el_value is '$el_value'"


Combination of ls, xargs and zcat leads to duplicate file name suffixes?

_**Disclaimer** : Yes, finding files in a script with `ls` is bad, but `find` can't sort by modification date._ Using `ls` and `xargs` with `echo` everything is fine:               $ ls -t1 ssl-access*.gz | xargs -n 1 echo     ssl-access.log.2.gz     ssl-access.log.3.gz     ssl-access.log.4.gz     [...]      Changing `echo` to `zcat`:               $ ls -t1 ssl-access*.gz | xargs -n 1 zcat     gzip: ssl-access.log.2.gz.gz: No such file or directory     gzip: ssl-access.log.3.gz.gz: No such file or directory     gzip: ssl-access.log.4.gz.gz: No such file or directory     [...]      Duplicate file suffixes?! What is going on here? * * * **UPDATE:** OS is Debian 5. `zcat` is a shell script at `/bin/zcat`:               #!/bin/sh     PATH=${GZIP_BINDIR-'/bin'}:$PATH     exec gzip -cd "$@"


How to disable anti-aliasing in git-gui and gitk

After an upgrade to Tcl/Tk 8.5, `git-gui` and `gitk` are using anti-aliased fonts which look ugly on my display. I can select different fonts in the preferences dialog, but the fonts I was using before (Helvetica and Courier bitmap fonts) don't seem to appear in the list. How do I restore the previous fonts?


How to mount a dd-image which was created via fmem (memory dump tool)

I'm quite new to Linux. I've used the tool `fmem` for creating a memory dump dd-file. That works fine. But how can I access this image? I've tried it with `mount` but it says I have to specify a filesystem. But non of the given possibilities works (ext4, vfat etc). What did I miss?


usr/bin/xterm Xt error: Can't open display: /usr/bin/xterm: DISPLAY is not set?

I'm trying to submit a job to a school server (HPC) with:               #!/bin/bash          #$ -S /bin/bash     #$ -cwd     #$ -o ./out_$JOB_ID.txt     #$ -e ./err_$JOB_ID.txt     #$ -notify          #$ -pe orte 1          date     pwd          ##################################     RESULT_DIR=~/Results     SCRIPT_FILE=sample_job     ##################################          . /etc/profile     . /etc/bashrc          module load packages/comsol/4.4     module load packages/matlab/r2012b          comsol server matlab "sample_job, exit" -nodesktop -mlnosplash          /bin/uname -a          mkdir $RESULT_DIR/$name     cp *.csv $RESULT_DIR/$name      The job aborts saying:               Sun Jun  8 14:20:21 EDT 2014     COMSOL 4.4 (Build: 150) started listening on port 2036     Use the console command 'close' to exit the program     /usr/bin/xterm Xt error: Can't open display:      /usr/bin/xterm:  DISPLAY is not set     Program_did_not_exit_normally     Exception:         com.comsol.util.exceptions.FlException: Program did not exit normally     Messages:         Program did not exit normally          Stack trace:         at com.comsol.mli.application.a.a(Unknown Source)         at com.comsol.mli.application.MatlabApplication.doStart(Unknown Source)         at com.comsol.util.application.ComsolApplication.doStart(Unknown Source)         at com.comsol.util.application.ComsolApplication.doRun(Unknown Source)         at com.comsol.bridge.Bridge$2.run(Unknown Source)         at java.lang.Thread.run(Unknown Source)          ERROR: Could not start COMSOL Application. See log file: /home/.comsol/v44/logs/server2.log     java.lang.IllegalStateException: Shutdown in progress         at java.lang.ApplicationShutdownHooks.add(Unknown Source)         at java.lang.Runtime.addShutdownHook(Unknown Source)         at org.apache.catalina.startup.Catalina.start(Catalina.java:699)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)         at java.lang.reflect.Method.invoke(Unknown Source)         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)         at java.lang.reflect.Method.invoke(Unknown Source)         at com.comsol.util.application.ServerApplication.a(Unknown Source)         at com.comsol.util.application.ServerApplication.a(Unknown Source)         at com.comsol.util.application.ServerApplication.a(Unknown Source)         at com.comsol.util.application.ServerApplication.main(Unknown Source)      What might be the reason and how should I fix it?


How long will Debian be supporting Gnome 2?

I'm choosing a new distro, and I'm trying to avoid Gnome 3 (and Unity). Debian is using Gnome 2.3, but I'm not sure for how long -- I don't want to install it and be forced to update to Gnome 3 in a couple months. How long does Debian plan to support Gnome 2?


How to write a script that effectively determines distro name?

I saw this post on all the different ways to find out what distro is installed, so I'm trying to write a script that tries them all. The possible commands include:               $ cat /etc/lsb-release      $ cat /etc/issue      $ dmesg | head -1     $ cat /proc/version      $ cat /etc/slackware-version      $ cat/etc/debian-verion       I tried writing something like this (I speak Spanish normally, so it's in Spanish):               function Nombre_SO()     {              DistroName="Linux"         if [ $DistroName = Linux ] ;         then          # Debian         debian=`cat /etc/debian_version | cut -d " " -f01 | tr '[:upper:]' '[:lower:]'`         if [ "$debian" = "debian" || "squeeze/sid" || "lenny" ];              then             DistroName="debian"             else             echo "Esto no es debian"         fi          # Slackware         slackware=`cat /etc/slackware-version | cut -d " " -f01` | tr '[:upper:]' '[:lower:]'`         if [ "$slackware" = "slackware" || "slackware-x86_64" ];         then             DistroName="slackware"          else         echo "Esto no es Slackware"     }      Can someone help me incorporate all the other ways to get a distro's name?


How do pwd and . determine the current path differently?

Is it mainly because `pwd` is not a builtin, while `.` is builtin to the bash shell? For example, they differ in the following example:               /tmp/ttt$ mv ../ttt ../tttt     /tmp/ttt$ pwd     /tmp/ttt     /tmp/ttt$ cd .     /tmp/tttt$


How to install adobe flash tar?

I have a problem getting Flash working in Mint13 XFCE. Now I have downloaded the tar file, but I don't understand what I have to do to get this installed. I have this file: install_flash_player_11_linux.i386.tar downloaded from here: http://get.adobe.com/nl/flashplayer/?no_redirect How do I install this?


Problems with SIG WINCH

When I run this command in a Linux terminal (konsole) and change then the windows size nothing happens. I have a second Linux in a virtual machine. There it works as expected.               trap -- 'echo changed size' SIGWINCH      What could be the reason that `SIGWINCH` doesn't work any more? __ Example: when I run this script on a normal Linux it outputs "SIGWINCH!" and dies as soon as the windows is resized. On the problem Linux resizing the windows has no effect - the script keeps running.               #!/usr/bin/env perl     use strict;     use warnings;          $SIG{WINCH} = sub { die 'SIGWINCH!!!' };          my $sum;     for my $i ( 1 .. 10_000_000 ) {         printf "%0.3f\n",  $i / 31;     }      * * * SIGWINCH is working again. I don't know why.


Running python script from Linux Terminal

I have downloaded this script named, pyAES.py and put it in a folder name codes, inside a Desktop directory of my Linux, According to this example, http://brandon.sternefamily.net/2007/06/aes- tutorial-python-implementation/ When I type,               ./pyAES.py -e testfile.txt -o testfile_encrypted.txt      the file pyAES.py should be executed. but I am getting this error,               pi@raspberrypi ~/Desktop/Codes $ pyAES.py     -bash: pyAES.py: command not found      the output of `ls -l` command is,               pi@raspberrypi ~/Desktop/Codes $ ls -l     total 16     -rw-r--r-- 1 pi pi 14536 Oct  8 10:44 pyAES.py      Here is the output after `chmod +x`               pi@raspberrypi ~/Desktop/Codes $ chmod +x pyAES.py                              pi@raspberrypi ~/Desktop/Codes $     pi@raspberrypi ~/Desktop/Codes $ pyAES.py     -bash: pyAES.py: command not found     pi@raspberrypi ~/Desktop/Codes $      and the command, `chmod +x pyAES.py && ./pyAES.py` gives the following error,               -bash: ./pyAES.py: /usr/bin/python2: bad interpreter: No such file or directory      I have also tried moving the file in `/usr/bin` directory and then executing it,               pi@raspberrypi /usr/bin $ pyAES.py     -bash: /usr/bin/pyAES.py: /usr/bin/python2: bad interpreter: No such file or directory     pi@raspberrypi /usr/bin $      I can see the file is present in /usr/bin directory but it is still giving an error that No such file or directory. I want to know why the Linux terminal is not executing the python script ?


Unplug AC causes anacron to stop. No resumumption if cron.daily had already started?

Anacron is started/stopped by a number of means, one of which is when AC power is plugged/unplugged, as can be seen by examining `/etc/apm/event.d/anacron` and `/usr/lib/pm-utils/power.d/anacron`. You can also see in `var/log/syslog` that anacron stops/starts when you unplug and replug the laptop. This a power saving feature. When anacron runs the `cron.daily` batch of jobs, initially `0anacron` is called, and it updates the `/var/spool/anacron/cron.daily` time stamp (`anacron -u cron.daily`) to the current date, before anacron goes on to process the remainder of the scripts (alphabetically, I believe). All well and good, but let's say we have the scenario where the `cron.daily` batch begins to run, the time stamp gets updated for `cron.daily`, but then sometime before completion the user unplugged the AC stopping anacron. What now? If the user replugs in (either after or before rebooting), anacron will relaunch, but upon checking the timestamp for `cron.daily` it will see it as newer than one day old, and deem the batch complete for the day. Can someone confirm if this really is the case? It would seem to explain why my backup script has not run some days, but ran fine on others. Then if so, why is the timestamp updated before the jobs run and not after all have completed?


Wireshark or MC installation wants to remove gnome and more

I want to install wireshark or mc (Midnight Commander) with `apt-get` or `synaptic`, but I get a message that "this installation will remove a lot of actually installed packages".   There are for example `gdebi`, `gedit`, `gnome`, `vino`, etc. I don't understand. Of course I need these packages. Transcript of `apt-get install mc`:               apt-get install mc     Reading package lists... Done     Building dependency tree                 Retrieving state information ... Done     The following packages were automatically installed and are no longer needed:       aptdaemon cheese-common empathy-common evolution-common 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-rest-0.7 gir1.2-tracker-0.16 gnome-panel-data gnome-session-common gnome-themes-standard-data       gstreamer1.0-nice gstreamer1.0-plugins-good gstreamer1.0-pulseaudio libavcodec54 libavformat54 libcamel-1.2-43 libcaribou-common       libchromaprint0 libcrack2 libebackend-1.2-6 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-15 libedata-book-1.2-17       libedata-cal-1.2-20 libedataserver-1.2-17 libelf1 libfluidsynth1 libgcr-base-3-1 libgexiv2-2 libgoa-1.0-common libgrilo-0.2-1       libgstreamer-plugins-bad1.0-0 libibus-1.0-5 libimobiledevice4 libmpg123-0 libmx-common libnm-gtk-common libopencv-core2.4       libopencv-flann2.4 libopencv-imgproc2.4 libopencv-ml2.4 libopencv-video2.4 libpackagekit-glib2-16 libpwquality-common libpwquality1       libraw9 libsbc1 libsecret-1-0 libsecret-common libsrtp0 libsystemd-journal0 libtbb2 libusbmuxd2 libwebp4 libx264-133 libytnef0       metacity-common python-aptdaemon python-defer python3-apt python3-aptdaemon python3-dbus python3-defer python3-gi python3-pkg-resources       python3-software-properties     To remove them, use the "apt-get autoremove".     Install the following extra packages:       accountsservice aptdaemon cheese-common colord empathy-common evince-common evolution-common evolution-data-server-common folks-common       gdebi-core gir1.2-freedesktop gir1.2-gck-1 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-soup-2.4 gir1.2-telepathylogger-0.2 gir1.2-tracker-0.16 glib-networking glib-networking-common       glib-networking-services gnome-control-center-data gnome-menus gnome-packagekit-data gnome-panel-data gnome-session-common       gnome-themes-standard-data gsettings-desktop-schemas gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-pulseaudio       init-system-helpers libaccountsservice0 libapt-inst1.5 libapt-pkg4.12 libarchive13 libasn1-8-heimdal libatk1.0-0 libatk1.0-data       libatspi2.0-0 libavcodec54 libavformat54 libavutil52 libcairo2 libcamel-1.2-43 libcaribou-common libcolord1 libcolorhug1 libcrack2       libcups2 libcupsfilters1 libcupsimage2 libdjvulibre-text libdjvulibre21 libebackend-1.2-6 libebook-1.2-14 libebook-contacts-1.2-0       libecal-1.2-15 libedata-book-1.2-17 libedata-cal-1.2-20 libedataserver-1.2-17 libegl1-mesa libelfg0 libflac8 libfolks-telepathy25       libfolks25 libgbm1 libgcr-base-3-1 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgee-0.8-2 libgeocode-glib0 libgexiv2-2       libgirepository-1.0-1 libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a libgnomekbd-common libgoa-1.0-common libgrilo-0.2-1 libgsf-1-114       libgsf-1-common libgssapi3-heimdal libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgtk-3-common libgweather-common       libhcrypto4-heimdal libhdb9-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libibus-1.0-5 libicu52       libimobiledevice4 libjavascriptcoregtk-3.0-0 libkrb5-26-heimdal libldb1 libllvm3.3 libmx-common libnm-glib4 libnm-gtk-common libnm-util2       libntdb1 libopus0 liborc-0.4-0 libpackagekit-glib2-16 libpixman-1-0 libproxy1 libpwquality-common libpwquality1 libraw9       libroken18-heimdal libsecret-1-0 libsecret-common libsmbclient libsoundtouch0 libsoup-gnome2.4-1 libsoup2.4-1 libswscale2       libsystemd-daemon0 libsystemd-journal0 libsystemd-login0 libtasn1-3 libtelepathy-glib0 libtelepathy-logger3 libtevent0 libtiff5       libtracker-extract-0.16-0 libtracker-miner-0.16-0 libtracker-sparql-0.16-0 libudev1 libusbmuxd2 libva1 libvpx1 libwacom-common libwacom2       libwayland-client0 libwayland-server0 libwbclient0 libwebkitgtk-3.0-common libwebp4 libwind0-heimdal libx11-6 libx264-133 libxcb-xfixes0       libxi6 libxml2 libytnef0 libzeitgeist-1.0-1 mc-data metacity-common nautilus-data python-aptdaemon python-gi python-gi-cairo       python-talloc python3-apt python3-aptdaemon python3-dbus python3-defer python3-gi python3-pkg-resources python3-software-properties       samba-libs tracker tracker-extract tracker-miner-fs tracker-utils     Navrhované balíky:       lrzip cups-common rng-tools grilo-plugins-0.2 gstreamer-codec-install gnome-codec-install gstreamer1.0-tools opus-tools arj catdvi       texlive-binaries dbview djvulibre-bin genisoimage gv odt2txt poppler-utils python-boto python-tz python3-apt-dbg python-apt-doc       python-dbus-doc python3-dbus-dbg python3-setuptools     Odporúčané balíky:       lintian gstreamer1.0-x cracklib-runtime libegl1-mesa-drivers     The following packages will be REMOVED:       aisleriot alacarte baobab brasero caribou caribou-antler cheese 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 iagno 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 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 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 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 libmetacity-private0a libmutter0 libmx-1.0-2       libnautilus-extension1a libnm-gtk0 libpanel-applet-4-0 libpeas-1.0-0 librhythmbox-core6 libseed-gtk3-0 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 python-aptdaemon.gtk3widgets quadrapassel rhythmbox       rhythmbox-plugin-cdrecorder rhythmbox-plugins rygel-preferences seahorse shotwell simple-scan software-properties-gtk sound-juicer       swell-foop task-gnome-desktop totem totem-plugins tracker-gui transmission-gtk vinagre vino xdg-user-dirs-gtk yelp zenity     Install the following NEW packages:       gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gir1.2-ibus-1.0 gir1.2-tracker-0.16 gstreamer1.0-plugins-base gstreamer1.0-plugins-good       gstreamer1.0-pulseaudio init-system-helpers libarchive13 libasn1-8-heimdal libavcodec54 libavformat54 libavutil52 libcamel-1.2-43       libcolorhug1 libcrack2 libcupsfilters1 libebackend-1.2-6 libebook-1.2-14 libebook-contacts-1.2-0 libecal-1.2-15 libedata-book-1.2-17       libedata-cal-1.2-20 libedataserver-1.2-17 libegl1-mesa libelfg0 libgbm1 libgcr-base-3-1 libgee-0.8-2 libgexiv2-2 libgrilo-0.2-1       libgssapi3-heimdal libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libhcrypto4-heimdal libhdb9-heimdal libheimbase1-heimdal       libheimntlm0-heimdal libhx509-5-heimdal libibus-1.0-5 libicu52 libimobiledevice4 libkrb5-26-heimdal libldb1 libllvm3.3 libntdb1       libpackagekit-glib2-16 libproxy1 libpwquality-common libpwquality1 libraw9 libroken18-heimdal libsecret-1-0 libsecret-common       libsystemd-journal0 libtelepathy-logger3 libtevent0 libtiff5 libtracker-extract-0.16-0 libtracker-miner-0.16-0 libtracker-sparql-0.16-0       libudev1 libusbmuxd2 libwayland-client0 libwayland-server0 libwebp4 libwind0-heimdal libx264-133 libxcb-xfixes0 libytnef0       libzeitgeist-1.0-1 mc mc-data python-talloc python3-apt python3-aptdaemon python3-dbus python3-defer python3-gi python3-pkg-resources       python3-software-properties samba-libs     Nasledovné balíky sa aktualizujú:       accountsservice aptdaemon cheese-common colord empathy-common evince-common evolution-common evolution-data-server-common folks-common       gdebi-core gir1.2-freedesktop gir1.2-gck-1 gir1.2-glib-2.0 gir1.2-javascriptcoregtk-3.0 gir1.2-soup-2.4 gir1.2-telepathylogger-0.2       glib-networking glib-networking-common glib-networking-services gnome-control-center-data gnome-menus gnome-packagekit-data       gnome-panel-data gnome-session-common gnome-themes-standard-data gsettings-desktop-schemas libaccountsservice0 libapt-inst1.5       libapt-pkg4.12 libatk1.0-0 libatk1.0-data libatspi2.0-0 libcairo2 libcaribou-common libcolord1 libcups2 libcupsimage2 libdjvulibre-text       libdjvulibre21 libflac8 libfolks-telepathy25 libfolks25 libgcrypt11 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgeocode-glib0       libgirepository-1.0-1 libglib2.0-0 libglib2.0-bin libglibmm-2.4-1c2a libgnomekbd-common libgoa-1.0-common libgsf-1-114 libgsf-1-common       libgtk-3-common libgweather-common libjavascriptcoregtk-3.0-0 libmx-common libnm-glib4 libnm-gtk-common libnm-util2 libopus0       liborc-0.4-0 libpixman-1-0 libsmbclient libsoundtouch0 libsoup-gnome2.4-1 libsoup2.4-1 libswscale2 libsystemd-daemon0 libsystemd-login0       libtasn1-3 libtelepathy-glib0 libva1 libvpx1 libwacom-common libwacom2 libwbclient0 libwebkitgtk-3.0-common libx11-6 libxi6 libxml2       metacity-common nautilus-data python-aptdaemon python-gi python-gi-cairo tracker tracker-extract tracker-miner-fs tracker-utils     91 upgraded, 82 newly installed, 183 to remove and 919 not upgraded.     You need to download 118 megabytes of archives.     After this operation, the disk space 235 megabytes     Do you want to continue [Y / n]?      Content of `/etc/apt/sources.list` (`/etc/apt/sources.list.d` is empty):               # deb cdrom:[Debian GNU/Linux 7.2.0 _Wheezy_ - Official amd64 NETINST Binary-1 20131012-14:04]/ wheezy main          # deb cdrom:[Debian GNU/Linux 7.2.0 _Wheezy_ - Official amd64 NETINST Binary-1 20131012-14:04]/ wheezy main          deb http://ftp.sk.debian.org/debian/ wheezy main contrib non-free     deb-src http://ftp.sk.debian.org/debian/ wheezy main contrib non-free          deb http://security.debian.org/ wheezy/updates main contrib non-free     deb-src http://security.debian.org/ wheezy/updates main contrib non-free          # wheezy-updates, previously known as 'volatile'     deb http://ftp.sk.debian.org/debian/ wheezy-updates main contrib non-free     deb-src http://ftp.sk.debian.org/debian/ wheezy-updates main contrib non-free          deb http://download.virtualbox.org/virtualbox/debian saucy contrib     deb http://download.virtualbox.org/virtualbox/debian raring contrib     deb http://download.virtualbox.org/virtualbox/debian quantal contrib     deb http://download.virtualbox.org/virtualbox/debian precise contrib     deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free     deb http://download.virtualbox.org/virtualbox/debian wheezy contrib     deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free          deb http://ftp.debian.org/debian experimental main     deb http://ftp.debian.org/debian testing main      Output of `apt-cache policy`:               apt-cache policy     Package files:      100 /var/lib/dpkg/status          release a=now      500 http://ftp.debian.org/debian/ testing/main Translation-sk      500 http://ftp.debian.org/debian/ testing/main Translation-en      500 http://ftp.debian.org/debian/ testing/main amd64 Packages          release o=Debian,a=testing,n=jessie,l=Debian,c=main          origin ftp.debian.org      500 http://ftp.debian.org/debian/ experimental/main Translation-en        1 http://ftp.debian.org/debian/ experimental/main amd64 Packages          release o=Debian,a=experimental,n=experimental,l=Debian,c=main          origin ftp.debian.org      500 http://download.virtualbox.org/virtualbox/debian/ squeeze/non-free amd64 Packages          release o=Oracle Corporation,n=squeeze,l=Oracle Corporation,c=non-free          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ squeeze/contrib amd64 Packages          release o=Oracle Corporation,n=squeeze,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ wheezy/contrib amd64 Packages          release o=Oracle Corporation,n=wheezy,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ lucid/non-free amd64 Packages          release o=Oracle Corporation,n=lucid,l=Oracle Corporation,c=non-free          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ lucid/contrib amd64 Packages          release o=Oracle Corporation,n=lucid,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ precise/contrib amd64 Packages          release o=Oracle Corporation,n=precise,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ quantal/contrib amd64 Packages          release o=Oracle Corporation,n=quantal,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ raring/contrib amd64 Packages          release o=Oracle Corporation,n=raring,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://download.virtualbox.org/virtualbox/debian/ saucy/contrib amd64 Packages          release o=Oracle Corporation,n=saucy,l=Oracle Corporation,c=contrib          origin download.virtualbox.org      500 http://ftp.sk.debian.org/debian/ wheezy-updates/non-free Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy-updates/main Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy-updates/contrib Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy-updates/non-free amd64 Packages          release o=Debian,a=stable-updates,n=wheezy-updates,l=Debian,c=non-free          origin ftp.sk.debian.org      500 http://ftp.sk.debian.org/debian/ wheezy-updates/contrib amd64 Packages          release o=Debian,a=stable-updates,n=wheezy-updates,l=Debian,c=contrib          origin ftp.sk.debian.org      500 http://ftp.sk.debian.org/debian/ wheezy-updates/main amd64 Packages          release o=Debian,a=stable-updates,n=wheezy-updates,l=Debian,c=main          origin ftp.sk.debian.org      500 http://security.debian.org/ wheezy/updates/non-free Translation-en      500 http://security.debian.org/ wheezy/updates/main Translation-en      500 http://security.debian.org/ wheezy/updates/contrib Translation-en      500 http://security.debian.org/ wheezy/updates/non-free amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=non-free          origin security.debian.org      500 http://security.debian.org/ wheezy/updates/contrib amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=contrib          origin security.debian.org      500 http://security.debian.org/ wheezy/updates/main amd64 Packages          release v=7.0,o=Debian,a=stable,n=wheezy,l=Debian-Security,c=main          origin security.debian.org      500 http://ftp.sk.debian.org/debian/ wheezy/non-free Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy/main Translation-sk      500 http://ftp.sk.debian.org/debian/ wheezy/main Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy/contrib Translation-en      500 http://ftp.sk.debian.org/debian/ wheezy/non-free amd64 Packages          release v=7.3,o=Debian,a=stable,n=wheezy,l=Debian,c=non-free          origin ftp.sk.debian.org      500 http://ftp.sk.debian.org/debian/ wheezy/contrib amd64 Packages          release v=7.3,o=Debian,a=stable,n=wheezy,l=Debian,c=contrib          origin ftp.sk.debian.org      500 http://ftp.sk.debian.org/debian/ wheezy/main amd64 Packages          release v=7.3,o=Debian,a=stable,n=wheezy,l=Debian,c=main          origin ftp.sk.debian.org      I have used Debian 7 Wheezy - 3.2.0-4-amd64 SMP Debian 3.2.51-1 x86_64 GNU/Linux. Have you any solution for non-conflicting installation?


Open port 80 in CentOS 6.5

I'm trying to open the Port 80 in my CentOS 6.5, on my virtual machine, so I can access the apache from my desktop's browser. ![enter image description here](http://i.stack.imgur.com/vw3zn.jpg) If you take a look at the screenshot above.... I've added the line before the blue arrow, as is written on http://www.cyberciti.biz/faq/linux-iptables- firewall-open-port-80/ Now I do get the apache test page when entering the IP- address in my browser, but still when restarting the iptables, I get a "FAILED" when CentOS tries to apply the new rule. Does anyone know a solution for this? Or do I need to ignore the failure?


What's the origin of rc, rc.d, share, proc in Linux?

I don't think I am a newbie at all, but I still can't figure out many abbreviations' origin like `rc`, `rc.d`, `share`, `proc`... I've heard someone says `rc` is "run command", `.d` is directory, but I'm not sure that's true. Is there a table explaining what their source is?


How do I redirect output from a command line app (howie AIML interpreter) to another command line app (espeak)?

I'd like to interact with an AIML interpreter that runs on the command line (Howie) using standard input and have the output played using espeak. I've tried: > ./runme.py | espeak --stdin No success yet.


How to start tailing a file that has not been yet created

I use `tail` to monitor the progress of jobs that I know will write their progress to disk. Almost always, I know which file they will create before they start running (the jobs are dispatched by a scheduler on a supercomputer) Is there a way to `tail` these files before they are created? I would like to do so while avoiding race conditions and/or making assumptions about how or when the jobs write to disk.


Obtain .avi file info from command line

What is the best way to obtain information as bitrate, framerate, width/height of an movie file (in my case .avi) from the command line? I am looking for a basic tool that works similarly as ImageMagicks identify. Running mplayer already gives this information (but also does a lot more): > VIDEO: [FMP4] 800x711 24bpp 25.000 fps 1320.9 kbps (161.2 kbyte/s) Is there a way to make mplayer only give this output (I did not find it in the man) or is there another standard bash-command to obtain the same information?


Print all lines not containing punctuation

I want a regex pattern which can print all lines not containing punctuation : **Input :**               .I am line 1     I am ! line 2     I am line (3)     I am line 4      **Output:** ( should be)               I am line 4      **What I've tried so far :**               grep '[^[:punct:]]' file.txt      But it shows all characters which is not punctuation.


How to expand tabs based on content?

I've got some tab-delimited data coming out of a Unix pipe. I'd like to format this data into a compact human-readable table. **How can I expand these tabs into spaces, and automatically set the tab stops based on the width of the field data?** For example, my hypothetical `generate_tsv` script might produce (I'm using `\t` to represent actual tab characters) —               alpha\t1\t0.21085026\tok     beta\t4096\t0.0\tok     gamma\t\t-1.0\tinvalid      Using `| expand -t 12`, I'd get:               alpha       1           0.21085026  ok     beta        4096        0.0         ok     gamma                   -1.0        invalid      But I'd like something more compact (so there are exactly two spaces separating columns), like this:               alpha  1     0.21085026  ok     beta   4096  0.0         ok     gamma        -1.0        invalid      * * * As suggested by @jw013, `| column -t -s $'\t'` is close, but not quite correct, as it collapses the empty cell:               alpha  1     0.21085026  ok     beta   4096  0.0         ok     gamma  -1.0  invalid


Subtracting Binary files

I have 2 Binary Files `FileA` and `FileC` Its is such that `FileC = FileA + FileB` using the `cat` utility How do I subtract `FileA` from `FileC` to get `FileB` ? _PS: I am using Ubuntu Oneiric_


Installing .package file in Arch Linux

I'm looking to install Yenka, the successor to Crocodile Clips (electronics simulation software). I was initially going to use WINE, but it seems they offer a linux option, too. However, the download is for a `.package` file, and I have absolutely no idea how it works. There seems to be very little about it on Google, and I'm not even sure if it's compatible with arch, so I'm not sure where to go from here. Any advice?


I am using CentOS in which i had removed libxml2 accidentally now it was showing the following error as follows: > There was a problem importing one of the Python modules required to run yum. > The error leading to this problem was: > > libxml2.so.2: cannot open shared object file: No such file or directory > > Please install a package which provides this module, or verify that the > module is installed correctly. > > It's possible that the above module doesn't match the current version of > Python, which is: 2.4.3 (#1, Jun 18 2012, 08:55:31) [GCC 4.1.2 20080704 (Red > Hat 4.1.2-52)] > > If you cannot solve this problem yourself, please go to the yum faq at: > http://wiki.linux.duke.edu/YumFaq


svn backup bash script errors

I have created bash script for create dump of svn repositories. I want to add such functionality that after dump of every repository script send it to remote server using rsync and delete from dump location and after that starts to make dump of next repository. I am using following script. script has some errors help me to improve it.               #!/bin/sh          # Record todays date     # --------------------     bakdate=$(date +%Y%m%d)     echo "--------------------------------"     echo "Running SVN backup $bakdate"     echo "--------------------------------\n"          # From where to backup repos?     # ---------------------------     svnrepos="/kk/svn/"     echo "\nGoing to backup all SVN repos located at: $svnrepos \n"          # Where to save the dump?     # ------------------------     bakdest="/save/"          # Location of remote server (to copy backup)     # ----------------------------------------     baktoremote="root@192.168.11.156:/kk"             cd $svnrepos               # Just make sure we have write access to backup-folder     if [ -d "$bakdest" ] && [ -w "$bakdest" ] ; then       # Now $repo has folder names = project names       for repo in *; do         # do svn dump for each project         echo "Taking backup/svndump for: $repo"         echo "Executing : svnadmin dump $repo >     $bakdest/$repo-$bakdate.dump \n"         # Now finally execute the backup         svnadmin dump $repo > $bakdest/$repo-$bakdate.dump               # Just make sure we have write access to backup-folder     if [ -d "$bakdest" ] && [ -w "$bakdest" ] ; then       # Now $repo has folder names = project names       for repo in *; do         # do svn dump for each project         echo "Taking backup/svndump for: $repo"         echo "Executing : svnadmin dump $repo >     $bakdest/$repo-$bakdate.svn.dump \n"         # Now finally execute the backup         svnadmin dump $repo > $bakdest/$repo-$bakdate.dump              # sent it to remote server            rsync -avP $bakdest/$repo-$bakdate.dump $baktoremote                      # delete repository after sending                rm -rf $repo-$bakdate.dump              fi


Unable to mount ext2 hard drive

I have been trying to mount an ext2 hard drive in ubuntu server, but when i run `sudo mount /dev/sdb /media/mynewdrive -t ext2` I get               wrong fs type, bad option, bad superblock on /dev/sdb1,     missing codepage or helper program, or other error     In some cases useful info is found in syslog - try     dmesg | tail  or so      I also ran fsck /dev/sdb and got               fsck from util-linux 2.20.1     e2fsck 1.42.5 (29-Jul-2012)     ext2fs_open2: Bad magic number in super-block     fsck.ext2: Superblock invalid, trying backup blocks...     fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb          The superblock could not be read or does not describe a correct ext2     filesystem.  If the device is valid and it really contains an ext2     filesystem (and not swap or ufs or something else), then the superblock     is corrupt, and you might try running e2fsck with an alternate superblock:         e2fsck -b 8193 <device>      Not sure where to go from here! Anyone have any ideas?


Massive, unpredictable I/O performance drop in Linux

I'm using Debian testing without any problems for ~6 years (I'm just regularly updating it), but recently it started to show a random behaviour that can be summarized as "Low I/O performance which persists until reboot". The problem is, suddenly all disk reads and writes slow down to ~5MB/sec which results in continuous read and writes. Since the rate is so low, disks are not mechanically challenged or stressed, but everything slows down until I reboot. I/O subsystem of the computer consists of one OCZ Vertex 3 SSD and two WD Caviar Black HDDs. SSD holds read-heavy part of the OS and a partition on the HDD holds the rest. To diagnose the problem I tried the following without success:   * `top` doesn't show any runaway activity neither in CPU nor I/O usage.   * `hdparm` returns normal performance ratings of the disks (I only checked `-t` though).   * `smartctl` doesn't show any performance problems in disks. Long tests showed that the disks are as good as new.  System has Z77 Chipset, 16GB of RAM and Intel i7 3770K CPU and the stats show no signs of saturation in RAM, I/O or CPU, but I'm not experienced to debug problems like this (esp. in kernel space). Any help will be appreciated. ### Update 1:   * I ran (forced) fsck on every partition as a precaution. All FS are clean.   * Incidentally I found a BIOS upgrade which came out a month ago & applied it.   * No partition is filled more than 50%. ### Update 2: The problem is not surfacing up for two days. Either `fsck` or the BIOS update cleaned some clogs in the system. I'm still monitoring the issue and will close the question with a post-mortem answer. ### Update 3: Problem just resurfaced and I did some more digging. Please see the answer.


cd to directory of a symbolically linked file

Before I write a script, anyone know an easy way to do the following:               $ pwd     /foo/bar     $ ls -l     lrwxr-xr-x  1 username  admin  48 Apr 17  2012 foo.sh -> /bar/foo.sh     $ cd /bar     $ ls     foo.sh      _i.e.,_ in the directory `/foo/bar`, I'd like to do something like `cdl` (cd link), which would take me to the directory of the linked file (or alternatively to the linked directory, if that happened to be the case—if it was I could type `cd -P /bar`).


Mint 16 Cinnamon, maximize window fully

I am using Linux Mint 16 Petra cinnamon. The problem I have is that when I drag a window to the top edge of the screen the window only maximizes to the top half of the screen instead of the the entire screen, just like when I hit the maximize button (plus button on the top right side of the screen). This is what I get. ![enter image description here](http://i.stack.imgur.com/mTPPG.png) This is what I want to happen. ![enter image description here](http://i.stack.imgur.com/1mRXP.png)


Solving a shared object linkage

I tried to run `icecat`.               [hibudevb@localhost icecat-24.0]$ ./icecat     XPCOMGlueLoad error for file /home/hibudevb/icecat-24.0/libxul.so:     libjpeg.so.8: cannot open shared object file: No such file or directory     Couldn't load XPCOM.      I found that /usr/lib64/libjpeg.so.62 existed, so did then:               # ln -s /usr/lib64/libjpeg.so.62 /usr/lib64/libjpeg.so.8      Repeating produced:               [hibudevb@localhost icecat-24.0]$ ./icecat     XPCOMGlueLoad error for file /home/hibudevb/icecat-24.0/libxul.so:     /lib64/libjpeg.so.8: version `LIBJPEG_8.0' not found (required by /home/hibudevb/     icecat-24.0/libxul.so)     Couldn't load XPCOM.      What are the fedora mechanics for retrieving/downloading/selecting/building that file? Shall I compile it myself?


What commands are available in the %pre section of a Kickstart file on CentOS?

Environment: CentOS 5.5 and 6.4 I have a request to analyze the hardware before installation to make sure our customers don't install our software on sub-standard server hardware. For example, examining memory, disk space, CPU, network card... So, the %pre section in my ks.cfg file seems like the perfect place to do this??? But, I can't get a command like free to work.... I would like to find out what commands are available in the %pre section and is this the right place to perform hardware analysis before the installation begins???.. If the %pre section of ks.cfg is NOT a good place to do this, then where?? Here is what I've tried so far and I get NO output: ks.cfg:               %pre       (echo "Analyzing Hardware...") >/dev/tty1       free >/dev/tty1       free_txt=`free -o`       (echo "$free_txt") >/dev/tty1     %end      I see 'Analyzing Hardware...' on the screen during the first part of the install but nothing after that.....


Audible DRM Removal for personal use

I have a bunch of Audiobooks from Audible. I've made a complete switch from Windows to Linux but Audible do not support Linux. While there are some annoying ways around this I would like to convert my Audible books into Mp3 or Mp4 format. Has anyone done this previously? Can anyone suggest a quick and easy way to make this conversion? Should i go down the copy directly from the soundcard route? or is there a way to remove DRM directly from the file itself? I have absoloutly no intention of sharing these files once they are converted. I like the service audible provide, and i dont mind paying for books that i want. I just want to be able to listen too them!


How to back-up files from nautilus retaining the time stamp?

I connected my android tablet (Asus fonepad7 me372cg) to laptop using usb cable. It showed up in nautilus in Ubuntu 13.04. I've to back-up the files in the tablet (specially the videos & photos) to my laptop. The issue I find here is that via nautilus when I copy-paste, the original time stamp gets lost & the current time gets linked with the copied files. This I don't want. Is there a way to achieve this via nautilus which will retain the time stamp? I know that via command line, I can achieve that using `tar` or `cpio`. But the reason I'm not using cli is that the file names in the terminal for the tablet aren't displayed rightly. (I've a thread regarding this issue here) Rather than the names of the files & folders, it's reflecting as numbers. I've come across this issue in google search engine which I will try to resolve later. But till then I need a solution to achieve it via nautilus! By nautilus, I mean the GUI as shown below: ![nautilus](http://i.stack.imgur.com/eOwf1.png)


Need to move complete unix disk from old HP to new box

I have an old HP 715/80 that is running some really old software that we need to continue using. The software is no longer available. I am wanting to somehow clone or move the data to a new Unix/Linux machine. The only thing the HP has is a tape drive so I am lost on how to proceed. Any insight would be great.


Use Linux without a GPU

Is it possible do have basic (even just console) graphics on Linux, but without using the GPU (which, in this case, is fried and not replaceable)? Or would such a computer be limited to non-graphical uses only? EDIT: The computer I'm talking about is an iMac with a broken graphics card/GPU, but everything else working (like the screen)


URL with hostname doesn't work but it works with IP Address

I have a very basic question here. This thing is puzzling me a little bit. I have one Ubuntu machine which is running 12.04 and I am connecting to that machine from putty in my desktop (which is running windows). I started Netflix Exhibitor like this in that Ubuntu machine -               cronusapp@phx5qa01c:/zook$ java -jar ./exhibitor-1.5.1/lib/exhibitor-1.5.1-jar-with-dependencies.jar -c file     v1.5.1     INFO  com.netflix.exhibitor.core.activity.ActivityLog  Exhibitor started [main]     INFO  org.mortbay.log  Logging to org.slf4j.impl.Log4jLoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog [main]     INFO  org.mortbay.log  jetty-1.5.1 [main]     Dec 18, 2013 7:10:35 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate     INFO: Initiating Jersey application, version 'Jersey: 1.9.1 09/14/2011 02:36 PM'     INFO  org.mortbay.log  Started SocketConnector@0.0.0.0:8080 [main]      And then I went to chrome browser in my desktop and I opened the url like this with the machine hostname -               http://phx5qa01c.stratus.phx.qa.host.com:8080/exhibitor/v1/ui/index.html      And this url is showing me blank white page on the screen. But if I replace the hostname with IP Address of that machine, then it starts working and I can see the actual content on my browser.               http://10.108.24.132:8080/exhibitor/v1/ui/index.html      Now I am not sure why this is happening. Is there any file which I am supposed to modify in my Ubuntu box to recognize the hostname instead of ip address. I believe this is pretty basic question which I am not aware of? Any idea what I am supposed to do to fix this? **UPDATE:-** This is what I have done to figure out the IP Address, I am taking IP Address for etho -               root@phx5qa01c:/home/david# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:50:56:ad:5b:a9               inet addr:10.108.24.132  Bcast:10.108.27.255  Mask:255.255.252.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:351211 errors:0 dropped:590 overruns:0 frame:0               TX packets:291409 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:426570999 (426.5 MB)  TX bytes:39383233 (39.3 MB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:15839 errors:0 dropped:0 overruns:0 frame:0               TX packets:15839 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:1455090 (1.4 MB)  TX bytes:1455090 (1.4 MB)      And below is for the hostname -               root@phx5qa01c:/home/david# hostname -f     phx5qa01c.stratus.phx.qa.host.com      **UPDATE2:-** This is what I got after nslookup from my desktop -               david@desktop /cygdrive/c/ApacheExhibitor/Exhibitor-1.5.1/target     $ nslookup phx5qa01c.stratus.phx.qa.host.com     Non-authoritative answer:     Server:  sjd-entdc-001.corp.host.com     Address:  10.244.128.25          Name:    phx5qa01c.stratus.phx.qa.host.com     Address:  10.108.24.132


What is a windowing system?

Can someone provide me with a very clear and practical example of a "windowing system"? I was reading on Linux, and although I've always known that it's a kernel, I didn't really know what a kernel is because I haven't taken an OS class yet. My understanding of it is that it's basically the layer between hardware and software. Would that be correct? Now the Linux distros everyone uses is combination of GNU/Linux/X Window System. I think I got the Linux kernel part, but what is a windowing system and what is GNU? Wikipedia says GNU is an OS, but then that would mean Linux distros are composed of another OS. Can someone clear this up for me?


Utility for sending HTML mail with attachments to a long list of emails?

I'm in the middle of writing a Python program which simply sends the same HTML message with an attachment to a large list of email addresses (BCC). Is there a utility I could use to do this rather than writing something from scratch? The actual email message doesn't vary at all, I simply need to send the same HTML and same attachment to all emails. Does a Unix utility exist to provide this functionality?


How to install software in solaris?

How do I install NetBackUp software in solaris? I'm learning the software and I need to install and practice using it.


How to make new KVM with existing hard drive

I've been looking through the options of the QEMU binary, and I can't work this one out: Is it possible to make a new KVM machine with an existing hard drive image with an OS (XP Pro in this case) already installed? I have seen a guide online to turn my VirtualBox XP Pro hard drive (.vdi) into a qemu image (which I have done) but I can't seem to make a new KVM using this existing hard drive?


Substring only the first column in awk

I want to take first 500 characters of the first column and leave the rest of the columns as it is, using awk. This is what I am trying to do:               awk '{print ${$1:1:500} $2,$NF;}' doc.txt      But I get syntax error:               awk: {print ${$1:1:500} $2,$NF;}     awk:         ^ syntax error     awk: {print ${$1:1:500} $2,$NF;}     awk:                           ^ syntax error


Can separate unix accounts share a username but have separate passwords?

On unix systems, each separate user account has a unique username. Passwords, then, are not unique - every distinct user could have the same exact password. I want to do the converse. I want one username, but I want that login name to have multiple passwords. Depending on the password, you would either be logged into a different account (with a different UID) or you would simply have a different home directory. The goal is for two separate entities to share the same username but have their files be separate - in this case, file permissions between different UIDs are less important. Any thoughts on how to accomplish this, or something like it? Some abuse of /etc/shadow or PAM? Is this something that could be accomplished by writing a PAM module (I've never written one before. Is it very very hard?)


How to edit/delete a .dot_file on mac without using Terminal

When I start Terminal I can not control it. It starts executing an endless loop repeating that `some alias` does not exist. Because of this I am not able to edit this file using a program such as `vim`. Is there a way to update/delete `.bash_profile` and do not use Terminal at all, providing I have a replacement `.bash_profile`?.


Ubuntu 11.10 SFTP chroot jail problem

I am creating a SFTP server with Chroot Jail. The problem is user cannot log into the home directory. I need to keep `ChrootDirectory` value to one directory above the user's home directory (/home/jail/home in this case). I read that the directory needs to be owned by root. In that case user cannot do anything except logging into the server. Below is the sftp-specific part of my sshd_config file               Match User ftpuser         ChrootDirectory /home/jail/home/ftpuser         ForceCommand internal-sftp      Output of `$id ftpuser` is               uid=1001(ftpuser) gid=1002(ftpuser) groups=1002(ftpuser),0(root)      I have intentionally added it to the root group so that ftpuser can at least login. Output of `$grep ftpuser /etc/passwd` is               ftpuser:x:1001:1002::/home/jail/home/ftpuser:/bin/false      Permissions of /home/jail/home/ftpuser ared               rwx------+ 3 root root 4096 2011-12-12 12:49 /home/jail/home/ftpuser/      What should I do?


Why doesn't my iptables rule work?

I have two interfaces on my VPS: `eth0` and `eth0:0`. I want to block incoming packets on port 80 on `eth0:0` using iptables. I tried this, but it doesn't work:               iptables -A INPUT -i "eth0:0" -p tcp --destination-port 80 -j DROP      If I change `eth0:0` to `eth0` it works correctly. What is the problem?


How to delete 2 months back files in unix

Say I have below log files,               AA_XX_20130719185428.log     exec_xxx_cpb_20130712182453.log     13122013121327_AR_INC_DOBC_1.dprf.log     24122013_masterscript.LOG      Date part contains both date and time. I want to delete all the 2 months back files. I don't want to delete the file on the basis of last modified date but on the basis of the date included in the filename. The dates can be in any of these formats:   * YYYYmmddHHMMSS   * ddmmYYYYHHMMSS    * ddmmYYYY. How I can delete the files using shell script?


How can I know how long it takes to run updatedb daily job?

I'm using CentOS6.4 and `updatedb` is running as a daily job. What should I do if I want to know how long it takes for `updatedb` to run?


Vim delay when using Ctrl+C, but only in SQL files

I'm working on a side project with both JavaScript and SQL source files. When I'm editing the JavaScript, Vim behaves normally. However, when I'm editing the SQL files, there's about a one-second delay between when I press `Ctrl``C` and when Vim exits insert mode. When I use the Escape key, or `Shift``Enter` which I mapped in my `~/.vimrc` as a test, it shows no delay. I thought perhaps it was something to do with the syntax highlighting, but when I ran `:syntax off` to try and fix it, the delay still showed up. I also tried `:setf text`, which also did not work. I have only a couple of plugins installed (CtrlP, NerdTree, and highlighters for Jade, Less, and CoffeeScript) so I don't think that's what's interfering. Does anyone know what could be going on?


How to ensure SSH port is only open to a specific IP address?

This is my `/etc/sysconfig/iptables`: It has two ports open 80 apache and 22 for ssh.               # Firewall configuration written by system-config-firewall     # Manual customization of this file is not recommended.     *filter     :INPUT ACCEPT [0:0]     :FORWARD ACCEPT [0:0]     :OUTPUT ACCEPT [0:0]     -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT     -A INPUT -p icmp -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT     -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT     -A INPUT -j REJECT --reject-with icmp-host-prohibited     -A FORWARD -j REJECT --reject-with icmp-host-prohibited     COMMIT      For port 22 ( SSH ) I want to ensure no-one can connect to this port except for a specific ip address. example ip:               0.0.0.0      Please disregard any oversight/concerns regarding what if my ip changes and I can not SSH to my server any more.


How to change /var partition online?

I have a Linux server with `/var` in XFS and I want to change to EXT4. There is enough space in `/home`, so I can backup all files in `/var`. Is there a way to do it while the system in running ? I think `mount --bind` and `mount --move` can help, but I cannot find an example.


Weird authentication with Exchange server

I'm using Evolution with `evolution-mapi` to access an Exchange e-mail server.   It has worked flawlessly in the past, but recently it will fail to authenticate, asking my password endlessly. If I enter the correct password, it tells me that it is incorrect.   If I enter an incorrect password, it closes the prompt, but fails to obtain the mail from the inbox (due to the truly incorrect password). I fixed part of the issue by pointing my client to the server's IP address rather than its hostname, but it will still occasionally fail to send/receive e-mail. EDIT: What I can do: I am able to `ping` the server via its hostname and IP address with no packet loss. Since this is an internal server (or at least I'm accessing it via LAN), I have no reason to use a FQDN. I am able to use the server for its other functions, namely a network- mountable directory where we store shared files for work. The server appears to be fully operable. I'm under the impression that this issue is specific to Evolution or the MAPI plugin, or at least the versions thereof available in Ubuntu 14.04. EDIT 2: It seems to be on and off whether a certain session of Evolution will properly authenticate. Also, each time I enter my password, I am given the option to save the password to my keyring, but it never seems to actually save.


Fetching Remote Windows System Information From Linux Server

I need a script/command that would fetch Windows System Information (Host Name,User Name, Domain, OS Info, Hardware Info, Memory Info, processor Info, etc) by running it on a Linux Server (RHEL 6.5 preferably). I have already written a batch script using `wmic` that would record all above details and ran it on a Windows Server, but it won't work for Linux systems. A bash script with a series of `dmidecode` commands can fetch remote Linux systems' details, but all Windows systems will be skipped. In brief, the scope of using those scripts is limited to Windows-Windows or Linux-Linux environment. Is there any possible way with which we can fetch all the mentioned parameters of remote Windows systems by running a script on a Linux server or vice-versa?


Changing file permissions on an HFS+ filesystem

I ran the command `fdisk -l` to find out what my external drive is formatted to, I found out it's uses GPT partitions and the filesystem is HFS+. When I try and create a new folder on the external drive I receive the following message:               chmod: changing permissions of 'file_name/': Read-only file system      If I run `mount` this is the output:               /dev/sda1 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/cgroup type tmpfs (rw)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)     none on /sys/fs/pstore type pstore (rw)     systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)     gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=dev)     /dev/sdc2 on /media/dev/andre backup type hfsplus (ro,nosuid,nodev,uhelper=udisks2)     /dev/sde2 on /media/dev/andre_clients type hfsplus (ro,nosuid,nodev,uhelper=udisks2)      So now I ran `umount /dev/sde2` and unplugged the device then reconnected the device and ran the command `dmesg | tail` and got this information back:               [429154.613747] sd 14:0:0:0: [sde] Assuming drive cache: write through     [429154.615995] sd 14:0:0:0: [sde] Test WP failed, assume Write Enabled     [429154.616993] sd 14:0:0:0: [sde] Asking for cache data failed     [429154.616997] sd 14:0:0:0: [sde] Assuming drive cache: write through     [429154.669277]  sde: sde1 sde2     [429154.671369] sd 14:0:0:0: [sde] Test WP failed, assume Write Enabled     [429154.672742] sd 14:0:0:0: [sde] Asking for cache data failed     [429154.672747] sd 14:0:0:0: [sde] Assuming drive cache: write through     [429154.672751] sd 14:0:0:0: [sde] Attached SCSI disk     [429157.047244] hfsplus: write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.      Would it now be safe to run `sudo mount -o remount,rw /dev/sde2 /media/dev/andre_clients` without loosing any infomation?


Debian doesn't detect disks from Live CD

I've loaded from the USB stick with Debian Live CD on it to fix the MBR after a Windows installation. Suddenly I've found that `fdisk -l` shows nothing but the live USB itself. What would it mean? I've used this image: http://cdimage.debian.org/debian-cd/current- live/i386/iso-hybrid/debian-live-6.0.5-i386-xfce-desktop.iso


How to safely replace a not-yet-failed disk in a Linux RAID5 array?

I have a software RAID5 array (Linux md) on 4 disks. **I would like to replace one of the disks with a new one, without putting the array in a degraded state** , and if possible, online. How would that be possible? It's important because I don't wan't to:   * take the risk of stressing the other disks so one may crash during rebuild,    * take the risk of being in a "no-parity state" so I don't have a safety net for some time.  I suppose doing so online is too much asking and I should just raw copy (`dd`) the data of the old disk to the new one _offline_ and then replace it, but I think it is theoretically possible... _Some context_ : Those disks have all been spinning almost continuously for more than 5.5 years. They still work perfectly for the moment and they all pass the (long) SMART self-test. However, I have reasons to think that one of those 4 disks will not last much longer (supposed predictive failure).


Linux Mint 13 Xfce window button disappeared & no mouse cursor in text mode

I am using Linux Mint 13 Xfce version on VBox. After one month without any problem suddenly today I noticed that the min-max-close buttons on all windows have disappeared. Secondly, I can write in gedit, but I cannot see the blinking mouse cursor while coding. It is somehow wierd. I tried:               sudo apt-get update     sudo apt-get upgrade but still it is the same problem.....


Send print job to printer immediately without queueing, aka increase print performance

I have a ruby/rails web application, one action of which sends PDF files that have been generated by the app to a Xerox 4127 printer on the network. This is accomplished via shelling out and running multiple lpr commands (to default print queue, using -s to prevent spooling copies and -o InputSlot to identify the tray). The PDF's cannot be combined into one single doc/printjob because they are sent to different trays depending on file specifics and the color of paper needed. A "cycle" might consist of 15k or more pages, sent to the printer in batches of 20 or 30 up to several hundred at a time. I set up the printer on the server as an lpd queue with the generic pcl 6 gutenprint driver. Xerox does not provide a Linux driver, but says it will work with lpd/lpr. And it does - I am able to send documents successfully, both manually from the command line and via the web application. This process was prototyped as a Windows program in Foxpro. The prototype generates a PDF for each page of the batch and sends it as an individual print job. Because the printer has a metric butt-ton of memory, the prototype just dumps job after job to the printer and allows the printer to manage them all, which it does very well. A batch of several hundred pages/print jobs queues into the printer almost immediately and the printer spits them out with little pause as if they were part of one giant document. My web application actually combines pages that are destined for the same tray one right after another into a single PDF, so I actually expected things to be faster, but they are not. By an order of magnitude, the process is much slower. A "cycle" that would take 8 hours to run in the prototype takes several days to get through in the web app. What appears to be happening is that the print jobs are not "dumping" to the printer like they do in the prototype. Monitoring the printer through it's onscreen utilities, we only see one print job showing up at a time. The print queue on the server seems to be waiting to send each print job until the printer signals back that the prior job is complete. As such, instead of everything spitting out constantly as if one document, we get a page, then a pause while the next file comes in, then a few pages, then a pause, then a page, then a pause, etc.... you get the idea. Is the print queue on the server actually waiting for the printer to say "done"? If so, is there anyway for me to configure it to just send, send, send and not wait for comms back from the printer? Two notes: the server is in another building, but we did some testing with a machine on the exact same sub-net as the printer and saw no measurable improvement, ie does not seem to be network related. Likewise, I'm aware that lpr is converting the PDF documents to postscript before sending, so I pre- converted them and tested the process without that. Some improvement in the queuing process at the server, not terribly significant, but no impact on the fact that only one job is going to the printer at a time, which I believe is the root problem.


find and globbing (and wildcards)

I tried finding some files (`*.e*`) that are in the same directory as another file (`md.tpr`). I needed to list them (for further processing) using the following:               find . -name md.tpr -execdir ls *.e* \;      I tried a few variants of this command and some others (including single quoting the command passed to `-execdir` or passing it as `sh -c 'ls *.e*'` or `eval 'ls *.e*'` to name a few). It appears that globbing is not working when passed to `-exec` or `-execdir`. The error I get when running the above command is:               ls: *.e*: No such file or directory      Just as a sanity check, I did `-execdir pwd` and it prints what it should, so it appears that it's a problem with globbing, as those `*.e*` files do exist in the directories listed with this test. Now, I was able to solve this problem in a much less elegant way but it just baffled me why globbing and wildcards wouldn't work here. Any ideas? Or am I completely off the track? I use bash 3.2.25 (old but I don't have admin rights on that system). Also, interestingly, if I do               find ~ -name .bashrc -maxdepth 2 -execdir ls -d .b* \;      it doesn't work unless it's done from `$HOME`.


locate java source code in jdk7

I have installed Jdk7 in Ubuntu 14.04 and it is successfully configured and I can use java libraries in code. The problem is that I am trying to locate java source code, but not able to find the jar file. The below part is updated -- I run the the following command in the location `/opt/sun/jdk7`               find . -name *.zip      It didn't find anything. Given that source code could be located in the location as Julien suggested.               $JAVA_HOME/src.zip      Here is what I did while installing jdk7               sudo apt-get install openjdk-7-jdk       and it downloaded the package `java-7-openjdk-amd64` which seems to not have something like src.zip. So now I got `jdk1.7.0_17` and I can find the source code in jdk1.7.0_17/src.zip


"database disk image is malformed"

Running `yum search something` I get:               Error: database disk image is malformed      How to fix?


Unresponsive desktop after resume from hibernation

After booting up my computer after hibernation (suspend to disk), my desktop is unresponsive for up to 15 minutes. I've found that the slowness is caused by the fact that all running applications seem to be swapped out to disk. For example, 3 GB of RAM may be in use when I suspend to disk. After resuming from hibernation, RAM usage is low (500 MB or so) and slowly everything will start to get swapped back into RAM. The problem does not occur with sleep (suspend to ram). Is there a problem with my setup (swap partition size, BIOS), or is this simply the way hibernation works in Linux? This answer seems to suggest that TuxOnIce may improve matters; is that possible? I'm running Arch Linux on a Toshiba Satellite L300-2CP with 4 GB of RAM and a 4 GB swap partition. **EDIT:** TuxOnIce (using the linux-pf kernel) indeed makes a huge difference, and basically solves the problem for me. I would find it hard to believe that what I was experiencing with the standard kernel (swsusp) hibernation is normal, however... **EDIT 2:** Of course TuxOnIce hangs now and then during hibernation.


How to force watch to run under bash

The problem is that when watch is executed it runs `sh` and I get this error:               sh: 1: func1: not found      here is the code:               #!/bin/bash          func1(){       echo $1     }          export -f func1          watch func1


Bash Script Permission denied & Bad Interpreter

I'm on a kali linux 64 bit. I have created a python script which takes 2 arguments to start. I don't want to type out every time the exact same paths or search in the history of the commands I used in terminal. So I decided to create a simple script which calls the python script with its arguments.               #! /bin bash          python CreateDB.py ./WtfPath ./NoWtfPath/NewSystem/      It is the exact same command I would use in terminal. However, I get an error message when I try to execute the script file.               bash: ./wtf.sh: /bin: bad interpreter: Permission denied      wtf.sh has executable rights. What is wrong?


Changing Locale

I am using Linux Mint 15 Currently I have my locale as (by using command `locale`):               LANG=en_US.UTF-8     LANGUAGE=     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC=ar_SA.UTF-8     LC_TIME=ar_SA.UTF-8     LC_COLLATE="en_US.UTF-8"     LC_MONETARY=ar_SA.UTF-8     LC_MESSAGES="en_US.UTF-8"     LC_PAPER=ar_SA.UTF-8     LC_NAME=ar_SA.UTF-8     LC_ADDRESS=ar_SA.UTF-8     LC_TELEPHONE=ar_SA.UTF-8     LC_MEASUREMENT=ar_SA.UTF-8     LC_IDENTIFICATION=ar_SA.UTF-8     LC_ALL=      I want to change `ar_SA.UTF-8` to `en_IN.UTF-8`. How do i achieve this? Which file shold I be editing? Cant seem to find any locale file other than `/etc/locale.alias`


What to make of system scans reported by psad

My system logs show that `psad` detects scans like this every minute.               psad: scan detected: 192.168.1.10 -> 192.168.1.1 udp: [53] udp pkts: 2 DL: 2      If the first address is mine, and the second address is my router, then this would be a scan coming from my computer, correct? Is this anything to worry about?


sslserver using 100% cpu

I've a qmail setup with sslserver being used to secure the pop connections. Normally it runs very well, however some instances of sslserver start taking 100% cpu and its child process qmail-pop3d process is seen as zombie. The process has to be killed to solve the prb. The sslserver version is 0.70. OS is CentOs 6.0 64 bit with 2.6.32-220 kernel. Any clues how I can debug this ?


How to force Debian to wait for DHCP

I am running Debian squeeze in a virtual machine (VirtualBox). The machine has two interfaces:   * eth0 in "Host-only" mode so that the machine is accessible from the outside; and   * eth1 in "NAT" mode so that the machine can access the Internet. Furthermore, I am running dnsmasq on the host machine to assign static IP addresses to the virtual machines (VirtualBox provides IP addresses for NAT). The virtual machine runs sshd and mysql. At boot time, sometimes both services fail to start:               sshd[1145]: Set /proc/self/oom_adj from 0 to -17     sshd[1145]: Server listening on 0.0.0.0 port 22.     sshd[1145]: Server listening on :: port 22.     sshd[1145]: Received signal 15; terminating.     sshd[1299]: Set /proc/self/oom_adj from -17 to -17     sshd[1299]: Server listening on 0.0.0.0 port 22.     sshd[1299]: Server listening on :: port 22.     sshd[1301]: Set /proc/self/oom_adj from -17 to -17     sshd[1301]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.     sshd[1301]: error: Bind to port 22 on :: failed: Address already in use.     sshd[1301]: fatal: Cannot bind any address.      And:               mysqld: 121012 10:36:24 [ERROR] Can't start server: Bind on TCP/IP port: Cannot assign requested address     mysqld: 121012 10:36:24 [ERROR] Do you already have another mysqld server running on port: 3306 ?     mysqld: 121012 10:36:24 [ERROR] Aborting      I observed that each time the services fail, DHCPDISCOVER on eth0 comes _after_ the failure. When the services start successfully, DHCPDISCOVER comes _before_. I assume that Debian does not wait for both interfaces to have received an IP address. Is there any way to force Debian to wait for DHCP on both interfaces? **Update on request by user`warl0ck`** Contents of file `/etc/network/interfaces`                 # The loopback network interface       auto lo       iface lo inet loopback            # The primary network interface       allow-hotplug eth0       iface eth0 inet dhcp         # routing for VPN         post-up route add -net x.x.20.0 netmask 255.255.255.0 gw x.x.10.1         pre-down route del -net x.x.20.0 netmask 255.255.255.0 gw x.x.10.1                 # 2nd interface for NAT       allow-hotplug eth1       iface eth1 inet dhcp


Naming PPP interfaces

I have two PPP peers, dsl-line1 and dsl-line2 which are configured with pppd on Ubuntu (Server) Linux. They are brought up by the /etc/network/interfaces file with the auto thingy however each PPP connection chooses the name pppX where X varies depending on which comes up first. I would like to make it such that dsl-line1 comes up with a name such as "dsl0" and dsl-line2 with a name like "dsl1" so that I can create firewall rules more easily for each and set up routing (as well as having it easier to configure). My question is how can I get the pppd's interfaces to name themselves? /etc/ppp/peers/dsl-line1 (dsl-line2 is basically the same apart from the default route being removed and the ethernet interface being different)               noipdefault     defaultroute     replacedefaultroute     hide-password     #lcp-echo-interval 30     #lcp-echo-failure 4     lcp-echo-interval 10     lcp-echo-failure 3     noauth     persist     #mtu 1492     #persist     #maxfail 0     #holdoff 20     plugin rp-pppoe.so eth1     user "xxxx@xxxx.xxx"      /etc/network/interfaces (the line1 part, again, 2 is very similar)               auto dsl0     iface dsl0 inet ppp         pre-up /sbin/ifconfig eth1 up # line maintained by pppoeconf         post-up /bin/sh /home/callum/ppp0_up.sh # Route everything         post-up /bin/sh /etc/miniupnpd/ppp0_up.sh # Start miniupnpd (if not alr$         provider dsl-line1      Thanks in advance.


Can vim warn on a tabpagemax overflow?

If I open a collection of files in vim tabs using a glob pattern, I'd like to be warned if the number of files matching the pattern exceeds the value of `tabpagemax`. For example, if the following,               $ vi -p `find . -type f -name "*.tex"`      matches more files than `tabpagemax`, only `tabpagemax` tabbed documents are opened. I'd like a warning or error in this case. Can it be done?


Disconnect a disk correctly

I wanna disconnect a disk from an array which is the correct process   1. umount file system   2. remove from volume group   3. **i dont know this step**   4. disconnect physically the disk


How do I find out the pixel depth of my graphic card?

Is there a command that can tell me which my graphic card is and its pixel- depth? I am running vncserver and I would like to learn which is the best parameter for pixeldepth (-depth).


Open screen process in terminal from script

I have a minecraft server running in screen, and right now, it is just a script that starts java like so: `screen -dmS mc java -Xincgc -Xms1024M -jar craftbukkit-1.6.4-b2882.jar` Basically this just starts minecraft in a screen container in the background, and I can access it with `screen -r mc` through SSH. However, what I would like to do, is have the process always up on the server monitor, and also accessible through ssh with `screen -x mc`. Also, I have a restart.sh script that stuffs the stop command to the mc process every two hours, then it executes the start.sh script. The server is at runlevel 3, so I don't think `gnome-terminal -e "screen -x mc"` will work. Also, it seems like the restart script is starting mc outside of screen. When I SSH into the server, `screen -ls` turns up nothing, but the minecraft server process is running and I can connect to it. Here's the script:               #!/bin/sh          screen -x mc     screen -s mc stuff "say Server Restarting in 15 minutes."     screen -s mc -X eval "stuff \015"     sleep 600     screen -x mc     screen -x mc -X stuff "say Server restarting in 5 minutes."     screen -s mc -X eval "stuff \015"     sleep 240     screen -x mc     screen -s mc -X stuff "say Server restarting in 1 minute."     screen -s mc -X eval "stuff \015"     sleep 60     screen -S mc -X stuff "say Server restarting."     screen -S mc -X eval "stuff \015"     screen -S -X stuff "kickall Server Restarting, it should be back up in about a minute."     screen -S mc -X eval "stuff \015"     sleep 2     screen -S mc -X stuff "stop"     screen -S mc -X eval "stuff \015"     sleep 30     screen -wipe     sleep 3     cd /minecraft/server/craftbukkit     ./start.sh      Any ideas?


Command added to visudo still is failing on permissions?

My sudo file has two commands in it right now that are allowed to run without logging in as root. It looks like this:               user ALL=(root) NOPASSWD: /home/user/prog1.py     user ALL=(root) NOPASSWD: /home/user/prog2.py      The `prog1.py` file runs fine without password needed. The `prog2.py` file fails on permissions denied? The first program is only accessing a file to read that is root protected. The second program is creating a symlink and removing a root-protected file:               #!/usr/bin/env python     # -*- coding: utf-8 -*-          import os     from random import choice     from subprocess import Popen               def back_drop_change():         link = "/usr/share/slim/themes/default/background.jpg"         os.remove(link) # this is the line that returns permission denied         image_selection = list()         for di, _, fi in os.walk("/home/user/pictures/apod"):             for f in fi:                 image_selection.append(di + "/" + f)         bck_img = choice(image_selection)         Popen(["ln", "-s", bck_img, link])          if __name__ == "__main__":         back_drop_change()      I try adding `/usr/bin/rm /usr/share/slim/themes/default/background.jpg` to the visudo file but, it still fails? EDIT: Some extra information -- `sudo -l` returns:               Matching Defaults entries for user on this host:         env_reset, editor="/usr/bin/vim -p -X", !env_editor          User user may run the following commands on this host:         (ALL) ALL         (root) NOPASSWD: /home/user/Pidtrk/main.py         (root) NOPASSWD: /home/user/backdrop.py      and again, I am able to run `python2 Pidtrk/main.py` without errors but, not `python2 backdrop.py`. And both these files are owned by the same `User` and have the same `Permissions`. EDIT 2: I have both of `prog1.py` and `prog2.py` running in a `crontab` on `@reboot`. If I have this line in `crontab`:               `python2 /home/user/prog1.py >> err.log 2>&1`       without:               user ALL=(root) NOPASSWD: /home/user/prog1.py      Inside my sudoers file, the err.log shows `it failed with permissions denied`. Now when I add in this line to sudoers:               user ALL=(root) NOPASSWD: /home/user/prog1.py      The `prog1.py` runs fine on reboot, why is this any different for the `prog2.py` file?


Sort files by modification time

I've seen many questions and answers here using a construction along the lines of               list_dir=`ls -t /path/to/dir/`     for i in $list_dir; do      or               ls -t | while read i; do      Now, I know that you shouldn't use ls in scripts because it breaks easily; but I can't find a better way of operating on files in order from last-modified to most-recently-modified (or vice versa). I can use something like:               find . -type f -printf '%T@ %p\n' | sort -n | cut -d ' ' -f 2- | while read i; do...      ...but this will still break with any files that have newlines in their names, and is much uglier to boot. Is there a better way?


What are these commands for?

Yesterday I had to install a Windows with its Grub override. Well, it's not the first time I had to fix Grub, so I used LiveCD, mounted the root partition (I don't have boot, just `/` and `home`) and ran `grub-install --root-directory=/mnt/ /dev/sda`. However, it didn't work. After Googling a while I found a tutorial in which instead of just mounting the Linux partition, he also did `mount --bind /mnt/dev /dev` and `mount --bind /mnt/proc /proc/`. After that `chroot` to `/mnt` and then installed Grub, and using this method, it worked. What are the `mount --bind` commands for? I'm familiar with the usage of `\--bind used` (man page) but I do not know why it was used on this example.


How can I test whether the output from a command is null or empty string?

I'm trying to get a pre-commit hook script to work on our old SVN box. It's very old, running Ubuntu Server 8.04. This script: @echo off :: :: Stops commits that have empty log messages. ::               @echo off          setlocal          rem Subversion sends through the path to the repository and transaction id     set REPOS=%1     set TXN=%2          rem check for an empty log message     svnlook log %REPOS% -t %TXN% | findstr . > nul     if %errorlevel% gtr 0 (goto err) else exit 0          :err     echo. 1>&2     echo Your commit has been blocked because you didn't give any log message 1>&2     echo Please write a log message describing the purpose of your changes and 1>&2     echo then try committing again. -- Thank you 1>&2     exit 1      I think it's not working because the command findstr does not exist. What does work is this:               if [[ -n "" ]] ; then echo "yes"; else echo "no"; fi      So I changed the script to:               @echo off     ::     :: Stops commits that have empty log messages.     ::          @echo off          setlocal          rem Subversion sends through the path to the repository and transaction id     set REPOS=%1     set TXN=%2          rem check for an empty log message     ::svnlook log %REPOS% -t %TXN% | findstr . > nul     ::if %errorlevel% gtr 0 (goto err) else (goto exitgood)          ::svnlook log %REPOS% -t %TXN% | findstr . > ""     ::if %errorlevel% gtr 0 (goto err) else (goto exitgood)          SET LOG=`svnlook log %REPOS% -t %TXN%`          if [[ -n %LOG%  ]]; then             (goto exitgood)     else             (goto err)     fi          :err     echo. 1>&2     echo Your commit has been blocked because you didn't give any log message 1>&2     echo Please write a log message describing the purpose of your changes and 1>&2     echo then try committing again. -- Thank you 1>&2     exit 1          :exitgood     exit 0      But that doesn't work either, they both exit with code 255. Can somebody tell me what I'm doing wrong?


File to access for CPU load average on AIX

Is there a file with the load average in it on AIX? I'm looking for something like Linux's `/proc/loadavg`.


grep command. '^1' won't work

ttys000 -bash: cat n_modified.txt           1  calibre library          2  desktop          3  documents          4  downloads          5  library          6  movies          7  music          8  pictures          9  public         10  sites         11  myfirstdirectory         12  vasylgolub.conf         13  CALIBRE LIBRARY         14  DESKTOP         15  DOCUMENTS         16  DOWNLOADS         17  LIBRARY         18  MOVIES         19  MUSIC         20  PICTURES         21  PUBLIC         22  SITES         23  MYFIRSTDIRECTORY         24  VASYLGOLUB.CONF         25                          26                  27                    28                    29                  30                 31                32                   33                 34                35                           36            .             37  CALIBRE LIBRARY         38  DESKTOP         39  DOCUMENTS         40  DOWNLOADS         41  LIBRARY         42  MOVIES         43  MUSIC         44  PICTURES         45  PUBLIC         46  SITES         47  MYFIRSTDIRECTORY         48  VASYLGOLUB.CONF          ttys000 -bash: grep '^1' n_modified.txt           ttys000 -bash:      As above, `grep '^1' n_modified.txt` doesn't give me the sentences starting with 1. Why?


Cannot access elements of an array in zsh

I am trying to write a script in `zsh` and I need to make use of arrays in order to achieve my aim in an elegant way. After reading some information over the Net, I tried to implement and access the elements of array in the following way:               ### Script for running everything in screens ###     killall -15 screen ## We make sure that no screens are running for now     #bkgarr=(TopJets BosonJets DiBoson TTbar)     bkgarr=(1 2 3)          screen -dmS "MYSCREEN"     screen -S "MYSCREEN" -p 0 -X stuff 'echo "The array has ${#bkgarr[*]} of elements."^M'     screen -S "MYSCREEN" -p 0 -X stuff 'echo ${#bkgarr[0]}^M'      However, this did not work and the output I get is as follows:               ~/Summer_Students/nTupler_topness/tupleAnalyzer% echo "The array has ${#bkgarr[*]} of elements."     The array has 0 of elements.     ~/Summer_Students/nTupler_topness/tupleAnalyzer% echo ${#bkgarr[0]}     0      Furthermore, I need to have an array of strings like the one commented out in this minimal working example. I would be glad if someone can pinpoint my mistakes and why the array is apparently not stored in computers memory. Code edit:               ### Script for running everything in screens ###     killall -15 screen ## We make sure that no screens are running for now     #bkgarr=(TopJets BosonJets DiBoson TTbar)     bkgarr=(1 2 3)          screen -dmS "MYSCREEN"     screen -S "MYSCREEN" -p 0 -X stuff "$(typeset -p bkgarr)"$'\r'     #screen -S "MYSCREEN" -p 0 -X stuff 'bkgarr=(1 2 3)^M'     screen -S "MYSCREEN" -p 0 -X stuff 'echo "The array has ${#bkgarr[*]} of elements."^M'     screen -S "MYSCREEN" -p 0 -X stuff 'echo ${#bkgarr[0]}^M'      Output afterwards:               ~/Summer_Students/nTupler_topness/tupleAnalyzer% declare -a bkgarr='([0]="1" [1]="2" [2]="3")'     declare: bkgarr: can't assign initial value for array     ~/Summer_Students/nTupler_topness/tupleAnalyzer% echo "The array has ${#bkgarr[*]} of elements."     The array has 0 of elements.     ~/Summer_Students/nTupler_topness/tupleAnalyzer% echo ${#bkgarr[0]}     0     ~/Summer_Students/nTupler_topness/tupleAnalyzer%      Thanks in advance


Float operation with bc?

It looks like bc doesn't support float operations, when I do `echo 1/8 | bc` it get me a zero. I checked `bc (1)`, but it doesn't even mention `float`, so I wonder if it's supported?


When I try to mount an ISO image with `mount -o loop` I get > mount: could not find any free loop device Running `losetup -a` shows > /dev/loop0: [0005]:2464 (/dev/sda1)   >  /dev/loop1: [0005]:3439 (/dev/loop0)   >  /dev/loop2: [0005]:4482 (/dev/loop1)   >  /dev/loop3: [0005]:4486 (/dev/loop2)   >  /dev/loop4: [0005]:4490 (/dev/loop3)   >  /dev/loop5: [0005]:4494 (/dev/loop4)   >  /dev/loop6: [0005]:4498 (/dev/loop5)   >  /dev/loop7: [0005]:4502 (/dev/loop6) What is the purpose of a loop device which refers to `sda1`? And what is the purpose of all the other loop devices referring to the previous one? Is it safe for me to disconnect these loop devices so that I can use them? If so how do I do so? (Running `losetup -d /dev/loop[0-7]` gives `loop device is busy`.) If I cannot disconnect these, how do I create new loop devices that I can use for mounting ISO images? p.s. I am running Debian "wheezy" v 7.1.0.


How to generate Module.symvers?

I recently went through Unpacking kernel-source rpm off-system (OpenSuse)?; and as it took > 10 h on my machine, imagine my surprise that after doing the process described there, I find no `Module.symvers` anywhere! When I search for "generate Module.symvers", I get this: > NOTE: "modules_prepare" will not build Module.symvers even if   >  CONFIG_MODVERSIONS is set; therefore, a full kernel build needs to be   >  executed to make module versioning work.   >  (Linux Kernel Documentation :: kbuild : modules.txt) ... but I don't really get it - didn't the kernel get built in the previous step (described in the link given above? I sure know it took > 10 h for CC to generate a whole bunch of *.o files, and LD to link them, so something must have been built. But if so, where is then `Module.symvers`? In more explicit terms, exactly what command should I call to generate Module.symvers? I know that `make prepare` will not work - but what is the command that will?


Which applications use /usr/share/dict/words

I have changed the symlink `/usr/share/dict/words` to point to my own custom dictionary but it doesn't seem to affect anything. Chromium and Abiword neither seem to use this dictionary. Which appilications use `words`? Do I have to manually configure each application to use it? What is the point of having a system dictionary if applications are going to use their own anyway?


Is it possible to install a custom Linux on an Android phone?

I have an Xperia X8 phone, and I'd like to know if I can install a non-Android Linux OS on it? I would like to have a light Linux Distro, like Kolibri or something like that.


Choosing a filesystem for a shared disk (not a cluster filesystem like GFS)

I have a bunch of servers connected to a SAN. One server hosts the production database server, performing full database backups to a filesystem on a LUN that is exported to all servers. Only the "owner" (production server) has this filesystem mounted read-write. When the owner has performed a full backup, `sync` is called. The other hosts later mount this filesystem read-only, for quick access to the backup, for loading copies. This way I don't have the network as a bottleneck for transferring the backup. I have had this setup on Solaris for ages, with no glitches, on a plain UFS filesystem. Now I am going to set up the same on Linux (RHEL6), and want advice on what filesystem to pick. I'm thinking simpler is better, because I absolutely don't want any other host than the owner to make any changes whatsoever. No journal replay or other crazy stuff that can confuse the owners kernel if the on-disk structures stop matching what the kernel "knows" is there. I hope you understand my question. I've seen stuff happen (like journal replay) when mounting read-only filesystems on linux that worry me a bit. I'm looking for something simple. Not a cluster filesystem that requires handshaking and heartbeats. Only one node needs to write.


Centos directory server / 389 directory server - any differences?

I have very broad view that Redhat Directory Server, 389 Directory Server and Centos Directory Server are all the same. It's just the support you pay for on the RedHat version. Is this true? Are there any differences between Centos DS and 389 DS?


Xorg Configuration for Unregistered Resolution

I have a monitor with native resolution of `1600*900_60.00`, and the intel on board Gen3 Xeon video chipset `(i915)`.   when i do `$> xrandr` the `1600x900` resolution is not in the list. I tried to write an xorg configuration for monitor and I placed it on `/etc/X11/xorg.conf.d/10-monitor.conf`. but i must mess some value in there up; that it ha no effect and doesn't change the resolution.   I am sure the `/etc/X11/xorg.conf.d/10-monitor` is being read at `$> startx` because if i put anything wrong like `()*!` at that file **X** won't start and produce an error.   The `cvt 1600 900` returns:               1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz      Modeline "1600x900_60.00"  118.25  1600 1696 1856 2112  900 903 908 934 -hsync +vsync      also the `xrandr` produce:               xrandr     Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192     VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm        1024x768       60.0*         800x600        60.3     56.2          848x480        60.0          640x480        59.9       HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     HDMI2 disconnected (normal left inverted right x axis y axis)     HDMI3 disconnected (normal left inverted right x axis y axis)     DP2 disconnected (normal left inverted right x axis y axis)     DP3 disconnected (normal left inverted right x axis y axis)       1600x900_60.00�� (0xa5)  118.2MHz             h: width  1600 start 1696 end 1856 total 2112 skew    0 clock   56.0KHz             v: height  900 start  903 end  908 total  934        And this is my `10-monitor.config` file:               Section "Device"      Identifier  "Intel i915"        Option   "VGA1" #"VGA screen"        Driver      "intel"     EndSection      Section "Monitor"        Identifier  "Primary Monitor"        Modeline    "1600x900_60.00" 118.25 1600 1696 1856 2112  900 903 908 934 -Hsync +Vsync        Option      "PreferredMode" "1600x900"      EndSection      Section "Screen"           Identifier    "Screen0"           Device        "VGA1"           DefaultDepth  24           SubSection "Display"           Depth        24           Modes   "1600x900_60.00"      EndSubSection      EndSection


how to move (not copy) files from one server to another?

I want to move files from _server1_ to _server2_. A producer on _server1_ will keep generating the files, and a consumer on _server2_ will keep processing them. I can copy files using the following shell script:               rsync path/*.txt server2:/path      The extension of the files on the destination ( _server2_ ) will be changed from .txt to .done once they are processed, so if I run the command again, the files will once again copied (and processed) to the destination. Hence, I want to delete (or rename or move) the original files so that they won't be transferred again. I am using `rsync` version 2.6.3, which does not have --remove-source-files option. I am new to shell scripting, so please give an example.


Is it possible to log directly into chroot?

Lets say I boot up my computer and I see the login screen. When I log in as _myuser_ , I want to be restricted to a certain root directory via. `chroot`. Let's assume that the directory is `/chroots/myuser/`. Is this possible to do ? If so, how would it be accomplished ? **Note:**   Just to be clear, I want to change the root directory, not the home directory. The new root directory for the user will contain another OS like Debian.


Using ramfs on embedded system

I am required to write some software to run on Linux installed on an x86 based embedded setup that has a 8GB compact flash drive for data storage. The critical requirements are logging measurement data to file every 30 seconds, and robustness to power loss (my system **MUST** be able to reboot successfully every time and logging data must not get corrupted). I have used buildroot to generate my kernel, crosstools and file system. Currently I have tried 2 things   1. Booting up using only the `.cpio` file system provided by buildroot.   2. Copying the file system to an `ext3` partition and telling syslinux that the root file system is located there. If I use option 1. and have my root file system in RAM I will lose my data at power down. If I use option 2. then I run the risk of system files getting corrupted on power down. The answer to this question Is using a read only root file system a good idea for embedded setup? lead me to consider using a read only file system, but the only answer I have received is currently too advanced for my level of Linux expertise. This has lead me to consider using a RAM based file system. In the case of a RAM file system using the `.cpio` file to boot from, how could I possibly operate things so that I can ensure power down safety AND get persistent data storage for my data logging requirements ?