Friday, December 30, 2005

yabi-0.2 update

Initially I wrote yaBi just for fun. (Read my first post about yaBi here which contains some more screenshots).

Gradually I implemented some more ideas and made it a full fledged KDE application. I took ideas from Metabar (thanks metabar :) and learnt how to show the application handlers for a particular file, I added support for thumbnail preview. Thumbnail extraction is expensive, so I made it so that the user (i.e. me) needs to click an additional link. Here is a screenshot,Of course, the user can remain content with only the regular beagle snippets (showing the highlighted text).
Ahh... I am a bit paranoid user of computer and like to keep everything under constant observation. Generally I use root-tail to display beagle-logs on my desktop. On similar lines, I added beagle index information and current-status information to the information tab.
Get the updated package here.

And one last-comment. I am putting all this online to break the myth that beagle is a gnome application. Actually, beagle is lucene-based personal data indexer written in C#. It happens to use gtk-sharp currently for some technical reasons, which I think can be avoid with some extra work. But other than that, beagle has no gui and thus not a gnome application. It is more of a service which provides C#, C, Python api for usage. Then whats up with the gnome-sharp dependencies ? It so happens that beagle is currently shipped with a prototype search GUI (best); best can be called a gnome app. If you want to taste beagle with only a minimum requirement of gtk-sharp and sqlite2, get this package. This is just a copy of my beagle directory. There was some change from mono-1.1.10 to mono-1.1.12, this package therefore needs mono-1.1.12 (unline the official beagle-0.1.4 release which requires mono-1.1.10). The package is merely a CVS checkout of beagle-0.1.4, and modified to drop unnecessary dependencies and changes for mono-1.1.12 added. To use that, untar, un-gzip it. Then run
  • ./ --prefix=/usr --enable-libbeagle --enable-python --disable-gui
  • make
  • make install
(change --prefix= to proper prefix)

Wednesday, December 21, 2005


Famous beagle-turned-googler Jon Trowbridge commented in the beagle-0.1.3 release notes ... This release also contains our new Python bindings, courtesy of Raphael Slinckx. With them, you can easily access Beagle search results from any Python program. Let the hacking begin...

So, I thought - why not! Following his advice would also be a nice way to say thanks to him. After a few days of effort, I came up with a basic, working version of yet another Beagle (search) interface aka yaBi.

Given my 0-exposure to Gtk and that this will be my first attempt at python (a previous attempt to hack bittorrent source code didnt work out), I chose an easy way out. Copy paste the pybeagle example code into a pykde program. So, yes, sorry to offend other, but this is PyKdeBeagle app. Here is the script and other files which I will keep updated as I find bugs during my daily usage. And for the impatient, here are the screenshots:yaBi starts with the help tab open. It lists the query syntax, what keywords can be used for searching and ways to do complicated query
A search for 'yabi' among all .jpg files. The Summary tab provides a summary of the search like the time taken and number of hits in each category.
Lets check the results among "Files". All the fancy gui stuff is done using the fast and snappy KHtml. All the designing is CSS; which means the result pages are skinnable in an infinite number of ways. Lets check out a particular result:
This one looks like the one I want. Clicking on the filename will open it in the default application. For more, click on "More actions..."
yaBi finds out the associated applications for this mimetype (you know, the ones in the right-click context menu) and show them. Use which ever one you like. Lets try another search, this time for mails on beagle 0.1.3 from Jon between 2005-11-30 and 2005-12-10 (also added source=KMail for fun).
Hmm ... only one result. Lets check that.
I already clicked on the [+] to the left of the subject to expand the properties box. Looks like this is the correct email. Simple to guess, clicking on the subject opens the mail with KMail.

The categories are incomplete and are what I use. I will gradually add the others. I have no clue how to handle IM conversations though - never used them with beagle.

There were some bugs (including some crashers) in pybeagle/libbeagle. Thanks to Joe for fixing them today. Thanks to Raphael for his awesome python bindings for beagle.

And lastly, python is cooooooool.

Monday, December 5, 2005

Beagle and Konqueror browsing history

What was the webpage that you visited yesterday on acpi and power buttons ? Dont remember ? No problem if you are a friend of Beagle. Beagle already knew how to index your firefox webhistory. Now it will also remember konqueror browsing history. Hooray!

PS: There is a copy-paste bug (due to me :( ) in the Makefile of beagle-0.1.3 which causes the konqueror backend to not build and install. Use the CVS version, it contains that fix and a couple of other fixes.

Monday, November 28, 2005

Some cool apps without which linux will be boring

(courtsey Friends, Blogs and Slashdot)

* Yakuake: Already wrote about this. Its very convenient when you need a terminal to check something simple or just give a few commands. Always ready for service. Briefly, its a terminal that is always present when you need it and absent when you dont need it.

* root-tail: I was checking out programs that could show me the last log entries (from syslog and other logs, includeing beale logs). I always like to know whats going on with my computer. GKrellm is awesome but sadly it cant show the lines from log files. I probably throw a glance at gkrellm every couple of minutes. Now with root-tail, I can see my logs without any extra effort. Briefly, its like a transparent screen-wide log-watcher. Oh... time to check the desktop again - if anybody is trying to force entry into my machine or if beagle indexed the webpage that I just visited.

* prelink: Simple, prelink binaries to reduce startup time. Google for more.

Sunday, November 6, 2005

Defn: [Geek]

From How to Manage Geeks,
According to the traditional stereotype,
geeks are people who are primarily fascinated
by technology and its uses. The negative part
of that stereotype is the assumption that
they have poor social skills. Like most
stereotypes, it's true in general -- but
false at the level of specifics.
By society's definition, they are antisocial.
But within their own community, they are
actually quite social. You'll find that
they break themselves into tribes:
mainframe-era graybeards, Unix people
who started out 20 years ago,
the new PC-plus-Web generation.

A nice article overall :)

- d.

PS: Watched "Iti Srikanta" yesterday. Nice art film, literally.

Sunday, October 30, 2005

desktop search (read beagle) vs web search (google)

Its been 5 months since I was introduced to beagle and started using it. And thanks to Joe, Jon, Daniel, Fredrik, Varadhan (and many others), beagle is quite mature now. They would say (and me too) home-use safe.

Hanging out in beagle irc channel and sometimes fiddling with the code has given me quite a good exposure of beagle internals. I liked it. With the C bindings (libbeagle) and python bindings (pybeagle), non-C# users can also create cool apps for beagle. I am waiting for somebody to write a kicker applet.

Anyway, I am recently feeling a bit separated from beagle. I was inclined towards beagle because I had to search something and I wasnt sure where to grep and what to locate. But for the last few months, I have hardly used beagle to find something in my computer. On the contrary, I use google probably 100 times a day or more. Why is it that searching in my files is so less infrequent than searching on the web ? It might be that its only me. A computer science research student doesnt need to find a lot of stuff (e.g. papers) among his own files. For him, a lot more is available on the web. So for me, I dont search a lot in my files not because I dont have the tool to search but because I dont have the data to search. Given that desktop-search is the new buzzword in the town, I just hope not many people are like me.

- d.

PS: Next in coming, more KDE support for beagle. Konqueror web-history indexing, Konqueror Bookmark indexing and (probably) thumbnail preview for best results in KDE!!! Stay tuned.

Friday, October 21, 2005

beagle superkaramba

python bindings for beagle is done. Fancy stuff should start pouring in like kicker, gnome applets, superkaramba widgets etc...

[kblogger] test-2

I think I understand the current problem. lets see if this helps :)

last post from kblogger was horrible. lets see if this one work ok.

[kblogger] test

Monday, October 17, 2005

Yeah Quake!

One word YaKuake.

I dont need to click the xterm button or konsole button now and then, type a 1-2 line command to do something and then close it. A konsole is just an Window key.
I dont need the window, better than minimizing - press the window key once again - it hides smoothly.
The hiding and reapperaring animation is pretty cool.
I have access to the same terminal (which can open multiple tabs, btw) on every desktop.
Less number of konsole running, so less resource wasted.
I have my animation time set as ~50ms - so I get the terminal (its already preloaded) without any significant lag (for konsole and even with xterm, it took ~1 second to launch).
And many more ... give it a try. Visit kde-apps for packages etc.

Vim Emacs flamewar

I always like to get in the middle of Vim-Emacs fight. Of course I am on the Vim side. Yesterday, Vim 6.4 was released. And what made me laugh ? The following post from slashdot:
Look, as good as vim could be, at this rate, you are not going to catch up with emacs, which is already at version 21.x or something. Which just proved that emacs is much better. If you don't believe, here is some proofs:

1- Emacs has a much higher version number, which proves to be a more mature software, which proves to be better (more mature is better)

2- Even an icon such as RMS whom has been proved to be more intelligent than the average USians, uses Emacs. This shows that smart people always make the right choice, and in reverse, proves that Emacs is better than Vim.

3- Everyone in Cryptonomicon, which is the bibile of all geeks, uses Emacs. We even have a module for encryption. It would take a long time for Vim to catch up to that kind of functionalities.

4- Only in Emacs can you do Ctrl-A to move the beginning of a line. In one shot. How could you do that in
Vim? You have to Esc, then press 0, which is lame. Which just shows how advanced Emacs is in terms of maturity and functionality.

5- As the theorem goes, computer science is a science for minimizing keystrokes. Emacs, in contrast to Vim, can prove this theorem right. Emacs users press less keys than Vim users.

6- Humans have 10 fingers (some may have more, but I don't know how to grow them), and Emacs allows you to use all your fingers at one. Which shows you that Emacs has a better human user interface. In contrast, Vim users can only type one key at a time, which has no concept of fingers. That is like an interface for dogs, which can only press one key at a time with their paws.

7- Emacs allows users to stretch their fingers more, and finger exercise has been proved, again and again, scientifically, to help increase human intelligence. The more you use Emacs, the more you become intelligent. Unlike Vim users, who become dumber and dumber, and end up with paws.

8- Everyone knows that geeks do no exercise. But we Emacs users have our daily dose of finger exercise. As a result, Emacs users have better shape. Take a look at the comparison: RMS (Emacs user) vs ESR (Vi user). RMS definitely looks better, with a nicer beard too. ESR can only have a lousy Asterix moustache. And look at what these two persons said in public, which just proved points 2, 6, and 7.

9- Look at this deductive proof I'm giving right now. Only an Emacs user can attain this level of intellect.

10- As a result of the last 9 points, this proves that Emacs is better. And from an evolutionary point of view, Emacs is like modern humans, and Vim like chimpanzee.

* putting on flame suite *

Tuesday, October 11, 2005

Duff's Device

I thought I was quite good in C. Duff's Device got me wrong! Check the wikipedia page for details; the original post is here. This is what it is, in brief.

Consider the following function in C to copy count integers from from to to:

void copy (int *from, int *to, int count)
do {
*(to ++) = *(from ++);
} while (- - count > 0);

This requires count comparisons. One way to cut down on the number of comparisons is to use partial loop unrolling:

void copy (int *from, int *to, int count)
int n = count/8;
int rem = count % 8;

// copy rem times
do {
*(to ++) = *(from ++);
} while (- - rem- > 0);

// copy 8*n times
do {
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
*(to ++) = *(from ++);
} while (- - n > 0);

Tom Duff had this ingenious idea of exploiting case-fall-through behaviour of C switch-case statement to write a smaller code:

void copy (int *from, int *to, int count)
int n=(count+7)/8;
int rem = count % 8;
case 0: do{ *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
}while(- - n > 0);

While you are trying to understand whats going on, let me answer the first question covering your mind, Yes! This is a prefectly legal C (even more, legal C++).

Thursday, October 6, 2005

Saturday, August 20, 2005

Carmacks number

News: Quake-3 source code has been officially released.
Interesting consequence: I come to know about Carmacks number.

In brief, this function was found in the source code of Quake-3 (in 2002, when they released the source code sans engine) to find (read: approximate) the inverse of the square root of x:

float InvSqrt(float x) {
float xhalf = 0.5f*x;
int i = *(int*)&x; // get bits for floating value
i = 0x5f3759df - (i>>1); // gives initial guess y0
x = *(float*)&i; // convert bits back to float
x = x*(1.5f-xhalf*x*x); // Newton step, repeating increases accuracy
return x;

Its basically two iterations of the Newton method - the interesting line to note here is the value of the initial guess 0x5f3759df. This was used by one of the authors of Quake-3 and might not be the great great great Carmack himself but generally attributed to him. Isnt is amazing ... this number hack! Its a pretty unique number - so Google it to find more.

- d.

Wednesday, August 17, 2005

KIO magic

In short its a pandoras box. KIO slaves are wonderful things; it is sad that they are not advertised that mush. KDE can appoint Apple to promote KIO and I bet it will be instantly hotcake.

Two KIO slaves that I recently came to know of:
- locate: - yes, it gives you the obvious extension of locate to konqueror
- newimap: - and yes, this gives you the ability to check and show imap mails in konqueror

Now I will periodically scan the kio protocol database to find cool stuff... That gives be an idea - how about a beagle: kio slave. Hmm... lets see. Keep watching this space.

- d.

Wednesday, August 10, 2005

thumbnail preview of search results in beagle

Beagle doesnt show thumbnail of all retrieved search results (e.g. for HTML, PDF, txt files). This patch (based on Nautilus code) does half of the required work. It shows a thumbnail of the file if the thumbnail exists (i.e. if the file has been previewed by nautilus or konqueror before).

As you will see in the code, the patch tries to create the thumbnail if it doesnt exists but for whatever reason I dont understand, it fails to create a new thumbnail, everytime. Boohoohoohooho...

Beagle advanced/Keyword query

Added support to Best (beagle GUI client) for querying via keywords (aka Advance Search) i.e. based on title/author/mail_sender etc.

Details at bugzilla. Here is the patch.

Happy beagling,
- d.

Sunday, August 7, 2005

End of a Chapter

Today I returned the XBox DVD for Warrior Within. It was comfortably halfway through it, thouroughly enjoying it and was so much into the game. But yesterday after I finished one of the levels, I just felt tired and decided to return the game. Maybe its one of my usual slump-period looming over or maybe I have played with a companion, someone to enjoy the game with me or maybe I have become tired of computer games. Whatever is the cause it means a lot of freedom to me, currently. I dont have to rush home to play the next level nor I have to dream about the fighting styles and waste my dream. And of course, that means I can understand where naive explanation of causality goes wrong in Quantum computing.

- d.

Wednesday, August 3, 2005

Yuppie - nerd :)

Took areqgrfg and scored
My computer geek score is greater than 79% of all people in the world! How do you compare? Click here to find out!
. Hah!

Tuesday, August 2, 2005

beagle kmail/maildir

repolished (but still with a lot of debug messages and comments) version at

Saturday, July 30, 2005

Great day and horrible night

Yeah... at last defeated Shahdee (ref: Prince of Persia Warrior Withing) in the hard mode. None of the suggestions of the forums worked. At last I got tired and watched her fight for quite a few minutes (while blocking myself from her blows ... and rants) while deciding upon a style myself. And that worked :) - hit her right after she finished the deadly combo (in which she ends with a strike down). That way she doesnt get enough time to block herself (yet she managed to block quite a few times). Anyway, and then the crow master fell off the ledge hahahhahhahha (I myself fell quite a number of times). Couldnt believe that the crow master himself cant fly. Good for me. Played for sometime after that. Boy, the ninjas are great. The jump all around (and sometimes over) me and I had to be real quick to eliminate them. The shadow guards are stupid ... they are annoying but disgusting. Realised that taking them my throwing daggers or axes are probably easier.

That was the good part. The bad part was after that... couldnt sleep for a couple of hours. Kept dreaming of the game. I dont know what to call them - dream or nightmare ? Anyway, it was over by morning.

Found two great torrent sites for bangla movies and music. Find them yourself :).
The Maildir backend is nearly done. Should be able to submit a first revision tonight or tomorrow.

Thats it for now,
- d.

Wednesday, July 27, 2005

beagle maildir : try-1

Try 1 to search maildir (e.g. kmail) mails with beagle. This is basically a wrapper around FilterMail so that the mails get indexed as type message/rfc822. It seems to work for me. Let me use it for sometime - if it works without any serious bug (I dont know why, but the number of mail messages indexed is 1 less than the number of files *scratching head*), then adding a mailcrawler would make it more or less complete. Try it here.

If anybody (other than me :P) actually uses it, do let me know any problems or suggestions. In the meanwhile let me get the opinion of experts at dashboard-hackers about potential problem of this approach!

- d.

Sunday, July 24, 2005

Boo hoo ... awful player...

prince of persia - warrior-within : toughest game played tilll date. and
that also on an xbox for a pc-gamer. Its so different (and difficult, tho'
its not any excuse). The raves are pretty stupid. You can kill them any
way you like and try various combos (they are no fun). But Shahdee is
giving me real headache. Have been able to defeat her only in easy
setting; in the hard setting, nops, I was able to take out a maximum of
1/third of her health. Everytime I hit her, stab her, kick her and then
she starts her combo, gets near me (or rather, I somehow end up close to
her) and just finishes me off - no matter what level of health I have.
The Crow master is relatively easier. (Why does the IGN FAQ by nifal say
otherwise... :-o). Anyway a few hours afterday was spent after that.
Today need to finish off grading, do some research stuff and work on a
kde beagle applet.
Oh wait! Thinking of biking to Logan airport and back. Lets see... will
keep you updated. Stay tuned!

- d.

Friday, July 22, 2005

Today is a bad day ...

Just got this email from bugzilla while I was working to add deletion support in the backend. Guessing since nobody will probably use beagle to search for akregator feeds (other than me, of course) and the current indexer can do without deletion support, I will stop working any more on this.

- d.

Thursday, July 21, 2005

beagle and kde

Using kde konqueror to open search results of beagle and using kde mimetype information. Use the file here - Tile.cs. Comment the lines marked with noKDE and add the lines ended with // KDE.

This approach opens everything using kfmclient exec "file_or_directory_name".

- d.

Wednesday, July 20, 2005

index and search mails in pine

Khoj! search - the new way of life. Information is all around us - just grab'em. Smart and not-so-smart people differ in their way of searching. Apple dashboard, GNome beagle, KDE Kat and M$ WinFS (with whatever engine) are players in this new game. (I am providing no links - just google them).

I use pine and kmail. While indexing and searching kmail mails via beagle is being worked upon I hit upon this wonderful tool called mairix. Its wonderful. I created a separate folder to store search results and added the folder to its own collection. Also I have interruption (Ctrl-z) enabled in pine. So now to search I press ctrl-z, that takes me to the shell, I use mairix to search whatever I want and then use fg to go back to pine, go the search results folder and read the results. Isnt that sleek!!!

- d.

Saturday, July 9, 2005

Akregator backend beagle

Now I can use beagle to search my akregator feeds. yahoo!!!

- d.

PS: BTW, i recently fried my hard-disk (without any of the traditional Indian spices). So now it only works after I cool it for an hour or so. Should I buy a freezer (that might be cheaper than another h/disk).

Thursday, May 19, 2005

KNotes Again

Tomorrow I am leaving for a 5 week vacation. Probably wont be blogging till I return (unless I think of posting some nice juicy rasagulla photos; OMG - there is no wiki entry for Rasgulla!!! Somebody please add).

So to find further news about the looknfeel update of knotes (Kudos to Michael), look here.

PS: I checked Prince of Persia 3 (or POP-6) videos yesterday. They were soooooooooooo good that I had to download POP-5 Warrior Within demo-2 and play/finish it yesterday night. Wish I had a decent video card/laptop/console ;-). Ohh.. wait, with XBox 360 around the corner delivering 1 Teraflops I should start saving money.

Beagle and JPEG Comments

Yeah you might have guessed it ... I am using Beagle extensively to find stuff amoung my photos and PDF papers (I would also love to use it for KMail mails and source codes but due to lack of space all source code reside outside my home directory).

Anyway, I use digikam for digital photo management - it can do more or less all the basic stuff. I generally add comments to some of the images via digikam and I would like beagle to index the comments in the photos. Unfortunately beagle-0.0.9 doesnt do that. Hour long of investigation revealed that JPEG files can have comments in multiple places. Digikam adds comments as JPEG comments and Beagle used to index only the exif comments. Quick patch followed.

- d.

Friday, May 13, 2005


A post from Your Hard Drive Lies to You

I really hate this damned machine!
I wish that I could sell it.
It never does quite what I want,
But only what I tell it!

Saturday, May 7, 2005

cpu speed control

I rarely use my laptop as a mobile device :-( but still I would like to scale its CPU speed according to its load. Till today I used to use cpudynd (or manually set the throttling via klaptopdaemon). Upon doing lsmod recently I noticed a whole set of modules called cpufreq_ondemand, cpufreq_userspace and cpufreq_powersave. While I knew that my earlier kernel had the userspace and powersave governors (and I hoped that cpudynd used them) I didnt knew of the new ondemand governor.

Its an automatic scaling facility added in 2.6.9 which means that now I can get rid of cpudynd (one more startup service gone...). This page has a decent description and usage.

Keep your CPU cool,
- d.

Friday, May 6, 2005

kompose patch

Kompose allowed me to remove pager from my KDE kicker and save an inch of taskbar space. One thing I found lacking after that was my current desktop number. I became hard to know which desktop I am currently working in. I used some code from aKregator to patch kompose so that it shows the current desktop number on top of its systray icon. Its working for me at least (kompose v0.5.1).

- d.

Tuesday, May 3, 2005

ACPI Events bug fixed but not for me

I dont get any ACPI interrupts like lid events, power button events. They are however properly registered as wakeup devices as seen in dmesg:

May 3 17:38:36 dbera kernel: ACPI wakeup devices:
May 3 17:38:36 dbera kernel: LID PBTN PCI0 USB0 USB1 USB2 USB3 MODM PCIE

and in /proc/acpi/wakeup:

Device Sleep state Status
LID 3 *enabled
PBTN 4 *enabled

so if I open the lid or press the button I wakeup my computer. As a result, I had to use klaptopdaemon which just polled to find out when the lid was closed.

Months ago I checked out the kernel bugzilla and found that there is indeed such a bug. It had to do with the dell BIOS (I have the latest BIOS - A32 for my Dell Inspiron 1100).

I checked today and it seems the bug is fixed: using acpi_irq_balance as a boot param and with BIOS A38 (for Inspiron 5100). This guy claims to have success even for A28 BIOS for 5100. Sigh... I checked immediately, the kernel param doesnt help me with my A32 BIOS. My last BIOS update was months ago, its time that Dell comes up with a BIOS update. Hoping they do ...

- d.

Monday, May 2, 2005

A week l8r: beagle

Beagle is working nicely now. However, MDK2005 comes with beagle-0.0.8 which wasnt indexing properly. So, I had to upgrade to beagle-0.0.9. Since I also wanted to use the power of inotify, I upgraded my kernel from the default to (from cooker); uses inotify 0.21 which is required by beagle-0.0.9. Had to remove the .beagle directory ... and now everything is nicely indexed.

Need to figure out how to make some things work:
1) How to ask Best to use kde/konqueror to open the search results. Currently I dont use the Best GUI but use the command line beagle-query to search for files.
2) How to ask the indexer to index jpeg exif data. From the CVS it seems it does that, but beagle-query is not returning the appropriate results.
* Initially beagle indexer was not indexing jpeg files, and the log file at ~/.beagle/Log/current-IndexHelper showed: System.DllNotFoundException:libexif.dll; I had to install libexif-devel (according to this chat-log)
3) mono-1.0.6 is a bit slow; but that will probably improve with the later releases.
4) Find out how to enable indexing of mails :P

Thursday, April 21, 2005

Disaster Struck! and Recovering...

One fine morning one of our main servers went down... so I thought why not upgrade to Mandrake 10.2 (I still like this name against Mandriva). Can you see the clouds lining along the horizon!!! Not even a week Mandrake 10.2 (or Mandriva LE2005) has been released, I am yet to read a review (not even an amateur review). I already had Mandrake 10.2 beta running (more or less OK) on the my test partition. Disaster struck when I decided to upgrade my working partition from perfectly running Mandrake 10.1 to Mandrake 10.2.

Install procedure: There was nothing wrong in the installation procedure; I am just including it here for completeness. Note that, Mandrake is yet to release CD ISO images - the new release is only available via ftp (for free access). I used the standard urpmi approach:

  1. Added Mandrake 10.2 sources (and PLF sources too so that I can upgrade all of them) from EasyUrpmi. While adding the URLs, replace official in them by devel. The files in official are broken (read in /.).
  2. If you havent done this before, add the PLF signing key.
  3. urpmi urpmi
  4. Logout from kde. Go to text console, log in as root, stop X (e.g. init 3). Rest of the commands are to be given at the console prompt.
  5. urpmi --auto-select --auto
  6. It will automatically update all your packages, except the kernel. Look out for missing file errors. In case of any missing file, get the file manually from any other mirror and install maually.
  7. urpmi kernel - get the standard one - 2.6.11-6mdk-1-1mdk
  8. Fix lilo.conf with any additional kernel parameters and reboot.

Okay till now. It booted fine (nice, transparent lilo choosing screen). At the kdm login prompt, somehow the display (rather the fonts) didnt look fine. They looked a bit fuzzy. Anyway, went ahead and logged in as my test user (in case the user explodes, I dont want to loose my data :) ). The font problem continued. Rest were OK. Logged out and logged in as me. Hmm... fonts dont look good. Tweaked with the anti-aliasing settings, hinting setting, changing the fonts, sizes ... nothing worked.

Fixed it now by using Freetype-2. Followed the steps of this page and to some extent the font settings from this page. BTW, I found that freetype with anti-aliasing looks better than freetype without AA, so I left AA on. Look for yourself.

Original font rendering. Look how the curved letters like "o", "s" etc. are a bit hazy.

After making the changes (with AA turned on).

Freetype without AA (using Tahoma).

Freetype and AA. Current settings.

Next thing to test is sleep/hibernate. Suspend to ram (S3) works as before - still the video reinitialization tool (video_post by Venki) is needed. Major problem with hibernate/suspend to disk(S4/S4b). Resume from hibernation doesnt work - no matter what I do (tried all the possible suggestions from different forums, faqs). At last, following a bug report, installed the mm-kernel It seems that is the only rescue as of now; once I fully recover from the upgrade-trauma I will try the latest kernels to see if the bug is fixed. The mm-kernel works OK and everything works (in fact, there was an earlier bug due to which lid-opening events were not caught properly and I had to manually press the power button to wake it up from S3; now just opening the lid wakes it up).

Oho, suspend and resume works but USB mouse (havent tried other USB devices) doesnt wake up from sleep. Replugging it seems to make it work. Had to change the script to modprobe -r uhci-hcd; modprobe -r echi-hcd before and modprobe uhci-hcd; modprobe echi-hcd after both S3 and S4 sleeps.

With 10.1, whenever I inserted a USB pen drive or my USB camera, an icon used to show up on the desktop. 10.2 uses KDE3.3.2 (backported from KDE 3.4) - and uses hal and it is supposed to improve the behaviour a lot. Now I have to turn on "Show unmounted hard disks" in control-center so that a desktop icon shows up when USB devices are inserted (as a result, my linux partitions also show up on desktop which I dont need nor like - but I guess I will to fix them later).

Having the annoyances mostly removed, I should mention that I installed beagle. Its great and once I figure out how to open up files/directories from within beagle, it would become indispensable.

Thats it for now,
- d.

Thursday, April 14, 2005

Colourful knotes

The default knotes is pretty stupid looking. I was looking for a chance to make it better (read: suitable for my taste). As usual Qt3.0 became the obvious bottleneck. Anyway, managed to do it at last. Now it looks quite okay to me (the screenshot is excessively colorful - my default color is lightyellow and pastel shades).

- d.

PS: the image of the pushpin is from google image search. I should have acknowledged it and verified that it not copyrighted. But I dont remember from where I got the test image - if anybody has any objections, I wont use it anymore.


Many times I encounter nice quotes/comments/sentences which I wish I could jot down at some place. Why not use ny Weblog to do so ? That way I can collect them later.

From /. entry of Linux_Cant_Kill_Windows by Noksagt:

I use Linux on the desktop... A long-time colleague in an adjacent office walked in, glanced at my desktop, and said "I thought you ran Linux".

After Quote (Context):All I had displayed was the fluxbox window manager with firefox, gvim, and a matplotlib window from a python session. I had to switch vterms to convince him, as I was running Linux, as he also assumed Linux was all CLI. He should've known better too: He wasn't some PHB, but someone who used X11 and fink under OS X!

Sunday, April 10, 2005

kubuntu: Try-1

Tried kubuntu 5.04 live-cd today (actually wanted to see the inbuilt compositing of kde - how does the eye candy do on my 845GL). More or less OK. Enabled transparency/shadows are things are pretty much OK (didnt crash during the 30 minutes I was working in Kubuntu).
I was using the live cd, so I had to fix a few of the default settings (below), but other than that Kubuntu lived up to its reputation of flawless hardware recognition (ummm... perhaps my hardware is pretty common, recent Mandrakes did the same too).
  • Anyway my first reaction was the small vga boot screen - used live vga=791 as boot parameter for subsequent times.
  • Next, X server started in a small screen. Changed the /etc/X11/xorg.conf file to add Modeline:
    ModeLine "1024x480" 65.00 1024 1032 1176 1344 480 488 494 563 -hsync -vsync
    • If the modelines arent proper, you would see the following in /var/log/Xorg.0.log
      • The resolution you want (e.g. 1024x768) is listed as "*Mode ... (1024x768):" - so the video card can support this video mode (look for the '*' before 'Mode'; only "Mode ..." means that video mode is unavailable).
      • But, right after the mode listing you will notice that the monitor rejects this mode
        not using mode 1024x768 (no mode of this name)
  • Also, fixed the hsync and vsync values (ubuntu used values for a generic monitor). For my Dell laptop panel, they were
    HorizSync 31.5-48.5
    VertRefresh 59.0-75.0
  • Enabled Composite extension.
    Section "Extensions"
    Option "Composite" "Enable"
  • Logged out of Kubuntu and then used ctrl-alt-backspace to restart X.
Didnt have much time to test the other features of KDE 3.4. Will do so (and report interesting findings, if any). But I did make one observation, the eye candies are good. Gradual menu opening, smooth window appearing but all of these come at the cost of time. Without any animation, the menu, windows would show up instantly and now with them, there is some delay before they are fully displayed in a usable state. It looks like I wouldnt like these fancy animations (as I didnt like the minimization genie effect of OSX). But its too early now - let me install KDE 3.4 fully and let it speak for itself.
Thats all for now,
- d.

Saturday, April 9, 2005

Adding fade-effect to kslideshow

I recently transferred some amzing photos from my long-term buddy Siddhartha Saha. What better use could they be put to other than using them as slideshow screensaver. And KDE screensaver comes with a kslideshow (/usr/bin/kslideshow.kss) which is just the perfect slideshow screensaver. Well, not quite.

kslideshow contains all the fancy inter-slide transition effects, horizonal lines, blobs, chessboard, spiralling ... except, the smoothest one - fading. While xscreensaver-gl is a much improved screensaver with fading and other fancy effects, it didnt make sense for kslideshow not to have this effect. One night of Qt-trial-and-error made me realize why this is the case.

First, I got the kdeartwork module from kde CVS. The kslideshow.kss source is in more or less contained in slideshow.cpp. Highly undocumented with quite short variable names; still it didnt take long to understand how the various effects were implemented.

Ended up after adding three effects (also removed the lines which randomly chose transitions - I fixed it to only one specific transition).

1. Added a different form of vertical lines transition that was fading. Currently I use this transition for kslideshow.

2. Added a true fading transition by adding alpha transparency to the previous image and adding alpha opacity to the next image, in small steps. A bit of qimage and qpixmap manipulation. Soon came to realize that manipulation alpha on a qpixmap requires visiting every pixel and manually adding alpha value. Boohoo... cant just set a transparent qbrush and paint the image with that brush. Optimistic me is waiting for Qt 4.0 which has transparent qbrush and qpen - giving the much sought after effect of transparent drawing. Anyway, visiting every pixel to change the alpha (found that I need to change alpha in steps of 8 from 0 to 255 to achieve smooth blending) is a bit too much (even on my modest 1024x768 desktop). The effect is cool but unusable due to high CPU usage. OpenGL based texture manipulations or smarter way of adding alpha to a few pixels at a time might give better performance. I will have a better idea when I fund out how xscreensaver-gl looks like.

3. Added a sweeping fading separator between the two images. Nothing great. I was just trying to see how I can get away by manipulating only a few pixels at a time.

I had in mind to change the kslideshow configuration to allow the user to choose which transition(s) he/she wanted. But now I dont feel like doing it - lets wait for Qt 4 when the alpha blending can be actually used.

- d.

Tuesday, April 5, 2005


While writing C-code, I frequently needed some local variable to temporarily store some value or create arrays with size fixed at runtime (not using malloc). The dirty workaround I used was the scope trick.

void f() {
int b,c;
/* large code segment */

int temp = somefunction(b);
/* avoiding calling somefuntion multiple times */
c = (temp > 0 ? temp : anotherfunction(temp));

Recently I was debugging some code where I saw a variable declaration in the middle of a scope (illegal in C89) but compiling perfectly with gcc3.4. That led me to C99. C99 has a lot of improvements - making life a lot easier for the programmers. For more, check the standards or look here. Just a side note, gcc 3.x supports C99 to some extent. To see the difference between the two standards, compile using gcc -std=c89 -pedantic file.c.

- d.

Saturday, March 26, 2005

Simultaneously LCD+CRT for Linux presentation

I know its stupid - it works for nearly all out there. It even used to (I think it did, though I have started having doubts) for me, some ~1 year back. Yet, the Fn+F8 key does not take me through the
"LCD (local laptop display) - LCD+CRT - CRT (external monitor, projector)"
loop. It only gives you only of LCD and CRT - which is OK for playing games on a large screen but not ok for presentation stuff.
Did some RTFM and here's the way to go (its video card specific - and guess what I have :-) - the poor-man's genie Intel 845GL). Add the following line to the end of Device Section in your xorg.conf file (/etc/X11/xorg.conf):
Option "MonitorLayout" "LFP+CRT,NONE"

One more excuse (for failing qualifier) removed. Yikes!

- d.

Thursday, March 24, 2005

Wobbly Window Day

Today is WWD. I read about luminocity today morning in slashdot. My quals got deferred one week and I couldnt wait to try this 0-day.
Just finished playing with it - its AMAZING! It really feels a lot different when you move the windows - they feel like "real" (and I really mean real) windows.
(Warning: the wobbly windows are very very addictive. Beware!).


Saturday, March 5, 2005

d-Randomized Thots

A detailed (no-techie) article on OS-X and KDE goodies. I am planning to write what I think gives my KDE3.3/MDK10.1/Dell-1100 an uptime of ... (The last time I had to reboot was to go the Mandrake 10.2 beta installation to test something). Suspend while in office and hibernate when not needed for extended amount removes any need to actually take the machine down.

I do have a few weird computer habits and systems under me are stress-tested naturally (for some reason I dont like opening for some app to start and sometimes end up starting 3 apps at the same time; huge file transfers and compile/build simultaneously is another way of having a bit of fun). It would be interesting to pen the habits (and motivations behind them, if any) ... the upcoming spring break should be a good time to do it.

- d.

Friday, March 4, 2005


OMG, I read about kompose, installed it (there is a mandrake rpm either in contrib or plf), removed pager from kde panel and (within 2 minutes) got used to it. Cant stayt without it now.

* No pager - more space on panel for window icons.
* I just mapped ctrl-1 (ctrl-one) to kompose. Instead of using ctrl-tab to navigate between different desktops, i just use ctrl-1. Works perfectly even when i have 6 different windows on all 4 desktops 8=).
* Further more, I can not only choose desktop, I can choose a particular window and further more, I even get to kill windows without actually going to that desktop. Isnt that handy ?

- d.

Saturday, February 26, 2005

Audio recording in KDE/Mandrake

I had a sudden desire to hear my own voice. Installed kdemultimedia-krec which contains the nice, small sound recorder 'krec'. The Krec gui seemed pretty intuitive but nothing would get recorded. I had always thought that the line-in/mic/capture etc. controls in the mixer (kmix) confuses me; 15 minutes of fruitless messing with them only added to my fear.

I have an onboard Intel Corp. 82801DB/DBL/DBM AC'97 audio card with pci-id (lspci -n) 8086:24c5. I use arts as my KDE soundserver. kmix (and alsamixer) both shows several input controls -
Line, CD, Mic, Video,...,Capture. In kmix, each control has
* a green LED at the top (showing whether the input control is turned off or on)
- there can be many controls turned on at the same time
- turn the input controls off (mute them) when not in use to prevent feedback noise (sound of typing, humming noise etc.)
* a slider showing the playback volume (which I guess, is the volume at which input audio will be played). The slider for the Capture control does not move in kmix but I can manipulate it via alsamixer to change the capture/recording volume)
- I noticed that if I set the 'PCM Out Path and Mute' control to 'pre 3D' (the other value is 'post 3D') then I whatever I say in the microphone comes out via the speaker (headphone). The volume of this feedback can be controlled (besides the normal Master etc. controls) by the slider of the currently enabled input control.
* a red LED showing the current capture source. There can be (besides capture control - it has be turned on to capture/record) only one capture control which is enabled. Turning one on turns the others off. (In alsamixer, use 'space' to set capture device).

Okay, now whats wrong with my krec ? It has VU-Meter on the main window which (irrespective of recording or not) shows the audio signal level coming in through the recording device. No activity was observed there. Since kmix was not allowing me change the 'capture' control I decided to fall back to the good old and trusted amixer. After a little playing, I could make it work. This is my working configuration (as seen in the output of 'amixer' - only relevant controls):

// line-in turned off
Simple mixer control 'Line',0
Capabilities: pvolume pswitch pswitch-joined cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Front Left: Playback 18 [58%] [off] Capture [off]
Front Right: Playback 17 [55%] [off] Capture [off]

// mic turned on, playback ... dont care, set as capture device
Simple mixer control 'Mic',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined cswitch cswitch-joined cswitch-exclusive
Capture exclusive group: 0
Playback channels: Mono
Capture channels: Front Left - Front Right
Limits: Playback 0 - 31
Mono: Playback 25 [81%] [on]
Front Left: Capture [on]
Front Right: Capture [on]

// capture control
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 11 [73%] [on]
Front Right: Capture 11 [73%] [on]

- I used
$ amixer sget Capture,0
to get the control details. To change/set controls, use sset as in this example
$ amixer sset Capture,0 80%,40% unmute cap

Things started working. Oh - after I heard myself in krec, I almost shouted (to myself) - "Slow down, dude!".

- d.

Thursday, February 24, 2005

KDE Performance Boost

My KDE installation is fast enough ... but who does not want more. Gotta play with it ... once I need to waste time.

Sunday, February 20, 2005

Bored ... understood font fundas

Bored ... need to do something other that working on the current proof. Options include

* Going out with the camera - its too cold outside. I cant manage the camera with gloves.
* Work on showing the access points in the right click context menu of kwifimanager. Its halfway done but once I start working on it, I wont have any work done tonight.
* Fine-tune my KDE 3.3.0/Mandrake 10.1 system. Vote for that!

I recently saw a couple of screenshots of OS X. One of the reasons their display look so smooth and nice is their text engine. Like Adobe and Microsoft, Apple has invested a lot in their text rendering. Anti-aliasing (AA), sub-pixel hinting and other sophisticated font technology give users a feel of ~1200 dpi print medium on their ~75 dpi (my Dell LCD panel) laptop display.

The recent mandrake distributions use fontconfig. One can use the KDE control panel or manually set up AA and hinting. I initially excluded AA for range 8-12pt but then didnt like it and turned on AA for all sizes. I also changed the menu/window title etc. fonts. Things look a lot smoother and better (for the eye too) now. One of the problem that still stays is the ugly bold font of the taskbar buttons. I could not find a font which would look good on the current button (with bold face) and inactive buttons (with normal face). Anyway - its not that bad.

And oh ... after you change the AA settings you need to restart the (relevant) app to see the change. For the taskbar (which cant be restarted that easily) you can just go to a text console (alt+fn+1) and come back or hide the panel and then show it; all of these will force font rendering with the new setting.

Back to latexing.

- d.

Saturday, February 19, 2005

Floating calendar - JS+XMLHttp+PHP+XML

Gone are the days of Websites and Webpages. Its all Web-applications now. And the recent hype seems to be centered around XMLHttpRequest and DOM,DHTML. From Google-maps to Switzerland-maps (doesnt use flash, XMLHttp but DHTML based tiling), new technology is creating richer and more useful web-content. I thought to have a quick glance at XMLHttp since I already have some experience in DHTML (this page was created when DOM was not in full effect and cross-browser coding was a major headache; so you need Netscape 4.7 or IE 5.0 to view this page. I did not update the page to use DOM so recent browsers will not work). But first I need to think of some useful application. Thinking... thinking... thinking...

How about a floating calendar. Like the one here (calendar icon at the top-left corner). I can put such a calendar on my blog page. At the backend I would just have to write a small tool to feed the events (that I want to share) to an (XML) file (which will stay on my server). So, whenever any user clicks on a date, the event information for that date will retrieved from the XML file via a (PHP) script using XMLHttpRequest which can then be displayed. Cool! I like the idea.

How should I start ... IE and mozilla have different ways of creating XMLHttpRequest object. And then again, for old browsers, I have to use the old style of accessing div. While its not impossible to write them from scratch, its easier to use an existing one. The rest was smooth. Created a simple xml event file and a simple php script to parse the xml file on request and retrieve the event for a given date.

Everything worked, except the most crucial part. I soon came to realize that under normal browser-security policy, XMLHttpRequest can only query the same server as the current web-page. That means I cannot have the events file on my server and calendar on the blogger server.

Without trying further, I put the calendar on my start page and stopped worrying about XMLHttpRequest for the time being. If anybody has a better idea (other than hosting my blog on my own server), please let me know.

- d.

Sunday, February 13, 2005

Linux yahoo messenger online contacts/friends are shown offline

Moved from Yahoo to Kopete.

Reason: The official linux yahoo messenger client has suddenly stopped working (strange that the other clients are still able to work). None of the online contacts are shown online. Only the 'idle' status is reflected but the yellow 'online' icon does not appear. Initially I thought it to be a gtkhtml... bug but later confirmed 'summary' tab that the client actually thinks only 'YahooHelper' is online and nobody else. Strangely whenever a contact comes online or goes offline I still get the notification messages.

Explanation: None :(! The ymessenger client stopped working suddenly... there was no update or install of ymessenger. I have also checked with old releases - same problem. The web-messenger is working properly and I guess the ports are using the web-messenger protocol. Its possible that yahoo (once again) changed their protocol. Till another version comes up... stuck with kopete (I somehow like the lightweight ymessenger over Gaim/Kopete etc.).


Saturday, February 12, 2005

Site design changed

Changed blog temnplate. The previous template used 'div's for content placement and there was some problem with firefox/win with overflowing contents. Should have changed the CSS ... but decided to go for a quick hack and used another template with contents etc to the right - so that overflow will be handled trivially :).

Friday, February 11, 2005

Solution to Firefox Problem - XDM authorization

$ ./firefox
Xlib: connection to ":0.0" refused by server
Xlib: XDM authorization key matches an existing client
(firefox-bin:4083): Gtk-WARNING **: cannot open display

Where did I encounter: My officemate has this problem (on his Suse 9.0 - 64 bit).

(Possible/Google-recommended) Solution Idea: Run firefox as root once (preferably first time).

Solution Steps:
(Commands as root are in Red, those as user are in black)
As the user, in the firefox directory
$ xhost +
$ su
< give root password >
# ./firefox
< if firefox starts succesfully, close it and continue >
# exit
$ xhost -
$ ./firefox

If any of the steps fail, then there might be a different problem. Try Googling again.

Wednesday, January 19, 2005

Tuesday, January 11, 2005

Random Thots of D

Another comparison of G5 vs Opteron here. More food for thought...

Thursday, January 6, 2005

Compute Bias

I have (atleast somewhat) experience on working on

Unix on Dec, Intel-machines

Linux on Intel-machines

Solaris on SPARC

Windows (on Intel)

OS-9.1-OSX.1 on (G3 and older)

Kind of covers a lot. And I should say I like all of them

* Linux - oh - I can control everything in many different ways, locally via well-organzed system management tools (I am a Mandrake user), from command-line when things are badly broken and even remotely when I cant even reach my machine.

* Windows - thousands of software, mostly What You Want Is What You See. Games, quick apps to create something. Any nice software is probably first available in Windows. Best of all, if something breaks in the huge mess, there is somebody you can blame.

* Solaris - The machines are a beauty - they look so professional. Kind of hard to manage - but never had to manage one personally. But the look and feel ... wow!

* Mac - Beauty ... its eye candy everywhere. Everything is so sleek, smooth. No wonder best in GUI.

My current work platform is an archaic 266 MHz Pentium Compaq desktop dual boot with MDK10.0 and W2k and a huge,ugly, heavy, bulky, low-end Inspiron 1100 laptop dual boot with MDK10.1OE/KDE3.3 and WinXP. I love both of them. But I should say I am a proud Linux (read: Mandrake) fanatic. And like many other fanaticism I have, I am terribly biased towards Mandrake on intel (havnt used Linux/PPC or Linux/AMD). No questions or arguments... Its my Bliand Compte Bias :)

You see, I like all the systems I talked about above. I like to use each of them for their area of expertise. But I am amused by how some people consider one better than other without giving reasons (NOTE:I consider Blind Fanaticism as perfectly good reason to like a system - only you have to admit that you blindly like it - no matter what come may). Recently I had the chance of talking to Vijay and Akhil Gupta (UMD => Google), both wannabe Mac-users. Both claimed they loved Mac/OSX but not blindly. Ding dong ... somebody finally has a reason :-).

Akhil's point was ... its stable and usable right out of the box (point against Linux) and yet has the power of command-line (Point against GUI based Windows). Hmm... valid point (by the way, its really hard to do all via console in OSX - except using Applescript - which is not really a command-line). Actually in that way, Windows also have a command line ... you can do all the basic file management, you cae use rundll32 for system management and use MS Developer tools link link.exe and cl.exe for coding.

Vijay is waiting for Powerbook G5 - his best bet for the best machine (hardware) with best OS and best GUI - furthermore all 64-bit so his huge network simulations and matlab will run faster. Hm... dunno about matlab etc... but I think one should use the departmental compute resources for these critical high-speed stuff. I doubt if G5 will be able to match any of our departmental linux-clusters or compute servers. And baat rahi Best hardware, its arguable if 64-bit can be readily used and furthermore ... one should start looking at the comparisons and discussions. This can be a good starting point. Best OS and GUI - well OSX is all eye candy but Windows-Blnds and Linux also has reached similar status (still some way to go) though the machines wont be as cute as Mac machines - guaranteed. About the OS specifically, I think Windows is a pretty good OS and Linux too (in terms of *OS*). Go through the various benchmarks available. After all OSX.* is Unix-based :)

I am myself biased towards a particular system ... but I admit it as well as I admit the good things about others. The bad thing is there are people out there who think e.g. Windows PCs are ultimate OR Linux is the best thing - as it is open source and bla bla bla .. OR Apple is the best company of the world because ... umm... others suck (or something similar). C'mon, choose your machine based on your budget and kind of work you do... and in that way no other combination will be better for *you*.

- D.