Which software would you like to see ported to Linux?

January 31, 2006 8 comments
I have always wondered about this all the while not because I am unhappy with the applications currently bundled with Linux. But purely in a business point of view, this is a pertinent question. A major reason that businesses shy away from embracing Linux is because many of the software that they use do not have a Linux equivalent. And some of these software do play a dominant role in the market in their respective spheres.

I can think of a few software like Adobe Photoshop, FlashMX, Director, Quicken Financial software, Shockwave and Adobe Illustrator to name a few.

Now Novell - a big shot in the Linux distribution market - is running a survey to determine which applications the users feel is critical for their enterprises and would like them to be ported to Linux. So if you have any software in your wish list which run only on Windows at present, then this is the right time to visit their site and let yourselves be heard.

Effective Partitioning - The How and Why of it

January 28, 2006 25 comments
A few days back, when my non-techie friend came to visit me at home, he was amazed to see me booting into multiple OSes (4 to be exact) on my machine. He then wanted to know how I accomplished this feat. I told him about creating partitions and how these partitions play a vital role in installing multiple operating systems on ones machine. But this conversation with my friend set me thinking; why is there so much fuss on creating partitions? I think the primary reason that people face this issue of re-partitioning is because they do not think ahead about their future needs.

Even I have faced this problem of re-partitioning my hard disk many a times. And each time, it was a fine balancing but time consuming act of shifting important data from one partition to another, sometimes taking backup and also at times wiping the disk clean and starting afresh.

At present, I run 4 OSes on my machine. Them being Windows XP, FreeBSD, Ubuntu Breezy and Gentoo Linux. For the curious ones, my hard disk is partitioned as follows :

# fdisk -l
Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 38745 19526976 7 HPFS/NTFS
/dev/hda2 38745 47461 4393336+ a5 FreeBSD
/dev/hda3 47462 48466 506047+ 82 Linux swap
/dev/hda4 48466 77536 14651280 5 Extended
/dev/hda5 48467 65902 8787523+ 83 Linux
/dev/hda6 65902 77536 5863693+ 83 Linux
As you can see above, I have divided my entire 40 GB hard disk into three primary partitions and one extended partition and the extended partition is further divided into two logical partitions (See figure below).

Fig: A view of my partitioned hard disk

You must be aware that one can create only 4 primary partitions per hard disk. The big question is why just 4 ? Why can't we create more than that number? The reason lies in the boot sector. In your primary hard disk, the first 512 bytes is reserved for storing the partition table also called the Master Boot Record (MBR). The problem is that this space fills up after storing just 4 records. So to create multiple partitions, a work around was found out. That is creating an extended partition whose address was stored in the partition table and then creating any number of sub partitions (called logical partitions) inside the extended partition.

Creating partitions is also dependent on the type of file system and OS used
For example, way back when I used to install Windows 95/NT, I remember having to split the hard disk into partitions of 2 GB size. This was because the file system used at that time FAT16 could not reside in partitions with sizes over 2.1 GB. Though the newer version FAT32 or NTFS does not have this limitation.

Similarly, OSes like Sun Solaris and FreeBSD can be installed only in primary partitions.

Deep thought should be given prior to creating partitions
The major work in creating partitions is to decide how many partitions to create and how much space to allocate to each of them. If too little is allocated, within no time, all the space will be filled up. And if too much space is allocated, then there will be a lot of unused space being wasted left around.

Generally speaking for Linux/Unix mail servers, you put the /var directory in a separate partition. This is because the users mail box resides in this directory. And if you are allowing the public to create email accounts on your machine, then in no time, the /var directory will get filled up and will eat up the remaining space on the hard disk and in the process bring the server down. This will not happen if /var resides in its own partition.

Should /tmp reside in a separate partition ?
A few people believe that the /tmp directory in Linux/Unix should reside in its own separate partition. There is a good reason for it. That is, the /tmp directory is world writable. If you do a long listing of the /tmp directory ...

$ ls -ld /tmp
drwxrwxrwt 14 root root 4096 2006-01-28 16:32 /tmp
... you will find that the directory is having read, write and execute permissions for all. Now why is that a bad thing? It is not exactly bad and has its uses. But a hacker (if he knows your IP address and is able to access your machine behind the firewall), will be able to upload and execute programs in the /tmp directory thus making your system vulnerable. For one, he can upload a tiny program to your /tmp directory, which when run will create a core dump.

Core dumps are files of huge sizes (some can be 1 GB size) which are generated when a faulty program is run on a Linux/Unix machine. A core dump can be used by a developer for finding out what is wrong with his program, but that is besides the point. One can imagine what will happen if the hacker repeatedly executes his tiny program and creates a series of core dumps on your machine. In no time, all the space on the hard disk will be filled and your system will crash.

Note: I have found out that in Ubuntu the functionality of creating core dumps is disabled by default. So people using Ubuntu can have the /tmp directory in the same partition as the '/' .

Another thing I feel positive about is creating a separate partition for the /home directory. This way, one can easily reinstall the operating system or switch distributions without worrying about creating backups. More over if you are using multiple Linux distributions like I do (see figure above), then you can have the same /home directory for both distributions.

How do you create a partition ?
There are a variety of tools available right from the ubiquitous fdisk to ranish partition manager, qparted, cfdisk to commercial products like Partition Magic. But as a long time Linux user, I would recommend learning to use fdisk. This is because even though it uses cryptic commands, once you master it, partitioning becomes a piece of cake. Also in emergencies, you will not be left high and dry for want of your favourite partitioning tool because fdisk is bundled with all Linux distributions and Unixes alike.

Will partitions ever go out of vogue ?
I think we will have to put up with partitioning for a couple more years. But with the recent interest in virtualisation technologies (like Vmware, Xen, Usermode Linux and QEMU), which allow one to run any operating system over another at the same time, and also taking into consideration the increase in processing power and availability of cheap memory, I feel, may be in 10 years or so, people will opt out of partitioning their hard disks all together.

Update:
I forgot to mention that the partition housing FreeBSD (see figure above) was originally a FAT32 partition which I was using to share data between Linux and Windows. Because I felt a bit lazy or just didn't feel like it, I opted for converting the FAT32 primary partition to UFS2 to install FreeBSD. If you are considering dual booting between Windows and Linux, it is beneficial to have atleast a small FAT32 partition to facilitate sharing of data between the two OSes.
Also Read:
Creating and resizing a Logical Volume Manager in Linux

Regular Expression Tutorial

January 26, 2006 0 comments
This is a short tutorial on understanding regular expressions.

What is a Regular Expression ?


A regular expression is a set of characters that describe a pattern in any text. The set consists of a combination of characters and symbols which when used in a group, convey a special meaning. The term "Regular Expression" is usually abbreviated to regex or regexp.

Illustrating desktop Linux distributions through screencasting

0 comments
If you are the curious type and would like to compare how other Linux distributions package their desktops, then you are in luck. Now you can get a feel (a tiny one though) of different Linux distributions without installing and trying them out.

LinClips has put together a collection of flash videos which gives a peep into the desktops of different Linux distributions including the menu layout and the softwares bundled with them. What is even better is that each clip runs for exactly 2 minutes which brings it to the reach of people with low bandwidth internet connection.

Festival - A Free Text to Speech Tool

January 24, 2006 28 comments

What is Festival ?


Festival is a free text to speech tool developed by the Center for Speech Technology Research at the University of Edinburgh.

It is shipped with most Linux distributions and has been released under an X11-type license allowing unrestricted commercial and non-commercial use alike.

My dalliance with Gentoo Linux

January 19, 2006 38 comments
I am a self confessed Linux addict. Seriously, I just love to try out new Linux distributions and see how they fare against one another. Now this addiction of mine has got its own advantages. For example, it gives me a fair idea about the pros and cons of each distribution, its weaknesses and strengths. And this experience form a basis on which I decide which should be my dominant distribution at any given time. Not surprisingly, I have reserved a ext3 partition of 6 GB size, specifically for installing and trying out new Linux distributions on my machine.

For quite some time now, I had wanted to install and try out Gentoo. But the experiences of other people showed that I should perhaps start installing it when I have at least a few days to myself. So the weekend prior to last when I got a few days off, it was Gentoo's chance for getting installed on this partition I talked about earlier.

I dutifully downloaded the ISO image for Gentoo. Actually, Gentoo is all about choice and even for downloading it, the user is faced with choices. I found that, broadly speaking, I had a choice of downloading the Universal installation ISO which included all that was needed to get a workable Gentoo on your hard disk like the stage 3 files (I will come back to it later), the source code for extra applications as well as the Gentoo hand book which is a must read if you are to install Gentoo on your machine.

Alternatively, you could also download the minimal installation ISO image which will only configure your network for you and allow you to connect to the internet from where, you will have to download the additional files including the stage 3 tar balls. The second option is better if you have a broadband internet connection of 512 kpbs or more because then you get the latest versions of packages. But since I had less than the 512 Kpbs line, I chose to download the universal installation ISO image and burn it to the CD.

Next I booted my machine using the Gentoo Universal CD and Gentoo automatically detected all the hardware like sound, PCI slots, USB and so on and put me in the root shell.

From here it was a matter of opening the Gentoo Handbook in links (a web browser) on one of the terminals and carrying out the tasks listed in the book on the other terminal. I had around 5 terminals at my disposal and I could easily switch from one terminal to the other using the [Alt+Fn] Key combination.

A word about stages in Gentoo
There are three stages in Gentoo. They are as follows:
  1. Stage 1 : In this stage the system must be bootstrapped and the compilers and essential libraries need to be compiled first from the source.
  2. Stage 2 : In a stage 2 tar ball, the system has already been bootstrapped for you, but you still have to compile all the packages from source.
  3. Stage 3 : A stage 3 tar ball contains all the essential files like compilers and libraries in a binary format. When you are installing Gentoo on your machine, it is recommended to use the stage 3 tar ball unless you have a lot of time to kill on your hands. The advantage of using stage 3 is that the user is saved from the mundane tasks of starting from the very beginning.
Gentoo uses Portage to install software
Each Linux distribution out there has adopted one or the other form of automation for installing packages on an end user's system. If Red Hat has adopted Yum, Debian based distros swear by apt-get.

Gentoo also has developed its own way of automating the whole task. And that is using portage. Portage is a python based package management system similar to those found in FreeBSD which downloads the source of a software and compiles them on the end user's machine. So suppose, I want to install abiword on my machine running Gentoo, I can achieve it through just one command - that is :
# emerge abiword
The emerge script will download the source of the Abiword package along with the source of any other dependency packages to my machine, compile it using the parameters I have opted for and install it on my machine. It is as simple as that.

I will not go into the exact steps I took in installing Gentoo on my machine. The best and the right place for that would be the Official Gentoo Handbook which has done an excellent job of detailing in a simple manner, the steps to be taken in installing this fine distribution . Any way, if you intend to install Gentoo on your machine, you will compulsorily have to read the book at least once so there is no point in detailing the steps here.

Gentoo makes heavy use of environment variables. One environment variable you can be sure of dealing with is the USE variable. I found the use of this variable really unique and useful (no pun intended). Another environment variable I had to set was the CFLAGS variable which specified the architecture and processor make of my machine.

For example, there are a lot of GPLed libraries like gtk, gtk2, qt and so on. If I do not intend to install KDE applications or KDE desktop on my machine, I can easily disable the support for Qt library in my programs at the time of compilation. This I accomplish using the USE variable.
# USE="-qt gnome gtk gtk2" emerge abiword
... will download the source and compile abiword on my machine without any support for Qt but with support included for gnome, gtk and gtk2 libraries.

The environment variables are usually inserted one per line in the /etc/make.conf file. But as far as USE variable is concerned, you can also pass values at the time of emerging as shown in the above example.

Gentoo helps understand Linux better
One thing I found unique to Gentoo was the knowledge gained by the user in the process of installing it on the hard disk. And if you are an experienced Linux user / administrator, it will be a revision time well spent. Some of the things you will understand more are as follows:
  • Partitioning the hard disk using fdisk utility.
  • Creating file system of ones choice on the partition.
  • Turning on swap using the swapon command.
  • Mounting the partitions on to a mount point (/mnt/gentoo in my case)
  • chrooting to a directory or partition
  • Configuring the kernel parameters and compiling and installing the kernel the old fashioned way (If you are not opting for the stock genkernel that is).
Advantages of Gentoo
  • After all this trouble, what you get is a Linux distribution which is tailor made for your machine, blazing fast, with just the packages you need devoid of unnecessary baggage. In fact, if you can correlate other Linux distributions to a Honda motorcycle, ie rolled out from a factory assembly line, all looking and working alike, then Gentoo is a Harley Davidson of Linux distributions; no two installs identical to each other.
  • Another advantage for Gentoo is a very strong user community with prompt help support.
The down side of installing Gentoo
  • Unlike other distributions, it takes a lot of time for installing gentoo on the machine. In my case it took a larger part of 4 days to finish installing gentoo with X and the applications I needed. Coming back to our bike analogy, same way as a Harley Davidson bike is a fuel guzzler, Gentoo is a time guzzler.
  • To successfully install Gentoo on your machine, at some point of time, an internet connection is mandatory.
  • Finally, you should stock yourselves with a large dose of patience.
A suggestion to the developers of Gentoo
One thing which grabbed my attention was the inordinate time it took to download and install software on the machine. This is especially evident when there are dependency packages to be installed. For example, when I gave the command:
# emerge kde-base/kgoldrunner
It started downloading the first package, unpacking it in a directory and compiling and installing it. Then downloading the second package, unpacking,compiling and installing it and so on. In fact it was a download - compile - install - download - compile - install cycle.

The down side of following this cycle is your internet connection should be maintained at all times till the installation of all the packages are completed.

I feel it would be better if the emerge script is tuned to download all the package sources including the dependencies first at a single stretch and then, start the compile and install process. This way, once the download is complete, the internet connection is not important any more and even if the internet goes down, it will not hamper the installation in any way.

Why should someone use Debian over another distribution?

January 18, 2006 2 comments
I think the reason I run Debian rather than anything else is because its as true to the Unix philosophy as it can get: each of the system components does what it should, does that as well as it can, and otherwise keeps out of your way. Nothing on the system happens without your consent. And because everything is designed with little pieces building on top of each other, it's easy to keep an overview. This directly translates into manageability and security. In other words, you control the system, and not the other way around"
.
This was the reply given by Martin.F.Krafft, the author of the best selling book "The Debian System" in an interview with Sal Cangeloso when this question was posed to him. The interview also touched on topics on various other aspects of the Debian system like the importance of Debian policy to the final product, the path the author would like to see Debian adopt in the future and many more.

The questions have been well thought out and the replies are quite insightful which makes reading the whole interview a worthwhile exercise.

Print a large banner on your terminal

January 17, 2006 5 comments
I still remember those days clearly when I was taking a short term course in Unix. The Unix flavour being SCO Unix ver 5.0. The first command we were introduced to in Unix by the instructor was the 'banner' command.

'banner' is a command which prints a high resolution text banner on the system console or if you have a printer connected to your machine, you can redirect the output to the printer. This utility is available on all Linux / Unix platforms.

For example, to print my name as a large banner, I give the command as follows:
$ banner -w 60 Ravi
The above command will print my name on the console with a width of 60 characters. If the -w option is omitted, it prints my name in the default width of 102 characters. The character used to print the name is '#'.

Fig: My name printed on the terminal
You can also redirect the output to a printer as follows:
$ banner -w 60 Ravi > /dev/lp0
We had great fun by printing out a variety of text on the console using the banner command. In some ways, it is a pity that nowadays, the first thing a new user to Linux or Unix do is check out the GUI or the games installed in them.

UWIN - Unix for Windows

January 16, 2006 0 comments
UWIN is a UNIX to Windows Integration Toolkit that gives you almost all the features of a traditional UNIX operating system on Windows 7, Windows Vista, Windows XP, Windows 2000, Windows ME, and Windows 95/98.

The latest version of UWIN as of this writing is version 5.0. UWIN is released under an open license which includes parts released under Eclipse Public License version 1.0, BSD license, MIT license, and GPL.

Book Review : Linux Quick Fix Notebook

January 15, 2006 3 comments
I am always on the lookout for good books on Linux which covers system and network administration topics. So when I came across one of the Bruce Perens' Open Source Series books on Linux called "Linux Quick Fix Notebook" authored by Peter Harrison, I gave it a shot. At first I was a bit skeptical owing to my past experiences with books that claim to be all rounders in their respective field but which in reality covers the topic in shallow depth. But after flipping through a few pages, I marvelled at the sheer amount and depth of coverage of system and network administration topics.


This book positions itself as a System / Network administrator's guide to configuring and fixing various issues faced in Linux and so is a bit short on theory but more than makes it up by taking a hands-on approach in tackling these problems. It has everything from the basic configuration and trouble shooting to advanced security and optimization techniques.

Would you like to set up your own Wireless network, you can do it with ease by following the 13th chapter titled "Linux Wireless Networking". Or how about creating a complete website using Apache web server after setting up DNS, DHCP et al ? The author takes you through all these topics and more in this well structured book. This book is divided into three parts namely :
  1. Linux File Server Project - which gives a sound base on the introductory networking topics like a complete chapter on subnetting IP addresses - which interestingly has not been covered in any of the Linux books I have come across so far, setting up a NIC on Linux, Simple Network Troubleshooting, three chapters on Samba, configuring a DHCP server and more. This part includes 13 chapters.
  2. Linux Website Project - This is the second part of the book which contains 11 chapters and covers all the topics even remotely related to website hosting like setting up a firewall using iptables, setting up servers like FTP server, Apache web server, NTP server and mail server (sendmail), Monitoring server performance using MTRG and configuring DNS (both static and dynamic) and ...
  3. Advanced Topics - This forms the third part of this book and contains 11 chapters. This part deals exclusively with those topics in networking and system administration which are niche areas. These include a chapter on network based Linux installation, how to configure RAID (Redundant Array of Inexpensive Disks), managing disk usage through quotas, configuring NFS, NIS, LDAP and RADIUS, setting up a proxy server using squid, a chapter on Virtual Private Networking, modifying the kernel parameters to improve its performance and basic MySQL configuration details.
That is not all, the author has also included 4 appendices which can be considered to be chapters in their own right which covers those topics which did not fit in any other place in the book like using TCP wrappers to improve security, codes, scripts and configurations, examples of zone files for DNS configuration and so on. The author has also included a short section on Cisco routers and PIX firewalls and explains how to backup the configuration files of these hardware routers to a remote Linux server.

The Book at a glance
Because the book has over 35 chapters and 4 additional apendices, I will list the essential topics covered in this book instead of a chapter-by-chapter listing.
  • Software Installation
  • Network setup and troubleshooting
  • Samba for windows files on Linux servers
  • Linux-to Linux file sharing with NFS
  • Simple MySQL database administration
  • LDAP and NIS for centralized logins
  • FTP and SCP file transfers
  • Disk data redundancy with software RAID
  • Wireless Linux networks
  • MRTG server performance monitoring
  • Linux firewalls and VPNs
  • Squid for Web access control
  • Mail, Web, and DNS server setup
  • Websites on DHCP Internet links
  • Time synchronization with NTP
  • Error reporting with syslog
  • Restricting user's disk space usage with quotas
Book Specifications
Name : Linux Quick Fix Notebook
ISBN No: 0-13-186150-6
Author : Peter Harrison
Publisher : Prentice Hall (Professional Technical Reference)
No of Pages : Over 650
Price : Check at Amazon
Rating : Excellent

A word about the Author
Peter Harrison, the author of this book is a principal network engineer for a major Web-hosting company with over 20 data centers throughout North America and Europe. He has worked extensively with Linux in mission critical, high availability environments used by a number of Fortune 500 companies. He was founding president of PCJAM - Jamaica's first computer user group, and was principal systems engineer responsible for computerizing the island's tax collection and social security systems. He is a Cisco Certified Internetworking Engineer (CCIE).

Things I liked about this book
  • As the name indicates, this book is truly a hands on reference for any system or network administrator dealing in Linux. Each topic is dealt with by giving practical how-to kind of examples and all the person has to do is execute the commands the same way that has been given in the book.
  • The topics are explained in a simple and lucid manner keeping complex jargon to a minimum.
  • The chapters have a logical flow of information starting with concise backgrounders and ending with a troubleshooting section.
  • Each chapter is a complete entity in its own right and so it is not necessary to read the book from cover to cover. You can easily jump to the section you are interested in and carry on from there. For example, if you are interested in configuring RAID on your machine, you can directly flip to the chapter dealing in RAID (chapter 26) and start reading from there thus saving a lot of time.
  • Configuring and setting up various packages and services is explained using command line method, which I believe is a plus point as far as the topic of system and network administration in Linux is concerned.
  • This book addresses the real issues that systems administrators encounter when working with Linux.
The only thing I found a bit of a drawback was that the author has used the Red Hat way of configuring things all through out the book. So starting and stopping services is explained using the 'chkconfig' and 'service' scripts through out the book. Installing packages is explained using 'rpm' and so on. And a person using a non Red Hat distribution will feel a bit disoriented at first.

But that does not bring down the value of the book at all. Taking into consideration the sheer amount of topics covered and their depth, I can't fail to notice that it is a book worthy of being a companion to any professional system or network administrator in Linux.

Benchmark : Performance comparisons of various Filesystems under Linux

January 14, 2006 3 comments
If you are asked to list the types of filesystems supported in Linux, I am sure you will be able to list quite a few of them. But when it comes to listing the pros and cons with respect to the performance of these filesystems in Linux, one is not so sure right? This may be because not many have benchmarked these filesystems and published their findings online.

Now things have changed though, because Justin Piszcz has written a two part series listing his findings regarding how each filesystem fared performance wise under Linux. He has published his findings for Linux kernel 2.4 as well as 2.6 .

The filesystems that were included in the benchmark were EXT2, EXT3, JFS, ReiserFS v3, ReiserFS v4 and XFS . To arrive at a conclusion, he performed 17 different tests which included creating 1000's of files on the filesystem and cat'ing a huge file (1 GB) to /dev/null among other things.

So what is the verdict ?
The author has concluded that XFS is the best filesystem in terms of performance and scalability though JFS has improved in some of the tests. And the surprise of all, ReiserFS is the slowest in most of the tests. But I think it would be prudent to read the article first and arrive at your own conclusions.

How to Compile Qt Programs on Command line

January 13, 2006 7 comments
Qt is a cross-platform application framework (toolkit) that is widely used for developing GUI applications, and also for developing non-GUI programs such as command-line tools and consoles for servers.

Qt is the underlying library in KDE and all the KDE specific applications. Qt allows you to create robust, well designed, GUI applications in the shortest period of time.

Xfce 4.2 - A light weight window manager heavy in features.

January 10, 2006 15 comments
The first time I used Xfce was when I tried out the Belenix Live CD. Xfce was the only window manager bundled with it so I had no choice but to use it though my personal preference was Fluxbox. But after playing around in it for some time, I just couldn't stop admiring the usability and design of Xfce as well as the responsiveness of the applications when run in it.

So the first thing I did was to install it in Linux and take it for a test drive. And the things I found out were really interesting. For one, Xfce is not just any window manager out there but it is a desktop in its own might. It comes bundled with applications like its own light weight xterminal, a file manager, desktop configuration utilities, a light weight mail client, a media player and optional utilities like a calender similar to those that pop up in KDE and Gnome when you click on the clock in the panel and a very cool lightweight text editor.

Fig: Xfce Desktop - Note the highlighted menu and the calender

But what sets Xfce apart from the more popular heavy weights like Gnome and KDE is its very low memory foot print. In fact, in the developer's own words, the aim of Xfce is to be a simple, light and efficient environment which is easy to use and configure, stable, fast and at the same time visually appealing. And not to speak of a clean desktop. In fact, I found out that the desktop is a separate utility which goes by the name xfdesktop and the user has the option of not running it in Xfce if he chose to.

Fig: You can configure most of the features from the Xfce settings manager

Another aspect which endeared me to this light weight window manager cum desktop is that when you install or uninstall any software in Linux, the menus in Xfce are automatically updated to mirror the change which is a comfortable feature which is lacked by other light weight window managers including popular ones like Fluxbox.

In my opinion, it would be a good idea to install another light weight file manager called 'Rox' along side Xfce which I believe integrates quite well with the Xfce desktop.

Fig: Rox file manager in action

If you are using a Debian based Linux distribution, installing rox is as simple as executing the command:
# apt-get install rox
I recommend using Rox file manager with Xfce because it is quite easy to associate file types with the applications of our choice in rox and it is blazing fast.

Software bundled with Xfce
  • xffm - The light weight file manager
  • xfdesktop - Enables menus to pop up when right clicked on the desktop.
  • xfce-settings-show - Xfce settings manager, where you configure the desktop settings, keyboard, mouse, xfpanel.
  • xfce4-panel - The Xfce4 panel.
  • xfce4-menueditor - A useful widget to edit the menu entries in Xfce4.
  • xfmail - A light weight mail client.
  • xfmedia - A utility to play audio files.
  • xfcalendar - This is an optional widget which gives a compact monthly calendar similar to those found in KDE and Gnome.
  • xflock4 - Activates the screensaver and locks the display.
  • xfrun4 - Run application command dialog box. Can be activated by using key sequence [Alt+F2] .
  • xfhelp4 - Opens the Xfce4 documentation in the default web browser.
  • xfce4-terminal - This is actually a script which runs the ubiquitous xterm but with better configuration. See this link for more details.
  • mousepad - A light weight text editor. (Has to be installed separately).

Fig: xfmail - a light weight email client


Fig: A beautiful Xterminal

And if you are usually booting into run level 2 or 3 and then starting a window manager using the startx command, then you may make Xfce the default window manager by creating a hidden file by name .xinitrc in your home directory and entering the command startxfce4 in it as follows:
$ touch .xinitrc
$ echo "startxfce4" > .xinitrc

$ startx
One thing that I found really annoying though is that when I start nautilus (the Gnome file manager), it overlaps my xfce desktop and I stop getting the xfce menus when I right click on the desktop. I figured a work around here in that by using the --no-desktop flag, I was able to circumvent this problem.
$ nautilus --no-desktop
After using this light weight window manager (version 4.2.2) for a week now, I am so impressed by it that I have made it my default window manager in Linux.

Input/Output redirection made simple in Linux

January 07, 2006 23 comments
Linux follows the philosophy that every thing is a file.

A keyboard, monitor, mouse, printer ... are all files in Linux. Linux identifies each of the hardware with unique file descriptors that are associated with it.

Now this nomenclature has got its own advantages. The main one being you can use many command line tools to send, receive or manipulate data with these devices.

For example, my mouse has the file descriptor /dev/input/mice associated with it (yours may be different).

So if I want to see the output of the mouse on my screen, I just enter the command :

$ cat /dev/input/mice

... and then move the mouse to get characters on the terminal. Try it for yourselves.

In some cases, running the above command will scramble your terminal display. If that happens, you can get back your terminal by typing reset

All programs in Linux have access to 3 special files. They are -

  1. Standard input - 0
  2. Standard output - 1, and
  3. Error - 2

Where the numbers 0, 1, and 2 denote file descriptors.

In the previous example, the tool cat used standard output which by default is the screen or the console to display the output.

Redirecting output to other files


You can easily redirect input / output to any file other than the screen. This is achieved in Linux using input and output redirection symbols.

These symbols are as follows:

> - Output redirection

< - Input redirection

Using a combination of these symbols and the standard file descriptors you can achieve complex redirection tasks quite easily.

Output Redirection


Suppose, I want to redirect the output of ls to a text file instead of the console. I can use the output redirection symbol and do it as shown below.

$ ls -l myfile.txt > test.txt

The above command will redirect the output to the file - test.txt. If the file 'test.txt' does not exist, then it is automatically created and the output of the command ls -l is written to it.

This is assuming that there is a file called myfile.txt existing in my current directory.

Now lets see what happens when we execute the same command after deleting the file myfile.txt.

$ rm myfile.txt
$ ls -l myfile.txt > test.txt
ls: myfile.txt: No such file or directory -- ERROR

What happens is that ls does not find the file named myfile.txt and displays an error on the console or terminal. Now here is the fun part.

You can also redirect the error generated above to another file instead of displaying on the console by using a combination of error file descriptor and output file redirection symbol as follows:


$ ls -l myfile.txt 2> test.txt

By typing 2>, you are telling the program to redirect any error (2) to the file test.txt.

Linux terminals
Two open terminals can be used to practice output redirection

Examples of Redirection


I can give one practical purpose for this error redirection which I use on a regular basis. When I am searching for a file in the whole hard disk as a normal user, I get a lot of errors such as :

find: /file/path: Permission denied

In such situations I use the error redirection to weed out these error messages as follows:

# find / -iname \* 2> /dev/null

Now all the error messages are redirected to /dev/null device. Thus I can reduce a lot of clutter in my terminal.

/dev/null is a special kind of file in that its size is always zero. Anything you write to that file will just disappear.

The opposite of this file is /dev/zero which acts as an infinite source. You can use /dev/zero to create a file of any size - when creating a swap file for instance.

If you have a line printer /dev/lp0 connected to your Linux machine, you can send any output to the printer using output redirection. For example, printing the contents of a text file (testfile.txt) is simple.

$ cat testfile.txt > /dev/lp0

Input Redirection


You use input redirection using the less-than symbol (<) and it is usually used with a program which accepts user input from the keyboard.

A legendary use of input redirection that I have come across is mailing the contents of a text file to another user.

$ mail ravi < mail_contents.txt

Now with the advances in GUI, and also availability of good email clients, this method is seldom used.

Here is another example of input redirection ...

Suppose you want to find the exact number of lines, number of words and characters respectively in a text file and you want to simultaneously write it to another file.

You can do it using a combination of input and output redirection symbols as follows:


$ wc < my_text_file.txt > output_file.txt

What happens above is the contents of the file my_text_file.txt are passed to the command wc whose output is in turn redirected to the file output_file.txt.

Appending data to a file You can also use the >> symbol instead of output redirection to append data to a file. For example,

$ cat - >> test.txt

... will append what ever you write to the file test.txt.

Hope you liked this short tutorial on input output redirection in Linux.

10 things you should know about every Linux installation

January 04, 2006 5 comments
I still remember the first time I had to use a non-windows operating system. I couldn't make head or tail of how to navigate the file hierarchy. It was so different from the working of windows that I had to overcome a steep learning curve. But once I mastered the Linux way of working and its file hierarchy, I felt that it was (and is) a robust operating system and has very many advantages over the windows OS.

Jeffery.G.Thomas has writen an insightful article which details the ten things one should know about every linux installation.