Skip to content

Dandekar’s Nifty Guide to Indian Politics

This is a sarcastic look at the state of Indian politics today. The problem is that it is true.

First you should ask yourself, are you serious about it? Politics is hard work. Start by noting important points in your notepad such as… when was the last time you committed a murder? How many kids did you beat up in your school? How many teachers? Passing even one of your school exams without copying your answers instantly disqualifies you. Hell, even passing disqualifies you. Being intelligent disqualifies you. Stop using the computer immediately. Otherwise the only chair you will sit on will be the one in front of your computer. … If you never participated in college elections, and by that I mean if you never had attempted murder charges on you when you were in college, that disqualifies you. Never having owned a gun disqualifies you. Never having fired one instantly disqualifies you… Get more weapons… use them… at least on endangered animals if not on men and women and babies… If the only knife you own is the one in the kitchen… please do not choose this career… if ‘die evil onions’ is a phrase that has ever come to your mind… you will never do well in politics. I would suggest you completely give up studies and take up some form of a drug habit and work out three hours a day. Try to beat an innocent man daily for starters. Trust me, it will help. Try to hit a petrol pump as well… How are you going to rig elections and capture ballot boxes if you can’t hold up a stupid grocery store? Maybe you should also become a ladies man if you know what I mean… they say it works wonders. How can you ever enter politics if you think all races are equal? And you should not just hate other races… you should be willing to bash their skulls with blunt weapons… for it is always ‘their fault’. If you even once think it is your fault… that spells instant disqualification my friend. Claiming to be a ‘defendent’ of a religion, or willing to give up your life for a religion helps, but you should never actually be willing to give up your life for religion. In fact, you should be willing to strap a bomb to the chests of the people that follow your religion and send them to explode. If watching them do this very thing does not delight you. Maybe you should pick a softer career such as an in the armed forces. You should also be willing to kill the leader of your own religion and claim that ‘they did it’ at the right time. In fact you should always claim that ‘they did it’. ‘They’ can be anybody you desire to get beaten to death in broad daylight. What? You don’t think anyone deserves to be beaten to death? Pack your bags and go home… I just hit the buzzer to disqualify you.
Loving money is a necessary condition for holding any post in any government but never sufficient. And by loving money, I mean you should be willing to beat up blind beggars to steal their coins… In fact try robbing people as a pass-time. If you succeed, you have another career choice, if you get caught and appear on national tv.. Great! You are off to a flying start already. If you are not that great at robbing, that is always an incentive to print your own money. So some form of technical background may help… but it is rare not to have a technically capable friend in India whom you cannot kidnap or blackmail to do your work for you these days…Bribing people always helps… Bribing cops or anybody for that matter is also a necessary condition… but don’t get too good at it. How will you take bribes if you give them??? If you are better at giving bribes than taking them.. try your hand at some illegal business maybe… but not politics… On the contrary, having an illegal business background helps a lot in politics. You could use your ill-gotten fortune for funding your campaign. Or you could just take a bribe from a friend to facilitate his/her illegal business when elected. But then the funds are always limited in these cases. The advantage in the latter case however is that you can always backtrack on your promises. Which brings me to probably the most important point of all!!! Lying is an absolute MUST in politics! Jot that down in bold letters in your mind. Lying with a straight face is a thing of the past. You should be good at lying with an emotional face and crying out emphatically to make a point you never ever had, to succeed in politics. There are many that have done quite well on this one ability alone… Always lie daily to practice this. Lie to your parents, lie to your friends, lie to your teachers, lie to people unknown to you. Lie to anybody you come across. Manipulate people into committing crimes. A little pedagogy goes a long way in politics. Lie to your significant other/others(+1point). Fake a prayer to God. Stand in front of the mirror and lie to yourself. If you don’t see the guy in the mirror clapping in awe, try again. WHAT??? Did you say you cannot lie??? What a big waste of my time?!?! Why are you even reading this then??? What were you thinking? I write this awesome guide and this is what I get. baaah… I am better off manipulating my resume.

Removing links from the Ubuntu applications menu

This post is going to be a short one. Interestingly, I had not learnt how to delete links from the Ubuntu applications menu. So when I needed to do this, it took me a while to find out how to do it. But it is really a very simple task. All you have to do is delete the icon or link from “/usr/share/applications”. Note that this will not delete the actual application.

I like accessing applications directly from the terminal. So I frequently have to do this. Also, for all the power-users out there, I would suggest that you give Gnome-do a try.

My Cup of Tea

I figured that my blog needs a kickstart from the almost year long break. And what better way to end a seista, than with a cup of tea!

So I am dedicating this post to Tea. Given below is the recipe for making tea (All other recipes are wrong).
Recipe for the perfect Indian Tea

(serves 2 usually…  the limit of tea tends to zero as friends tend to infinity)


Water, Milk, Dried Black/Red Tea Leaves(I prefer ‘Brooke Bond’), Ginger and Sugar

Heat one and 1/3rd cups full of water (no more, no less). As soon as the water looks like it is going to boil, smash about an inch long piece of ginger and add it immediately to the water with two teaspoons of sugar. In exactly one minute, add about 2/3rds of a cup of milk (In case the milk is cold, you may need to heat it separately before adding it in… microwave it for 40 seconds or heat it for 5 minutes). As soon as the mixture starts to boil, add one heaped teaspoon of tea. Bring the mixture to a boil without spilling it, and then stir it once and simmer it for a minute. Strain the tea in two cups using a strainer. Drink it while it is hot in teaspoon sized sips with puckered lips while talking about politics, philosphy, arts, science, math, sports, or any other topic of your choice. Repeat at least twice daily for good mental health.

There are two additions one must make to the tea in the summer and in the rainy season. In the summer, one must add 1/5th of a teaspoon of powdered cardamom seeds along with the ginger to the tea every other day. In the rainy season, about ten lemon grass leaves folded and wound together in a tight bundle, must be added to the tea every day. Tea may be consumed only by individuals 10 years and older.

Using Gparted Live CD to partition a hard drive

Gparted livecd is one of the best ways one can partition an external hard drive. It is probably the safest way too. It is particularly useful in at least one scenario.(which I encountered interestingly) Consider that, you just received that flashy new external hard drive with Zillions of bytes of capacity on your office address (because you are single and don’t want to go to the UPS/FedEx “central customer center” to collect it). You wanna try it out right away. But it is not formatted so you decide to go about doing that. You plug it into your Win-do-do workstation and it never shows up. So you cannot format it. You go into My computer > Manage and you don’t have admin privileges… what are the odds of that!

Here is a brief walkthrough for using gparted.

1. The first step is downloading and writing the gparted live cd. Go here and download the gparted live cd iso. Then write it to a blank disc. (Such a cd can then become a permanent part of your computer utility cd stack)

2. The next thing to do is connect your external drive and boot from the live cd. Put in the Gparted livecd in. Shut down your computer. Connect your external hard drive to it. Restart your computer and go to the boot menu or bios to change the sequence in which you computer boots. Boot menu is usually triggered by f12 just when the computer starts.

3. Gparted Livecd(or rather debian) will ask you a couple of questions while booting such as keymaps, screen resolution and stuff. Keep all the default options (hopefully you wont have a lot of issues here) . Once you boot into gparted, it will detect your main hard drive and show the hard drive stats. Select the external hard drive in the dropdown menu. It should show up with all of its drive space unallocated. (At this point you make an instant choice between deleting your computer’s main drive and driving you boss mad and obviously resulting in you getting fired from the company, OR formating your external hard drive and everything stays the way it is. Assuming it is the latter choice, read on)

4. Now select the unallocated space for your external hard drive and make partitions. First set a disklabel, by selecting set disklabel from device the drop down. Just stay with the defaults. Next select a primary partition. this partition is necessary in case you want to boot from your hard drive later. Click on new and select primary partition in the menu. If you want just one partition for your entire drive, select the entire unallocated space. Else, modify the options accordingly. Specify a disk label if you want. If you want this drive to work well with windows select the drive format as NTFS. If you work with both linux and windows, most linux machines recognize NTFS so you should not have a problem, but you might want to consider FAT32. If you plan to use your hard drive with linux alone, go for ext2 or ext3. Don’t worry if you do not know any of these file systems. Just pick ntfs. You now should see a pending operation in the gparted status bar. Be warned though that there might be issues resizing NTFS partitions later, as gparted has its limitations.

5. In case you did not select all of your drive space as a primary partition, the rest of your unallocated hard drive space can be formatted as an extended partition. For more information on partitioning terminology, look here. Select the remaining unallocated space and click new. Select extended partition in the options menu. Once you select an extended partion, the space will still be unallocated but it will be under the extended partition. So select this unallocated space and make as many logical partitions in it as you need. Once you are done, review and edit any options you want before you proceed further because in the next step you apply the partitions permanently.

6. Select apply all pending operations from the partition drop-down. If you have a big hard drive and a lot of partitions, this can take a while.  And once that is done, shut down gparted  and your computer, and you should have a formatted external hard drive hungry for data.

Note: disklabels can be easily added, modified, or deleted, so in case you forgot to add a disk label… you can go back to gparted and add it.

*Update: After partitioning your hard drive with an ext3 partition in linux, the permissions are tied to the root user. So normal users cannot use that partition. This can be easily corrected by using chmod.

eg. ‘sudo chmod a=w /media/<yourdisklabel>’

CAS in Ruby on Rails

Ruby on rails has its own implementations of the CAS client and CAS server thanks to Matt Zokowski. The rubycas-client is a Ruby client library for JA-SIG’s Central Authentication Service (CAS) protocol, while the server is an ultra-lightweight implementation of the CAS authentication server following the same protocol.

More information on the project and the download links can be found here – and here –

This is a great single solution to all your CAS needs in ruby on rails. It works very well with linux so be sure to give it a try if you work with Linux. However, the sample code given in the project pages is not the best way to implement a CAS system for your ruby on rails application. I tried to refine the installation for Noobs such as me.


First thing to do is make sure that the CAS server for your organization is working. I case you don’t have one, try the handy rubycas-server gem. It is in version 0.6.0 but I tried the 0.5.1 when I started. The instructions here are pretty simple and straightforward so I am not repeating them. In case you run into problems, try editing the config.yml file because that is where one would usually go wrong. Some configuration options explained here
The important things to look out for are the database config such as sockets and ports, and the right port numbers to run the server.
a) server: select the server eg. webrick, mongrel and add server info such as port, ssl certificate locations
b) database: enter the database configuration this varies according to db used
c) authentication: setup table info, authentication type and settings here
d) look and feel: you can change this to suit your organization, this just involves adding a theme.css file to /themes
e) logging: set logging location and level
f) other: set the ticket expiry times

Now if you plan to use ssl (I do not recommend this for testing and again mongrel does not seem to support ssl) you can try to make a self signed certificate by following the steps here.  Also, make a table of users and passwords in the cas server’s database. So for example mysql is selected as the database, then according to the config.yml default options, there should be a ‘casserver ‘ database and there needs to be a table titled ‘users’ with the columns ‘username’ and ‘password’ in it.

Next would be to implement the CASClient in our application.


The home page of the rubycas-client shows one way to implement it as a plugin. However, I was using the casclient as a gem. So that did not help me much. Besides I had started with an older version of 1.1.0 instead of the newer 2.0.1. Whichever option you choose, the CAS client is also simple to install and use. For installing it as a gem, do a ‘gem install rubycas-client’ first. You can also force the versions by specifying them. The ruby forge api mentions the simplest way to install the ‘CAS filter’ for your controller is to add the line ‘before_filter CASClient::Frameworks::Rails::Filter’ or ‘before_filter CAS::Filter’ to your controller depending on which version of casclient you have. Version 1.1.0 requires the latter command. However, as mentioned further in the api, it is not the most efficient way. A better way is to ask CAS once and store the authentication info in session. Given below are the methods I used to implement casclient on my app. To change the method to suit the latest casclient version, just change the lines to the latest casclient commands (casfilteruser is replaced by cas_user etc.). I had to verify that users were authenticated both by CAS and by the local database.

cas filter sample code