Virtually the best blog on the web!
Archive for August, 2005
Microsoft Job Blog and Other Blogs
Aug 30th
Since people often accuse me of hating Microsoft, I have decided to go a little easy on them. At one point, I have passionately advocated to use Linux and dump Windows. Sometimes, I even forgot that Linux has weaknesses. I still do advocate, but I only point out Linux’s strengths and weaknesses (gasp !) and leave the choice to the person. Isn’t that what freedom is about?
Microsoft has its share of shadowy marketing practices, but the tech people are simply amazing. Some of the MSDN blogs are really cool and have quite a good technical information. I like them more than the Sun blogs, because they talk about technologies that I cannot really touch and don’t have much experience. It’s cool see this WinFS video, where the developers are talking about their experiences. The blogs actually show the real environment in Microsoft: intelligent, tech savvy and down right geeky just like all of us Linux geeks. Nowadays, anytime I see a Slashdot post bashing Microsoft, I quickly skip it, because it’s just unbearable to watch a few Slashdotters spread FUD about Microsoft FUD.
One of the very high quality blogs I want to mention is the Job blog. It has a ton of useful information and a lot of Microsoft hiring personnel write informative posts. There are too many interesting tech blogs to mention. A few I follow regularly are below:
BTW, get the mplayer plugin to watch the videos within firefox.
Network Programming in the Kernel – my Linux Journal Article
Aug 29th
Ok, it’s official. Grab the latest copy of LJ to read our article about network programming in the kernel. Ravi and I explained in pretty good detail on how to create a network connection and read/write data from sockets in the kernel-mode. The sample code shows a basic FTP client that connects to a given IP address and downloads a file. The code can be downloaded from LJ FTP site.
There is, ofcourse always a debate on whether this should be done in the kernel, but I think there are situations, where you may want to do this. I have explained a few reasons in the kernelnewbies thread.
I think the article will be freely available online in LJ archives after a few months. Until then, you can devour the code at LJ download site, if you are not subscribed to LJ.
Is TLDP dying?
Aug 26th
TLDP, if you don’t know already is The Linux Documentation Project. It’s one of my favourite OpenSource projects, as I grew up with it. In the dark ages, when we had to muddle with XF86Config to get X working, TLDP had some cool HOWTOs to help newbies. I fondly remember the days when I scrolled through the HOWTOs in Lynx. I have learnt a lot by reading the HOWTO/Guides, and it compelled me to contribute a HOWTO for NCURSES.
Ok, back to the topic. Recently, there was a discussion about the lack of author response, and outdated HOWTOs on the TLDP discuss mailing list. As always, somebody proposed to setup a Wiki to correct all the problems, and had the audacity to say tldp might be dying. Natually, this started a flame war with others pointing out that this has been discussed at lenght many times, and it’s tough to find solutions. I have contributed my share of the flames
and posted a summary of the Wiki war. Stein Gjoen also did a review of Wiki, and concluded that Wiki is not yet ready for TLDP.
In my opinion, TLDP is a great resource, and even though some HOWTOs are painfully out-dated, there is still a lot of documentation that is of high-quality and well-maintained. Having a Wiki might help to bring a few HOWTOs back from dead as mentioned on the discussion list, but it won’t be a replacement for current state of affairs.
Snapshots: The Final Piece in the Puzzle
Aug 23rd
I have checked in a basic framework for maintaining snapshots in LFS, and this pretty much completes the SoC project as proposed (Woohoo !!!). I have sent a mail explaining the snapshot design to the logfs-devel list.
I was initially skeptical about the amount of work I could accomplish in two months, but everything pretty much went according to the plan. I have also done some preliminary performance tests, which can be seen here. A mail explaining the results can be read here
Cheers !
Managing Patches with Quilt
Aug 20th
Quilt is a handy script to manage a series of patches. This is especially useful, if you are maintaining a large body of patches that need to be applied in a particular order. Quilt can also be used to create a series of patches that can easily be included in a software. Linux kernel people recommend Quilt for creating patches and they want your changes to be in a series of easily-manageable patches. LFS in its current state stands at more than 4000 lines of code, and people will be annoyed if I submit LFS as a single blob patch.
However, there are no clear instructions on how to use Quilt for doing this. Well, Quilt documentation is well written, but it’s written from the perspective of a patch applier/manager rather than a patch generator. Here’s a simple tutorial for generating patches using Quilt.
The idea is to get a series of manageable patches out of your changes to a big code base. Let’s say you want to add something to the Linux kernel
- Get the original code and put it in a directory say
linux/ - First decide what patches should contain what changes. You should also decide the ordering, if that matters. Say you divide your changes into two patches
fs-makefile.diff # fs/Makefile, fs/Kconfig changes cfiles.diff # fs/lfs/*.c (new files)
- Cd to the codebase directory, and Create the first patch file using Quilt
quilt new fs-makefile.diff
- Add the files you are going to change
quilt add fs/Makefile fs/Kconfig
Note that this doesn’t really add the file to the patch. It only tells the Quilt system to manage it. Any changes you make to those files from now on will appear in the patches. Now, add/copy your modifications to these files.
- Do a
quilt refreshto actually create the patch. The patch is created in thepatches/directory - If the file you are adding is a new file, you would do the same thing. Since the file doesn’t exist in the tree yet, you have to explicitly name all the files. This is a little painful, if you have a lot of files to add. You would do something like
quilt new hfiles.diff quilt add fs/lfs/ifile.h fs/lfs/lfs.c ...
- After adding all the new files to the Quilt system, copy all your changes (new files) to the appropriate directories. Do a
quilt refresh, and all your patches are created in thepatches/directory - Now onwards any changes to those files are tracked by quilt. All you have to do is a simple
quilt refresh
There are a ton of useful options to manipulate the order, contents of a series of patches. Read the PDF documentaion for more details.
Quilt can also be used to post the patches to a mailing list. README.mail file in the quilt documentation directory (doc/) has the details.
Kernel Stack Fault
Aug 17th
Everyday, you learn a new way to crash your computer
I ran into the error shown in the left image, while meddling with kmalloc. Nice to see VMWare catch the stack fault, and show a helpful message. BTW, I have gone over 200 Oops, since I started hacking on logfs. Kernel hacking would be totally frustrating without the amazing VMWare.

Gruha Pravesam (Housewarming Ceremony)
Aug 13th
This was my dream for years, and we finally own a nice apartment in Visakhapatnam (Yay !!!). Traditionally, when we move to a new house, Puja is performed, friends and relatives are invited to the new house for a feast. The invitation is on the left side. It’s written in Telugu (a language primarily spoken in the state of Andhra Pradesh).
It basically says that my parents are inviting you to attend the Puja and feast in the new house on 16th August. The address is
Pavan Residency, Pavan Block Apt 2B Simhachalam Road Vizag - 29
Maan, I am soooo happy
I wish I can be there. I will post pictures of the Gruha Pravesam later.
More VIM Tips
Aug 12th
A few people have asked me a few questions about VIM usage after reading my previous post about VIM. Here they are with my answers.
- Show whitespaces
- There seems to be no particular option like
:set listfor showing white spaces. One can use a mapping like below to see the white spaces temporarilynmap <F2> :%s/ /./g^M # Note that you have to type CTRL-V,CTRL-M to get the ^M
Pressing F2 will show you the spaces as dots. Just do undo(u) to get back to the original text.
- Show trailing white spaces at the end of line
-
nmap <F2> :%s/ +$/ยท/g^M
- Switching off the smart indentation
- This is one of the few features I hate. VIM tries to move the text to follow an indentation pattern. For example, in an html file, if you type
<td> text </td>VIM converts it to
<td> text </td>Sometimes, this is useful, but other times it’s extremely annoying, especially when you have multiple nested elements and you don’t want to have indentation. This is almost like automatic capitalization in MS word. Anyway, this can be disabled with
:set nosmartindent :set indentexpr= # Note that there's nothing after the = sign
- Showing line and column number.
-
:set ruler
- Formatting Paragraphs
-
gqap
This is a pretty cool thing, that I use quite often. Often, you write a paragraph and insert a few things and it becomes ugly. Use
gqapto nicely format it depending on thetextwidth. This can also be used to change the textwidth of a paragraph. Say you wanted to change the textwidth to 60 characters, do this:set textwidth=60 gqap
I wish VIM guys spent sometime explaining cool features of VIM instead of adding new features. A lot of simple/cool things are lost in the sheer amount of options. I wonder how many people use advanced features like folding.
LFS Stable Version and Mailing List
Aug 11th
I have updated the stable version in CVS, with the latest and greatest of LFS. This stable version is pretty much a complete log structured file system minus the cleaner. I have a cleaner in the main trunk of the CVS, and if you are feeling lucky and adventurous try it out. It also requires no patches to the kernel, and should compile cleanly on 2.6.11. Follow the instructions on the LFS website for compiling and running LFS.
I have also created a mailing list for LFS development, and if you are interested in following the development, please subscribe here
Finding the RPM Containing a Particular Binary
Aug 10th
At times, you want to find the rpm that installs a particular binary. I was trying to find the rpm for latex, and was doing yum list "latex*" etc. Well, there’s a simple way to find out
rpm -qif <file name>
This will tell you the rpm that installed the binary. BTW, latex comes bundled in tetex-latex rpm. There are bunch of other cool options to rpm. Check the man page for details.