Leisurehours's Blog

Ubuntu & Linux Recipes

Category: Tips & Tricks

Installing Oracle JDK/JRE 7 on ubuntu

by manojgumber

If you have tried to install JDK via Ubuntu Software Center, It will show only OpenJDK/JRE. Oracle JDK is the most widely used development kit for java. Actually it is fairly easy to install the Oracle JDK on Ubuntu.

The guys at AskUbuntu have put up a fabulous response and it works without any issue.


Testdisk – A Great Recovery Tool

by manojgumber

You must be wondering why I am appreciating this tool this much. Well …this tool is worth it. I saved me from a hell of trouble. Actually due to some unknown reasons , my partition table got corrupted . My one partition was lost and rest were fine. The partition which was lost ( it had some important documents) , different tools showed it as free space.

At ubuntu forums, a fellow suggested to use this tool and it worked awesome. It detected my old partition table and I could recover my lost partition.
Read the rest of this entry »

Automatically Download Subtitles Using Smplayer in Linux

by manojgumber

Have you found it annoying to searching subtitles for your favourite movie / tv-series ? Then this is for you.

Smplayer on linux platform has this awesome feature. While you are watching your movie or tv series,

In Menu Bar ->  Subtitles -> Find Subtitles on OpenSubtitles.org

Read the rest of this entry »

Encrypt & Secure Your Files Using vi Editor

by manojgumber

[tweetmeme service=”bit.ly” source=”LeisureHoursWP” ]

Do you know that you can encrypt your source code files and other text files using vi editor? Isn’t vi editor wonderful.

It is very simple. While creating new file which you intend to encrypt

leisurehours@wordpress-laptop : ~ $ vi -x file1.txt

To encrypt an existing file , open it with vi using -x option

leisurehours@wordpress-laptop : ~ $ vi -x file1.txt

vi editor will now ask for password twice. Whenever you will open the file again with vi editor, it will ask for password to decrypt the file. When opened using other editors , file will show only garbage text.

Get Rid of Annoying “x is an executable text file ” Message Box each time you open a file

by manojgumber

[tweetmeme service=”bit.ly” source=”LeisureHoursWP” ]
Whenever in gnome you open any text file , you get an annoying message box each time asking “Do you want to run x.txt or Display its content? ”. “ x.txt is an executable text file” .

To get rid of this annoying message box —

In the nautilus, Edit -> Preferences -> Behaviour

Check the radio button next to “ view executable text files when they are opened” .
Read the rest of this entry »

Transfer Files Between Your Mobile Handset & Ubuntu System via Bluetooth

by manojgumber

[tweetmeme service=”bit.ly” source=”LeisureHoursWP” ]

Ubuntu Linux has excellent support for bluetooth devices which can greatly ease you in transferring files between your bluetooth mobile handset/pda/any bluetooth device and computer. So lets give it a shot.

Pairing your Ubuntu System and mobile phone

  • Switch on the bluetooth dongle of your laptop/computer . Also turn on the bluetooth of your mobile device . Make sure that visibility is set to true in your mobile phone.
  • Now to configure bluetooth settings for your ubuntu system , start the terminal and type the following command.

    leisurehours@wordpress-laptop:~$ bluetooth-properties

    This will bring a gui configuration window for bluetooth.

    Read the rest of this entry »

Download Movie Trailers from Apple Site using wget on linux

by manojgumber

[tweetmeme service=”bit.ly” source=”LeisureHoursWP” ]

I love watching trailers of latest movies on Apple trailers site. Apple site has recently done something that requires only that Quicktime player users can watch the trailers. But those in Linux who want to download the trailers on disk, here is a solution.

What To Do When Your Ubuntu System Hangs/Freezes??

by manojgumber

[tweetmeme service=”bit.ly” source=”LeisureHoursWP” ]

Most of us must have faced this problem when our ubuntu system hangs and does not respond to any thing / keystroke or command. What to do simply?? Simply press power off or restart and you will be getting weird messages when next time your system boots .

What is the safest way to handle this problem??

You have the press the following key combination to safely restart your system to recover from such situation

Alt + print screen +  R  + E  + I + S + U + B
Read the rest of this entry »

Turning off annoying notifications in pidgin in ubuntu jaunty jackalope

by manojgumber

Everything about ubuntu jaunty rocks despite the annoying and distracting notifications in pidgin which keep up popping during whatever work u r doing.

These notifications are due to a plugin “libnotify” which is enable by default in pidgin.

To disable this plugin,

In Main window of Pidgin, Tools->Plugins->Uncheck “LibNotify PopUps”

Happy Ubuntuing!!

Share Firefox Saved Passwords , Browsing History & Bookmarks between windows and linux

by manojgumber

Many of us use linux on dual boot system along with windows. We often use firefox in both linux and windows . It sometimes feel very annoying that some password that I had saved in firefox in windows or bookmark saved in windows , I can’t access that in linux. We can solve this problem and share common settings between windows and linux by utilizing the concept of soft links.
Your passwords are stored in two different files in firefox, both of which are required:

  • key3.db – This file stores your key database for your passwords. To transfer saved passwords, you must copy this file along with the following file.
firefox 3.5/3.6:
  • signons.sqlite – Saved passwords.
firefox 3.0:
  • signons3.txt – Saved passwords
  • places.sqlite -This file contains all your Firefox bookmarks and the list of websites you have previously visited.

The concept here is that in  linux, we will create a soft link to these files pointing to  firefox of windows.Thus both windows & linux will share common files and hence bookmarks, browsing history and passwords are shared.

The commands  are–
cd ~/.mozilla/firefox/xxxxxxxx.default/
xxxxxxxx represents a random string of 8 characters different on each installation.

ln -s “<path to profile folder of firefox in windows>/key3.db”
ln -s “<path to profile folder of firefox in windows>/signons3.txt”              (Note– replace it with signons3.sqlite if you are using firefox 3.5 . )
ln -s “<path to profile folder of firefox in windows>/places.sqlite”

Path is –
Suppose your windows drive is mounted at /media/disk/ ( change accordingly in command for your mount point)
then path is
For (Windows XP/2000)
/media/disk/Documents and Settings/<username of windows>/Application Data/Mozilla/Firefox/Profiles/xxxxxxxx.default
For (Windows Vista/Windows 7)
/media/disk/Users/<username of windows>/AppData/Roaming/Mozilla/Firefox/Profiles/xxxxxxxx.default

As an example , I show the sequence of commands on my system…
cd ~/.mozilla/firefox/9bqs94b3.default/
ln -s “/media/disk/Documents and Settings/manoj/Application Data/Mozilla/Firefox/Profiles/pz2cmxos.default/key3.db”
ln -s “/media/disk/Documents and Settings/manoj/Application Data/Mozilla/Firefox/Profiles/pz2cmxos.default/signons3.txt”
ln -s “/media/disk/Documents and Settings/manoj/Application Data/Mozilla/Firefox/Profiles/pz2cmxos.default/places.sqlite”

A Caveat

  1. Firefox 3.5 onwards , passwords are in signons3.sqlite . If using firefox  3.5 , both windows , linux should have firefox version 3.5 or above.
  2. A point of caution is that windows drive should have a fixed mount point in your linux filesystem. Otherwise during the next reboot, the soft links will become invalid. To set a fixed mount point for windows drive every time the system boots, we can append the appropriate entry  in file /etc/fstab.
    /dev/sdax   <mount point>     ntfs-3g    rw,defaults,umask=0000 0 0
    /dev/sdax is your windows partition (can be sda1,sda2 or other)
    <mountpoint> is the mount point in linux filesystem where windows drive will be mounted.
    e.g. in my system , it is
    /dev/sda1   /media/disk     ntfs-3g    rw,defaults,umask=0000 0 0