Friday, 26 October 2007

How to run apps that dont run on XGL desktop

You might encounter some apps that do not like XGL enabled desktop(for the less informed, aka Beryl, Compiz, Compiz-Fusion enabled desktops). Most often these are DirectX based Windows apps that you want to run through Wine or probably some Java App like Lazarus.

I found two different solutions with different approaches.

First approach:
Shift your present XGL enabled session into a separate Window and launch a nonXGL window manager on the main Xsession. I found this approach funny, but works.

Create this script and copy it to ~/bin for single user only or /usr/bin for global access. Give it a name like noxgl(u can change this to your liking)

if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ $# -eq 0 ] ; then
echo "Usage : noxgl
echo " noxgl -b
echo " (-b option means 'border' so it adds a window border)"

if [ "$1" = "-b" ]; then
if [ -x /usr/bin/kwin ]; then
killall $WM
DISPLAY=:0.0 "$@"

Now u can launch ur app as noxgl -b appname [options]

The second approach is to launch a nested Xserver using Xnest and launch ur app into the Xnest. You need to install Xnest for this.

Use the following commands:
Xnest -ac -terminate -geometry 1280x1024+0+0 :3 &

This will launch Xnest which is an Xserver as well as a Client.

Now launch ur app into this:
DISPLAY=:3 appname [options] &

A word of caution: By default Xnest will not allow Window borders, so it will be a hell to manage multiple windows(if your app uses them). So before launching ur app launch metacity using the above command and then launch ur app.

Thursday, 25 October 2007

Migrating Your Windows Mozilla Thunderbird Profile to Linux

One of the most common tasks when migrating from Windows to Linux is making sure that your emails from ur Mozilla Thunderbird install are migrated properly. Here is a small HOWTO which I figured out myself, when faced with this task.

What you need to know?
Locations of the Profiles in Windows and Linux
On Windows its located in: "C:\Documents and Settings\UserName\Application Data\Thunderbird\Profiles\randomprofileid.default"

On Linux: ~/.mozilla-thunderbird

There is absolutely no need to copy your mails from windows to Linux partition. You can keep them where they are incase you do not plan to uninstall ur Windows OS or you frequently toggle between both OS like I do due to work requirements.

So here is what you do either copy your randomprofileid.default folder to the Linux partition or link it inside the ~/.mozilla-thunderbird folder.

Here is how you link it:
ln -s /media/WinPartition/Documents\ and\ Settings/Albuquerque/Application\ Data/Thunderbird/Profiles/okapp5e4.default/ ~/.mozilla-thunderbird/okapp5e4.default

Now you need to edit the profiles.ini file located at ~/.mozilla-thunderbird/profiles.ini
Here is the snippet from my Modified Profile




I added the new Profile 1 section in place and added the path to point to the one which is the one i linked above. Also changed StartWithLastProfile=1 to StartWithLastProfile=0 so that I would get a choice at startup.

Now start you firefox and you are done. Enjoy ur mails on both OS without any problems.

Tuesday, 28 August 2007

Grub Background Image HOWTO

While answering this thread on Linux Community on Orkut, I said that it is possible to have the sexy boot screen like Fedora, RedHat and Debian on the Ubuntu and related ..buntu systems. I even pointed how, but had not tried myself although I was confident that it will work. So I set off to actually try it out.

Your Recipe:
A linux machine with Ubuntu/kubuntu/edubuntu/xubuntu installed
a 15 colour image to be used as background, Canvas size 640x480. Must be in xpm format

The preparation:
OK. the first question you will ask me is where to get a 15 colour image in xpm format from? My answer is simple. Google it or make it. I have tried both. But I will explain the making one.

I used a photograph I had taken from my friend's N95 of the London Underground. It definitely was not 15 colour and particularly not 640x480. Click to see the original image. You may save it if you like. So the task was to convert it to the required format. I played with few commands like cjpeg, djpeg, etc till i found convert. After going through its options this is what i used:
shashank@shashank-laptop:~$ convert /media/hda3/Shashank\ pictures/09052007088.jpg -colors 15 -resize 640x480 underground.xpm

The command is pretty self explanatory. with the exact required options; -colors and -resize

The final product wasn't pretty impressive, but would suit my requirements. What else would you expect converting a 32bit image to a 15colour one. Can't upload the image so you have to experiment with the original image and the command to see what I got.

now gzip the image:
shashank@shashank-laptop:~$ gzip underground.xpm

move or copy the xpm.gz file to /boot/grub/ folder. You need to be root to do this, so use sudo

Modifying the grub:

Now we need to modify the grub configuration file. This is /boot/grub/menu.lst on the Ubuntu. Use your favourite editor. I love vi, some love nano, for others gedit. remember to be root or sudo your command
shashank@shashank-laptop:~$ sudo vi /boot/grub/menu.lst

Now add this below the timeout line:

My Boot and / same the same partition and it is the second primary partition on my laptop. The first Primary partition is used by the laptops recovery utility which I have left as it is, just in case. You may need to figure out what you have to use in place of (hd0,1) according to your partitoning scheme.

Finally save exit and reboot to view the effect. Cheers.

Thursday, 21 June 2007

Who Rules?

Some days back I was reading a Linux vs Windows debate on an Orkut Community. the debate started with this YouTube Video:

After reading half way through the posts, I decided I had to speak out my view, so I posted this:

Linux can perform these graphic wonders at a meagre 256MB RAM whereas Vista requires atleast a Gigabyte for its Aero which gives nothing..

For ppl who are saying Windows is more user friendly, u got to tell me why ppl are downgrading their machines back to XP from Vista? And all those guys praising Windows how many of you have actually bought a copy of Windows?? 90% of you are using a pirated copy.

Your praises are all because Windows has been shoved down your throat ever since u knew what a computer is. U have never known the power of linux. You have never know what freedom of choice is. U r stuck with daily dose of updates that fixes ur OS patches. U R stuck with just FAT and NTFS. U R stuck.

The Linux users have broken free from the bondage. The are free to choose.. free to innovate..

Everytime someone tried to speak the FACT they were ridiculed and laughed at until it was proved otherwise. TRuth Happens.. and it will be seen.

"First they ignore you..
then they laugh at you..
Then the fight you..
Then you win."
- mahatma Gandhi

Monday, 28 May 2007

Linux Saves Windows's Day

Last week my friend came to me with his Acer Aspire. Apparently his room mate had formatted his machine and installed a pirated copy of Windows XP and had also forgotten the password for it.

My friend requested me to install the original copy of Windows Media Centre back on it and restore it to the original state. He was told that all the partitions have been deleted.

I could not find any easy way around it by his descriptions. Even if the rescue partition existed there was no easy way to get to it as the Bootloader had been changed. He wanted me to create the rescue disk from another Aspire system to be used on his machine. But the problem was the other machine had some kind of grudges towards blank disks. It would simply spit it out randomly.

So I popped in a Ubuntu Fiesty that I had recently ordered for free. After the GUI launched I started the Terminal.(I am a shell nerd)
I used fdisk [sudo fdisk /dev/hda] to identify the partition structure.(I wont explain any commands in detail here but that would be pretty easy to figure out even for a first timer) There were 3 partitions. Two FAT32s and 1 NTFS. The second FAT32 was marked as bootable. I figured out that the first definitely is the rescue partition, so i toggled the bootable flag on both the first and second partition. So effectively the first partition was made bootable.

Now I rebooted the machine and let it boot thru the hard disk. As I had hoped the rescue wizard started. I rejoiced and sarcastically teased my friend. "Look to save your Windows I am using Linux"

After the rescue wizard was completed it was time for the machine to reboot. But the machine rebooted back into the rescue mode. I guessed what was wrong and again used Ubuntu to toggle the bootable flag on the first two partitions.

The final reboot allowed the Windows partiton to start with the Windows final setup screens with the EULA and all.

Nevertheless Linux Saved Windows Day. :P

Wednesday, 16 May 2007

Software Patent Violations

i read a post on that quoted that Microsoft is blaming Linux of infringing it's software patents, 235 of those. and it turned out they are only giving numbers claiming violations, but is not ready to tell exactly what is being violated.

Made me just remember the SCO controversy where SCO was claiming Linux used code from UNIX. Microsoft seems to walking on the same path.

Microsoft has already lost its battle on the Internet front to the giant Google. Google even started an online Office Suite. Although it is very far from MS Office, it is a full fledged Office suite waiting for more features to come in.

On the OS front, Linux was already gaining more and more control on the server segment. And more recently with Ubuntu and Novell SuSE and more notably the XGL interface is making even Microsoft's much talked of OS, Vista look naive. Vista offers just a fraction of the eye candy that XGL can offer. To add to it XGL runs on much lesser configuration than what a Vista demands.

So all Microsoft can do is fight back in retaliation. But it wont describe what Linux is violating, something that we all want to know. something that can allow the Linux developers to change the so called copyright infringement scenario. We can develop workarounds only if you tell where your infringed code lies.

I would believe there is much less chance of Linux violating copyrights than there is of Microsoft violating them. The Linux code is open for all. Anyone can view it, review it, dissect it, analyze it, tear it apart to evey bit and point out for themselves what is being violated. But as for microsoft, the code is closed. You are not allowed to dissect it, no access to source code. End of story.

So there is much higher chance of Microsfot copying a lot of code from the open source community to implement in its own product and still release its own product in closed source, thus violating the GNU GPL.

By all means, Microsoft is just bluffing about it's software patents. After all it has to remind people that they still are in business..

Friday, 26 January 2007

Peep out your Window..

Why do all Windows have the same style? Why is there no variety. On Windows front u have no choice but to live with the Windows UI that microsoft gives you, whether you like it or not. What if you wanted to use the Macintosh UI? U have no choice. On the contrary there are so many GUI projects in the UNIX world that I can explain only a few of the most remarkable ones.

One of the earlier ones were designed to work with very limited resources. For people who want a Windows 95 like interface there is FVWM(F? Virtual Window Manager). Sorry.. Do not ask me what F stands for. The original Author, Rob Nation himself forgot what it originally stood for. But I am asuming F stood for FVWM just like GNU stands for GNU is Not Unix. It was developed as an improvement to otherwise ugly twm. The screenshot showed here is the very minimalistic FVWM2 interface. No themes at all. Click it for a bigger view. Or visit the fvwm official site for more screenshots and really cool ones.

Another interesting Interface was called WindowMaker. I say "was called" because due to some naming issues it was sued by a company making Windows and Doors and they changed the name to Window Maker to relate it to the X-Window process in which it creates windows. This was the first interface I used on Linux and it was very simple, very light weight(used on a machine with 8MB RAM) and very different. It does not have a start menu. But it does have a nicely hidden application menu where all the apps reside. To get this you just have to right click on the desktop. I experimented with this and designed three themes for it. Just search my name, Sam Albuquerque, on Google and you will find the first link pointing to these themes that I designed myself. For direct access click this link

If you like the XP look and feel there is another project called the XPde(XP Desktop Environment). The aim of the XPde project is to make it easier for XP users to migrate to Linux. Just have a look at the screenshots at, the official Website of XPde. They have managed to get many of the XP features into xpde. The ALT+TAB works similar to Xp, the strat menu is similar to that of XP, etc.

There are many such Interfaces. But two major environments on which many such interfaces work are the GNOME and the KDE. GNOME stands for the GNU Network Object Model Environment. GNOME is usually distributed by almost every distribution of Linux. It was started as an answer to KDE because KDE used a set of libraries which at the time of its conception was not free. The Qt libraries which KDE used was then made free by Trolltech. However, GNOME and KDE evolved out as two string projects with lots of wonderful features and applications developed. Both of them have their own office suites too. Visit for details on the GNOME project and to see a lot of their screenshots.

KDE can be accessed at KDE was started with a view to bring some consistency in the Unix applications of the time since all applications had its own look and feel. Matthias Ettrich, who started the KDE project was concerned that his girlfriend was having difficulty in using his desktop. He started developing a complete desktop environment by using the Qt libraries and other programmers joined his bandwagon. There was initial concerns which spurred the GNOME movement. But Trolltech finally made its source code open under the GPL and now there are no issues at all. So finally everyone loves Konqi the friendly dragon.

Allow me to make you a bit more jealous. Does your Windows support 3d desktop? Our cute little Linux supports a fantastic 3D desktop using XGL Cube. Its sexy, it superb and its WOW!! I wont say more now but let you watch for yourself the power of linux with this XGL video..

Tuesday, 23 January 2007

Commands and GUI (Graphical User Interface)


This is my first blog, after my friend, Sam, convinced me to write up a blog. As many of us know that Linux is a command based interface. Where you have to remember those complex commands. But its not always that you should remember those commands. If you are stuck up with a commands syntax you can use a man command. They can be referred as manual pages for the command.

For eg. To know the syntax of command rpm you have to type on command prompt

man rpm

and press enter key. This will bring you a complete syntax, various parameters, arguments and combinations of those parameters and arguments to be passed to the command.( You can try it out on a Linux machine)

Now second example like Windows user may be knowing, to list the contents of drive we type command dir, this will list all the contents of a particular drive. Now you don't what command is to be used in Linux. Then just type the following command

apropos directory

This will list all the commands which are associated with directories. If you are not sure which command is to be used you can use man to know the details. See its so easy!!!!!
You don't have to remember the commands. These will make you understand that Linux is not so hard even at command level.

Coming to GUI (Graphical User Interface), not all Linux are dedicatedly on command based. Even Linux have a GUI. For example GNOME and KDE are most developed GUI for Linux. Other GUI's like IceWM, Fluxbox or Afterstep, Xfce4 etc. which are LightWeight GUI's are also available. Isn't it great to know that you have multiple choices for a GUI.

In Microsoft world you are left with no other option but Windows. On contrary for Linux you have multiple GUI's.

But why is there different GUI? This choice of GUI has been made possible by the nature of open source (Linux). This allows anyone to develop a GUI to answer specific needs. Thus, all these GUI have a reason to exist: to fit the needs and goal of those developing them. That also means that there isn't a "best" or "worst" GUI. There's only GUI that are, or aren't, adapted to your needs. The idea is then to find the one that's right for you...

Friday, 12 January 2007

A short HOWTO - Installing Softwares

Linux does not have the setup.exe like Windows. On the contrary they have many brilliant or sometimes rather boring and tiring approach. All depends on where and in which form you get the software. Let me describe to you some of the popular approaches.

On the RedHat and many derived platforms including SuSe and mandrake(now Mandriva) as also Fedora, the main installation program that has been for ages is the 'rpm'(Redhat Package Manager). You need to download your package(software) and store it somewhere. Use the rpm command to install it. The rpm command is very simple:
rpm -ivh packagename.rpm
-i Install
-v Verify before install
-h Use Hashes [ ###### ] to show installation progress
packagename.rpm the package that you are installing

Optionally, You may replace the -i with an -U if you are upgrading the package, as it will throw error messages otherwise. If you ever come across a dependency issue and you have the dependency package in the same folder then just add an -aid in the end.

The removal of the package is simpler.
rpm -e packagename
You do not have to use the rpm or even keep the rpm package. If you have installed the package that is enough. Just use the command from anywhere on the command line.

The Debian based ditros used a tool called dpkg to install .deb files. If you ever lay your hands on a .deb file issue this command to install it:
dpkg -i filename.deb
is Install

There is a new way to install softwares without even downloading them and without having to worry about the dependencies. this is called the repository based update. All of the Red Hat based distros depend on a tool called yum(Yellow dog Updater, Modified). As you may have guessed, it was originally designed for the Yellow dog Distro of Linux and was then named yup. The new yum has now replaced the original yup in Yellow dog and is being used by almost all RedHat based distros and support repositories of each other to some extent. The tool that Fedora uses is called yum and so is the one used by CENTOS, Yellow dog and many other RedHat clones. The one used by RHEL is called up2date and can handle both yum and apt repositories. SUSE has it integrated with YaST and OpenSUSE entirely uses a yum repository. The simples t way to install using a yum is
yum install packagename

The graphical tools using yum are:
  • KYum
  • pirut
  • Yum Extender
  • YaST2
A similar style has also been adopted by the Debian Side as well. The tool that they use is called APT(Advanced packaging Tool) APT was originally designed as Debian's tool for their dpkg tool to install .deb packages. There are many front-ends to this tool. The one that you would usually come across at the command line is called the apt-get which works exactly like the yum. The command for installing using apt-get is:
apt-get install packagename

The graphical tools used instead of apt-get are
  • Adept Package Manager
  • KPackage
  • Synaptic Package Manger
The most difficult way to install a package is when you have the source code of the package and not the binary. This is the time when you need to compile it. These packages usually come in the form of .zip, .tgz, .tar.gz, formats.

So let me guide you to identify and extract these packages first before you move with the installation part.
.zip is as usual a Compressed ZIP file using a zip tool so just use unzip to unzip it.
unzip filename

and .tar.gz are gzipped tarball. So you need to gunzip it and untar it to extract it. This is done by
tar -zxvf filename.tgz and tar.bz2 is a bzipped tarball and you need to use bunzip it and untar it. This can be done by replacing the z above command with j.
tar -jxvf filename.tar.bz2

Next, look for files like README or INSTALL to get hint on how to install the specific software. If not follow these steps. Most of the packages are built this way. Usually you will find that there is a file named Makefile in the main folder. You will also find a file called configure. configure will help you to identify the variables specific to your machine so that the package can be optimised for it. It will also find the required packages. You have to install the following commands one after the another; ignore the garble you get but watch for error messages, if any.
make install
make clean

./configure will create the configuration files for you
make will compile the entire package.
make install will install the package
make clean will clear the source folder of all the compiled files.

Now that you have learnt all the ways to install the softwares on Linux, go find yourself a package and start installing. If you are scared of the command line, go use the Synaptic Package Manger, KPackage, YaST2 or Yum Extender.

Enjoy the new power that you have learnt today....

Sunday, 7 January 2007

Linux @ WorkPlace

Companies need to make profits and not losses from their infrastructure. How do you achieve this if your machine crashes every now and then? How does your employee focus on his work if every other week a computer geek is lingering on his machine trying to remove the deadly virus or a secret spyware from his machine? How is the company profits meant to rise if the amount you pay to maintain the company infrastructure is huge? How?

Companies stick to Windows because they have never known of any other option. They have always been taught that there is one Windows and thats it. No one told them of options to the Windows. No one probably ever asked, "Is there a Doors too?". There is a Gates as we all know, but no Doors or Walls(There is Larry Wall and his Perl). No one really knows except the community.

The major requirement in the companies are Word Processing, Spreadsheets, Accounting, Emails, IM, printing, filesharing, and thats it. It hardly ever goes more than this. You don't need to buy a licensed copy of Windows to work on all these stuff. Not that I am advocating piracy which is common anyway in most part of the world and the main reason for Windows success, but I am pointing you in a direction that is entirely different. The best option out there is Linux, and I say this by experience.

Linux comes shipped with all the softwares you would require for your office environment. OpenOffice 2.0 is distributed as part of all major distros. Some also come with Abiword and KOffice. Some GNome distros ship gnumeric which is a spreadsheet like Excel. There is already a plethora of word processing packages that do not require you to learn any coding as the popular myth goes. The GUI of Linux is also very intuitive and easy to learn.

As a case study, let me speak of the place where i worked earlier. The systems used in the entire organization were either Windows 98 or XP. I was the only one using RHEL 3.0 and my teammate later asked me to install one for him(I installed RHEL 4.0). So we had two linuxes, which were more of an envy for all the people in the organization. As we used to leave our machines locked, no one could access them. If ever we ask them to use it, they would get awestruck at whats in front and leave sayng I dont know how to operate it. It was just their mind playing games.

I realized this one fine day. The peon in my organization had some work to do. But there were no machines free for him. My friend was on leave. He asked if he could use the machine. i said try and logged in for him. Thats it. I carried on with my work. 10 minutes later when I turned my head towards him, he was working on Mozilla Firefox, opening our company's internal application processing orders(which was his duty). I gave a pat on his back and explained him that people who held a higher post were reluctant to use this stuff but he did it without any help.

We later installed two more machines using Ubuntu and the employees were handling it smoothly. That was a success.

So if you plan to have huge savings in your organization, switch to Linux... SLOWLY..

Slowly <--Remember this keyword. A sudden switch over will have reactions and fingers pointing at you. But a slow switchover will have people dying to use the new system. Create Envy by frequently pointing out the benefits that you are having.. Have fun.. The work becomes a better place.

The battle is tough

Debian and Redhat have been fighting a long battle since long. This is due to their implementation of linux and the philosophies they follow.

Debian is a community based distro, or should i say parent distro. Its main philosophy is to use softwares that are under the GNU GPL only. So you will never find a debian rolling out with KDE. The child distros or derivatives may, for example Kubuntu and Knoppix.

Red Hat on the other hand is a company. They are here to make business and so they are ready to have softwares that are non-GPL clubbed with their distro. They can even add other open source projects which follow other open source license.

But difference still exist in many other aspects. One major aspect is that of packaging. Redhat uses the popular RPM(RedHat package manager) where as Debian has their dpkg(Debian package). Both distros now have their repository based installers like yum/up2date for RedHat-Fedora families and apt-get for all debian based distros. You can't install a debian package easily on a Redhat nor can u easily install an RPM on a debian. There are softwares that can help you with that. Softwares like Alien. But they are not as acceptable.

Still all of us agree that RedHat and Debian are the biggest players of Linux market. This battle will go on for ever until if one day both decide to merge which probably is just a dream..