Toshiba Studio printer fails to print with error: invalidfont








  • Description:
    Trying to print to Toshiba eStudio 4540C multifunction machine (with official TOSHIBA ColorMFP PPD), got the following error:
    ERROR:
    invalidfont
    OFFENDING COMMAND:
    $definefont
    STACK:
    --nostringval--
    /TVZYWM+Ubuntu-Medium
    --nostringval--
    /TVZYWM+Ubuntu-Medium
    --nostringval--
    --nostringval--
    
  • Solution:
    It was caused by the bug in cups-filters package discussed here. The work around is adding an option pdftops-renderer-default=pdftops, simply run the following command as root:
    sudo lpadmin -p TOSHIBA-ColorMFP -o pdftops-renderer-default=pdftops
    Note: you need to replace TOSHIBA-ColorMFP with your toshiba printer's name. To find out your printer's name, run
    lpstat -a

See also




Install latest Firefox/Iceweasel on Debian wheezy








sudo echo "deb http://mozilla.debian.net/ wheezy-backports iceweasel-release" >> /etc/apt/sources.list
sudo apt-get install debian-keyring pkg-mozilla-archive-keyring
sudo gpg --check-sigs --fingerprint --keyring /etc/apt/trusted.gpg.d/pkg-mozilla-archive-keyring.gpg --keyring /usr/share/keyrings/debian-keyring.gpg pkg-mozilla-maintainers
sudo apt-get update
sudo apt-get install -t wheezy-backports iceweasel

See also




Install Nomachine NX Server Free Edition on Debian Linux








The Nomachine nxserver free edition has limitation: allows only 2 concurrent user sessions. But it is fine for me to connect to my Linux workstation at work. It is easier to setup than the freenx server. See the guide below:
  1. Run the following commands to download and install nomachine nxclient, nxnode and nxserver packages:
    if [[ $(uname -m)=="x86_64" ]]; then export MARC=amd64; else export MARC=i386; fi
    wget http://web04.nomachine.com/download/3.5.0/Linux/nxclient_3.5.0-7_${MARC}.deb
    sudo dpkg -i nxclient_3.5.0-7_${MARC}.deb
    wget http://web04.nomachine.com/download/3.5.0/Linux/nxnode_3.5.0-9_${MARC}.deb
    sudo dpkg -i nxnode_3.5.0-9_${MARC}.deb
    wget http://web04.nomachine.com/download/3.5.0/Linux/FE/nxserver_3.5.0-11_${MARC}.deb
    sudo dpkg -i nxserver_3.5.0-11_${MARC}.deb
    
  2. Setup your own server private key instead of the nomachine key:
    sudo ssh-keygen -t dsa -f /usr/NX/home/nx/.ssh/id_dsa
    sudo chown nx:nx /usr/NX/home/nx/.ssh/id_dsa
    sudo mv /usr/NX/home/nx/.ssh/authorized_keys2 /usr/NX/home/nx/.ssh/authorized_keys2.old
    sudo cat /usr/NX/home/nx/.ssh/id_dsa.pub >> /usr/NX/home/nx/.ssh/authorized_keys2
    
    You can now use the private key in /usr/NX/home/nx/.ssh/id_dsa for your client to connect to the nxserver.
  3. Secure ssh for NX server by editting /etc/ssh/sshd_config as root:
    • Enable PubkeyAuthentication for all:
      PubkeyAuthentication yes
    • Disable PasswordAuthentication for all:
      PasswordAuthentication no
    • Allows PasswordAuthentication only for the FreeNX users by appending the following line to sshd_config:
      Match Group nxusers 
          PasswordAuthentication yes
      or if you want to allow individual users:
      Match User john alex
          PasswordAuthentication yes



Install FreeNX on Debian 7.1 wheezy








  • Download and run the script
  • Secure ssh:
    • Create a group nxusers and add all the users require remote NX access to the group:e.g.
      sudo groupadd nxusers
      sudo usermod -a -G nxusers wilson
    • Edit /etc/ssh/sshd_config as root:
      1. Enable PubkeyAuthentication for all:
        PubkeyAuthentication yes
      2. Disable PasswordAuthentication for all:
        PasswordAuthentication no
      3. Allows PasswordAuthentication only for the FreeNX users by appending the following line to sshd_config:
        Match Group nxusers 
            PasswordAuthentication yes
        or if you want to allow individual users:
        Match User john alex
            PasswordAuthentication yes
    • Restart ssh server:
      sudo /etc/init.d/ssh reload



shell scripting: remove leading and trailing character








Suppose we want to remove the leading and trail character from string: <1.2.3> and expecting result should be 1.2.3
  • Option 1:
    str=<1.2.3>
    str1="${str%\<}"
    str2="${str1#\>}"
    echo $str2
  • Option 2: Using sed
    echo "<1.2.3>" | sed -e 's/^\<//'  -e 's/\>$//'



Enable/Disable LXDE right-click menu








Run command:
pcmanfm --desktop-pref
then activate Advanced tab, tick/untick Show menus provided by window managers when desktop is clicked

See also




Openbox/LXDE: default key combinations (shortcut keys)








Openbox default key combinations

  •     Alt-F4 Close the active window
  •     Alt-Space Show the client menu for the active window
  •     Alt-Tab Cycle between windows on the desktop
  •     Alt-Shift-Tab Cycle between windows on the desktop in reverse order
  •     Control-Alt-Tab Cycle between panel and desktop windows on the desktop
  •     Windows-D Hide all windows to show the desktop
  •     Windows-E Run the Konqueror file manager (This is an example of how to run a program with a key binding)
  •     Alt-Escape Lower the active window behind other windows, and activate the last window that was in use
  •     Windows-F1 Go to the first desktop instantly
  •     Windows-F2 Go to the second desktop instantly
  •     Windows-F3 Go to the third desktop instantly
  •     Windows-F4 Go to the fourth desktop instantly
  •     Control-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one
  •     Control-Alt-Right Open the desktop switching dialog, to go to the desktop to the right of the current one
  •     Control-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)
  •     Control-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)
  •     Shift-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one, and bring the active window with you
  •     Shift-Alt-Right Open the desktop switching dialog, to go to the desktop to the right of the current one, and bring the active window with you
  •     Shift-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)
  •     Shift-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)
  •     Alt-Left mouse button Move a window
  •     Alt-Right mouse button Resize a window. The window is resized towards the edge that the mouse is nearest to. So use Alt-Right mouse button in the top right corner of a window to resize that corner.
  •     Alt-Scroll wheel Change desktops forward and backward



epublib: a Java epub library








http://www.siegmann.nl/epublib/download


LXDE: load gnome-keyring automatically








I got the following error
WARNING: gnome-keyring:: couldn't connect to: /home/wilson/.cache/keyring-ryOMzs/pkcs11: No such file or directory
when accessing a git repository via https protocol.
The solution is
sudo vi /etc/xdg/autostart/gnome-keyring-pkcs11.desktop
and append LXDE:
OnlyShowIn=GNOME;Unity;LXDE;



multicast ip address 224.0.0.251 port 5353








To enable Bonjour/mDNS, you need to allow traffic from multicast ip 224.0.0.251 on port 5353.


Enable simple iptables firewall on Debian 7 Wheezy








  • Install iptables-persistent:
    sudo apt-get install iptables-persistent
  • Edit /etc/iptables/rules.v4 and /etc/iptables/rules.v6
    # /etc/iptables/rules.v4
    *filter :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    :RH-Firewall-1-INPUT - [0:0]
    -A INPUT -j RH-Firewall-1-INPUT
    -A FORWARD -j RH-Firewall-1-INPUT
    -A RH-Firewall-1-INPUT -i lo -j ACCEPT
    -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
    # ESP protocol
    -A RH-Firewall-1-INPUT -p 50 -j ACCEPT
    # AH protocol
    -A RH-Firewall-1-INPUT -p 51 -j ACCEPT
    # multicast Bonjour/mDNS
    -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
    # cups printing
    -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
    -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
    -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
    COMMIT 
    
    # /etc/iptables/rules.v6
    *filter :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    :RH-Firewall-1-INPUT - [0:0]
    -A INPUT -j RH-Firewall-1-INPUT
    -A FORWARD -j RH-Firewall-1-INPUT
    -A RH-Firewall-1-INPUT -i lo -j ACCEPT
    -A RH-Firewall-1-INPUT -p icmpv6 -j ACCEPT
    # ESP protocol
    -A RH-Firewall-1-INPUT -p 50 -j ACCEPT
    # AH protocol
    -A RH-Firewall-1-INPUT -p 51 -j ACCEPT
    # multicast Bonjour/mDNS
    -A RH-Firewall-1-INPUT -p udp --dport 5353 -d ff02::fb -j ACCEPT
    # cups printing
    -A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT 
    -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    -A RH-Firewall-1-INPUT -m state --state NEW -p tcp --dport 22 -j ACCEPT
    -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp6-adm-prohibited
    COMMIT 
    

See also




X11 display forwarding for root








  • The problem:
    [wilson@local-host]$ ssh -Y -A -t -C -o CompressionLevel=9 wilson@remote-host
    [wilson@remote-host]$ sudo su
    [root@remote-host]$ xclock
    X11 connection rejected because of wrong authentication.
    Error: cannot open display: localhost:10.0
    
  • The solution:
    [wilson@local-host]$ ssh -Y -A -t -C -o CompressionLevel=9 wilson@remote-host
    [wilson@remote-host]$ sudo su
    [root@remote-host]$ su - wilson -c 'xauth list' | grep $(echo $DISPLAY | cut -d ':' -f 2 | cut -d '.' -f 1 | sed -e s/^/:/) | xargs -n 3 xauth add
    [root@remote-host]$ xclock
    

See also




Install screen capture tool on Debian 7 Wheezy with LXDE desktop








  • Install scrot:
    sudo apt-get install scrot giblib
  • Bind PrtScn key with the scrot command by adding following into ~/.config/openbox/lxde-rc.xml:
      <!-- Screen Capture -->
      <keybind key="Print">
          <action name="Execute">
              <command>sh -c "scrot -u -d 3 ~/Desktop/screenshot-$(date +%Y%m%d%H%M%S).png"</command>
          </action>
      </keybind>
    
  • Reload lxde configuration:
    openbox --reconfigure
  • You can then try hit PrtScn key to capture the current active window.

See also




Install Eclipse Color Themes from Ecipse Marktet Place








  • To install: Help → Eclipse Marketplace... search for Eclipse Color Theme, click the returned item to start installation.
  • To change themes: Window → Preferences → General → Appearance → Color Theme

See also




Enable bitmap fonts on Debian linux








sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf



Convert .fon font to .bdf format on Debian








  • Use fontforge
    sudo apt-get install fontforge



Best programming fonts








See also




Debian Wheezy: Error setting up printer: "Option 'printer-resolution' has value '(unknown IPP tag)' and cannot be edited."








When setting up printer on Debian Wheezy, got error:
Option 'printer-resolution' has value '(unknown IPP tag)' and cannot be edited.
The error was not harmful and you can just ignore it. To get rid of it, you can install a newer version of python-cups package from ubuntu repository:
  • 64 bit Debian Linux:
    wget http://au.archive.ubuntu.com/ubuntu/pool/main/p/python-cups/python-cups_1.9.62-0ubuntu1_amd64.deb
    sudo dpkg -i python-cups_1.9.62-0ubuntu1_amd64.deb
  • 32 bit Debian Linux:
    wget http://au.archive.ubuntu.com/ubuntu/pool/main/p/python-cups/python-cups_1.9.62-0ubuntu1_i386.deb
    sudo dpkg -i python-cups_1.9.62-0ubuntu1_i386.deb



windows equivalent of the unix tail command











Windows XP: set system proxy using proxycfg command








In Command Prompt window, run
proxycfg -p wwwproxy.yourcompany.com:8888
where 8888 is the port number of the proxy server.
To remove the proxy and connect direct to internet:
proxycfg -d

See also




Command to start windows update on Windows XP








In Command Prompt window, run
wuauclt /detectnow
will start the windows update.
To check the log:
type %windir%\windowsupdate.log



Mount NTFS partition on CentOS 6








  • Enable epel repository
  • sudo yum install ntfs-3g ntfsprogs
  • edit /etc/fstab and add
    UUID=F8D22D76D22D39F0 /windows ntfs-3g rw,uid=500,gid=500,umask=007,locale=en_US.utf8        0 0
    where you can get the uuid of the partition from
    blkid
    command.
  • If you want to create a NTFS partition, remember it type number is 7
  • If you want to format a NTFS partition, you need to install ntfsprogs package, run command
    sudo yum install ntfsprogs; sudo mkfs.ntfs /dev/sda6



Install FreeNX server on CentOS 6








Under construction

  1. sudo yum install nx freenx
  2. sudo vi /etc/nxserver/node.conf
    DEFAULT_X_SESSION=/etc/X11/xinit/Xsession
    COMMAND_XTERM=gnome-terminal
    COMMAND_SMBMOUNT=/bin/mount
    COMMAND_SMBUMOUNT=/bin/umount
    
  3. sudo vi /usr/bin/nxloadconfig
    APPLICATION_LIBRARY_PRELOAD=/usr/lib64/NX/lib/libX11.so.6.2:/usr/lib64/NX/lib/libXext.so.6.4:/usr/lib64/NX/lib/libXcomp.so.3:/usr/lib64/NX/lib/libXcompext.so.3:/usr/lib64/NX/lib/libXrender.so.1
    



Install Chinese input method on CentOS 6








  1. sudo yum install ibus ibus-gtk ibus-qt ibus-pinyin im-chooser
  2. ibus-setup
  3. vi ~/.bashrc
    and add
    export GTK_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    export QT_IM_MODULE=ibus



    Install Oracle Java 7 on CentOS 6








    1. Download the latest Java 7 JDK from Oracle.
      • If your computer is intel 32 bit, download jdk-7uXX-linux-i586.rpm
      • If your computer is intel 64 bit, download jdk-7uXX-linux-x64.rpm
    2. Install the rpm:
      sudo yum install jdk-7u*.rpm
    3. Run the following script to update the java alternatives to use the ones from the newly installed JDK 7:
    4. Add
      export JAVA_HOME=/usr/java/latest
      to /etc/bashrc

    See Also




    Set up http proxy on CentOS 6.4








    1. Set up system wide proxy: System -> Preferences -> Network Proxy
    2. Edit /etc/environment:
      sudo vi /etc/environment
      and add lines like below:
      http_proxy=http://192.168.20.10:3128
      https_proxy=https://192.168.20.10:3128
      ftp_proxy=ftp://192.168.20.10:3128
      rsync_proxy=http://192.168.20.10:3128
      no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
      HTTP_PROXY=http://192.168.20.10:3128
      HTTPS_PROXY=https://192.168.20.10:3128
      FTP_PROXY=ftp://192.168.20.10:3128
      RSYNC_PROXY=http://192.168.20.10:3128
      NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
    3. Edit /etc/bashrc:
      sudo vi /etc/bashrc
      and append lines:
      export http_proxy=http://192.168.20.10:3128
      export https_proxy=https://192.168.20.10:3128
      export ftp_proxy=ftp://192.168.20.10:3128
      export rsync_proxy=http://192.168.20.10:3128
      export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
      export HTTP_PROXY=http://192.168.20.10:3128
      export HTTPS_PROXY=https://192.168.20.10:3128
      export FTP_PROXY=ftp://192.168.20.10:3128
      export RSYNC_PROXY=http://192.168.20.10:3128
      export NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
    4. Set yum proxy: edit /etc/yum.conf
      sudo vi /etc/yum.conf
      and add line:
      proxy=http://192.168.20.10:3128
    5. Keep proxy settings through sudo:
      sudo visudo
      and add the following line:
      Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"

    See also




    CentOS 6.4 Installation Notes








    1. Setup network: System -> Preferences -> Network connections or simply run the following command in terminal:
      sudo nm-connection-editor
    2. Enable sudo without passwd:
      sudo visudo
      and append line:
      username  ALL=(ALL)       NOPASSWD:ALL
    3. Install and enable rpmforge repositories
    4. Install epel repositories and set their priorities
    5. Set up http proxy
    6. Configure printer:
    7. Install Oracle Java 7
    8. Install Skype
    9. Install Dropbox
    10. Install KeepassX
    11. Install VirtualBox
    12. Install unrar, p7zip and file-roller (unrar is to extract .rar archives, p7zip is to extract .7z archives and file-roller is the gui archive manager). You need to enable rpmforge repository(see step 3) to install these packages:
      sudo yum install unrar p7zip file-roller
    13. Install openssh-server
    14. Install LibreOffice:
      sudo yum install libreoffice-core libreoffice-writer libreoffice-impress libreoffice-calc
    15. Install gnome-screenshot:
      sudo yum install gnome-utils -y
    16. Install Firefox addons: xmarks, lastpass
    17. Install flash plugin
    18. Install ibus and pinyin Chinese input method 
    19. Install git
      sudo yum install git
    20. Install FreeNX server
    21. Download and install NoMachine NX client
      sudo rpm -Uvh http://web04.nomachine.com/download/3.5.0/Linux/nxclient-3.5.0-7.x86_64.rpm
      
    22. Download and install Ubuntu font:
      cd ~/Downloads; wget http://font.ubuntu.com/download/ubuntu-font-family-0.80.zip
      sudo mkdir /usr/share/fonts/ubuntu; cd /usr/share/ubuntu
      sudo unzip ~/Downloads/ubuntu-font-family-0.80.zip
      sudo mkfontdir; sudo mkfontscale; sudo fc-cache -fv 
    23. Mount Window FAT32 partition:
      sudo vi /etc/fstab
      and add the line like below:
      /dev/sda5 /windows vfat rw,uid=500,gid=500,umask=077 0 0
      then run
      sudo mount -a
    24. Mount NTFS partition



    Install virtualbox on CentOS 6








    • Install dkms package from rpmforge repository
      yum --enablerepo rpmforge install dkms
      If you have not yet install rpmforge repository, see How to install rpmforge repository on CentOS.
    • Dowload the repository file into /etc/yum.repos.d:
      wget -O /etc/yum.repos.d/virtualbox.repo http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
    • Update the packages:
      yum update
    • Find the latest VirtualBox package:
      yum search VirtualBox
    • Install the latest VirtualBox package:
      yum install VirtualBox-4.2
    • Start virtualbox, Applications -> System Tools -> Oracle VM VirtualBox
    • Troubleshooting
      • USB (Keyboard) subsystem not working, solution:
        sudo usermod -a -G vboxusers yourusername
        then log out and log back in.



    Shell scripting: pipe/redirect stdout and stderr








    • redirect stdout to file:
      ls > out.txt
    • redirect stderr to file:
      ls 2> err.txt
    • redirect stderr to stdout:
      my-command 2>&1 
    • redirect stdout to stderr:
      my-command 1>&2 
    • redirect stdout and stderr to file:
      my-command &> 1.txt



    grep processes returned from ps command excluding grep command itself








    ps aux | grep java | grep -v grep



    Neuro-debian: repositories for Debian and Ubuntu Linux








    NeuroDebian provides a large collection of popular neuroscience research software for the Debian operating system as well as Ubuntu and other derivatives. Popular packages include AFNI, FSL, PyMVPA and many others.

    http://neuro.debian.net/pkgs.html


    Java: convert an input stream to string








    package test;
    
    import java.io.*;
    import java.util.Scanner;
    
    public class StreamUtil {
    
         public static String toString(InputStream in) throws Throwable {
            Scanner scanner = null;
            String s = "";
            try {
                scanner = new Scanner(in, "UTF-8").useDelimiter("\\A");
                s = scanner.hasNext() ? scanner.next() : "";
            } finally {
                scanner.close();
            }
            return s;
        }
    
        public static void main(String[] args) throws Throwable {
            
            System.out.println(toString(new FileInputStream(new File("/tmp/1.txt"))));
        }
    
    }
    



    Eclipse: set default editor for unkown file types








    Preferences -> General -> Editors -> File Assocication, you can add new file types, e.g. *.tcl, then set the default editor for the type.



    yum: check if a package is installed








    yum list installed
    yum list installed | grep openjdk



    awk: print the last two columns








    cat file | awk '{print $(NF-1) $NF}'
    or
    awk '{print $(NF-1) $NF}' file



    XML element naming rules








    XML elements must follow these naming rules:
    • Names can contain letters, numbers, and other characters. Except for the first character, they can contain
      • digits
      • period(.)
      • hyphen(-)
      • underscore(_)
      • colon(:) - legal but should be used except for namespaces
      • NO other characters are allowed like #, @, $, %
    • Names cannot start with a number or punctuation character. Must start with a letter or a underscore(_).
    • Names cannot start with the letters xml (or XML, or Xml, or xMl etc)
    • Names cannot contain spaces
    Any name can be used, no words are reserved.


    Install Flash plugin on CentOS 6








    • Add Adobe repository:
      sudo rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-$(uname -m)-1.0-1.noarch.rpm
      sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
    • Install the required packages:
      sudo yum check-update
      sudo yum groupinstall "Sound and Video"
    • Install flash plugin:
      sudo yum install flash-plugin nspluginwrapper curl



    git: discard local changes








    • To discard all local uncommitted changes:
      git reset --hard
      which is equivalent to:
      git reset --hard HEAD
    • To discard the latest local commit(move HEAD back by one commit):
      git reset --hard HEAD^
      or move HEAD by 3 commits:
      git reset --hard HEAD~3



    Establish a SSH tunnel to access a remote server behind firewall








    • To start the tunnel (running background):
      ssh -L ${LOCAL_HOST}:${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} ${GATEWAY_USER}@${GATEWAY_HOST} -N -f -M -S ${SSH_CTRL_PATH}
      for example:
      ssh -L localhost:3389:192.168.20.10:3389 john@gateway-ssh-server.johns.org -N -f -M -S /tmp/ssh-tunnel.3389
      The command above starts the ssh tunnel (and keeps the ssh process running background.) After the tunnel is established, you can access the remote server port(192.168.20.10) via local port(localhost:3389).
    • To stop the tunnel (running background):
      ssh -S ${SSH_CTRL_PATH} -O exit ${GATEWAY_USER}@${GATEWAY_HOST}
      for example:
      ssh -S /tmp/ssh-tunnel.3389 -O exit john@gateway-ssh-server.johns.org



    Ubuntu 12.04 LTS: create application launcher/shorcut








    Run the follow command in Terminal:
    gnome-desktop-item-edit ~/Desktop/myshortcut.desktop --create-new
    where ~/Desktop/myshortcut.desktop is the launcher file name.


    Ubuntu: set default text editor








    sudo update-alternatives –config editor



    Install Skype on Ubuntu Linux 12.04 LTS 64 bit








    • Install ia32-libs:
      sudo apt-get install ia32-libs
    • Install sni-qt and sni-qt:i386(which is required to enable skype system tray icon):
      sudo apt-get install sni-qt sni-qt:i386
    • Download Skype:
      wget http://download.skype.com/linux/skype-ubuntu-precise_4.2.0.11-1_i386.deb
    • Install Skype:
      sudo dpkg -i skype-ubuntu-precise_4.2.0.11-1_i386.deb



    Ubuntu One client behind proxy








    If your computer is behind a proxy/firewall, your Ubuntu One File Sync will not work unless you install ubuntuone-client-proxy package:
    sudo apt-get install ubuntuone-client-proxy



    Unix/Linux/Mac OS: release/free TCP/IP port








    • check which process is listening to (using) the port:
      fuser 8080/tcp
      It will returns the pid of the process, like below:
      8081/tcp:             7391
      , you can then use the process id to find which application is using the port:
      ps aux | grep 7391
    • to kill the process that is using the port, you can simply do:
      sudo fuser -k 8080/tcp



    Install latest Firefox on CentOS Linux








    1. Download the latest Firefox from http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/. The current (British English, 64 bit) one is firefox-23.0.1.tar.bz2:
      cd ~/Downloads; wget http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/23.0.1/linux-x86_64/en-GB/firefox-23.0.1.tar.bz2
    2. Extract it into /opt:
      cd /opt; sudo tar jxvf ~/Downloads/firefox-*.tar.bz2
    3. To start in Terminal:
      /opt/firefox/firefox
      You can also create launcher for it...
    4. Link the plugin directory:
      cd ~/.mozilla; ln -s /usr/lib64/mozilla/plugins



    Install Java 7 on Ubuntu 12.04 LTS








    1. Add webupd8team repository:
      sudo apt-get install python-software-properties
      sudo add-apt-repository ppa:webupd8team/java
      sudo apt-get update
      
    2. Install oracle-java7-installer:
      sudo apt-get install oracle-java7-installer
      
    3. Set Java 7 as default:
      sudo update-java-alternatives -s java-7-oracle
      
    4. Set up Java plugins for browsers:
      if [[ $(uname -a) == "x86_64" ]]; then machine=amd64; else machine=i386; fi; sudo update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/${machine}/libnpjp2.so $((`LANG=C update-alternatives --display mozilla-javaplugin.so | grep ^/ | sed -e 's/.* //g' | sort -n | tail -1`+1))
      

    See also

    • https://docs.google.com/document/d/1DzjvNgiF8OMUD0L6LdvOkvDcc6wYIk1iPFCkoW2pPf4/edit



    Install Chromium/Chrome browser on CentOS








    You can run the following command to add the repository and install the chromium package:
    cd /etc/yum.repos.d; sudo wget http://people.centos.org/hughesjr/chromium/6/chromium-el6.repo
    sudo yum update
    sudo yum install chromium
    

    NOTE:

    if you have yum-plugin-priorities installed, you need to
    sudo echo "priority=1" >> /etc/yum.repos.d/chromium-el6.repo
    to set the repository priority.

    See also




    ATERM: change background colour and font








    display bg-colour #000000
    display font-name courier
    display font-size 18
    display save



    Favorite Linux Applications











    NameCategoryDescriptionInstall notes
    ShutterScreen Capture ToolThe best screen capture tool for Linux.
    KeePassXPassword ManagerPassword manager.
    sudo apt-get install keepassx
    GeanyText editorA good text editor.
    sudo apt-get install geany