24 August 2009

13 steps

I was using the stair-case instead of lift, whenever possible, in my office, for the past couple of weeks. I park my motorcycle in 0th floor and my office is in 6th floor. Each floor has 2 stretches of 13-steps each. Even though there are even number of steps(26) between 2 floors, it was split in to two stretches of odd number of steps(13).

The problem with odd -number of steps is that, if you don't watch your step, you would make the first step with your dominant leg(say right leg) at each stretch by one-step more than the other leg. That would burden that leg by 1-step at each stretch. There are 12 -stretches to the 6th floor. so 12 -steps more than the other leg. This can create an imbalance and knee problems! Does Vaasthu take care of these stuff?

ஆயிரத்தில் ஒருவன்

2009AD. இந்தியாவிலிருந்து ஐ.நா வின் கப்பலில் ஆயிரம் பேர் இலங்கையில் நிவாரண பணிகள் செய்வதற்காக செல்கின்றனர். அதில் கார்த்தி ஒருவன். கார்த்தி விஞ்ஞானி. ஆண்ட்ரியா ஒரு மருத்துவர். ரீமா சென் ஒரு பாதுகாப்பு அதிகாரி. ஆனால் வழியில் சுனாமி தாக்குகிறது. இவர்கள் மூன்று பேர் மட்டும் யாரும் இல்லாத தீவில் கரை ஒதுங்குகின்றனர்.

அங்கே இயற்கையில் உருவான டைம்-வார்ப்(Time-warp) பாறை ஒன்று உள்ளது. அதில் உள்ளே நுழைந்து அடுத்த பக்கம் வந்து பார்த்தால் காலம் கீ.பீ 209ஆம் ஆண்டில் சோழ மன்னனுக்கும்(பார்த்திபன்) ஒரு ராணிக்கும் இடையே போர் நடந்து கொண்டிருக்கிறது. இவர்கள் ஒளிந்திருந்து கவனிகின்றனர். போரில் தோற்கும் பார்த்திபன் மற்றும் அவரது 17 வீரர்கள் சிறை-இல அடைக்கப்படுகின்றனர். கார்த்தி அவர்களை காப்பாற்றி மீண்டும் அந்த டைம்-வார்ப் பாறையில் புகுந்து இக்காலத்திற்கு(2007 AD) திரும்புகின்றனர். மறுபடியும் இலங்கைக்கு அருகே உள்ள தீவில் திரிகின்றனர். அப்போது புலிகள் பயன்படுத்திய ஆயுத கிடங்கு ஒன்றை கண்டு பிடிக்கின்றனர். அவற்றை எடுத்து கொண்டு பார்த்திபன் மற்றும் 17 வீரர்கள் மீண்டும் கீ.பீ 208 செல்கின்றனர். இப்பொழுது மாடர்ன் weapon-களை கொண்டு போரை சுலபமாக வெல்கின்றனர். இதனை பார்த்துவிட்டு கார்த்தி/ரீமா/ஆண்ட்ரியா மீண்டும் தற்காலத்திற்கு(2008AD) வருகின்றனர். வந்து பார்த்தால்...

இந்தியா உலகின் மிகபெரிய வல்லரசாக இருக்கிறது. இப்பொழுது நாம் பார்ப்பதை விட அறிவியல் மிகவும் முன்னேற்றம் அடைந்து இருக்கிறது! அமெரிக்காவில் லியோ-நார்டோ டி காப்ரியோ எனும் நடிகன் "10 incarnations " எனும் லோக்கல் மொழி படத்தில் நமது அதிபர் மன்மோகன் சிங்க் மாதிரி ஒரு ரோல் செய்கிறார். அமெரிக்காவில் உள்ள ஏழை மாணவர்கள், இந்தியாவிற்கு on-site வர துடித்து கொண்டு இருக்கின்றனர். office-க்கு, வேட்டி-துண்டுடன் formals-ல்தான் வர வேண்டுமா என இந்தியன்-embassy-il கேட்டு கொண்டு நிற்கின்றனர்.

மீண்டும் கார்த்தி அந்த டைம்-வார்ப் பாறைக்கு திரும்புகிறார். அதிலிருந்து வரும் காற்றின் கார்பன் வெளியீட்டை அளவிட்டு, future-க்கு செல்ல எந்த திசையில் செல்ல வேண்டும் என கணிக்கிறார். செல்கிறார். (முற்றும். கற்பனை: Nikanth, Sankarlal)

27 July 2009

ullae-veliyae: Live graphs for I/O, CPU...

Wrote a small utility to print live graphs of I/O per-process. Find more information here. As a bonus added graphs for CPU as well.

RPM can be found here: http://download.opensuse.org/repositories/home://nikanth/openSUSE_11.1/noarch/

08 July 2009

Atomic git

As I wrote in git-pull-mishap-and-git-clean, the problem with git is that, operations are non-atomic. For example, if a git-pull is interrupted, or fails due to lack of disk space or network problem, the resulting repository will be in an in between state. This is problematic. It would be nice if git operations are atomic, in this sense.

A solution could be to have the git repository inside another git repository. For example, have the linux-2.6.git repo inside another git repo, say git-o-git. When you do a pull in linux-2.6.git, and if it succeeds do a `git commit -a` in the outer git-o-git. If it fails for some reason, one can go back to previous version of linux-2.6.git repo by doing a `git clean -d -f` and `git checkout -f` in the outer git-o-git.

It should be possible to add wrapper scripts to `git` and do this auto magically. May be it could be called as git WC, as it is built on top of git porcelain, which is built on top of git plumbing commands. ;-)

Has anyone tried this already?

GIT pull mishap and git clean

When I was doing a `git pull` from a remote repo, I ran out of disk space, which resulted in errors like

Updating ce8a742..faf80d6
error: git checkout-index: unable to write file drivers/usb/gadget/s3c-hsotg.c
error: git checkout-index: unable to write file drivers/usb/gadget/u_audio.c
error: git checkout-index: unable to write file drivers/usb/gadget/u_audio.h


Freed some disk space and re-ran the `git-pull`. But it failed saying

$ git pull
Updating ce8a742..faf80d6
error: Untracked working tree file 'Documentation/ABI/testing/sysfs-bus-pci-devices-cciss' would be overwritten by merge.


Some of the files were created by the previous pull, but they are considered untracked files as the previous pull failed. `git pull -f` didnt help as git was reluctant to delete my untracked files.

Deleting huge list of files one by one was a pain. I was thinking of doing a git status to get the list of untracked files and deleting them. But Jony rescued me by telling me about `git clean` which can delete all the untracked files!

But I would really like to see a way to pull/checkout and over-write the untracked files, so that other untracked files, which will not be over-written, need not be deleted. Is there a way to do it?

17 June 2009

White ignored in India?

Four coloured tri-colour flag. (நான்கு வண்ண மூவர்ணக்கொடி)



Is it because white is not considered as a colour?



No. The wheel is not considered!

It is composed of three colours with a meaning and a navy-blue wheel in the center. Mexico and Croatia also have tri-colour flags with more than 3 colours! See http://en.wikipedia.org/wiki/Tricolour

13 May 2009

Cloning multiple git repos

Many of the maintainers of linux-kernel maintain a git repository. I usually have clones of various such repositories.

For example I have clones of
Linus Torvalds's repo:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Block Maintainer, Jens Axboe's repo:
git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
...

If I do individual clones of all these repositories, it downloads and maintains duplicate copies of same objects wasting disk space, and network bandwidth.
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
git clone git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git

So I was looking for a way to share the common objects so that duplicate objects wont waste disk and network. And no surprise, git has a way to do that. Just that I was unaware of a simple option, "--reference".
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
git clone --reference linux-2.6/ git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git






Difference between cloning Jens' git with and without --reference to Linus's git.

# git clone git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
Initialized empty Git repository in /home/knikanth/labs-sw/linus/linux-2.6-block/.git/
remote: Counting objects: 1180249, done.
remote: Compressing objects: 100% (295444/295444), done.
remote: Total 1180249 (delta 984716), reused 1073684 (delta 878311)
Receiving objects: 100% (1180249/1180249), 289.32 MiB | 496 KiB/s, done.
Resolving deltas: 100% (984716/984716), done.
Checking out files: 100% (27842/27842), done.
# du -sh linux-2.6-block/
714M linux-2.6-block/


# git clone --reference linux-2.6/ git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
Initialized empty Git repository in /home/knikanth/labs-sw/linus/linux-2.6-block/.git/
remote: Counting objects: 111061, done.
remote: Compressing objects: 100% (19021/19021), done.
remote: Total 100463 (delta 84138), reused 95679 (delta 79959)
Receiving objects: 100% (100463/100463), 23.21 MiB | 1209 KiB/s, done.
Resolving deltas: 100% (84138/84138), completed with 8189 local objects.
Checking out files: 100% (27842/27842), done.
# du -sh linux-2.6-block/
468M linux-2.6-block/




--reference automatically sets up .git/objects/info/alternates to obtain objects from the reference repository. Now I wonder whether it is possible to have circular references, multiple references, etc.. The plural file name, "alternates" suggests it should be possible, but "git clone" ignores multiple --reference on the command line!

BTW git uses SHA-1 digests to identify objects. I wonder what is the chance of a SHA-1 collision and how git handles it? The SHA-1 digest has 40 Hex-digits == 160 bits.. So at most, only 2160 objects are possible. :-)

10 May 2009

Mother's day story

The story that disturbs me the most.

A monkey and its baby were caught in flood. The mother held its baby above the water level. Slowly the water level raised. Knee level, hip, chest, throat.. the monkey dropped its baby in the water and stood on top of it.

Thats why they are called monkeys.