Wednesday, April 18, 2007

Linux Tips - 4

This is not a big secret. But just thought of putting it here.

If you work on a server by remotely logging into it and wonder how you can open softwares like matlab, openoffice on the remote server with the GUI window appearing on your screen, this is what you need to do.

Login with ssh with the -X flag

# ssh -X abc@bcd

where abc is your login name and bcd is your server name

The flag -X enables the X11 forwarding. Now any graphical program that you run on the server will appear on your screen. Note that you have to have high speed network connection for this to work smoothly.

Now run the program

# ooffice &

ampersand (&) runs it in the background.

A window will appear on your screen that actually belongs to the program running on the remote server.

The use of flag -X invloves some security issues. You can use -Y flag to enable trusted X11 forwarding.

Sunday, March 18, 2007

Linux Tips - 3

If you have recently started using Linux and ofcourse love your language, often you get frustrated when you can't read your favourite sites in your language. This happens because many of the sites in local languages use ttf fonts instead of new unicode encoding.

I happened to buy a book from www.rasik.com and faced this problem. I couldn't read the Marathi web pages on Rasik site.

Here is what you need to do to enable ttf fonts with your X server.

I am writing this with respect to marathimati.com but this will work for any site that uses ttf fonts (e.g. rasik.com). Note for rasik.com don't use the default procedure given for linux, instead use the procedure given for windows to download the ttf fonts.

1. Download the kiran ttf fonts from here and save them on Desktop.

2. Create a new directory, lets say 'marathifonts' under /usr/share/fonts

# mkdir /usr/share/fonts/marathifonts

3. Copy the ttf fonts to this directory.

# cp kiran.TTF KF-kiran.TTF /usr/share/fonts/marathifonts


5. Run the following command to build the font cache.

# fc-cache -f -v


6. Restart the web browser (Firefox)

7. No need to restart the X font server.

Also note that for the sites that use ttf fonts, you need to change/disable the Character Encoding if it is already set to 'Unicode'. Set it to default 'Western'. Go to View -> Character Encoding -> Western.

Tuesday, January 30, 2007

Linux Tips - 2

2. Installing newer FUSE module.

You may get some warning while mounting ntfs partition. One sample warning is as follows. This indicates that the FUSE module is old.

WARNING: Old FUSE kernel module detected. This means, some driver features are not available (swap file on NTFS, boot from NTFS by LILO), and unmount is not safe unless you make sure the ntfs-3g process naturally terminates after calling 'umount'. The safe FUSE kernel driver is included in the official Linux kernels since version 2.6.20-rc1, or in the FUSE 2.6 software package. Please see the next page for more help: http://www.ntfs-3g.org/support.html#fuse26

If so, you can manually install the newer fuse module.

Download new fuse tarball from here.

Untar the downloaded file.

# tar -xzvf fuse-2.6.x.tar.gz

Remove the old module.

# rmmod fuse

Change to the fuse-2.6.x directory and run following commands.

# ./configure --enable-kernel-module

# make

# make install

Make sure that you get no errors after configure command. If you don't have kernel source code available, the it will give some errors.

Once these commands are executed successfully, you can mount ntfs partitions without any warnings.

Linux Tips - 1

I am referring to Fedora Core 6.

1. How to mount windows NTFS partitions in read/write mode?

This tip tells you how to make your linux system capable of mounting NTFS partitions in read/write mode. After this you are no longer constrained to the linux partitions. You can use windows partitions to read and even to write the data.

Change to root.

Make sure that Livna repository is set up.

# rpm -ivh http://rpm.livna.org/livna-release-6.rpm

# rpm --import http://rpm.livna.org/RPM-LIVNA-GPG-KEY

Now install fuse and ntfs modules.

# yum install fuse fuse-libs ntfs-3g ntfsprogs ntfsprogs-gnomevfs

Once these modules get installed successfully, you can mount the windows ntfs partitions as

# mount -t ntfs-3g /dev/hda1 /mnt/windows

Note: This assumes that a directory named 'windows' is present under /mnt. You can alternatively mount it under any directory but it is always a good idea to mount it under /mnt.