Thursday, October 29, 2009
Ubuntu one on Karmic Koala
Once you have completed the registration and confirmed , the ubuntu one account can be set up on your karmic koala desktop.
Click on Applications >> Internet and click Ubuntu One. The following window will pop up.
You can set the preferences for show icon ,connect on start and bandwidth.
The web browser will be launched and you will be taken the the launchpad website and asked to login. Once you login you will again be asked to confirm whether you want to add you computer to Ubuntu One. Once you agree, the Ubuntu one menu item will come under . See the picture below.
You can use this folder as any other normal folder on your computer.
This folder will be under your home directory. If you open a terminal and move to ~/ Ubuntu\ One/ folder, you can see the off-line contents on your hard disk. If you open the folder in nautilus, a special connect / disconnect button appears. You can use this to connect to the Internet and update your files on the Ubuntu one servers.
Thursday, October 8, 2009
Time Synchronization using NTP on Ubuntu
Click on System->Administration-> Time and Date
Click on unlock. You may have to enter your password to continue.
You may get a dialog box informing you that NTP support has to be installed.
Click on Install NTP Support . The necesary files will be downloaded from the repository.Once the download is complete Close the Time and Date pop up window. Run it once again from System->Administration-> Time and Date . You will get the following window.

Click on Select servers.

Put a tick mark on the selected server and close the window. The NTP client will start running depending on the configuration file /etc/ntp.conf. You can tweak this file for various time update options.
Wednesday, October 7, 2009
Accessing remote computers via XDMCP
Suppose you have two machines A and B ( In my case both are running ubuntu 9.04 , you can try this on other distros too.) They are connected via Ethernet and they are on the same network. (At my end, machine A had an IP address of 10.0.2.2 and machine B had an IP address of 10.0.2.1).
At machine A.
Open a terminal and run
$ sudo gdmsetup
You will get the following screen.
Select Remote tab.
Change the style tab from remote login disabled to same as local.
Close the window.
At machine B
Boot the machine and come to login screen. Click on options and select remote login via XDMCP. Wait for a moment you will see machine A in the list.
Select Machine A from the list and click on connect button. You will get login screen of machine A.
It is possible to login to remote machines on internet if you have good connectivity. You can add the host IP in the above box and connect to the remote machine to get the login screen.
Tuesday, October 6, 2009
Downloading Ubuntu 9.10 beta with zsync
zsync is a file transfer program similar to rsync. zsync is optimized for distribution of files across Internet, with one file on a server to be distributed to thousands of down loaders.
Recently ,I used zsync to update the iso image of karmic koala alpha6 to beta . This is what I did on my ubuntu Jaunty machine.
$ sudo apt-get install zsync
I had downloaded the alpha version of karmic koala and kept it as karmic-desktop-i386.iso in my home folder. For updating this image to the beta release I typed the following command.
$ zsync -i karmic-desktop-i386.iso http://releases.ubuntu.com/karmic/ubuntu-9.10-beta-desktop-i386.iso.zsync
The above command will read karmic-desktop-i386.iso from my hard disk and compare it with the ubuntu-9.10-beta-desktop-i386.iso on the ubuntu servers and update the local image to new version.
As per the release schedule for karmic, the release candidate and final release are expected on 22nd and 29th of October 2009. Get ready with zsync for updating your beta iso to the final .
( Ubuntu provides jigdo files which can also be used to update the image)
Wednesday, September 16, 2009
How to install android sdk 1.6 on Ubuntu 9.04
Google has recently released version android SDK 1.6. This tutorial will teach you how to install it on ubuntu 9.04.
1 Installing Java
Android SDK is built around Java . So, you have to install Sun Java before trying to install Android. Look at this post for details about installation of sun java development kit on ubuntu 9.04.
2) Download android sdk. The current version ( 1.6 R1 ) is available as a tar.gz file from google. Look at this link . You will be prompted to accept android licence and if you accept it, you will be redirected to another link which will permit you to download the sdk. ( It is around 222MB)
3) Unzip the tar.gz file .
I unzipped it to my home folder with the following command
$ tar -xzvf android-sdk-linux_x86-1.6_r1.tgz
All the files were unzipped to a folder named android-sdk-linux_x86-1.6_r1
If you look at the directory now , you will see the following files and folders.
$ ls android-sdk-linux_x86-1.6_r1
add-ons docs documentation.html platforms RELEASE_NOTES.html tools
The tools for android development is under the tools directory.
4) Test drive the android emulator
Since all the android tools are kept under android-sdk-linux_x86-1.6_r1/tools, we must modify the PATH environment variable so that it includes the above directory too.Open a terminal and execute the following.
fermi @Jaunty:~$ PATH=${PATH}:~/android-sdk-linux_x86-1.6_r1/tools
fermi @Jaunty:~$ export PATH
You can also add the above line to your
~/.bash_profile or ~/.bashrc , so that the setting is available always.My PATH variable looks like this after the above command.
fermi @Jaunty:~$
echo $PATH/home/fermi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/fermi/android-sdk-linux_x86-1.6_r1/tools
Now you can test fire your set up . It is a good idea to keep all your android related files in a separate folder. I created a new folder named ANDR for experimenting. All the commands below are executed in that folder.
The virtual phones created by android SDK are called AVDs ( android virtual device) .Let us start the experiment with a virtual SDcard and a Virtual Phone.
Let us create a virtual SDcard
$ mksdcard 2048M SDCARD
If you look at the contents of the folder you will see a 2GB file named SDCARD
Next, create an android virtual phone named FERMI_PHONE.
$ android create avd -n FERMI_PHONE -t 2
Android 1.6 is a basic Android platform.
Do you wish to create a custom hardware profile [no]
Press enter to choose no. You will get back the following message.
Created AVD 'FERMI_PHONE' based on Android 1.6, with the following hardware config:
hw.lcd.density=160
Now start up android emulator.
$ emulator @FERMI_PHONE -sdcard SDCARD
Your virtual phone pops up as below. ( Another window which asks you to participate in a survey also pops up, you can close it.)
Wait for a moment , your screen will change to the one shown below.
You can press menu button to unlock the phone.
You can flip the phone with CNTRL+F11
Now let us browse on the android phone.
5 )Starting development with SDK.
The easiest way to start development on android is via eclipse. The eclipse version shipped with jaunty is some what old. ( Version: 3.2.2-5ubuntu3) . You need a later version for installing the ADT ( android Development tools ) for eclipse. I downloaded Eclipse 3.5 (Galileo) from the eclipse site and installed it . Then completed the following steps.
- Start Eclipse, then select Help > Install New Softare.
- In the Available Software dialog, click Add....
- In the Add Site dialog that appears, enter a name for the remote site (e.g., "Android Plugin") in the "Name" field.
In the "Location" field, enter this URL:
https://dl-ssl.google.com/android/eclipse/
Click OK.
- Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.
- In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.
- Restart Eclipse.
- Select Window > Preferences... to open the Preferences panel
- Select Android from the left panel.
- For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
- Click Apply, then OK.
For running a hello world application, read this entry from the developers guide. Here is a screen shot of my hello world application.
Happy Hacking.
Friday, September 11, 2009
Songbird :The Open Music Player
For trying out songbird you can get source/binary from the songbird website. If you are on ubuntu, ready to use packages are available at getdeb.
For installation , grab the deb corresponding to your version of ubuntu.
On my Jaunty box I did
$ sudo apt-get install songbird_1.2.0-1~getdeb1_i386.deb
Song bird appeared under Application-Sound and Video->Songbird
When I clicked on the menu item it showed me the songbird licence and proceeded to ask some configuration questions. Finally, I got the following screen and I started listening immediately,
You can do anything that you do in rhythmbox. Songbird Rocks !!
Wednesday, September 9, 2009
How to remove a deb package manually
For this , you can try the following. ( Assuming aspell is the broken package)
# apt-get remove aspell
#dpkg -P aspell
#dpkg –force-all -r aspell
These methods can also fail some time. Your only way out will be a manual removal of packages, which can be achieved as detailed below.
a) Get a list of files from the package
# # dpkg -L aspell
b) Remove the files one by one.
c) It is also suggested that you run
# apt-get remove aspell
after manual removal.
Tuesday, August 25, 2009
command-not-found in Ubuntu 9.04 and 9.10
For example , I got this when I typed jed.
$ jed
The program 'jed' is currently not installed. You can install it by typing:
sudo apt-get install jed
bash: jed: command not found
However when I type
$ jid
bash: jid: command not found
The command -not-found hook neatly searches the package database and suggest a possible package for installation. The upcoming release of Ubuntu ( 9.10 aka Karmic Koala) will have spell checking incorporated into the command -not-found feature . It will suggest a list of possible packages even if you make a spelling mistake. See the following screen shot of my Karmic Koala Alpha 3.
Saturday, August 22, 2009
Reset a forgotten root password with a live CD
Any live Linux cd from standard Linux distros such a ubuntu , knoppix etc can be used.
Boot the system with the live CD
Open a terminal and use dmesg command to find out the hard disk.
The ide hard disk are generally named as hda, hdb etc. SATA and SCSI disks are named sda sdb etc. My SATA hard disk is detected as below.
[ 3.206832] sda: sda1 sda2 sda3 sda4 <>
[ 3.266679] sd 0:0:0:0: [sda] Attached SCSI disk
The above hard disk has several partitions. sda2 , sda2 ,sda3 are primary partitions , sda4 is divided into several logical partitions. You have to find out where your root partitions is mounted.
You can use cfdisk to find out the partitions.
$sudo cfdisk /dev/sda
I am getting the following screen .
You can examine the screen and find out the Linux partitions . If you have multiple installations , this can be tricky. You can quit from cfdisk and return to terminal. Now, try to mount the desired partition into some directory. ( Assuming that you Linux partition is /dev/sda2 , the following commands are described.)
Aquire root powers on the terminal with ( in the case of ubuntu live cd which I use)
$sudo su
# mount /dev/sda2 /mnt/Now, chroot to /mnt
# chroot /mnt Change the password# passwd
Next unmount the partition and enjoy .
# umount /mnt
Wednesday, August 19, 2009
Replacing the default screen shot utility on ubuntu with shutter
Installation.
The shutter website hosts a step by step installation tutorial for graphical installation on Ubuntu. If you are oriented towards command line, follow these steps
1) Import the GPG key
$ sudo wget -q http://shutter-project.org/shutter-ppa.key -O- | sudo apt-key add -
2) Add the PPA repository--- to /etc/apt/sources.list
deb http://ppa.launchpad.net/shutter/ppa/ubuntu jaunty main
( Replace jaunty with your version of ubuntu)
3) Install shutter
$ sudo apt-get update
$ sudo apt-get install shutter
Features
Shutter offers lot of features for a blogger. Some of them are,
- take a screen shot of your complete desktop, a rectangular area or capture a website
- take screen shot directly or with a specified delay time
- save the screen shots to a specified directory and name them in a convenient way (using special wild-cards)
- Shutter is fully integrated into the Gnome Desktop (TrayIcon etc.)
- generate thumbnails directly when you are taking a screenshot and set a size level in %
- Shutter session collection
- keep track of all screenshots during session
- copy screeners to clipboard
- print screenshots
- delete screenshots
- rename your file
- upload your files directly to Image-Hosters (e.g. http://ubuntu-pics.de), retrieve all the needed links and share them with others
- edit your screenshots directly using the embedded drawing tool
Making shutter the default screen shot tool on Ubuntu.
Assuming that you are using Genome desktop on ubuntu, you can set Print Screen and Alt-Print Screen can be
configured to launch shutter as below.
a) Open shutter
b) Select Edit->preferences from the menu
c) Click on behavior tab . See the screen shot below.
d) Enable Gnome Key binding by ticking the check boxes.
Monday, August 17, 2009
Using multiple window managers with nested Xserver
Installation
$ sudo apt-get install xnest
Using Xnest to run another window manager.
Method 1
Xnest server can be started from a terminal as below
Xnest :1 -ac &
See the screen shot below. The :1 above indicates virtual X display numbered 1. You can also try other numbers.

export DISPLAY=:1
The above line exports the variable DISPLAY to :1. Now you can open a terminal in the Xnest window by typing xterm & in the terminal. See the screen shot below.
I could start icewm and fluxbox and kde like this. However, trying to start gnome-session resulted in some error. I am yet to find out the reason .
Method 2
This method uses gdmflexiserver . gdmflexiserver is a part of gdm and it is used to run gdm session on demand on a virtual terminal.
You can start it to give a gdm login prompt as below.
$ gdmflexiserver -n
You will get a new virtual X with a gdm login screen. See the picture below.
Friday, August 14, 2009
Importing a remote desktop session via ssh tunnel
The steps I took are detailed below.
On Hardy box
1) Install open ssh server
$sudo apt-get install openssh-server
On Jaunty Box
2) I switch to a text terminal by pressing Control+ALT+ F2. (any thing from F1 to F6 will work)
3) Login to the text terminal
4) Start a new session on Virtual Terminal 8 and launch xterm on it.
$ xinit /usr/bin/xterm -- :1
( :1 above represents the virtual graphical display , you can also use :2 )
5) A gray screen with xterm will appear on virtual terminal 8. If it is not appearing you can switch to it by
$ chvt 8
Or by pressing Control+Alt+f8
6) Now ssh to the Hardy box with tunneling.
$ ssh -Y fermi@192.168.0.2
Give your credentials and login (The IP address above is that of my Hardy box, you can replace it with your user name and IP). You are now logged to Hardy. The GUI of any program launched on Hardy ( in this terminal) will be tunneled back to Jaunty via ssh.
7) Start a gnome session on Hardy by typing the following command in the xterm terminal.
$ gnome-session
You can start other desktop sessions like kde or xfce , if they are installed.
Thursday, August 13, 2009
Tweaking dhcp client configuration to change the default DNS servers to Open DNS
My /etc/resolv.conf ( supplied by ISP) looks like this.
$ cat /etc/resolv.conf
domain asianetindia.com
search asianetindia.com
nameserver 202.88.238.3
nameserver 202.88.238.5
nameserver 202.88.231.2
There is a trick I used to make Open DNS servers as my default DNS server.
Edit /etc/dhcp3/dhclient.conf and look for the line.
#prepend domain-name-servers 127.0.0.1;
Add the following line immediately below the above line.
prepend domain-name-servers 208.67.222.222;
prepend domain-name-servers 208.67.220.220;You can also put any other DNS servers.
Now renew the lease with
$ sudo dhclient eth0
The new /etc/resolve.conf looks like this.
$ cat /etc/resolv.conf
domain asianetindia.com
search asianetindia.com
nameserver 208.67.220.220
nameserver 208.67.222.222
nameserver 202.88.238.3
nameserver 202.88.238.5
nameserver 202.88.231.2
DNS look up is made from open dns.
Monday, August 10, 2009
Five gui hex editors for ubuntu
1) Ghex
Home http://live.gnome.org/Ghex
Ghex is hex editor for GNOME. GHex allows the user to load data from any file, view and edit it in either hex or ascii.
On ubuntu 9.04 , ghex is available in universe repository.
$ sudo apt-get install ghex
2) Khexedit
I could not locate the current home page of khexedit on internet. It is good editor based on kde 3.5. Unfortunaltley , khexedit is missing in the Jaunty repository. I downloaded khexedit form the hardy repository, and nstalled the package with
$ sudo dpkg -i khexedit_3.5.9-0ubuntu3_i386.deb
The screen shot looks like below.
3) Okteta
Home http://utils.kde.org/projects/okteta/
Okteta is a KDE utility. It is included in the new KDE 4.3 also. The data is displayed in two variants: as the numeric values of the bytes and as the characters assigned to the values. Values and characters can be shown either in two columns (the traditional display in hex editors) or in rows with the value on top of the character. Editing can be done both for the values and for the characters. Besides the usual editing capabilities Okteta also brings a small set of tools, like a table listing decodings into common simple data types, a table listing all possible bytes with its' character and value equivalents, a info view with a statistic, a checksum calculator and a filter tool. All modifications to the data loaded can be endlessly undone or redone.
On ubuntu 9.04 you can install okteta with
$ sudo apt-get install okteta
Octeta looks like this screen shot.
4 ) Wxhexeditor
Home http://wxhexeditor.sourceforge.net/
wxHexEditor is another Hex Editor useful for editing large files. Debian/Ubuntu package is not available now. However, you can download it in source or get a binary from here. It is still in alpha but looks very promising.
5 lfhex
Home http://stoopidsimple.com/
lfhex is an application for viewing and editing files in hex, octal, binary, or ascii text. The main strength of lfhex is it's ability to work with files much larger than system memory.
The interface is not very impressive. It can be installed with
$ sudo apt-get install lfhex
See the screen shot below.
Sunday, August 9, 2009
Howto setup Second IP address or Virtual IP address to your Networkcard in ubuntu
See this how to from Shibu Varkala for details.
Friday, August 7, 2009
Setting up automatic login in ubuntu
Click on System ->Administration-Login Window.
You will get a screen like this.
Click on security and check the enable automatic login check box.
Select the user name a automatic log in.
The login preferences window offers several other options. For example, you can setup timed logins. This will allow you to login using user name and password with in a specified time.If you don't do this the user name specified will be automatically logged.
Also, if you are enabling the system administrator account "root" , you can allow him to login to the GUI by ticking the appropriate option.
Monday, August 3, 2009
Download and convert Youtube videos with Elltube
Youtube is one of the most popular video sharing sites on Internet. There are several applications that let you download and store on your hard disk. Elltube is one such application which works both on Linux and windows.
You can download Eltube from here. I installed the deb package for ubuntu on intrrepid with
$ sudo dpkg -i elltube_0.3-1_all.deb
It showed up under Application->internet
The screen shot of eltube is as below.
Now you can download any youtube video by pasting the url of the video to the Elltube window. Locate the video you want to download and copy its URL. On my ubuntu desktop, when I copied the URL, it automatically appeared in ELtube.
Enhancing contextual menus on Ubuntu Desktop
There is a special directory ( .gnome2/nautilus-scripts/ ) inside your home folder into which you can put your custom scripts. Any script you place in that location can be accessed by right-clicking on a file or window and selecting it from the Scripts sub menu. (The Scripts menu item will be visible only if you have some valid scripts installed.
Let us try to open a terminal from the contextual menu. Change to the scripts directory. ( Note that .gnome is a hidden directory, try control -h in nautilus to see hidden files. )
$ cd ~/.gnome2/nautilus-scripts/
Create the following script
#!/bin/sh
gnome-terminal
Change the permission of the file and make it executable
$ chmod u+x myterminal
Now right click on the contextual menu. You should get it as below.
When you execute a contextual menu script , a number of environment variables are passed to the script from nautilus. For example, if you select some files and then right click and select a script , the list of selected files will be passed to the script as an environment variable . You can use this variable inside the script for further processing.
Some of the variables passed are.
NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
Newline-delimited paths for selected files if they are local
NAUTILUS_SCRIPT_SELECTED_URIS
Newline-delimited URIs for selected files
NAUTILUS_SCRIPT_CURRENT_URI
URI for current location
NAUTILUS_SCRIPT_WINDOW_GEOMETRY
Position and size of the current window
Here is a bare minimum example with which you can try out the use of environment variable.
Suppose you want to open a terminal and change to a particular directory, you can put the following code in nautilus-scripts directory. ( There is no error checking).
Code:
#!/bin/sh
mydir=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
if [ -d $mydir ]; then
cd $mydir
gnome-terminal
exit
fi
There are a number of nautilus scripts available on the internet. In the ubuntu 9.04 repository, the following script collections are available.
nautilus-script-audio-convert - A nautilus audio converter script
nautilus-script-collection-svn - Nautilus subversion management scripts
You can also get lot of useful scripts from http://g-scripts.sourceforge.net/.
Adding Document templates to Nautilus right click menu
It allows you to create an empty document in your current location. The file created will be a text file. It is possible to create other kinds of file by a simple hack. Suppose you want to add an invoice template to the menu. Create an invoice template file in your favourite application ,say in open office spread sheet. Let us call the file as invoice.odt.
Copy invoice.odt to ~/Templates directory . ( Templates directory will be automatically created under your home folder in Ubuntu)
$ cp invoice.odt ~/Templates
Now see the right click menu. It will look like the screen below.
You can add as many templates as you like . Also, it is possible to group together templates by creating folders under ~/Templates directory. See the figure below. I have some groupings inside my template directory.
Sunday, August 2, 2009
Yakuake : A pull down terminal for your desktop
To install, simply use
$ sudo apt-get to install both konsole and yakuake
If yuo are on Ubuntu open up a terminal and run yakuake from the terminal.
It will prompt you with the following screen .

Yakuake is prompting you to set a short cut key .The default is F12 . However on my Ubuntu desktop F12 is bound to search. So I clicked on the button and changed the default key to F10.
Press ok and save the configuration.
Now if you press your short cut key , yakuake terminal will pop up. If you press it again , it will hide itself. The appearance and behaviour of yakuake can be controlled. from its menus. You can access the menu by clicking on the down arrow symbol on the bottom right corner of yakuake window. Yakuake recognises almost all settings of konsole the KDE terminal.


















.png)















