Archive for December, 2008

Tata Indicom CDMA Epivalley modem in ubuntu

December 22, 2008

I recently got a Tata Indicom wireless modem. It is a device from Epivalley and uses the qualcomm chip. It came with a software CD which contained the softwares only for windows. I searched through the forum and I found a very simple way of configuring it in ubuntu. In ubuntu the modem got detected without installing any additional softwares and all I have to do was to set some configuration information for it to connect to the ISP. I had to create some files to put in the settings required by it.

I created the peers file with the  command.

gksudo gedit /etc/ppp/peers/tatagprs

Put these commands starting with a blank line into the file and save it.

noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/tatagprs"
debug
/dev/ttyACM0
460800
defaultroute
noipdefault
user "internet"
password "internet"
remotename tata
ipparam tata

usepeerdns

Next I created the chatscript with the command

gksudo gedit /etc/chatscripts/tatagprs

Then I put these contents into the file and saved it.

ABORT   'BUSY'
ABORT   'NO CARRIER'
ABORT   'ERROR'
''      ATZ
OK      ATDT#777
CONNECT ''

Now to connect to the internet I will open a terminal and type.

pon tatagprs

and to disconnect I simply type

poff tatagprs or
poff

Windows XP and Custom Fonts in Ubuntu

December 22, 2008

I work with both windows and ubuntu and I edit my documents from both of these OS. I want all my formatting to be consistent but, there are many fonts in windows which are not present in ubuntu. This makes editing word files a boaring task as I have to keep changing the fonts whenever I change the OS or use a font which is available in both the OS. There are  also some web sites which require me to install their font to show up in  correct format.

We can install any font in ubuntu by following these simple steps. To start with we need the font file to install. If it is a fovourite font from Windows just copy the font file from the windows fonts directory into a memory stick and copy it to your home directory in ubuntu. Then open up a terminal.

  1. Create a directory to hold our fonts  – sudo mkdir -p /usr/local/share/fonts/truetype
  2. Change to the directory we have created – sudo cd  /usr/local/share/fonts/truetype
  3. Copy the font file – sudo cp ~/<font-file-name>.ttf .
  4. Rebuild font cache – sudo fc-cache -f -v

We could see that the last command updates the font-cache by printing a lot of messages to the console. We are done. Now open the website which asked for the font, it should open with  correct formatting. If we open a document to edit we could find the font we have just installed from the fonts drop down.

Thinkpad Scroll Mouse in Ubuntu

December 17, 2008

I am having a thinkpad R60 model. I was using it with WindowsXP and It is very easy for me to scroll thorugh documents my holding the middle mouse button and the tracker together. But when I moved to ubuntu I found that the Scroll button was functioning in a weird manner. In some applications like Document viewer I was able to drag the pages using this key combination. In some applications like OpenOffice Writer whenever I press this key combination it pasted the text in the clipboard on to the cursor, annoying me. I googled a bit a found a resource which insisted on adding the below lines to /etc/X11/xorg.conf

Section “InputDevice”
Identifier “Configured Mouse”
Driver “mouse”
Option “CorePointer”
Option “Device” “/dev/input/mice”
Option “Protocol” “ExplorerPS/2″
Option “ZAxisMapping” “4 5″
Option “Emulate3Buttons” “true”
Option “EmulateWheel” “true”
Option “EmulateWheelButton” “2″
EndSection

When I added these lines to the files and restarted X, my display crashed. I had to go into recovery mode to configure X again to bring my display back. The recovery process is automatic, It just needs our confirmation to proceed with reconfiguring X so, nothing to worry when something goes wrong while editing the file. We can get back the default values.

Ubuntu Intrepid uses a improved XOrg which supports hot plug. To configure any devices we have to place a xml file containing the configurations into the directory /etc/hal/fdi/policy. To enable scrolling using the middle button in Thinkpad, open a terminal and enter the following commands.

  1. cd /etc/hal/fdi/policy
  2. sudo vi tp-scroll.fdi
  3. Paste the following into the file and save it.

<match key=”info.product” string=”TPPS/2 IBM TrackPoint”>
<merge key=”input.x11_options.EmulateWheel” type=”string”>true</merge>
<merge key=”input.x11_options.EmulateWheelButton” type=”string”>2</merge>
<merge key=”input.x11_options.XAxisMapping” type=”string”>6 7</merge>
<merge key=”input.x11_options.YAxisMapping” type=”string”>4 5</merge>
<merge key=”input.x11_options.ZAxsisMapping” type=”string”>4 5</merge>
<merge key=”input.x11_options.Emulate3Buttons” type=”string”>true</merge>
</match>

Now log out and log in, the scroll button should function as it would in WindowsXp.

GTalk Yahoo Messenger meets ubuntu

December 16, 2008

I am very much used to GTalk in windows that, when I moved to ubuntu I was very much in need of it. But gtalk is not available in ubuntu or any other linux platform.

But there is a nice IM client that comes bundled with ubuntu know as Pidgin. Pidgin supports many popular IM protocols and to name a few like AIM, MSN, ICQ, Google talk, Yahoo. It proides a nice environment to use all these different IM protocols from the same interface and at the same time.

I use two accounts one with yahoo and one with GTalk frequently. In windows I have to alternate between Yahoo messenger and GTalk but, in ubuntu we can have both these accounts added to Pidgin and used at the same time.

Pidgin can be found under

Applications =>Internet =>Pidgin

To add an account for use with Pidgin we need to go to the manage accounts screen by selecting

Accounts => Manage Accounts

Select “Add”. In the protocol drop down we have many choices like GTalk, yahoo etc.

In this example lets configure a GTalk account

  1. Type your username. If your id is user@gmail.com, then username is user
  2. Fill in your domain name. Domain name is the thing which is after the @ symbol and in our case gmail.com
  3. For the resources leave the default value of Home.
  4. Type your password.

We are done. Now go to Accounts => Enable Accounts and check user@gmail.com.

Now pidgin will connect to google server and fetch your buddy list. It has similar options like GTalk for nofiying the status of buddies. We can sort buddies by their name, status etc by going to Buddies => Sort Buddies and selecting the various options.

Pidgin has a very nice feature of integrating with the system menu for setting the various status. When we log into Pidgin we can see that the system menu has the options like Online, Away, Busy etc inaddition to Shutdown, Hibernate etc.

When I am working with pidgin I found that it is taking a lot of time to load the buddy list, some times it doesn’t even load the buddy list with GTalk even after 30mins. Sometimes the connection gets broken down when the speed is low. Apart form these things Pidgin is a wonderful replacement for Gtalk, Yahoo Messenger and many other IMs for ubuntu.

Run eclipse on sun java

December 6, 2008

When eclipse is installed it uses OpenJdk by default. Eclipse gives a good performance when it is run on sun java. To change the JDK used by eclipse we got to do a couple of changes.
Open a terminal and type the following command

sudo gedit /etc/eclipse/java_home

In the file add the following line on the top of the list which represents the JDK search order of eclipse

/usr/lib/jvm/java-6-sun

Save and Close the file.
Restart eclipse. Now eclipse will run on sun java giving a good performance.

Installing Java 6 in Ubuntu Intrepid

December 6, 2008

I installed java6 in intrepid using the command

sudo apt-get install sun-java6-jdk

and the installation went fine without any errors. I opened a terminal to check the installation and typed the command.
java -version
It displayed
java version “1.6.0_10″
Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)


Now we have sun java installed as the defaulf JVM.
If we install any other package like eclipse that uses OpenJdk by default it changes the default JVM. To change the default JVM back to sun open a terminal and type in the command

sudo update-java-alternatives -s java-6-sun


In the command you can replace java-6-sun with the version of java you have.

How to erase all the files completely in Ubuntu

December 5, 2008

There are situations when we need to make file deletion unrecovarable for security concerns. There are simple commands that can do this. Open a terminal and type the following command.

dd ip=/dev/urandom op=~/consumeSpace.txt
This will fill up all space left with random characters and once the space gets over it stops by throwing an exception. Now we can delete the file we have created to free up the space. To delete the file created type the following command into a terminal.
rm ~/consumeSpace.txt
We have now deleted the files permanently from the disk.

How to setup iptables in ubuntu linux

December 5, 2008

There are acouple of gui front ends for configuring iptables
lokkit is a simple gui front end and it can be installed using the command

sudo apt-get install lokkit

For advanced options use firestarter. It can be installed by the command

sudo apt-get install firestarter

Hello world!

December 5, 2008

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!