Linux Tips

This is a small list of linux tips that I am putting here because I had a hard time finding them on the web

  1. How to browse files on a remote server via ssh: In nautilus, type ssh://username@remotemachine
  2. How to redirect nautilus to display on a remote X server:
    • ssh -X username@remotemachine
    • nautilus –no-desktop
  3. How to start a gnome session on a remote machine
    • ssh -X username@remotemachine
    • gnome-session
  4. How to mount a particular partition of a disk image created using dd
    • sudo /sbin/losetup /dev/loop0 somediskimage.img # Map the loop device to the file
    • sudo /sbin/kpartx -a /dev/loop0 # Create the loop devices corresponding to each partition
    • sudo mount -t ntfs /dev/mapper/loop0p1 # Mount a particular partition
    • sudo umount /dev/mapper/loop0p1 # Unmount partition
    • sudo /sbin/kpartx -d /dev/loop0 # Remove the loop devices
    • sudo /sbin/losetup -d /dev/loop0 # Unmap the loop device
  5. How to install Sun Java on Ubuntu
    • Download gziped JRE or JDK from Oracle site
    • Unzip under /opt/java/jdk1.7.0_05
    • Issue the following command to have the java, javaws and javac command available at the command lines:
      sudo update-alternatives –install /usr/bin/java java /opt/java/jdk1.7.0_05/bin/java 1
      sudo update-alternatives –install /usr/bin/javaws javaws /opt/java/jdk1.7.0_05/bin/javaws 1
      sudo update-alternatives –install /usr/bin/javac javac /opt/java/jdk1.7.0_05/bin/javac 1
    • Issue the following command  to enable applets to run in Firefox:
      sudo update-alternatives –install “/usr/lib/mozilla/plugins/libnpjp2.so” mozilla-java-plugin “/opt/java/jdk1.7.0_05/jre/lib/amd64/libnpjp2.so” 1
    • Issue the following command to enable applets to run in Google Chrome:
      sudo update-alternatives –install “/opt/google/chrome/plugins/libnpjp2.so” chrome-java-plugin “/opt/java/jdk1.7.0_05/jre/lib/amd64/libnpjp2.so” 1
      Note that you should point to the 32 bit version of the plugin if you are using Ubuntu 32 bit

One Response to “Linux Tips”

  1. Jaganat says:

    Hallo Tarik,

    I red your review for printer Canon LBP 6000. I have OpenSuse 12.2. May you help me to make working the printer.
    Thanks. Jaganat

Leave a Reply