Je Suis Charlie

It’s been a week and the dust has started to settle after the horrific acts of terror by the islamists again, this time against France. Acts of terror are no longer rare, they keep happening all over all the time most people are at a state where there reaction is like -‘Oh no, not again! How many innocent people lost their lives this time?’

By those standards the attacks at Charlie Hebdo wouldn’t be too appalling and yet these shook the world, these most certainly did shake me up. The difference in this case is that  whereas most terrorist attacks target a place and the goal of the terrorists is to kill as many people as they can, this one was an assassination with surgical precision.

But just that, is not the reason the world was shaken up. We were all shaken up because this was an attack at the conscience of freedom, freedom of thought and expression. It was an attempt to kill the mocking bird and that is what shakes me.

The other thing that saddens me now that all of this is over is that this will happen again and again and again, we still haven’t learned our lessons from all these attacks. Isn’t it funny how humans are supposed to be the smart creatures whereas the machines are supposed to be one dimensional, unable to think and to learn. If you were to run these incidents through the simplest of classification algorithms, you would stare at the common denominator and know what to fix to make sure that this didn’t repeat. Political correctness however wouldn’t allow society to contemplate on the real solution for it would be too radical and too obvious.

With all that being said, let us come back to Charlie Hebdo; I must admit that I didn’t know too much about this obscure French satirical comic. I did check their work out after this and I must admit it was pretty funny and surprisingly accurate factually which is why cartoons can do what bombs can do, shake the foundation of a fickle faith. The artists who illustrated those cartoons may not live anymore but others will come and you will be an inspiration, your memory and your art will live on and a time will come when we finally win this war, it may not be in my lifetime but I will remember and thank you for your invaluable contribution in this fight and in our shared victory.


New Year Ramblings 2015

I had neglected by blog for sometime now, lots has happened since my last post about setting up raspberry pi. I had a great vacation in Laddakh. After which I transferred to Audible Inc in Newark, New Jersey and the first few months have been great.  I saw my first snow here, spent some time withe Kids at the Ann St. School for the hour of code. Went around ‘New York’ or ‘The City’ as people call it here.

I got engaged last year and this is the year when I’m getting married, some of my friends tell me that it’s too early whereas the parents think this is the right time, I’m with my parents on this one.

New years resolutions this time are getting fit, seeing a remote part of the world and moving forward in my career and maybe penning down my thoughts more often. Last year was tremendous, this one has the promise of all that and so much more. Hope you guys had a great year last time around, even if not have a great one this time around.

Setting up raspberry pi

Here’s a list of things I do to set up my raspberry pi and a small note, the purpose of this list is to help me remember what all I need to setup if and when I start from scratch the next time around.

1. Finding your pi’s IP on the local network!

I don’t have a dedicated monitor and run my pi headless. I used to do this by running a for loop and finding the ips of all my devices on the local network and then sshing into them until I found my pi but this is easier and um.., more scientific!

2. Setup Vim and fish on pi.

I don’t like editing files with nano and so setting up Vim is essential and fish is an awesome replacement to bash/zsh you may want to give it a spin. It’s history management is way better than ohmyzsh.

3. Setup Avahi or Zeroconf

It’s always easier to remember hostnames than it is to remember ips and this is where Avahi shines. Now I can access my pi with pi.local even if it’s local ip changes.

4. Remove Xorg and the desktop packages

I like to run my pi, lean and mean there is no need for the desktop when I run it headless, this saves both the disk space and data with updates

5. Setup a bittorrent web client

The folks at howtogeek have an excellent tutorial on setting up deluge, there are a couple of other alternatives as well but deluge works for me quite well.

6. Give your pi a public ip/domain

What good is your pi if you can only access it over the local internet. The whole point of setting up a bittorrent web ui was to be able to download stuff remotely and watch it after you get home. You can also point your subdomain to your pi as I did in my last post.

7. Set up your external hard drive and samba to share it over the network.

To watch the TV shows or movies that you downloaded on your pc/mac you need to set up samba and also to connect your external hard drive to pi. Connecting the external hard drive is the same as connecting to any other linux box and so I’m omitting the steps here.

I’ll probably add more stuff here in time but this is my barebones pi setup.

Raspberry Pi tip : Map your Subdomain to Pi

After I had my Raspberry Pi setup, I wanted to create a subdomain which would point to it.
This is trivial to set up if you have a static IP but I’m assuming that like me you don’t have that.

The way that I have set this up is by following this excellent post on superuser. First you need to set up a dynamic dns for your pi. I use DNSDynamic for this, a tutorial on how to set this up for your pi can be found here. With dynamic dns set up, it’s like having a static ip.

All you need to do after this is to create a CNAME record which points to your dynamic dns. This can be created using your domain registrar’s web interface. A CNAME is basically a pointer and can point to any IP or domain. In my case I set up to point to my dynamic dns. If you’ve set that up correctly you can use dig to verify this. Here’s what I get, is my dynamic dns. I’d advice you to choose a better name!

After this it’s a matter of forwarding the right ports on your home router and viola you have a subdomain that points to your pi!


; <<>> DiG 9.8.3-P1 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57260
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 4

;      IN  A

;; ANSWER SECTION:   13171   IN  CNAME   60  IN  A

Another partition looms

By the indications that we are getting from the media the state of Andhra Pradesh will be bifurcated, partitioned into two and this saddens me immensely. The parallel with India’s partition at the time of independence is all to evident a state is being carved up in two by the power hungry who will do all that is necessary to remain in power.

India’s partition was engineered by foreign forces as is Andhra Pradeshs’ the former british and the latter italian. It is very easy for a foreigner to divide another persons homeland for they can never understand what it means to those who call that place home, but it isn’t the foreigners who are responsible for both these self inflicted wounds it is us indians who are responsible in both occasions. In 1947 it was Nehru and Jinnah both of whom were power hungry and this time with history repeating itself only the actors are different.

Any partition is a painful ordeal for both parties, be it siblings dividing ancestral property or best friends not being friends anymore. It is never a solution and even after decades the scars of the grave wounds remain, reminders of the futility and foolishness of division.

I’m not from Andhra Pradesh so I can’t claim to be an expert on Telangana but I’ve stayed in Hyderabad and Secunderabad for some time, I have a few friends from the state none of them are radicals so it is possible that my analysis is wrong all together. But I can’t see a single reason for dividing the state except for those motivated by political considerations, the people of the state are mainly from the same linguistic community with no regional community dominating other communities.

The solution to the problem that people are protesting about does not lie in dividing the state into pieces but does so in better governance and empowerment of the people. I wonder how much longer will politics of appeasement drive the future of our country. It hardly matters now though, tonight is probably the last when Andhra Pradesh will be one state come tomorrow another partiton looms large.


It’s been a while since I last blogged, sort of lost the interest didn’t know what to write about but you don’t really care about that do you! Lets get to the point and I’ll tell you what has me so excited about Meteor.

New programming languages and frameworks keep coming along faster than the speed of light in the world of technology but most of them just whiz by and hardly interest me. There are however a few which stand out amongst the crowd and Meteor is one of them. I’ve had a bittersweet relationship with JavaScript, back in the day when I had only gotten started with programming with C++ in school I found it like a breath of fresh air. It could add that fancy rollover effect to pages or a bouncing ball on a webpage, I was amazed by it. But the cross browser issues, quirky behavior and it being a nightmare to debug I gave up on JavaScript.

For a few years it stayed that way, I taught myself some php got bored by it and moved to ruby tried dipping my feet in rails but without much luck as it was too magical. I boarded the Sinatra bandwagon, it is an awesome framework. No magic, no nonsense simply rest but then again Sinatra itself isn’t enough to make nice websites you need something for the front end too and that’s when I started to dive into jQuery rediscovering my love for JavaScript. I read a couple of books on jQuery embraced the asynchronous and restful nature of the web and it was such a joy to make web applications again.

After that for the last couple of years things have been slowed down, sure there have been performance enhancements in jQuery and node.js came along too. I had a brief look at node.js but really didn’t see how much more of a value add it was over Sinatra. Similarly Knockout.js didn’t really knock me out neither did backbone have that much of a backbone for me. Meanwhile at work I used GWT which in my opinion isn’t the best way to write a web application today(It may have been 5 years ago, not anymore). Had I discovered the ultimate framework? Had I achieved nirvana? I sure thought so.

That was untill a week ago when I was struck by meteor.js, I had watched the introductory video and my head was abuzz with such excitement after a long time indeed. I watched the second video and boy was I jumping up and down. Meteor isn’t just an evolutionary framework it’s revolutionary! It doesn’t split the client and server parts of your web app but presents them together. It’s how you would develop any application, sure you need to know about the security aspects but when you’re developing something it should be fun, you shouldn’t be spending time on downloading jQuery and your favorite bootstrap framework and other trivial details. Ideally you should be able to focus on the core of your application and all the secondary things should be dead easy to implement. I also like the social focus of meteor, it couldn’t be easier to integrate your app with Facebook/twitter or for that matter any other social networking site.

What trumps all those minor features and enhancements is it’s publish subscribe feature, if you asked me what was the one single feature that defines meteor. You don’t need to implement polling to write a fluid always up to date interface, this isn’t the 1980s. Meteor just works where most other frameworks make you do too much unnecessary work! Also the package management is pretty sleek, it compares and in some cases surpasses the ruby gems which I consider the ideal package manager.

Having heaped so much praise on meteor I still have a few doubts, the most important is about how well will meteor scale? This is one factor that will probably decide meteors future in the years to come. Will it end up as a toy for prototyping stuff or will it dislodge rails from its pedestal remains to be seen. From a technical perspective it’ll be curious to see what strategy they eventually take to scale and perform under high load. Another thing that is probably on meteor’s roadmap is to support the various other nosql stores other than mongo db. It’ll be interesting to see how they implement this, right now the syntax is quite specific to mongo it’d be better if it was neutral so that there could be support for stores like dynamo db with no change in the existing application code. One last thing that would be absolutely awesome is integration with Native Mobile Apps, even though web apps work well on mobile devices native apps are miles ahead. It remains to be seen how easily can one write the app in meteor and then hook up the presentation onto the native platforms. Boy would that be sweet!

All in all this makes meteor a very interesting framework to watch out for even if you don’t write too much JavaScript, it has so much potential where it will be in two or three years time is an open question. Regardless of how it ends, the ride along the way promises to be a lot of fun. I don’t know about you but I’m boarding it right now!

Downgrade grub2 to grub

There was this weird issue that I’ve been facing for some time with both ubuntu 12.10 and 12.04, what happens is that my Acer Aspire One 722 netbook doesn’t boot into linux at times. The first couple of times I dismissed it as a one off but that didn’t stop the problem from recurring. Then I blamed my exotic grub2 setup wherein I had installed grub2 to /dev/sda5 and then was using the windows 7 bootloader to chainload it.
Continue reading Downgrade grub2 to grub

Keep Windows and Linux time in sync

Every time I log into windows after having used linux on my netbook there is a problem with the system time. It is because linux treats the time set in your BIOS clock to use the UTC clock, this is a problem as windows treats it to be set to your local time. If you’re using only one OS then both of these choices are acceptable design choices but when you use it becomes a problem. When I’m online it’s not a problem as both windows and linux sync their times with the internet but when offline it’s irritating to look at the clock and see a time that makes no sense.

Fortunately you can tell linux to follows the convention that windows follows, telling windows to behave like linux on the other hand is significantly harder. The best thing about linux is that it makes it’s assumptions and lets you change them to suit your preference. We need to edit this file /etc/default/rcS for ubuntu 12.10

# assume that the BIOS clock is set to UTC time (recommended)

By default the option is yes but we need to change it to no and from the next reboot the problem is solved!

Reliance Netconnect+ Settings for Ubuntu

I had written a post on how we can easily get MTS Mblaze to work under linux and as it turns out, the Reliance Netconnect+ is equally easy to set up and use. Instead of repeating the entire procedure which I have already mentioned here, I’ll just post the relevant wvdial configuration file. You need to add the following snippet to your /etc/wvdial.conf

[Dialer netconnect] 
New PPPD = yes 
Init1 = ATZ 
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 
Modem Type = USB Modem
Baud = 460800 
New PPPD = yes 
Modem = /dev/ttyUSB0 
ISDN = 0 
Username = 9388****** 
Password = 9388****** 
Phone = #777 
Stupid Mode = 1 

It goes without saying that you need to replace the username and password with your netconnect phone no. To connect simply type this in a terminal

sudo wvdial netconnect

Here’s what I get

 ➜  ~  sudo wvdial netconnect 
--> WvDial: Internet dialer version 1.61 
--> Initializing modem. --> Sending: ATZ OK 
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK 
--> Modem initialized. 
--> Sending: ATDT#777 
--> Waiting for carrier. ATDT#777 CONNECT 3100000 
--> Carrier detected.  Starting PPP immediately. 
--> Starting pppd at Mon Dec  3 15:45:39 2012 
--> Pid of pppd: 3981 
--> Using interface ppp0 
--> local  IP address 
--> remote IP address 
--> primary   DNS address 
--> secondary DNS address

Happy browsing with Reliance Netconnect+, I suspect that the MTS device and the Reliance device are actually identical, the only difference being the firmware. As usual let me know in the comments if this helped or if you have some clarifications.

Using the Windows 7/8 bootloader to dual boot linux

In the past whenever I had to install linux along with windows I would install grub and it works flawlessly most of the time. Sometimes however when you’re experimenting with something unusual, it is handy to know how to load linux using the windows bootloader. I used it when I was transferring my ubuntu installation from my laptop to my netbook.
Continue reading Using the Windows 7/8 bootloader to dual boot linux

The online journal of Nikhil Bhardwaj