Affinity for processors

My old roommate comes visting yesterday and we have a technical discussion with exchange of technologies we’ve been experiencing.

So there is this taskset command on Linux which you can use to actually move a process to a particular CPU on your system. Thing is, these guys are using an OS called SixWind (also WindRiver) that is used to run on one out of the two cores on their machine. The other core is used to run other binaries which include their customized application and anything else that is needed. Essentially, the OS runs separately against the application helping maximum usage of resources.

Now I tried doing a taskset on my dual core CPU (in my lappy), for a process (a small executable having an infinite while loop). Turns out that the process at first instance doesn’t get allocated to the CPU. My roommate couldn’t figure out the anomaly here and left. I kept on to it cuz the possibilities were limitless. I kept on doing additional things, killing the process and experimenting with larger processes and real world applications – like Thunderbird and Firefox. Eventually, I figure out that it really won’t matter if I set the affinity of one process onto one CPU or the other. How it started to work was when I went into super user mode and started switching affinity for some of the k* processes. The whole thing crashed and I was glad.

I was more careful next time and started off with setting affinity for kswapd (which is seldom working). Then I wrote a bunch of programs (using some virtual memory code from here) and managed to see how kswapd was working very well on just cpu#1. There’s still some performance to be tested, but I guess that helped me in getting to a point where I could see that when I let Thunderbird compact folders and ran test programs, things were better than wehn there was no affinity.

Mammoth Justice

This toothed tower is in remembrance of an elephant-judge.

Story is that the Mughals used to let “the accused” into a field with an elephant. It is for the elephant to decide whether the accused is innocent or guilty. Stomping would mean guilty-of-charge and on some days it would let off. That tower with protruding teeth you see marks the grave of that elephant.

Glad to not be ruled by such idiots any more.

Prayers of Gold

There was dust and noise all around as she hoped that this would die down soon. No matter how close she got to the chief destination, the ache at the back of her head never did plummet. Then there was a white majestic structure in sight which put fresh hopes of surprise.

With washed feet and a covered head, she ventured into the world of “Ek Onkar” behind the white gates. The golden domes in sight, the water around them and a safe feeling of being in one of the world’s best managed temples had already killed the dusty images of Amritsar left behind.

Going around the beautiful real-gold-domes on the cool white marble she saw a kid seated on the ground with folded hands towards the temple. Devotion could lead the kid to deliver a cheque of £100,000 from his London residence, when he grows up to realize these prayers, to the temple – as many others have done (evident from the tiles engraved with such generous donations at the Prasad area).

The langar was a simple black dal, roti and rice with a kesari halwa at the end. That wasn’t a deterring factor to have it as there can be no better way to experience community power. A few servants at the langar drove into the temple in a Mercedez as the community would give back what it got – supposedly from God.

Taj Black

Just the way I saw it.

The only white Taj Mahal I have ever seen was a sketch in a 3rd Standard (Class 3) history book. I envy the author who saw “..the most beautiful building in the world set in pure white marble”.

Apart from the verses written all over the Taj, you could find news about Rajesh loving Zubina, Suresh’s love for Puja and that Zakir would be dead without Karishma. Witness an educated NRI howling at the top of his voice “Hello.. My name is Arvind…” inside the Mahal. Bet that his excellency would have been delighted to hear those echoes inside his grave.

The picnic would have been incomplete without a Lay’s packet being smuggled into the building and being spread open – accidentally – on the ground. The chips were further battered into pieces by people walking on them and some even taking pleasure to play a game of “Hah, I footballed those pieces at your legs”.

Why should you, then, go there? Imagine this – there’s a 400+ year old structure, costing more than $100 billion in asset value and it would go down in the very near future. Would you miss a chance to rub your hands all over the inside of it and have a royal picnic hangout with your buddies who would help you in eve-teasing foreigners? Come on, you would surely not miss trying to scratch some marble out of it as a souvenier – or just to prove to your family that it really is Iranian marble (after all, you have a doctorate in geology and Taj Mahal is an excellent experimentation device).

Curious incident of the dog..

An excellent read. I could not have read a better book than this one in quite a while. If you like reading stuff that is out of ordinary and breaks literati-set-rules then go for this novel.

My observation was that the author was clearly into his first project (and bang on). There were problems in between (plot becomes slow), but the surprises were very neatly set in to wash all that off.

I would give this book a 8 out of 10 on all aspects and would recommend it to be read by 16+ only.


Rewind to somewhere in May 2000.

I had a small pet project of converting all our Jagjit Singh audio CDs into mp3. I had access to a computer only during Summers and I had very little time (about a month and a half). So I would have to do too many things in much little time. I would rip the CDs using a primitive CD cutting software (AudioRipper may be) and then edit the mp3 tags in Winamp. There was CDDB sans Jagjit Singh. So I would manually look up track names on the back of the jewel case, type in and then use another software to submit data back to CDDB.

It became a tedious affair to tag the mp3s after they were created. Well, there was a (the real overture) in those days that helped me find a nifty utility called mp3tagEditor(beware of look alikes – there’s just one The damn thing was so awesome that mp3 conversion became my summer hobby! I wouldn’t mind playing with blade/lame as long as this coolio was around. (dbpowerAmp came some time in 2001 I guess).

Well, what makes me write this after 8 years at 3 AM in the morning is the fact that mp3tag editor has grown up with me! I just tried it (after a really long time; I decided to do some mp3 management). The bloody thing is so so awesome that you just have to kill yourself to dream of something that it can’t do. Floran (Heidenrich) is one awesome guy. I just wish all other software matured like this super cool utility. The only glitch is that this is still a Windows utility, and though I haven’t tried it, I hope it would run on Wine.

So what did I really like about it is the fact that when you do a Tag to Filename or vice versa, you’ve got some awesome functions, regexes and extra fields that makes it much more fun. Another thing was the inclusion of getting Tag sources using a “web search”! Just give it the album name and it would pick out a list of albums from the FreeDB and match against your files. May be there’s other software doing similar things, but nothing can be better than free, tried and tested.

Those Who Don't Speak

So how do you know if something out there is going to solve your problem? You would do a search across the web with keywords that the search engines would recognize, match with content and based on popularity (at least the major algorithms run that way) you would get results. Not all the results would apply to you and out of the handful few relevant ones, there might be little chance of pure success. Happens all the time.

Consider this. You work with some really smart people. You’ve got a problem and after you have unsuccessfully tried out web searches, you go out to these people. You would either mail a list or you might even go personally finding out answers from folks. The latter recourse is not in the best interest of everybody but it certainly helps you out. You get the answer from the guy who never speaks out on lists, Internet, doesn’t have a blog and might not even join group discussions happening nearby. He only speaks when there’s a one-on-one and he definitely knows stuff. The vessel is full and doesn’t make much noise.

This is incorrect. One-on-one is good for the two people involved but then there is a void for everybody else. Unless the other guy documents what he knew from the silent alpha-omega, things would still remain the same. It doesn’t happen everyday that you get to know something really critical and you write it up on the wall. Then how do you fix the roots?

Make the alpha-omega come out with their ideas in open. Help them speak up and let them voice their opinion when they speak – even if it is irrelevant for the first few times (understand public/stage fear). That would be in the best interest of not just the other guy but you and your group too. Mutual benefits mutliply profits. Even though short term gains of taking credit for something you didn’t do/know might help you up the ladder (it doesn’t always) the longer perspectives would get broken. You know what I mean. Being mean is not in.

So help the silent know-all guys. The best things are made out of co-operation and everyone feels good when it’s out.

Chetan's Hello

One night at a call center is finally a film called Hello. It’s an amazing feat for an author who started off only a few years back and one who writes just like you and me.

The Indian literati are pissed off with this and are calling names on Chetan’s work. I wouldn’t second them on being pissed off (jealous anyone?) but for sure, you would find loads of grammatical mistakes and not-so-correct statements in his works. I read “One night..” in one night. What I didn’t read were the utter useless side stories he filled in between (which were jerky, long and out of context).

I am not in the least surprised about his story being made into a movie. Thing is, all his works correspond to the Bollywood way of making films: a love story, some utter sexual crap (which is not in the least sensuous) and some damn bloody action. Combined with it is a number of characters with the lead being played by multiple people. That makes sure that a novice reader doesn’t have to concentrate on being with a single player – ease of switching.

I would never read his novels again for I hate watching movies with plots of the ’90s and special effects in the 2000’s. Disorientation at it’s best.

Have You Been AmWaylaid?

This has been going on for a lot of days in Bangalore (and most other parts of the country). People, part of the Quixar/Amway family, would be around you in a mall, book store, super market or any heck place. It starts like this; they’d come up to you asking about something as general as an ATM around the place or may be a comment on the book you’re looking at.

The conversation begins with a hand shake, where do you work, what do you do (information gathering on whether you have enough money and enough will to earn more) and how long you’ve been around. Different people have different approaches, but the end goal is just one. To get you to a meeting with a lot of other potential candidates who can be sold Amway kits (or products) and made members out of. Those guys would then go about direct-selling among their friends/relations and strain their good will. Amway is generally seen as an untrustworthy brand in India, and these tactics to get people to start working for them makes it more so.

Another attempt to cook me in was that I got a call from a guy who claimed to have gotten my number from an old-time colleague. That guy talked me into it saying that they were going to open up a new e-business company and needed some technical help. “What kind of e-business?” I asked. “We’re doing a start up, so come over and have a look.” Turns out the e-business was yet another Amway shop with not a bit of technicality involved. Just another duped Sunday for me.

The last shot in my arm leaves me bleeding with this post. Mrs. Pande decides that she should get a personal consulting session from a skin specialist doctor who met her at the footsteps of yet another mall. The doctor turns in at our place, sweet talks all over. Skins get looked at, charts get drawn. And what have you! “Artistry has the best cleanser and toner that you should definitely try,” goes the doctor. Now that someone is inside our house, I can’t be rude – and for all the information that the so-called-Amway-doctor has been feeding us with for the last two hours wasn’t all that bad either. I figured it out quickly that she is yet another trapped direct seller in the Amgang and posed as a doctor to get started.

Finally buying off a few products from the Amdoctor, I tell my wife about the whole thing and clear out the clouds. She realizes the truth, but takes solace in the fact that a lot of information and a few bottles of cleansers/toners ain’t bad after all.


Update (27 Sep ’08 12:44pm): Video – Amway/Quixtar Scam / Amway/Quixtar Scam (Part 2)

Lowmus – Play songs to your audio (music) system

Screen shot: Amarok XUL Remote + Winamp Edcast Plugin
Screen shot: Amarok XUL Remote + Winamp Edcast Plugin

I wanted to play music from my laptop to my music system. So, if I fire up Amarok (or Winamp, in case it’s my wife), and I play a song – that should start playing onto my music system.

The best way to achieve it was to connect a low end machine on the network and connect the Audio out from the sound card of that machine into the music system’s Auxiliary port. Hurdles were the software to make it work seamlessly. Follow on…

Apart from a low end system, you also need the perfect OS, which expands to openSUSE. Perfecto.

  • an old system (can be as old as a Pentium 100 Mhz, with some 128MB RAM to spare)
    • this old system would be connected to the Auxiliary input of your music system
  • an openSUSE 10.3 CD (KDE) – Gawd, I love the lizards..
  • a laptop running any Linux or Win*****

After I got 10.3 SUSE running on the host, I connected lowmus (that’s the name I gave to my Pentium 2 166 Mhz with 256 MB RAM) to my old Panasonic audio system (a really old model) and did this:

  • sudo zypper in fluxbox icecast amarok

The next thing to do was login locally to the box (lowmus) and select fluxbox as my default window manager. I configured fluxbox to run amarok and icecast at startup. Essentially, this:

  • mkdir -p ~/.icecast/log/
  • cp /usr/share/icecast/doc/icecast_minimal.xml.dist ~/.icecast/icecast_minimal.xml
  • # changed password on line 24 onwards in ~/.icecast/icecast_minimal.xml
  • # changed logdir to ~/.icecast/log on line 134 onwards in ~/.icecast/icecast_minimal.xml
  • # changed user and group on line 183 onwards in ~/.icecast/icecast_minimal.xml
  • # edited ~/.fluxbox/startup to add these lines:
    • /usr/bin/icecast -c /home/$USERNAME/.icecast/icecast_minimal.xml &
      /opt/kde3/bin/amarok &
  • Used icecast plugin for Winamp on the laptop to stream video to lowmus
  • Configure icecast plugin to stream as Ogg and give the host IP of lowmus along with the passwords you had set above
  • Make sure to configure Amarok on the remote host (lowmus) to play a local stream
    • Fire up amarok on lowmus
    • Click on Playlist > Add Stream > enter [http://localhost:8000/stream.ogg
    • The stream.ogg is the mount point you configured in your Winamp plugin (edcast) or Amarok plugin
    • Hear the sound of music already? (if your player on laptop is playing music)
  • If you play Amarok on your lappy, there are loads of plugins available for icecasting music to lowmus
  • The only other thing you need on your laptop is the Amarok XUL remote
    • Make sure to do a sudo zypper python-qt on your remote host (lowmus)
    • Amarok XUL remote should be installed by doing Amarok > Tools > Script Manager > Install Script > (select the xul-remote-tgz file) and click ok! (do that on lowmus)
    • Configure the script to have the localhost’s IP and a port (preferable 8888) – click Run!
    • Fire up firefox on your laptop and connect to the IP above, like
    • It would automatically install Amarok Remote plugin for firefox
    • Go to Tools > Amarok remote on Firefox (laptop) and click on Configure
    • Give your host (lowmus) IP a username (given in a step above) and password – port=8888
    • After you connect, you see Amarok’s playlist on your laptop from the remote host
    • You can increase/decrease volume using amarok remote and change to a different song on the playlist on the remote host (if you have enlisted those)

Play along!


My favorite task as a teenager: cut CDs that had all the essential software I would ever need. Titling them as Essentials, I’d be ready lest somebody needed a piece. Exactly 10 years ago. The hobby soon curled up as a small business where we would burn SparcCDs containing all essential freeware programs and sell them. End: some 4 years back.

Today, the only essential software I need is a command prompt with wget. Of course, then I would get the following:

  • openSUSE 11.0
  • Firefox 3.0
    • TabMixPlus  / Live HTTP Headers / Vimperator
    • FoxyProxy / User Agent Switcher / bookmarker
  • Thunderbird 2.0
    • Lightning / Threadkey / SwitchProxy
    • QuoteCollapse / Mailbox Alert / XNote
  • PIdgin
    • Conversation Colors / Guifications / History / Log Reader
    • Psychic Mode / Nicksaid / Mystatusbox
      • zypper
        • konsole
          • screen
        • kbluetooth
      • klipper
        • xrandr
      • amarok

Very soon, they’ll be in your essentials list.