Saturday, 31 December 2005

5 New Year Resolutions in favour of Linux

Today is the last day of 2005. From tomorrow, it is the dawn of a new year - 2006. As usual, many of us are introspecting about the year gone by and at the same time resolving to set right the mistakes, bad habits and other faults of ours. So this is the time for new year resolutions.

The year 2006 has a lot in store for us in terms of excitement, knowledge, cutting edge technologies and more. Excitement because this year will see the release of three major projects - two by commercial multi-billion dollar corporations and one by the equally strong player in the Free Software Movement.


For the first time in the history of Apple, 2006 will see the formal release of Mac OSX on the Intel platform . 2006 will also see the release of a new operating system by Microsoft called Vista - which it hopes, will change the way people perceive of Microsoft Operating Systems.

But as a Linux enthusiast, the one thing I am looking forward to in right earnest is the release of KDE 4.0 for the Linux platform. KDE 4.0 is seen by many as a fitting answer in terms of usability, stability, beauty and aesthetics in the desktop arena. It is said to contain a lot of improvements over the current version of KDE and is being designed with the lay person in mind. There is a lot of hope that the release of KDE 4.0 will see a major push for Linux in the PC desktop market. And even though this alone may not be enough for a Linux dominance, it will definitely increase the use of Linux by desktop users.

5 New Year Resolutions in favour of Linux
But as a Linux user, each one of us have a duty to act proactively so that Linux finds more acceptance with the computer users in general. So here are my new year resolutions for 2006 favouring Linux
  1. First and foremost I have resolved that I will earnestly help anyone I come across who is facing a problem in installing Linux on their machine.
  2. I have a huge cache of Linux CDs of a variety of distributions which includes Ubuntu, PCLinuxOS, Fedora, Knoppix, SuSe among others. I have decided that I will hand out these CDs to anybody that I come across who is even remotely associated with computers. What is more, during the conversation, I will persuade him or her to install and try out Linux on their machine.
  3. If ever I have to take decisions regarding buying new computers or any other hardware like printers and scanners, I will make sure that those hardware have support for Linux. Also I will make a strong pitch to embrace Linux over other OSes (where ever possible) at my work place.
  4. Through my writings, I will share my views and experiences with everybody in using Linux on a day-to-day basis.
  5. And lastly, I have resolved that I will give my support to only those candidates or political parties in my country which strongly supports the embrace of Open Source software over proprietary ones in the government. Why this last resolution ? Well I will explain that in another post.
If you have any new year resolutions in favour of Linux, then you are most welcome to include them as a comment in this post.

Friday, 30 December 2005

An Evening with Jeff Waugh - an employee at Canonical


Are you curious as to what the people at Canonical (the creators of Ubuntu) are doing ? Do you download and try out the latest versions of Ubuntu when they come out ? On November 7th 2005, Jeff Waugh, an employee at Canonical had given a talk at the University of Toronto in Ontario, Canada, as part of his BadgerBadgerBadger tour where he had offered his insights into GNOME and Ubuntu in a talk titled "Running with Scissors".

He had touched upon topics as wide ranging as the dominant desktop (GNOME) running in Ubuntu, the applications that run on it like beagle, tomboy, f-spot (I use all these applications on a regular basis and can vouch for their usefullness myself) and also upcoming projects like Dashboard, Galago, Telepathy, Istanbul and Sabayon and of course the future goals of the Ubuntu project.

Colin McGregor has written a synopsis of what transpired in the talk given by Jeff Waugh which is a very interesting read.

Wednesday, 28 December 2005

Creation and use of RAM Disk in Linux

In an earlier post, I had written about a very cool Linux distribution called Damn Small Linux whose size is just 50 MB. What I failed to mention was that, if you have enough memory, you can load this whole OS into memory which will make it blazingly fast. This can be achieved by using a RAM disk. But for that, you have to first know how to create a ram disk.

A RAM disk is a virtual disk which resides entirely in the memory of your PC. It is fixed in size and act like regular disk partitions. On the positive side, the access times of a ram disk are much faster than a physical disk but the data stored on a ram disk is lost once the system is powered down. There are some advantages to this. One being, you can use a ram disk to store and view your decrypted files and once your system is turned off, all traces of the decrypted file are lost.

So the big question is how do you create a ram disk ? Well, Van Emery has put together a Linux Ram Disk mini-How-To detailing just that. He walks you through the steps needed to create a ram disk on Linux. Just make sure that you have a Linux kernel with built-in support for ram disks. Any kernel equivalent to 2.4 or above should be fine.

Bandwidth monitoring with iptables

The word bandwidth holds a lot of meaning for ISPs and just about anybody related to the networking field. Even a home user has to deal with his bandwidth usage if his ISP allocates a bandwidth limit.

For example, my friend has bought an internet package which is data based. That is, he is charged by the ISP according to the amount of data in MB he has utilised. So it is imperative that he keep track of his bandwidth usage to control his internet bills.

Linux has a good collection of bandwidth monitoring tools available. But one of the basic tools which most people miss is the ubiquitous iptables. In fact, Gerard Beekmans has written an article detailing how one can monitor the bandwidth using iptables which forms a good read.

Related Posts:
iptables - The poor man's robust firewall for Linux.
Designing a firewall using iptables for the home user.

Monday, 26 December 2005

PCLinuxOS - A distribution tailor made for New Linux Users

When ever I have reviewed a Linux distribution I have used, I get one or two comments on PCLinuxOS. And when I wrote an article called "The best Linux distribution of them all", among the 75 or so comments, I got no less than 10 comments talking favorably about PCLinuxOS. Having piqued my curiosity, I decided to download and give PCLinuxOS a test drive.

Read more »

Friday, 23 December 2005

Clustering - A technology to solve common computational problems

The first time I heard of a cluster was in my schooling days when my science teacher talked about Star clusters to denote a group of stars. Clustering is the process of organising objects into groups whose members are similar in some way.

In the computer world, when people talk about clustering, they are refering to technologies that allow multiple computers to work together to solve common computing problems.

A famous example of clustering technology being used in Linux would be the Beowulf Cluster. The Beowulf cluster consists of multiple Linux machines connected to one another on a high speed LAN. The down side of a Beowulf cluster is that it require specially designed software using specialised libraries in order to take advantage of cluster resources.

Clusters are also used in normal computing areas in Linux where a degree of redundancy is required. For example, if you are running a database server, then you can make it fail safe by using a database cluster. That is the same database running spread over multiple machines such that even if one machine hosting the database goes down, it does not affect the process accessing the database. Alex Davies has written an excellent article on setting up a mysql cluster. He takes the users through the process of setting up a mysql server on two machines (you need atleast 3 servers for failsafe redundancy), to converting them to a cluster.

On a different note, I also came across this informative article written by W.G Krebs who gives a good review of using GNUQueue software for setting up a Linux cluster the easy way.

Wednesday, 21 December 2005

Multi booting Solaris 10, Linux and Windows on a Laptop

You got your hands on the latest version of Sun Solaris DVD/CDs and are raring to install it on your machine. But you have some nagging doubts because this is the first time you are installing this OS and you need some hand holding.

Ifeyinwa Okoye an intern working at Sun Microsystem has put together a good concise guide on this subject where he pursues the steps to be taken for installing Microsoft Windows, Fedora and Sun Solaris on a laptop. He has used Power Quest's Partition Magic for creating the necessary partitions (3 primary partitions and an extended partition) on his hard disk (though you may also use fdisk) . Other than partitioning ones hard disk, he also walks through all the steps taken while installing Solaris 10.

Belenix - A Live CD based on Open Solaris

I had always wanted to try out Solaris OS ever since Sun released its code under an open licence and renamed it as Open Solaris. But even though open solaris had its own website, downloading a binary image was an entirely different matter and was not an easy proposition. So when a few brilliant Indians :) at the Bangalore India Engineering Center of Sun Microsystems released a live CD called Belenix based on Open Solaris, I decided to give it a spin.

The first thing that you encounter when you boot using the Belenix live CD is the Grub boot loader. Here you are presented with 3 choices, them being :
  • Belenix (32 bit)
  • Belenix (32 bit) with no ACPI and
  • Boot from harddisk - which will boot your normal OS from harddisk.
I selected the default selection (Belenix 32 bit) and it started booting the OS. At this point, a lot of messages scrolled off the screen and eventually, I was presented with the 'Keyboard layout selection' where I chose the US keyboard layout. Belenix gives the user two choices while booting. You can either boot into a full fledged GUI environment (which by the way is XFce desktop) or choose to go for command line login. Once I made the necessary choices, it started the process of configuring the devices and mounted the local partitions.

Exactly after 6 min, I got a fully loaded Xfce environment. Belenix being a Live CD intended to showcase the power of Open Solaris, does not come with as many GUI utilities as a Linux Live CD like Knoppix. This could be because the real power of Open Solaris and its difference with Linux lies under the hood.

While in the GUI environment, it would be a good idea to look into the services running on it. For that right click on the desktop and select services. Belenix has around 66 system services running in the background. Another thing to try out is the DTrace toolkit.

DTrace toolkit is a collection of tools written using DTrace for the Solaris 10[tm] by Sun Microsystem. It can be used by system administrators and developers to tune the performance of as well as pin point errors in the processes running in Solaris OS.

Applications bundled with Belenix
  • Xfce desktop
  • DTrace Toolkit Guide
  • Bash Shell
  • GVim - a versatile text editor
  • Mozilla Firefox - web browser
  • Thunderbird - EMail client
  • A game called Super Tux
  • Network profiles.
Advantages of Belenix
  • Belenix is not targeted for normal use but it endeavours to showcase Open Solaris by letting people try it without installing on the harddisk.
  • More over, downloading and installing Open Solaris would be a harrowing experience as Sun has not made the job any easier.

Cons of Belenix in its current form
  • Does not come with man pages. So prepare yourself with a good book on Solaris if you want to dig deep into learning Solaris.
  • No easy way of installing on the hard disk though there is a basic installer provided which helps in creating Solaris partitions on the hard disk .
Strong points of Open Solaris over Linux
  • Comes with DTrace, a toolkit which can be used to tune the performance of processes running on Solaris. Linux achieves this using a combination of tools like strace and oprofile but it cannot be compared to the power and versatility of DTrace.
  • Another area where Open Solaris outshines Linux is in the power and sophistication of its security features. These being :
    1. Role Based Access Control - Administrators use role-based access control to delegate limited authority to subsets of users. This is similar to SUDO in Linux but much more flexible. In Solaris RBAC is fully integrated, and administrators use standard utilities such as useradd to administer user roles.
    2. Process Rights Management - With process rights management, administrators grant individual processes only the privileges they need to perform the work assigned to them. An equivalent of this feature is not yet available in Linux.
    3. System partitioning using containers - Solaris implements system partitioning using Containers. Containers are virtualized environments running in a single instance of Solaris. Processes running in a container can access only the resources allocated to that container. Of course Linux can also implement this using third party products like Vmware or Usermode Linux or provide file system isolation using chroot jails. But this technology is well integrated in Solaris.
  • And finally, Sun gives you the guarantee that applications compiled for one version of Solaris will continue to work on other versions.

Monday, 19 December 2005

The best Linux distribution of them all - an Epilogue

I had written a previous post named - The best Linux distribution of them all - where I tried to explain in the best possible way, how to go about selecting a Linux distribution. The response to that post was overwhelming and so many people added a comment which gave valuable insights about their favourite distribution that it became impossible to publish all the comments without making the page lengthy. So instead of publishing all the comments, I decided to write a separate post giving the gist of what everybody who read the post had to say. Also I wanted to clarify a few things that I had left out in the original post.

First and foremost, the staff writer at madpenguin.org, Mr Christian Einfeldt was kind enough to drop by and share his views about this very volatile topic. In a nutshell, This is what he had to say:

All the newbies out there could get themselves a Live CD with an instruction manual. He gave three choices of books them being :
  • "Linux Made Easy" by Rickford Grant, which comes with a free copy of Xandros Open Circulation edition of Linux.
  • "Point & Click Linux" by Robin Miller, which comes with a copy of Mepis Linux." and
  • "Peter van der Linden's Guide to Linux," which comes with a Linspire Live CD in it.
... the reviews of which you can read at madpenguin.org. Thank you Mr Christian Einfeldt for sharing your thoughts on this subject.

A surprising number of people said they used PCLinuxOS or Mepis as their choice Linux distribution and they vouched that these supported all proprietary file formats out of the box.

A number of people voted for Arch Linux and still others for Vector Linux which is based on Slackware.

A few of the comments pointed out to me that Mandriva indeed supported mp3 file support out of the box which was a little known fact.

I had written that Debian was the only linux distribution which supported the maximum architectures. But then this is what one commenter had to say about it - "Both Red Hat and SuSE also have support for non-Intel platforms, like IBM's zSeries mainframes. Debian certainly isn't the only one".

A reason I left out saying anything about liveCDs was because all linux distributions worth their name have released a live CD. More over, all live CDs work out of the box with support for all file formats. Another thing is a liveCD is designed to be booted from the CDROM and is not optimised for installing on the hard disk.

Finally, I have a statement to make. I am in no way affiliated with any linux distribution or any commercial website. And nobody has paid me to give preference to their linux distribution in my post. Further more, what ever I have written is my own opinion.

Saturday, 17 December 2005

Excellent set of Video tutorials on DNS , Network monitoring and Web server configuration

Are you looking forward to setting up an intranet in your office or home network? Then you will benefit by setting up DNS on your server. DNS stands for Domain Name System and is used to resolve names to IP address and vice versa. For example, when you type the name www.google.com, it is the DNS server's job to translate this name to the IP address of the google server.

On this note, Jake Paulus has put together an excellent set of videos which hand holds a person through the whole setup and configuration process. The video tutorials can be either downloaded or viewed online as a flash presentation. He has also created video tutorials for configuring a web server (apache + mysql + php) as well as a Linux network monitor ntop.

I strongly recommend anybody interested in these Linux topics to view the videos.

Related Posts:
Understanding DNS
Implementing DNS on Linux Part I , Part II , Part III

Thursday, 15 December 2005

Book Review: Cross-Platform GUI programming with wxWidgets

wxWidgets is an open-source library used for writing sophisticated C++ applications. There are quite a few libraries available for GUI development but what is unique about this library (wxWidgets) is its cross platform support as well as it being released in the open source realm. Some of the popular software like Chess Commander, Audacity - a popular audio editor and pgAdmin III - a powerful administration and development platform for the PostgreSQL database have been developed using wxWidgets. In fact, this library comes with 100s of ready to use C++ classes which can be used to rapidly build sophisticated applications targeting Windows, Linux, Mac OSX and even Palm OS platforms.

This book Cross-Platform GUI Programming with wxWidgets is a part of the Bruce Perens Open Source Series and is targetted at application developers who are intending to use wxWidgets to develop their software. The authors of the book ( and there are three of them ) explain each and every wxWidgets class that is of importance. The authors start their narration by giving a broad outline of the wxWidgets architecture in the very first chapter which sort of reduces the learning curve for new application developers. The second chapter takes the reader through writing and compiling a complete program using wxWidgets which gives the reader a feel for the structure of a simple wxWidgets program.

All developers should know that handling events like mouse clicks, key presses and so on form an integral part of any application development worth its name. The third chapter of this book takes a broad look at the various classes and event handlers in wxWidgets library which aid the application developer in trapping events in his program.

One thing that struck me while reviewing this really good book was that, the explanation of each wxWidget class is followed by a short code snippet which describes the usage of the class.

The book is divided into 20 detailed chapters each covering a specific topic. For example, if one chapter concentrates on writing multithreaded applications, another covers the wxWidget classes that can be used to implement drag and drop functionality in your applications.

Would you like to create a wizard like you see in some GUI setup installers ? No problem, you can do it easily by using the wxWizard class which is explained in 12th chapter by name "Advanced Window Classes" in the book.

In the last chapter, the authors dwells on the design guidelines that are to be followed while creating GUI applications. The book even boasts of a remarkable eleven appendixes tagged A to K, which ties up the threads of nitty-gritty details like installing the wxWidgets library on your PC running Linux, Windows or OSX prior to starting to write code for your programs.

The book comes with a CD-ROM which contains the wxWidgets library, the complete documentation in PDF format, development tools like Compilers and even an open-source application called DialogBlocks which is a RAD tool that can generate XRC or C++ code for your dialogs or frames. The interesting thing about all this is that it works very well on the Linux platform.

Outline of Chapters in the Book
  1. Introduction
  2. Getting Started
  3. Event Handling
  4. Window Basics - This chapter alone covers in detail close to 35 important classes.
  5. Drawing and Printing
  6. Handling Input
  7. Window Layout Using Sizers
  8. Using Standard Dialogs
  9. Writing Custom Dialogs
  10. Programming with Images
  11. Clipboard and Drag and Drop
  12. Advanced Window Classes
  13. Data Structure Classes
  14. Files and Streams
  15. Memory Management, Debugging and Error Checking
  16. Writing International Applications
  17. Writing Multithreaded Applications
  18. Programming with wxSocket
  19. Working with Documents and Views
  20. Perfecting your Application
A note about the Authors
This book is the result of the work of three people who are experts in their respective fields. They are ...
  • Dr Julian Smart created wxWidgets in 1992 at the AI Applications Institute, University of Edinburgh. His firm, Anthemion Software, Ltd, helps companies deploy wxWidgets.
  • Kevin Hock is the founder of BitWise Communications, LLC, and has been developing commercial applications with wxWidgets for several years and provides enhancements to all wxWidgets platforms.
  • Stefan Csomor owns Advanced Concepts AG, a cross-platform development and consulting firm. He is the main author of the MacOS port of wxWidgets .
The Book Specifications
Name : Cross-Platform GUI programming with wxWidgets
ISBN No: 0-13-147381-6
Authors : Julian Smart, Kevin Hock and Stefan Csomor
No of Pages : Over 700
Price : Check at Amazon.com
Publisher : Prentice Hall - Professional Technical Reference
Addons : One CD-ROM + 45 Days Free Access to Safari Bookshelf.

End Note
Cross-Platform GUI Programming with wxWidgets aims to be a definitive guide for application developers hoping to use wxWidgets library in their projects. This book covers almost all the classes of the wxWidgets library and can be used not only by beginners who want to program using wxWidgets but also acts as a reference for experienced programmers. But the reader is expected to know the C++ language. All in all a book worthy of a place in the book shelf of a programmer looking forward to developing applications using wxWidgets.

Wednesday, 14 December 2005

The Best Linux Distribution of them all

A few weeks back, my friend Tom asked me a question regarding Linux - that is - Which is the best Linux distribution of them all. And following is the lively conversation we had about this topic which I am sharing with you.

Tom: Ravi, There is a lot of talk going on about Linux which I have read in websites, newspapers and articles in magazines. I am aware of quite a few names floating around like debian, ubuntu, fedora and so on. Which Linux distribution according to you would be the best one around ?

Me: Tom, you have asked a really simple question which has no single/simple answer. But I will try and explain it as best as I can. You should know that Linux is just a kernel. When all the necessary tools like the word processors, image editors, compilers and likes are added so that they seamlessly work on top of the Linux kernel, it becomes a distribution. I need not tell you that different people have different likes and dislikes. With respect to computers and OSes too this holds true. The versatility of Linux is that there is a Linux distribution which commits to cater to individual likes.

Tom: I didn't get you. Could you explain it a little bit more clearly ?

Me: Sure. You see, people can be categorised according to their tastes in computing. For example, one person may be newbie who is just getting introduced to computers who expects some hand holding. Another may be a Linux Guru who likes to do all his work using command line utilities. The beauty of Linux (or should I say the GNU movement) is that there is a distribution tailor made for each of these people.

Tom: So you are saying that the correct answer to my question is that it depends on the individual. Right?

Me: You are bang on target when you say that. :)

Lets look at a few scenarios. Suppose you are a student of computer science. Your main motive in installing Linux on your machine would be to study the inner working of the OS. About what happens under the hood of the OS so to speak. A person with such an inclination will find it ideal to build your own Linux distribution compiling from source. In fact, there is a project called Linux From Scratch which precisely lets one build a Linux distribution grounds up. Another distribution which caters to this segment of people could be Gentoo.

Tom: Well not all people are computer science students. How about a newbie like me ?

Me: For new users like you (and there are quite a lot of them too), there are Linux distributions which come bundled with nice GUI front-ends which makes your Linux experience really enjoyable.
But before we go into it, I would like to say something. Linux distributions can be broadly classified according to the package management they support. Package manager is a program similar to a setup installer in windows. There are two main players in this arena. One is deb package, the other being rpm (short for Redhat Package Manager).
Most Linux distributions follow one or the other of the above said package format to install applications. For example, Linux distributions like Debian and Ubuntu follow the 'deb' package format where as Redhat, Mandriva, SuSe and the likes follow the 'rpm' format.
Coming back to your question, a newbie will feel right at home in installing and using any of the distributions like Ubuntu, Fedora, Debian and so on. But there is an important factor. Because of licensing restrictions, these distributions exclude support for popular file formats like Mp3, Quicktime, wmv (windows media player), viewing encrypted DVDs and so on.

Tom: What? You mean, I would not be able to play my favourite mp3 music on these distributions ?

Me: Not at all. All I implied was that you have to download the codecs and install it by yourselves if you want the support for these file formats. For example, I use a versatile media player called mplayer to view all my mp3 audio and video. And it works flawlessly.

Tom: Is there a distribution that has these codecs installed by default ?

Me: Of course there are. For example, distributions like Linspire and Xandros comes with support for these formats. But you will have to shell out some money and buy first in order to use them.

Tom: What if I wanted to use Linux as a server ?

Me: If you are exclusively using Linux on the server side, then the GUI will lose its significance. You will be better off trying Debian. This Linux distribution gives stress on security and is considered to enjoy a large share of the Linux server market. Of course, you can also try RedHat or SuSe for the same. But the situation at your work place also play an important role in selecting a distribution for the server.
Did you know, Debian is the only Linux distribution that supports architectures other than x86/IA32, Intel 64 bit, AMD 64 bit and PowerPC ? More over, Debian is not controlled by any corporation or single entity and it is maintained exclusively through donations and volunteer support.

Tom: Ravi, you know Manish, my friend from school days ? He tried installing SuSe on a Pentium II machine with 32 MB RAM. And he said that he ran into problems in running GUI applications.

Me: That is because he doesn't have enough memory to run GUI applications. Anyway, SuSe is targeted at more recent machines having at least 128 MB RAM. But tell him he need not despair. There are Linux distributions which cater to this segment too. Like you have the Damn Small Linux which runs easily even on machines with just 32 MB memory. Did you know that Damn small Linux takes up only 50 MB space on your harddisk in its uncompressed state? Another linux distribution in this category is Puppy Linux.

Tom: Really? I wonder how they accomplish this extraordinary feat.

Me: If you are impressed by that, then there are Linux distributions that fit inside a floppy.

Tom: No Kidding ?

Me: Seriously Tom. I am not pulling your leg. Tombsrtbt is a Linux distribution that fits inside a single floppy. It can be used for troubleshooting purposes.

Tom: And it has my name too ;) . But seriously how is all this possible ? It is a bit overwhelming to have this discussion itself.

Me: All these forks are possible because of the GNU movement. If Linux was released as a closed source project, these forks would not have seen the light of day.

Tom: I am just curious. Which distribution will a geek favour ?

Me: Heh heh, So you are aspiring to be a geek is it ? I have heard that Slackware and Gentoo are favoured by geeks. Slackware needs some mention here. It is one of the oldest distribution around. Earlier I talked about Deb and RPM formats. But Slackware uses an entirely different format called TGZ - which is gzipped tape archive, to install applications. There are many die hard slackware users who swear by this distribution for its ease of configuration and use. But it is not suitable for new users because most of the configuration is done by editing text files.

Tom: But I always hear of Fedora, Ubuntu and the likes but seldom do I hear about Slackware, Xandros, CentOs or any others. Why is that ?

Me: Tom, you have to understand that somebody who makes the loudest noise need not always be right. Firms like RedHat and Novell (SuSe) are multinational corporations which have millions of $ at their disposal. They gain all the publicity by running advertisements, conducting certifications and so on. Then there are some distributions like Debian and Ubuntu which grab the public's fancy because of their social ideals and commitment towards GNU movement and essentially because they are free as in freedom as well as beer. That doesn't mean they are the only good distributions around. Ultimately the choice filters down to the ideals, tastes and necessities of the user.

Tom: Going by our discussion, I have arrived at the conclusion that I want a Linux distribution which is easy to install, easy for newbies and support all proprietary file formats out of the box (I definitely want to hear mp3 music). It has to have good customer support. And I am willing to pay money for it (though within limits). I guess I will go for Xandros, Mepis or Linspire. What do you think ?

Me: Go for it Tom. I have always known that you have a penchant for spreading your money around ;) . But on a serious note, I think you have taken a good decision because when you pay money for the distribution, they include addons like support for propritery file formats and the user is saved from the job of installing them himself. Some of these distributions like Linspire also ship with non-free softwares like Win4Lin which helps you to run popular windows programs like photoshop and games like Age of Empire. So it is money well spent. It may be worthwhile if you visit Distrowatch.com and read some reviews about what people have to say regarding a particular distribution before you make the choice.

Tom: Ravi, thanks for clearing my doubts regarding the Linux distributions. This discussion has helped me a lot. I do not know what I would have done without friends like you.

Me: No problem Tom. And God speed ahead.

A note to Readers
Tom and Manish are fictitious characters and this whole train of thought took place inside my mind. I hope this conversation has helped clear the air about which Linux distribution is ideal for you.

Tuesday, 13 December 2005

How much memory is enough memory ?

I remember the time around 5 years back when I had a system which had only 32 MB RAM. I still have this machine which has since been upgraded to sport 96 MB RAM. But even when this machine had only 32 MB RAM, I was able to install and play games on it, work on a word processor and also browse the internet. In fact, I remember that I was successful in loading X windows with just 32 MB memory. Of course, GNOME took a lo..oong time but a bare bones window manager like twm was quite fast to load.

From that time of 32 MB memory, the PCs as well as technology has come a long way. Now PC's come preloaded with atleast 256 MB RAM. Even this is not enough for playing graphics intensive games that are available in the market. Some of the games like Half life (which also runs on Linux) need atleast 512 MB memory to really enjoy playing the game. So the question that is foremost in everybody's mind is how much memory is enough memory ?

Toms Hardware has the right article which reviews this very question to give the readers a satisfying answer. The guys at Tom's, review how various memory limits affect the performance of different softwares and graphics intensive games like Quake and Doom, the performance of the two graphics technologies OpenGL and DirectX with different amounts of RAM and so on. The benchmarking was done with 512 MB, 1 GB and 2 GB memory.

And this is their verdict...
  • 512 MB RAM is enough if you run low resolution games or run only one application at a time.
    Umm... my more recent machine has just 256 MB and I am managing quite well.
  • 1 GB RAM is desirable if you are running more than one application at a time and wish to play high resolution graphics intensive games.
  • 2 GB RAM if you are a hot shot graphics professional or game developer.
All in all a worthwhile article which gives a fair idea of how much memory to buy while shopping for a PC.

A Concise apt-get / dpkg primer for new Debian users

Debian is one of the earliest Linux distribution around. It caught the public's fancy because of the ease of installing and uninstalling applications on it. When many other linux distributions were bogged down in dependency hell, Debian users were shielded from these problems owing to Debian's superior package handling capablities using apt-get.

All Linux distributions which claim their roots in the Debian distribution use this versatile package manager. For the uninitiated, Debian uses the deb package format for bundling together files belonging to an application. You can look at it as something like a setup installer (Eg: Installshield) in windows counterpart.

Here I will explain how to go about using this package handling utility to get the results that you desire.

The first step needed to use apt-get to your advantage is including the necessary repositories. Repositories are merely collections of softwares which are stored in a public location on the internet. By including the web address of these repositories, you are directing apt-get to search these locations for the desired software. You use the /etc/apt/sources.list file to list the addresses of the repositories. It takes the following format:
deb  [web address] [distribution name][maincontribnon-free]
For example, in Ubuntu a debian based distribution, it could be something like this:
deb http://in.archive.ubuntu.com/ubuntu breezy main restrcted
You can add any repository you like. apt-get.org contains an excellent collection of repositories to suite all tastes.

Once you have set the repositories, the next step is to sync the local software database with the database on the repositories. This will cache a copy of the list of all the remotely available softwares to your machine. This is achieved by running the following command:
# apt-get update
An advantage of this is you now have the power to search for a particular program to see if it is available for your version of distribution using the apt-cache command. And you don't need a net connection to do this. For example,
# apt-cache search baseutils
... will tell me if the package baseutils is available in the repository or not by searching the locally cached copy of the database.

Once you have figured that the package (in our case baseutils) is available, then installing it is as simple as running the following command:
# apt-get install baseutils
The real power of apt-get is realised now. If the baseutils package depends on the availability of a version of the library say, "xyz1.5.6.so". Then apt-get will download the library (or package containing the library) from the net and install it before installing baseutils package. This is known as automatic dependency resolution.

And removing a package is as simple as running the command:
# apt-get remove baseutils
Get statistics about the packages available in the repositories by running the command :
# apt-cache stats
Total package names : 22502 (900k)
Normal packages: 17632
Pure virtual packages: 281
Single virtual packages: 1048
Mixed virtual packages: 172
Missing: 3369
...
To upgrade all the softwares on your system to the latest versions, do the following:
# apt-get upgrade
And finally the king of them all - upgrading the whole distribution to a new version can be done with the command:
# apt-get dist-upgrade
Saving valuable hard disk space
Each time you install an application using apt-get, the package is actually cached in a location on your hard disk. It is usually stored in the location /var/cache/apt/archives/ . Over a period of time, all the cached packages will eat up your valuable hard disk space. You can clear the cache and release hard disk space by using the following command:
# apt-get clean
You could also use autoclean where in, only those packages in the cache which are found useless or partially complete are deleted.
# apt-get autoclean
dpkg - The low level Package management utility
As I said earlier, Debian based distributions use the Deb package format. Usually normal users like you and me are shielded from handling individual deb packages. But if you fall into a situation where you have to install a deb package you use the dpkg utility.
Lets assume I have a deb package called gedit-2.12.1.deb and I want to install it on my machine. I do it using the following command:
# dpkg -i gedit-2.12.1.deb
To remove an installed package, run the command:
# dpkg -r gedit
The main thing to note above is I have used only the name of the program and not the version number while removing the software.
You may also use the --purge (-P) flag for removing software.
# dpkg -P gedit
This will remove gedit along with all its configuration files. Where as -r (--remove) does not delete the configuration files.

Now lets say I do not want to actually install a package but want to see the contents of a Deb package. This can be achieved using the -c flag:
# dpkg -c gedit-2.12.1.deb
To get more information about a package like the authors name,the year in which it was compiled and a short description of its use, you use the -I flag:
# dpkg -I gedit-2.12.1.deb
You can even use wild cards to list the packages on your machine. For example, to see all the gcc packages on your machine, do the following:
# dpkg -l gcc*

Desired=Unknown/Install/Remove/Purge/Hold
Status=Not/Installed/Config-files/Unpacked/Failed-config/.
/ Err?=(none)/Hold/Reinst-required/X=both-problems
/ Name Version Description
+++-===============-==============-========================
ii gcc 4.0.1-3 The GNU C compiler
ii gcc-3.3-base 3.3.6-8ubuntu1 The GNU Compiler Colletio
un gcc-3.5 none (no description available)
un gcc-3.5-base none (no description available)
un gcc-3.5-doc none (no description available)
ii gcc-4.0 4.0.1-4ubuntu9 The GNU C compiler
...
In the above listing, the first 'i' denotes desired state which is install. The second 'i' denotes the actual state ie gcc is installed. The third column gives the error problems if any. The fourth, fifth and sixth column gives the name, version and description of the packages respectively. And gcc-3.5 is not installed on my machine. So the status is given as 'un' which is unknown not-installed.

To check if an individual package is installed, you use the status -s flag:
# dpkg -s gedit
Two days back, I installed beagle (a real time search tool based on Mono) on my machine. But I didn't have a clue about the location of the files as well as what files were installed along with beagle. That was when I used the -L option to get a list of all the files installed by the beagle package.
# dpkg -L beagle
Even better, you can combine the above command with grep to get a listing of all the html documentation of beagle.
# dpkg -L beagle | grep html$
These are just a small sample of the options you can use with dpkg utility. To know more about this tool, check its man page.
If you are alergic to excessive command line activities, then you may also use dselect which is a curses based menu driven front-end to the low level dpkg utility.

GUI front-ends for apt-get

Sunday, 11 December 2005

Help on creating a Makefile

When ever you download the source package of a software from the net and decide to compile it on your platform, you always move to its directory and issue a make command.

When you execute the 'make' command, it reads a file by name Makefile and according to the directions listed in this file, the source - which may be 100s of files of code - is automagically compiled (provided the necessary compilers are installed on your machine).

So one of the necessary ingredient in successful compiling of code using the make command is the Makefile. If you are a developer or aspiring to create your own programs, then it is imperative that you know how to create a Makefile because using make is much more efficient and time saving than directly compiling the source.

Guy keren has written a very clear tutorial on how to create a Makefile to aid the compilation of code. The author takes the reader through all the steps and syntax of the Makefile and explains it with the help of simple examples.

Friday, 9 December 2005

10 most popular Ubuntu sites on the net

In a previous post, I had written how I solved certain problems in Ubuntu like getting support for proprietary file formats. That post may or may not be helpful to many. But for me, it is definitely useful because, in a situation where I want to re-install Ubuntu on my machine, I just have to pull up my blog page and I can come up to date in very little time. The alternative being having to spend valuable time searching on the net or forums all over again.

Having said that, I think credit has to be given where it is due. So here I have put together a collection of sites which are dedicated to Ubuntu Linux and where one can find a wealth of information on general topics or accomplishing a particular task in Ubuntu.

1) Ubuntu IconUbuntu.com - This is the official site of Ubuntu Linux. All Ubuntu enthusiasts should make this the starting point of their journey towards embracing Ubuntu. On this site, you can get the latest official news related to this project, place orders for your free Ubuntu Cd's and search or browse for a particular package for your version of Ubuntu among other things.

2) help.ubuntu.com - This is the official documentation site for Ubuntu Linux developed and maintained by the Ubuntu documentation project. This is the first place any Ubuntu user must go to get his problem solved. Here you can access various guides related to Ubuntu such as installation guide, server guide, packaging guide and so on in PDF format for offline reading.

3) wiki.ubuntu.com - This is a part of the official Ubuntu project and as you can see is a wiki. A wiki can be edited by anybody a good example of a wiki being the wikipedia project. On the Ubuntu wiki, you can get a wealth of information about configuring this distribution. First time visitors to this site may be interested in checking the Help Contents page. A section which is specially interesting is the Restricted Formats section which gives tips on getting support for proprietary file formats in Ubuntu.

4) ubuntuforums.org - This is a high traffic web forum where you can post queries you have and get your doubts clarified. You need to first register to post in this forum. But just searching this forum will throw up a wealth of information a.k.a the issues that others faced and the solutions to these issues.

5) ubuntuguide.org - This guide is not affiliated with the official Ubuntu project but claims to be an unofficial FAQ where you can find solutions to getting your problems solved in Ubuntu. This site takes a How-To approach in giving the answers. Though recently, this site has become a bit outdated as I ran into some problem while configuring Ubuntu Breezy according to their directions. Nevertheless a very good site.

6) Ubuntu Blog - This is a very good blog maintained by a Ubuntu enthusiast and as the name of the blog indicates, exclusively caters to all things related to the Ubuntu distribution. Here you can get latest news, links to popular sites and experiences of the blog author in getting things done in Ubuntu Linux.

7) All about Linux - Yes, you will find lots of information related to Ubuntu on this blog too. This blog contain over 1000 unique articles many of them providing insights into solving problems in Linux which also includes Ubuntu.

By including these 10 7 sites in your search, you can have an easier time in using and troubleshooting problems in Ubuntu Linux.

The three sites which were listed here have gone offline or are redundant. So now there are only 7 sites.

Post updated on 07-October-2008

Thursday, 8 December 2005

A fly by view of KDE 3.5


Recently, the KDE team released the latest stable version of their flagship product KDE desktop for Linux and other Unices. And within a short time, the good samaritans at Ubuntu (or should I say Kubuntu) made available the packages for KDE 3.5 in their repository with the instructions on how to upgrade all the packages on your machine to mirror those of KDE 3.5 provided you were using Breezy Badger v5.10.
The upgrade to KDE 3.5 was a simple affair consisting of a few steps:
  1. Add the digitally signed key to your machine.
    $ wget http://people.ubuntu.com/
    ~jriddell/kubuntu-packages-jriddell-key.gpg
    $ sudo apt-key add kubuntu-packages-jriddell-key.gpg
  2. Include the kubuntu repository in your /etc/apt/sources.list .
    # FILE: /etc/apt/sources.list
    ...
    deb http://kubuntu.org/packages/kde35 breezy main
  3. Update your local database
    $ sudo apt-get update
  4. Lastly do a distribution upgrade
    $ sudo apt-get dist-upgrade
Over 130 MB of packages were downloaded from the repository after which the whole system was upgraded to use KDE 3.5.

KDE 3.5 has many marked improvements over its older sibling (3.4). Some of it like storage media notification for the user to realise and many of it under the hood.

Jure Repinc has written a wonderful review of the improvements that one can find in the new KDE 3.5 . His review is an ongoing series of which part 1 and part 2 has been released. Reading the review gives a user a good idea of what to expect from the new version of this ever popular desktop.

But this is just the beginning. KDE 4.0 the next major release is expected to be even more fantastic with respect to usability and eye candy. And we can wait with our fingers crossed till the release of KDE 4.0 next year.

Tuesday, 6 December 2005

Essential house keeping in Ubuntu

I started using Ubuntu Breezy ver 5.10 a month back on my machine. Prior to that I was exclusively into Fedora. What drew me to Ubuntu was the huge number of packages in its repositories including software which I find useful on a day-to-day basis like Tomboy which I had to compile from source in Fedora. But the Ubuntu CD comes with the base packages which support only open file formats. So if you want support for proprietary file formats like mp3 and quicktime support as well as install software not included on the CD, then you have to do some work.

I call it essential housekeeping because it is not exactly a problem, but only a matter of finding out how to get the necessary support. Here I share my experiences in putting the Ubuntu house in order on my machine.

Adding Universal and Multiverse repositories
The first thing to do in Ubuntu is add the universal and multiverse repositories to the /etc/apt/sources.list file. Usually you need to only uncomment the sections which are commented. But I also found that even the universal repositories did not contain some packages like mplayer. So I had to search the net and find a repository which contained the mplayer package and add it to my sources.list file.
deb cdrom:[Kubuntu 5.10 _Breezy Badger_ - Release i386 (20051012)]/ breezy main restricted
deb cdrom:[Ubuntu 5.10 _Breezy Badger_ - Release i386 (20051012)]/ breezy main restricted

deb-src http://in.archive.ubuntu.com/ubuntu breezy main restricted

deb http://in.archive.ubuntu.com/ubuntu breezy-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu breezy-updates main restricted

deb http://in.archive.ubuntu.com/ubuntu breezy universe main restricted
deb-src http://in.archive.ubuntu.com/ubuntu breezy universe

deb http://in.archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu breezy-security main restricted
deb-src http://security.ubuntu.com/ubuntu breezy-security main restricted

deb http://security.ubuntu.com/ubuntu breezy-security universe
deb-src http://security.ubuntu.com/ubuntu breezy-security universe

deb http://ca.archive.ubuntu.com/ubuntu breezy universe
deb http://si.archive.ubuntu.com/ubuntu breezy multiverse
The lines highlighted are those that I added seperately. For example the last line lists the path to the repository which has the mplayer package. I couldn't find the package in any of the other repositories.

Once I added the necessary repositories, the next step was to update the package database in Ubuntu. This I did by running the following command:
$ sudo apt-get update
Once updating was completed (took about 10 minutes), I got ready to install all the software that I found necessary. I had already prepared a list of the software I wanted and so it was only a matter of firing up synaptic (the GUI front end to apt-get ) and installing the software. The software list I prepared was as follows:
  • Flash plugin for firefox web browser
  • mplayer with quicktime and wmv support
  • libdvdcss support for playing encrypted DVDs
  • fluxbox - a light weight window manager. I find Gnome and KDE (with all the eye candy) distracting for doing serious work .
  • GNUCash - A personal finance package
  • Tomboy - A very good note taking application based on Mono.
  • Sun's JDK - For java support
  • Gkrellm - A GUI which gives a graphical display in real time of the system status , like cpu load, memory usage, processes loaded in memory, network traffic and so on which I find really useful.
  • Compiler tools - Ubuntu is a distribution targeted at the ordinary user. So it does not bundle a compiler on the CD. But compiler tools are handy because you never know when you might need to compile a package from source and install on your machine.
  • NVIDIA glx drivers - I have a NVIDIA Geforce 2 MX graphics card. And even though ubuntu contains the nvidia drivers, I had to install the nvidia-glx package manually.
  • Install firestarter - The front end for iptables firewall and configure it. This is desirable because I found that the default installation of Ubuntu leaves the system wide open. Check by running the command:
    $ sudo iptables -L
    With an open system, your machine is just sitting there waiting for getting cracked by crackers and script kiddies or including your machine in a DoS attack.
Other than the flash plugin and mplayer, I did not find any trouble in installing all the software. It was only a matter of selecting the necessary software in synaptic and installing. You can also do it in the command line as follows:
$ sudo apt-get install fluxbox tomboy gnucash

Installing NVIDIA Graphics card drivers
First I installed the glx driver package as follows:
$ sudo apt-get install nvidia-glx
Then I had to enable the driver to be used by X server.
$ sudo nvidia-glx-config enable

Installing Flash plugin
At first I couldn't find the flash player package in synaptic. The problem solved by itself when I accessed a web page which contained a flash component. Firefox informed me that a plugin was missing which was needed to view the component and prompted me to install it by directing me to the macromedia website. And once I installed flash plugin for firefox, I was able to view the flash based websites.

Installing the compiler tools
I installed the compiler tools which contained among others, gcc 4.0 and g++ as follows:
$ sudo apt-get install build-essential
$ sudo apt-get install manpages-dev autoconf automake libtool
$ sudo apt-get install flex bison gcc-doc g++
Now I could easily compile a source package and install it if the need arises.

Installing mplayer

Here I had to do a little more work than above but not as much as you might think. First I downloaded the essential codecs from the mplayer website. It was a bzip2 compressed tar file which was around 9MB in size. I unpacked it and copied the contents into the directory /usr/lib/codecs .
$ tar xvjf essential-20050412.tar.bz2
$ cd essential-20050412
$ sudo mkdir -p /usr/lib/codecs
$ sudo cp -R ./* /usr/lib/codecs/.
Now that the codecs were installed, the next step was installation of mplayer itself. This was achieved with the simple command :
$ sudo apt-get install mplayer-586
$ sudo apt-get install mplayer-fonts
Support for playing encrypted DVDs - libdvdcss
If you want to play encrypted DVDs it is important to have the libdvdcss library installed on your machine. There is a very good site called ubuntuguide.org which lists a method of using apt-get to install this library. But some how, it did not work for me. I got the error message that this package is not available in the repository. So I had to use a more round about way to install this library on my machine.
  • First I downloaded the source file libdvdcss-1.2.8.tar.bz2 using wget from the videolan.org website.
  • Then I unpacked it in my home directory and then compiled and installed it in the /usr directory as follows:
    # tar -xvjf libdvdcss-1.2.8.tar.bz2
    # cd libdvdcss-1.2.8
    # ./configure --prefix=/usr; make; sudo make install
The installation went normally and I was able to play encrypted DVDs on ubuntu.

Housekeeping is a necessary bane for all OSes, whether it be windows, linux or OSX. In Linux, it is a little bit more work because of the licence restrictions imposed by the owners of the popular proprietary format files. But Ubuntu has done a good job of reducing this work as much as possible.

Monday, 5 December 2005

Book Review : Self Service Linux - Mastering the Art of Problem Determination

Self-Service Linux - Mastering the Art of Problem Determination is a part of the "Bruce Perens open source series". The very same Bruce Perens who gave the computing world the Open Source definition which has since been embraced by such popular projects as OpenOffice.org and Mozilla. He is one of the leaders in the Open Source movement and was instrumental as a Debian GNU/Linux Project leader in getting the system on to two U.S space shuttle flights. Prentice Hall and Bruce Perens has come together to bring a series of books under the banner "Bruce Perens Open Source Series" and this book falls in this category.

The Contents of the book at a glance
The book is divided into 9 independent chapters and 2 Appendices each of which covers a distinct topic invaluable to any programmer or system administrator in Linux.
The first chapter deals with the four phases of investigation which should precede any problem solving. This also includes steps to effective technical investigation . By using the guidelines described in this chapter, any person will be able to proceed according to a plan of action which will help save valuable time in trouble shooting a problem. Also these tips help the programmer to stay focused on the problem at hand.

All unices including Linux has a very powerful tool in strace. Strace is a utility which is used to trace system calls that applications make to the kernel. The second chapter of this book takes an in depth look at ways in which a programmer can leverage this tool for effective troubleshooting.

Any book covering problem solving in Linux will be incomplete if it does not have a chapter dedicated to /proc systems. The third chapter of this book gives a broad analysis of the /proc file system including all the important files and directories residing in it. In fact this chapter is spread across 30 pages which should give you a fair idea of the depth of coverage of this very important virtual file system.

The fourth chapter is titled Compiling and concentrates on defending against many compilation- related problems, the potential pitfalls to look out for and compiler optimisation. Mind you, this chapter does not list the commands for compiling but takes the reader through solving a error message generated while compiling the kernel. The authors also explain the various errors that a user can come face to face while compiling the kernel.

One of the most fundamental parts of a computer is a stack. A stack is basically used as a temporary storage for the data and plays an important role in the working of an OS. The fifth chapter of this book pursues this topic with vigor. After reading this chapter, the person will have a very good knowledge of stacks, the role played by them and their inner working on varied architecture like x86 and x64.

The sixth chapter gives a broad review of the GNU debugger. Even though there are other proprietary debuggers, GDB has an advantage in that it is one of the few which are available across a myriad of hardware platforms running Linux. With out a debugger, problems like a memory corruption and code logic error are very hard to pin point. The authors have done an excellent job in explaining the art of debugging using GDB for effective problem determination.

The seventh chapter is a short one and deals with the Linux system crashes and hangs. It pursues how among other things how you can use OOPs report to find the causes of system crashes.

Kernel debugging using KDB forms the basis of the eighth chapter of this well structured book. KDB is a kernel debugger which can be used to debug a live kernel and it can be used from the machine running the kernel itself.

ELF: Executable and Linking Format is the 9th and final chapter of this book. All Linux shared libraries and executables use the ELF format. A good knowledge of ELF is essential to improve the overall knowledge of how an operating system works and knowing ELF format will help improve the diagnostic skills of a Linux user. Considering the importance of the topic with respect to problem determination and solving, the authors have paid special attention in writing this chapter which happens to be the second largest chapter in this book.

Lastly, this book has two good appendices - the first one named The Toolbox - which gives a listing of all the problem determination tools available for Linux. The second appendix lists a Data Collection Script, an invaluable piece which will aid a user in collecting the right information quickly when a problem occurs.

A word about the Authors
This book has been co authored by two experienced developers namely Mark Wilding and Dan Behman.
Mark Wilding is a senior developer at IBM and has over 15 years of experience writing software. He is an expert in the area of Operating Systems, networks, C/C++ development, serviceability, quality engineering and computer hardware.

Dan Behman is a member of the DB2 UDB for Linux platform exploitation development team at the Toronto IBM Software Lab. He has over 10 years of experience with Linux, and has been involved in porting and enabling DB2 UDB on the latest architectures that Linux supports, including x86-64, zSeries and POWER platforms.

Book Specifications
Name : Self-Service Linux - Mastering the Art of Problem Determination
Publisher : Prentice Hall Professional Technical Reference
ISBN No: 0-13-147751-X
Price : $39.99 US / $55.99 CANADA
No of Pages : 460
Target Audience : Intermediate to Expert Programmer/ Administrator.
Website : phptr.com

Things I found interesting in this book
  • This book takes a practical approach to problem determination and solving.
  • Is peppered with sample code and walk throughs which I found useful in understanding a problem. I especially liked the presentation of strace and gdb.
  • Concepts are explained in a simple and lucid manner keeping complex jargon to a minimum.
  • Though entry level programmers will find this book a bit on the far side, more experienced people can look forward to gaining a lot of knowledge from this book.
All in all a good book worthy of a place in the reference book shelf of a programmer or system administrator.

Saturday, 3 December 2005

Kompose - The MacOS 'Expose' on Linux

People always say, why can't Linux have some of the same functionality as OSX ? Look at apple, see the path breaking innovations they bring out w.r.t usability. It is anybody's dream machine. And then, they go for the final kill - have you seen Expose at work on a Mac ? It's awesome!!

I personally like OSX too for the importance they give to usability and aesthetics. And I really like Expose on OSX. Which is the real reason for this post. Now Linux can also claim to have Expose like functionality in an application called Kompose. Kompose is an efficient full screen task manager which gives a graphical representation of the open windows on your desktop(s) at any given time.

When you start kompose, it discretely resides in your system tray. But it also takes a screenshot of all the applications open on your desktop(s) in set intervals. Now when you want to switch from one window to another, just pressing the key combination [Ctrl+Shift+J] or [Ctrl+Shift+I] (You can remap the key combinations in the configuration settings) will neatly tile all the applications on your desktop (see picture below). Kompose creates a full screen view where every window is represented by a scaled screenshot of its own. And then clicking on the application image of your choice will give the focus to that application.

Fig: Kompose at work on a linux desktop

Kompose makes use of Imlib2 to render the images. And the minimum requirements for running this nifty application is KDE 3.2, Qt 3.2 and Imlib2. Of course I need not tell you that for such graphics intensive operations, you also need a very fast machine. It ran smoothly on my Pentium 4 2.0 GHz 256 MB RAM machine.

At present, you have to manually download and install it on your machine. Debian users can simply run :
# apt-get install kompose
However, on my Fedora core 2 machine, I had to download and compile it from source (Another reason to switch to a debian based distribution).

But hopefully, by the time KDE 4.0 is released, we can look forward to it being included as a standard feature of KDE.

Related Posts:
3dDesktop - The desktop switcher on steroids

Friday, 2 December 2005

Vi & Emacs - Two old time adversaries



Those who have been associated with Unix since a long time will have fond memories of the great flame wars fought over which was the better editor over the two - namely, Vi and Emacs. There were (and still are) diehard fans of eaither of the editors. I remember personally having been chewed up at numerous web forums for having sided one editor over the other. These Vi vs Emacs wars were so hot that Richard Stallman - the father of GNU and also the creator of Emacs - has gone on record saying, and I quote:
"People sometimes ask me if it is a sin in the Church of Emacs to use vi. Using a free version of vi is not a sin; it is a penance. So happy hacking."
io.com runs a very good article listing the similarities and differences between the two great editors which will put to rest the doubts cropping up in peoples minds about which is the better editor of the two. It is one of the most informative but neutral article I have ever come across regarding Vi and Emacs.

Thursday, 1 December 2005

Adding Windows Fonts in Linux

Unlike past times, Linux do come with good fonts. And the font rendering can be made better by choosing to antialiase the fonts. But at times you come across a website which has been designed with the windows user in mind. Such websites are best viewed with one of the windows fonts. If you have windows OS installed on your machine, you can copy the essential fonts from the windows partition to linux and use them to get a better web experience. Here is how you do it.
Method I :
Copy the ttf (True Type Fonts) fonts Ariel, Tahoma, Verdana, Courier New and Times New Roman from the windows partition to the fonts:// location in nautilus.

Method 2 :
Some people who are using Ubuntu have said that they can't do it as normal user. And since Ubuntu does not have a root account, they find difficulty in using su to copy eaither. Such people can do the following:
Create a '.fonts' folder in your home directory and copy the necessary fonts into it. Now you have access to the fonts on a per user basis.

Method 3:
This method can be used to install the fonts system wide if the above two methods do not give satisfactory results.
First find out in which location linux has installed the truetype fonts. It is usually at the location '/usr/share/fonts/truetype/' . But you may also do a search for the same as follows:
# find /usr -iname \*.ttf |head -n 5
Once you know the path of the fonts directory, move to this directory and create a folder there (it can be any name).
# cd /usr/share/fonts/truetype
# mkdir windowsfonts
Note: You need to be logged in as root while doing this.
Next copy all the windows ttf fonts to the windowsfonts directory that was just created.
# cp /media/hda1/windows/Fonts/*.ttf .
Now change the ownership of the fonts as well as make sure they have a right of 644 .
# chown root.root *.ttf
# chmod 644 *.ttf
Now run the command mkfontdir while in the windowsfonts directory.
# mkfontdir
This will create an index of the fonts in the directory. It will also create two files fonts.dir and fonts.cache-1 .
Now moving to the parent directory, edit the file fonts.cache-1 using your favourate editor and append the following line to it.
#File: /usr/share/fonts/truetype/fonts.cache-1
...
"windowsfonts" 0 ".dir"
Lastly run the command fc-cache.
# fc-cache
This command will scan the font directories on the system and build font information cache files for applications using fontconfig for their font handling.

That's it. Now you can have access to windows fonts in all your X applications including firefox and OpenOffice.org.