Wednesday, October 31, 2007

PC Magazine 'Leopard is “by far the best operating system ever written'

In his 4.5-star (out of 5) review of Leopard, Edward Mendelson ( maintains that Leopard is “by far the best operating system ever written for the vast majority of consumers, with dozens of new features that have real practical value.” Mendelson “found Leopard to be startlingly fast, brilliantly streamlined, and packed with conveniences

read more | digg story

Searching for files in Unix

Few days back, one of my friends asked me how to search for a file on Unix. I asked him to use locate but unfortunately he didn't have rights to use it or update the database (updatedb). That's when I realized, we have the old and reliable tool called "find". Here I cover some cool stuff that "find" can do for you


The find command allows the Unix user to process a set of files and/or directories in a file subtree.

You can specify the following:

* where to search (pathname)
* what type of file to search for (-type: directories, data files, links)
* how to process the files (-exec: run a process against a selected file)
* the name of the file(s) (-name)
* perform logical operations on selections (-o and -a)

1. Search for file with a specific name in a set of files (-name)

find . -name "rc.conf" -print

This command will search in the current directory and all sub directories for a file named rc.conf.

Note: The -print option will print out the path of any file that is found with that name. In general -print wil print out the path of any file that meets the find criteria.

2. How to apply a unix command to a set of file (-exec).

find . -name "rc.conf" -exec chmod o+r '{}' \;

This command will search in the current directory and all sub directories. All files named rc.conf will be processed by the chmod -o+r command. The argument '{}' inserts each found file into the chmod command line. The \; argument indicates the exec command line has ended.

The end results of this command is all rc.conf files have the other permissions set to read access (if the operator is the owner of the file).

3. How to apply a complex selection of files (-o and -a).

find /usr/src -not \( -name "*,v" -o -name ".*,v" \) '{}' \; -print

This command will search in the /usr/src directory and all sub directories. All files that are of the form '*,v' and '.*,v' are excluded. Important arguments to note are:

* -not means the negation of the expression that follows
* \( means the start of a complex expression.
* \) means the end of a complex expression.
* -o means a logical or of a complex expression.
In this case the complex expression is all files like '*,v' or '.*,v'

The above example is shows how to select all file that are not part of the RCS system. This is important when you want go through a source tree and modify all the source files... but ... you don't want to affect the RCS version control files.

4. How to search for a string in a selection of files (-exec grep ...).

find . -exec grep "www.athabasca" '{}' \; -print

This command will search in the current directory and all sub directories. All files that contain the string will have their path printed to standard output.

If you want to just find each file then pass it on for processing use the -q grep option. This finds the first occurrance of the search string. It then signals success to find and find continues searching for more files.

find . -exec grep -q "www.athabasca" '{}' \; -print

This command is very important for process a series of files that contain a specific string. You can then process each file appropriately. An example is find all html files with the string "". You can then process the files with a sed script to change those occurrances of "" with "".

Special thanks to:

Creating an auto redirector from your old web page to your new blog

I have a free domain space from the university at

Now, I am too lazy to host anything worthwhile on it. How about redirecting users to my blog automatically from there.
Just add the following lines in your index.html in your old web page.

<META HTTP-EQUIV="Refresh" content= "0;URL=">

Sunday, October 28, 2007

Gutsy : stdio.h not found ??

Imagine the great surprise I had when I compiled my Honors year project with gcc
It gave me 150 errors and thousands of warnings. Apparently the gcc libraries weren't fully installed. Just do the following:

#sudo apt-get update && apt-get install build-essential

Sunday, October 21, 2007

Take 2: Upgrading from Feisty to Gutsy - Recovering from a failed upgrade

As mentioned in my previous post, my upgrade failed and I finally had to resort to the normal fresh and clean way of installing the new OS. This meant formating my previous broken distro, downloading the iso, and doing everything from scratch.

The first thing I obviously did was to take a backup of my home folders. Next either download and burn the iso to a bootable cd. I prefer the no-cd method (Will describe that in later weeks)
which involves copying couple of files into my /boot, modifying the grubmenu.lst file, and do a network installation from the singapore ubuntu mirror (Too lazy to burn a disk from the iso).

The entire process took less than an hour and was highly streamlined. It's not much different from the Feisty installation and experienced as well as new users will find it right at home, with this distribution.

There is another issue at a point where it asks you to select the packages - lamp, xubuntu, kubuntu, multimedia & studio, etc. Some of the packages were missing in the mirror so its safer to just select the ubuntu-desktop now and install the rest later.

The Reward:

The shiny new, stable Gutsy with all the cool new upgrades and support for all restricted packages and device drivers ;)

BottomLine: I tried hard to downgrade to feisty and upgrade back to gutsy, but it's more complicated than it seems and it's definitely not worth the effort spent. Rather do a fresh installation as I mentioned above. If you are happy with your Feisty and aren't tempted by the gutsy phenomenon, I suggest waiting for few more weeks, so that the upgrade bugs can be resolved and all packages are properly mirrored back to your favorite servers.

Take 1 : Upgrading from Feisty to Gutsy

I was really excited reading reviews and preview of how good Gutsy was. So I decided to upgrade my Feisty to Gutsy. Was it as smooth as expected ? Here I show you the dos and donts and the howtos to get your gutsy up and running.

Ubuntu comes with an update-manager which can seamlessly upgrade to the latest release by click of a button. No downloading and burning images, or starring idly at the installation screen. Ubuntu is pretty functional for other tasks during the entire upgrade process.

Important things to keep in mind -

Note 1: Make sure that all critical updates for Feisty have already been installed. For instance, check if the installed update-manager is latest.

# sudo synaptic

search for update-manager. Check the installed vs Latest Version and if needed mark it for upgrade and commit.

Note 2: Uncheck all unsupported 3rd party sources. Do this by going to synaptic > Settings > Repository > Third-Party Software.

Note 3: The following method is known to be buggy and prone to crashes. Use at your own risk. It failed for me, but it worked fine on other systems I tested.

Let's start the upgrade process -

1. Run as root

# update-manager -c

Update-Manager loads with a "New distribution release 7.10 is available " message and an upgrade button. Ignore the warnings. Click on "Upgrade"

3. Thats it. The installation process starts.
All new updates are downloaded and installation begins.

4. It's an interactive process, and quite often ubuntu will prompt you asking what to do next (frustrating..).

5.If things go well, in an hour or so, depending on the speed of your connection and your nearest mirror, installation will complete and you will be asked to reboot.

6. What if things go horribly wrong !

Read what you can do after that here

Issues: In my case my installation failed at 74%. Subsequent efforts were fruitless as the update-manager always displayed Gutsy installation was completed. Downgrading ubuntu is not an easy task. I tried Pinning, but still no use.
In the end, I took the backup of my home directory and did a clean install ( completely fresh)
Also note, in the above case, if you don't take a backup and you restart your pc, it wont boot up again due to the broken dependencies and the fact that Xorg is configured in the end.

Friday, October 19, 2007

Ubuntu 7.10 (Gutsy Gibbon) FInally Released

Finally, the next Ubuntu upgrade is out. Gutsy Gibbon released, waiting for Hungry Hippo (the next release). Ubuntu guys surely know some creative codenames for their releases ;)

The new ubuntu has the latest GNOME 2.20. Not sure if Kubuntu 7.10 is coming out any time soon. KDE 4 is planned to release in December. The last time I heard, folks at kubuntu were trying to follow the KDE development cycle for their release. Anyways, enjoy the new GNOME till then.

Dowload the iso from:

Pitched as the best release *ever*, can't wait to try this release. I am currently busy with some projects and a test tomorrow. The mirrors are also pretty busy with traffic but expecting my download to complete by tomorrow.

Those staying in NUS campus can wait till we mirror the new release. Hopefully it should be available soon for the network install or iso downloads. Find it here at :

Anyways, I'll post my experience upgrading from Fesity to Gutsy in upcoming days. Hope the migration is smooth as always. Enjoy the new release...

Wired Review: Ubuntu's New 'Gutsy Gibbon' Brings Linux Out of the Jungle

On Thursday, Canonical, the London-based company which acts as Ubuntu's commercial sponsor, released version 7.10 of the software. This latest release, dubbed "Gutsy Gibbon," proves that Ubuntu Linux can compete with and, in some cases, trump Windows as an everyday desktop system when it comes to pure usability.

read more | digg story

Monday, October 15, 2007

Best IDE for C development on Linux ?

Lately, I have been coding heavily in C for my honors year project. Here is my prefered list of IDEs.

1. Eclipse/ EasyEclipse
  • Eclipse CDT
    Your favorite IDE with a C/C++ development toolkit

  • EasyEclipse C/C++
    A nice Eclipse based IDE tailor-made for C/C++ (highly recommended)

2. NetBeans with C/C++ plugin
  • Netbeans C/C++ development pack
    A nice addon pack to the super powerful Netbeans environment. Tough to choose between this and eclipse. Similar features but a little more welcoming than eclipse...;)

3. kdevelop/kate
  • KDevelop
    A nice light-weight development IDE that supports tonnes of formats.

  • Kate
    More like a generic multi document editor with a nice and clean interface. Highly recommended if you are coding small snippets and not full blown projects.

Other noteworthy mentions:

Feel free to send in your favorite IDE and I'll add them to this list.

Sunday, October 07, 2007

Ubuntu Feisty: Firefox Java woes

So you have java already installed but firefox still can't detect the java plugin...

$ sudo ln -sf <jre_path >/plugin/i386/mozilla/ /usr/lib/mozilla-firefox/plugins/

$ sudo ln -sf <jre_path >/plugin/i386/mozilla/ /usr/lib/mozilla/plugins/

replace <jre_path > with your jre path (without the angular brackets)

Can't seem to locate your jre path ? simply type :

$ locate jre

Thursday, October 04, 2007

Zune 2 - Can Microsoft be second time lucky ?

Microsoft is surely making news this month. They finally unveiled the 2nd generation line of Zunes and we are as excited as we were, the first time around.
Zune 80 with 80GB of storage and Zune 8 and Zune 4 with 8 and 4GB flash respectively. Priced similar to the comparable range of new iPods (nothing to compete against the iPod touch though), Microsoft is trying its luck again to dethrone Apple in the PMP market.

The earlier Zune had lots going in its favor, nice interface, wireless connectivity etc. But there were so many flaws that it faded off inspite of Microsoft's aggressive promotion and marketing efforts.

Our initial impression of Zune 2, clearly indicates that microsoft has tried hard to sieve out all the loose ends and added some minor improvements but then, its still too soon to say how good they would work.

One cool feature that everyone around is buzzing about is the firmware upgrade. The unfortunate and handful of early buyers of the Zune 1, will enjoy all the Zune 2 feature upgrades by just upgrading the firmware. This probably is the first instance ever, when a firm hasn't forced their customers to upgrade to a better model (like what Apple does, each time) for the cool feature upgrades.

It's strange though, that in a year of research and planning, after Zune 1 failure, we only see a thinner, higher capacity Zunes. No specifications or harware changes.All other improvements are just software based...

Things that interests me are

1. Hopefully could challenge the iPod monopoly
2. syncing of files over Wifi
3. Support for DRM-Free music formats (finally !)
4. Media Center sync
5. Sharing music with friends over wifi
6. All new Zune MarketPlace (similar to Xbox lives) with DRM free songs

Potential glaring pitfalls

1. Only windows supported - No Mac or Linux
2. DRM songs shared can be played max 3 times on other clients
3. Smaller screen size compared to comparable iPods
4. No comments yet on battery life
5. Microsoft Live update (never been a fan of M$ on this)

So will the Zune succeed?
Well only time will tell. In our case November 13. Till then please hold your pending ipod purchase and don't be tempted to pre-order a Zune. Hoping for a closer finish, this time...c'mon M$.. we don't hate you that much...and we don't love you that much both the cases hope consumers win...

My Verdict on Halo 3

As we were following Halo 3 in our previous weeks, a short verdict note to add here.
Halo 3 can be declared a runaway success. Favorable reviews, huge blockbuster opening (bigger than spidey 3, they say) and millions online on XBox live, currently competing with each other.
It's a great game and if you own an X360, go buy your Halo 3 copy now and if you don't own an X360, I suggest start saving money now, and buy yourself an Xbox360 and a copy of Halo3 for this Holiday season.

Apart from the being a quality product, Microsoft should also be applauded for the marketing efforts it put in, to promote the product. Never before, so much money and resources were spent on a game launch.

So what's the consequence? Where does Xbox go from here?

I believe, Xbox360 is way ahead of its competitors now (Wii and PS3 fanboys, don't start flaying me for this, personal opinion only). Gears of War, BioShock and now Halo 3, you have 3 solid reasons to buy the X360 now.
I really don't care if Wii has outsold the X360. C'mon Wii is almost 1/2 the price. Also, let's be frank here, Wii is not meant for serious gamers. It's cool, fun, can play with family etc...but you won't be playing Halo or MGS ever on it (Metroid an exception though). This clearly has been nintendo's product placement strategy, and it's good move. Nintendo has found a new GAP in the gaming segment and they have done remarkably well.

As a computer engineer, I can confidently say that good hardware needs to be backed with good software. A great example would be PS3s cell processors. If you don't have good SDKs written for such complex platforms, one can never utilise these great hardware and tap their potential.

PS3 might have great hardware but as a gamer, I really don't care unless I have some real cool games to play on it to appreciate its power and superiority.
I hope Sony learns a lesson or two here, and rallies behind developers and churns out nice titles to compete against the X360.

A healthy competition benefits us all. Looking forward to the next big game releases, till then happy fragging...