Category Archives: Uncategorized

British Telecom and Emacs

As I moved to Airbnb host in London and opened my laptop for getting some work done tonight – much to my chargin Emacs won’t start and just hang during startup.

One of the problems of constantly tweaking your editor configuration is – you blame yourself if things go south and I did promptly. Tried to revert to an earlier version of Emacs configuration, tried to undo some of recent shell config changes but no avail.

Very quickly though, I figured out – Emacs is hanging while loading tramp.el. Now that was weird – I wasn’t actually using tramp; it was just being loaded by rubocop.el which I use
when writing Ruby. Removing rubocop.el made Emacs go further but it still got hung bit later.

I enabled debug-on-quit thingy in Emacs and tried to manually load my ruby-mode settings (which included loading rubocop.el) and pressed Control-G when it got hung and I got some error from:

 (setq result "-o ControlMaster=auto")))
   (unless (zerop (length result))
            "ssh" nil t nil "-o" "ControlPath=%C" "host.does.not.exist")

Further research pointed me to bit of tramp code that defines a custom variable to select ssh-control options. The variable has
a default value which gets determined by trying to SSH to an non-existant host called host.does.not.exist. I know what you are thinking, stupid – right?

Thankfully they are trying to fix it –

So, where does BT come in all of this? If you fire your terminal and try to ping host.does.not.exist you will probably get:

hyperion? ~> ping host.does.not.exist
ping: unknown host host.does.not.exist

Not on the connection I was though. BT in its infinite wisdom has configured routes to unknown hosts to hop all over the place and as a result any attempt to ping or ssh to unknown hosts will result in ping/ssh command to wait for real long time.

This obviously made any attempts to require/load tramp.el while I am connected to BT network hang forever (or real long time). There are couple of workarounds – reduce SSH timeout or make host.does.not.exist point to etc.

Eulogy of a Singer

Jagjit Singh – my all time favorite Singer died today.

I never met him or communicated with him beyond listening to music he put out and yet I feel deep sense of loss today. As popular Hindi Music degenerates itself, I know a era has gone by – that will not come back and will not be felt ever again.

He himself did not write most of his songs but his greatest achievements perhaps was – he made works of great Urdu poets accessible to people. I wouldn’t know or appreciate work of, Mirza Ghalib or Mir – if not for Jagjit Singh.

I should perhaps link to one of his songs in this post, but the truth is – I can’t. There is just too much out there, which is outstanding and I can’t pick one. But as Mirza Ghalib said:

Woh Firaq aur woh Wisal Kahan ?
woh shab-o-roz-o-maah-o-saal kahaaN ?
fursat-e-kaarobaar-e-shauq kise ?
zauq-e-nazzaraa-e-jamaal kahaaN ?
thee woh ik shaKHs ke tasavvur se
ab woh raanaai-e-KHayaal kahaaN ?
‘eisa aasaaN naheeN lahoo rona
dil meiN taaqat jigar meiN haal kahaaN ?

Using Emacs for editing and properly formatting commit messages

As long as I remember, I have always been committing code to git from Command Line. Haven’t really used emacs and git integration. Unfortunately, that also meant – I was using vim from Command Line, for editing commit messages and doing interactive rebasing and stuff like that.

Today, I sat down and figured – how to do this properly from Emacs.

  1. Setup a emacsclient to open in terminal. I have following shell script, in $HOME/bin as fast_emacs:
    /Applications/ "$@" -t -a /Applications/ -nw

    If you are using Linux, the script can be simply changed into:

    emacsclient "$@" -t -a emacs -nw
  2. We also need to ensure that, when you are done with window (by pressing Control-X #), the buffers are cleaned up and stuff.
    (add-hook 'server-switch-hook
    	  (lambda ()
    	    (menu-bar-mode -1)))
    (add-hook 'server-done-hook (lambda nil (kill-buffer nil)))
  3. Next thing is to configure and load git-commit mode, which checks if your commit message is properly formatted or not:
    (require 'git-commit)
    (add-hook 'git-commit-mode-hook 'turn-on-flyspell)
    (add-hook 'git-commit-mode-hook (lambda () (toggle-save-place 0)))
  4. Last thing is to specify fast_emacs as GIT_EDITOR and you should be good to go.

The AppleCare story

We love Apple products, they usually have  excellent products with good hardware. But this post isn’t about, how great they are. This post is about, what happens when in a Country like India, your Apple gizmo falls apart.

Diving in.

I purchased my 15′ Macbook Pro on 18th June 2011 from Reliance iStore on M.G Road Bangalore. On, 1st of July – the machine broke down. After waking up from sleep, the Operating system wasn’t responsive and  I had to hard boot the machine and during the reboot, it got stuck at Gray Screen with Apple logo. Even leaving it like that for hours, did not result in any progress.

I called AppleCare on 2nd of July and they said usually this happens because of  “Software Problems” and we proceeded to reinstall the OS. But the problem was back again 2 days later. This time AppleCare guy told me to erase and install, which I did. At no point, I was asked to run any hardware diagnosis or any kind of tests. The AppleCare apparently operates by gut instinct.

Anyways, coming back – The machine again broke down in same fashion after 3 or 4 days and I called Reliance iStore this time. They asked me to bring the machine. I left the machine with them and after 2 or 3 days, I had to callback and ask whats up with my MBP. They said, they have reinstalled the OS and did not find any problems with the machine (hardware or software).

I was somewhat mad at this point, I told them – The OS has been reinstalled 3 times already, if there is a problem that reinstalling the OS can fix, it should have been fixed first time.  They asked me to contact AppleCare. I called up AppleCare and this is where first thing I learnt is – Call Center Executives in India aren’t authorized to take, how do I put it – any effective decisions. They routed my call, outside India. I waited for nearly 35 minutes and then some guy from Europe picked the call.

This senior executive asked me where I purchased my Macbook from and where I have given it for repair. I gave him the answers and also asked him, if I qualify for “Not-Fit-For-Purpose” program, since machine broke down within 14 days of purchase.  He in turn asked me, Why haven’t I purchased my MBP from an Apple Store? Why didn’t I take it back to Apple Store? He was somewhat clueless about how Apple sells hardware in India. It took me a while to give a picture of; how things stand in India. But the conclusion was, No I can’t get replacement since iStore people haven’t found any hardware problem and I was asked to take my Macbook, back from Reliance iStore.

I took back my MBP from iStore and used it for nearly 5 days. I also did my own bit of investigation in the meanwhile and found that “/var/log/kernel.log” was filled with “I/O errors”. I ran smart-utility and it reported SMART status as FAILING. After 5th day the machine, stopped working again in identical manner.  This time I took the machine to another Service Provider (Ample Technologies) and also purchased Mac Mini 2011 on same day since my work was getting affected.

They took nearly 4 days and asked my permission to erase and reinstall the OS. When I gave the machine to them, the machine was booting, but everything was dead slow and disk was reporting countless errors. After erase and install, they ran some tests and they came back to me, saying machine is fine and I can take back the machine.

To be honest, I was pissed at this point. The OS has been reinstalled 4 times and I showed them “kernel.log” errors, I had screenshot of Smart Utility reporting disk as failing. I started contemplating legal action via consumer courts at this point.

I asked them to use Smart Utility and Smart Monitor. To my surprise, they called in the evening saying – They couldn’t download the programs and if I can send those screenshots via Email.  I sent them the ScreenShot and I also sent them, downloaded version of Smart Utility with Email.

They ran those tests and finally concluded that Hard Disk is faulty. Finally, *win*.

I called Apple Customer relations (Thanks Sidu!) and asked for a replacement. A customer relation executive from Singapore picked my call and after 2 days of back and forth, they agreed to give me a new machine.  I was sent another Email by a lady from Singapore that, my machine has been dispatched and she gave me contact number of Apple local representatives.  It was 6th day  since that Email and in total more than 3 weeks of this sorry episode and I had to leave for Chennai day after tomorrow, so I called the local representative, Schenker India and the they told me, they no longer deal with Apple. *gasp*.

You see the classic disconnect, Apple gives me a number and the dude tells me – his company no longer handles Apple stuff. Fun. I had another number though. And I made few calls to this another number , left a voice message but couldn’t reach him. Fortunately, replacement macbook arrived, as I was packing my stuff for Chennai trip.

The bottom line I think is, Apple India customer support is massively fucked up.

  • Apple India executives have no authority to take any effective decisions.
  • Customers are left to the mercy of resellers and their crappy service. These guy have no incentive to give good customer service.
  • Whatever technical support executives these resellers have are crappy and in my opinion aren’t qualified to troubleshoot problems.
  • Since all decision making happens from Singapore, Brisbane or Europe, there is big disconnect between how things are with Apple India and what these executives sitting in Singapore, Brisbane have been told. It is big pain.


Getting prepped up for Rails hackfest

Listing down things, that you should do – to make best use of Rails Hackfest.

1. Install RVM. The instructions can be obtained from,

2. Install multiple versions of Ruby. Preferably, Ruby 1.9.2-p290, Ruby-1.8.7, REE and JRuby. All of this is, one command away via:

    rvm install ree && rvm install 1.9.2 && rvm install jruby && rvm install 1.8.7

3. Install a decent IRC Client. Mac users can use Colloquy, Linux users can use XChat2. Learn few simple commands. The canonical IRC server which we will be using is, Try connecting to it and see, if you are able to connect to #ruby-lang.

4. Keep Rails code cloned in your local hard disk. It takes time to clone Rails code base and many people cloning at the same time, may slow down things.

5. Install PostgreSQL and MySQL both. Mac users can use homebrew to install via, “brew install postgresql”, Linux users can use apt-get or whatever their distro supports. Also, make sure that, ‘pg’, ‘mysql’ and ‘mysql2’ drivers are working on your machine.

6. If your corporate policy allows, bring your proprietary code. Don’t worry, no one is going to steal it, might be useful in removing the warts and all.

We are all crappy superheros

In the past I’ve tried to say, ‘Look, we are all crappy superheroes,’ because personal computers and mobile phone devices are things that only Bat Man and Mr Fantastic would have owned back in the sixties. We’ve all got this immense power and we’re still sat at home watching pornography and buying scratch cards. We’re rubbish, even though we are as gods. I think the idea that we can all be superheroes if we want might still be contagious, like in V For Vendetta.

Alan Moore

Invisible mode considered harmful

Invisible people are bad. They start with good intentions and all that but eventually turn bad. You just have to read H.G Wells.

I have always hated invisible mode feature of IM clients. I understand why people use it but I hate their reasoning nonetheless. So here is my advice, friends don’t stay invisible to friends.

When you stay invisible and ping a person and start a conversation with him/her, you are being rude. The other person had fucking no way of saying something to you, if he had something urgent about which he wanted to talk. If you are actively using the IM client, turn off invisible mode. People aren’t really dying to talk to you, trust me you are not that important, but someone who is important to you – won’t be able to get his/her message across.

If you are busy and rather do not want to be disturbed, just disable notifications. That way, people can still reach you and you will not be bothered. If you can’t help yourself from checking IM window every 2 minutes, just logout. You can also use ‘status’ icon/message  for letting people know that, you do not want to be disturbed.

When all else fails, you can block people who are excessively chatty. If he is a friend/colleague you can talk them frankly and set some boundaries.

In honour of Ubuntu LTS – 8.04

Newest version of operating system for human beings is out. Kicking ass and users. Yes users, you heard it right.
I am not very happy with this release. In fact, I regret that I upgraded to this version. Why?

  • Today every upcoming Linux distro is bundling Firefox3 beta 5 as default browser so ubuntu is not alone there. But in my opinion this is a bad decision. Firefox3 beta5 is not stable. Most of the extensions aren’t supported yet. You are being hard on users by bundling a software thats still 2 months from final release. My main gripes with Firefox3 beta 5 is,
    • Its a CPU hog. Even with only one tab open, it consumes considerable CPU cycles. Bad for laptop users. Now before you jump the gun, in my tests, I have a simple page open (no fancy gmail with lots of background processing) and I am not interacting with firefox window
    • It hangs and freezes now and then. I have experienced this kinda behavior often, while downloading a page firefox will freeze momentarily and then suddenly it will come back.
    • Extensions, extensions. Many of my favorite extensions are not available for firefox3.
    • Also, I am using fully updated version of Hardy and have disabled Security->Tell Me, thingies. and have deleted urlclassifier3.sqlite without much success.
  • I guess all Linux users have seen occasional freezes and they have no other go than to hard reboot the machine. With Hardy and Compiz fusion, I just saw too many of freezes on my notebook. Also, did anyone notice metacity compositioning is buggy? I tried using metacity compositioning in place of compiz and had to press alt-ctrl-backspace couple of times. One sure way is, try enabling compositioning and then disabling it. I experienced X freeze when doing that.
  • Many Emacs users i think swap ctrl and caps keys. I am one of them. After upgrading to hardy swapping them through Gnome keyboard settings works, but whenever I press caps ( now its ctrl ), it still turns on caps LED display on my notebook. A bit annoying. This issue was not there in Guts.
  • Shipped Xorg is a CPU hog, even if you are not interacting with your machine, Xorg cpu usage stays around 10-30%. I have Nvidia graphics card and I have tried using <code>”UseEvents” “on”</code>. It doesn’t seem to have any effect.
  • Oh boy, I don’t even know, why they shipped this half hearted PulseAudio integration? For getting sound back on my laptop, I had to manually choose ALSA as Sound Playback device.

Being a LTS edition, I was expecting something solid, but I can confirm with some certainity that Hardy release is certainly inferior than Gutsy. Thank you Ubuntu for scrweing it up.

An idea about reviving Chennai.rb

Chennai.rb has been languishing for a while (strictly my opinion). First problem is, like almost all open source groups in India, its too business oriented. I have been on the mailing list for a while and attended one of their meetings and didn’t like the atmosphere. Back then, it was too rails centric.

I dunno if its a good idea, but I wanted to start a alternate Ruby group which is more code centric (like seatle.rb perhaps). We organize coding sprints, hacking sessions and stuff like that.

Whatever projects core members of the group decide to start and provided group accepts general idea of the project, it becomes groups responsibility, rather than one man job. Also, it will be responsibility of the creator of the project to explain underlying concepts of the project and it will be maintained by entire group.

We can have a page like seatle.rb on Rubyforge and collabaratively maintain projects.

Also perhaps, there won’t be any beginner sessions, business discussions and it should be truly chennai.alt.rb.

If you read this blog and is from Chennai let me know what you think?

Gnome Applications hanging up after lost wireless connection

I am experiencing weird issue on my Notebook running Ubuntu Gutsy. Often, I will loose wireless connection and network manager will attempt to reconnect, but in stead of properly reconnecting to wireless router it just hangs. Whats more weird is, after this, I am unable to start any X application with few exceptions.

I have reported the bug here . Many have reported similar problems and I am waiting for a fix. However temporary workaround seems to be, to run

$ network-admin --sm-diable

and reset the network connections. Also, you can try deleting the /tmp/.ICE-Unix directory and files.