May 15, 2014

Elections 2014

Tomorrow is being awaited by a lot of people. It is supposed to be a turning point in India's political history with Narendra Modi led NDA winning the polls by a comfortable margin.

At least that is what the Exit polls are pointing out to. However, exit polls are not very reliable as can be seen from the last couple of elections. As far as I can see, the Congress is always trying to win by hook or crook or even by Emergency so I would not be surprised if tomorrow the results are a surprise to everyone.

Anyways, my post is not about that. I am going to put my thoughts about the AAP ( Aam Admi Party ) out here. Been meaning to do so for quite a while and here goes.

AAP started really well, promising a different set of people - people more clean than the scam tainted today's politicians. The battleground was Delhi ( Indraprastha of yesteryears - quite apt I think). Exit polls for the Delhi state elections said AAP would get in the single digits and BJP would have a clean sweep. The results were totally off the charts - BJP did not get a majority, and AAP got 27 seats - quite shy of a majority. And then they started their own ruin by bad decisions.

Bad Decision #1

The bad decisions started now. BJP being shy of a majority could not make the govt. Congress played their trump card and said they will support AAP from the outside. AAP tried to be too clever and posted a referrandum whether they should form the govt and went ahead and formed it with the support of Congress - whom they have been bad mouthing for quite a while. I was aghast. This was stupid.

I firmly believe if they had not formed a govt, they would have come back with a majority. Right now, this looks like a far fetched dream.

Bad Decision #2

AAP decided to pass the LokPal bill. Predictably it was blocked by both the BJP and the Congress who ofcourse do not want any accountability in how they work. AAP resigned on 'moral' grounds.

Any other time it would be ok.

This time it was not.

AAP went into national mode - and to the people of Delhi this was tantamount to betrayal. They had put their trust into AAP but AAP was too ambitious for its own good. Add to it, AAP continued to behave like a protester - doing dharnas even though now they were in the system to make a difference. And then resigning in a huff.

This turned off many people from AAP, and since they were fed up of the Congress mis-Rule over the last decade, they say they are voting for BJP.

But despite this, I remain an AAP supporter.

AAP changed the way we view politics. I don't recall an election where people were so involved into all this. They may not be voting for AAP, but due to the incessant coverage of politics in Delhi, everyone is interested in what is happening. Instead of just the usual 2 party discussions, suddenly there is a new entrant in the crowd. Despite being totally uncouth when it comes to governance - they have made the other parties introspect.

In a way I am glad that AAP is not going to get many seats this time. I would say at a max they will get 20 seats. It will force them to think where they went wrong. It will force them to realize that politics is not about protesting and doing dharnas on the street - it is also about governance.

In the Delhi Assembly Arvind Kejriwal said that "We will teach you governance" to the Congress minister Arvinder Singh Lovely. But it seems that AAP and Mr Kejriwal has to first learn it themselves. And I am going to support them for a term more and give them a chance - which most other people seem to have written off.

I am naive in politics. I dont understand the complexity of the governance in India with 3 levels of government machinery before it veers into the Indian Beaureaucracy - but I think India is waking up - very slowly like Kumbkaran, but surely.


May 9, 2014

Minecraft Audio with USB Speakers

I have a Bose Companion 5 speaker set. Unfortunately, the USB audio support on Linux is quite iffy. I am able to play audio ok with audacious, but while playing Minecraft there was no audio.

Below is a fix I found on various message boards, which seems to work for now. Hopefully it works for you also.

The trick is to fix the OpenAL configuration.

create a file '.alsoftrc' in your home directory with the following text in it :

$ cat ~/.alsoftrc
[general]
channels=stereo
drivers = alsa

[alsa]
capture = default
device = pulse

Now start minecraft from the directory where you have the jar file:

java -jar Minecraft.jar

and sound should be working.




Mar 20, 2014

Setting up Rasberry Pi as a Media Center



Recently got hold of a Raspberry PI as I had heard a lot about this thing. The main thing I wanted to do was set it up as a media center. Now, though a lot of information is there on the net about how to do it, there was sadly a lot of information which was missing. The main aim of this blog post is to help you to get a whole setup running - because getting just the Raspberry Pi will not really work out of the box. The Pi team also assumes that you will have a lot of these things already at home - and while that is mostly correct, it does not really help in a permanent setup.

Parts List

Here are the parts you will need. Basic Assumption - you have a TV with HDMI , and you have access to a laptop/PC and access to the internet. Also you have the media on a USB drive.

This is not mentioned in any one place, and it took me a while to figure out :

  1. The Raspberry Pi : I suggest getting the one which comes with a box cover, as here in India it is quite dusty. Also, get the Model B as it has more RAM, and extra connection ports. 
  2. A HDMI Cable : The Raspberry Pi connects to video via a HDMI port, and although your TV will already have a HDMI cable, you would already be using it. So, order a separate cable to use with the Pi else you will keep swapping the cable between the pi and the other box you use ( in my case the TV reciever box)
  3. A WiFi USB dongle : I suppose there will be a day when the pi will have the wifi inbuilt into the box. But so far, it comes only with an Ethernet connectivity. Since you will normally not have an ethernet cable running all the way into your living room, you will need the WiFi connectivity. Not all USB Wifi Dongles work ! Make sure what you purchase is supported - check the list. 
  4. A SD Card : The PI does not come with any hard drive. It uses SD cards for booting up. If you have a digital camera ( except the SONY ones), then you will already have a SD Card. You will minimally need a 4GB card - but I would suggest something bigger.
  5. A power source : The PI uses the same power adapter as most phones ( unless you have an iPhone). It is a micro-usb powered devices, so most android phone chargers would fit. What you want is something which can give 5V and 1.2 A . The google Nexus phone charger fits the bill perfectly. Technically, you can have a lower A ( 750 mA is the least power you need), but to power the USB ports, I would say go for something with 1.2A or else get a powered USB hub ( next point)
  6. A powered USB hub. Mostly the USB hubs we have are not powered. They derive the power from the PCs or laptops. But with the low power that the PI uses, if you want to get anything attached to the PI, get this. With the 1.2A adapter I have seen you can power a HDD and a wifi dongle. But nothing more. 
  7. A Keyboard and Mouse : Well, actually the mouse is optional, as you can do most things using the keyboard. Also keyboard will be required just at the start if really needed, else most of the TVs with a CEC remote - you can control the media center through the remote. 
  8. A SD Card reader. The way you will install the OS on the SD card is via a card reader. If you have a laptop with the built in slot - great - you can use that. Else you will need a card reader. 

Cost

Here are some links to get you started off on your purchase : 
  1. Raspberry Pi with clear case at Crazy Pi : Rs 3,490
  2. HDMI cables from Amazon : Rs 399
  3. COMCAST WiFi USB from Amazon : Rs 399
  4. 8 GB SD Card from Amazon : Rs 467
  5. Powered USB hub from Crazy Pi : Rs 750
So, that comes around 5,5k + taxes ( Amazon has taxes included in the price, but Crazy pi has additional tax and shipping fee).

Setting up the SD Card


Now that you have all the hardware, the next step is to install the OS on the SD Card. Head over to raspbian and download the installer. This is a small installer which will be used to install the entire system. 

XBIAN is a media center which is linux based.
RaspBian is an XBIAN build specifically for the Raspberry Pi
Next, connect the SD card to your laptop/PC. Follow the steps given on the installation page. In addition make sure click on the "Manually configure WiFi" which will popup a screen to enter the details of your WiFi Setup. 




Enter the details and let it finish writing to the SD card. 

Starting the Media Center

Now, assemble your PI by putting in the SD card, the WiFi dongle and connecting to the HDMI cable and the USB drive. Plug in the power source only after you have connected everything else. 

As soon as the power is connected this will boot up and you will see onscreen details scroll by. If the WiFi has been setup correctly, you will see the update starting. Wait for it to finish ( it is about 1GB! )

After that you will be in the Xbian interface and can start watching your media!

Mar 15, 2014

Raspberry Pi on PI day

Coffee with Pi
Got this... and now wondering what to do with it ! Any suggestions ?

Feb 19, 2014

Pressure Sketching

I came across the brush pen in the Comic Con a couple of weeks back. Picked up one to try it out. The pen has a flexible nib, so depending on the amount of pressure you put , the line is either thin or thick. It is quite difficult to get a hang of it.

This is my first sketch with it. As you can see - i suck at this :D


Feb 5, 2014

Turning off Autocorrect in Nexus 5

I got this asked a couple of times, so thought it best to blog it :D

The scenario in India is that we use a mix of English and Hindi words written in the Latin script. So you can easily have something like :

I am ok. Tera kya haal hai ? 

The 2nd sentence is Hindi in the Latin characterset. Autocorrect is your enemy here. It will change the Hindi into gibberish. And... you only realize this after having sent the message that it totally killed it. It is quite easy to change this behavior into something that works in a better way - switch off the autocorrect :

1. Go into settings and tap on Language & Input.

2. The keyboard you use is the "Google Keyboard" it is greyed out by default as it is the default keyboard. However, the settings icon is clickable. Go there.
 3. Next scroll down a bit and you will see Auto-Correction. Tap on that.
 4. Turn it off.

That's it. Now you can write whatever you want, and it will not try to be too smart. The words it will think as wrong will be underlined making it easy to see the wrong spellings and what you have typed.


In case there is really an error, you can just tap that word and get a list of words that are relevant. E.g. in the above example, the ok is in small case and you can fix that by tapping as below.

That's all that there is to it. And if you really want to type in Hindi, just get the Google Hindi Input keyboard from the Play Store and you can type it easily.

Dec 2, 2013

Jungle Ride

Hey this was fun !

That's what I thought after I had come back from the ride. All during the ride I was like "Oh Shit ! Oh Shit ! I am going to fall... "

The ride plan materialized all of a sudden. Abhimanyu's bike was finally not in the garage and rideable. He wanted an early 6am ride to some place near Sohna Road which got pushed to 7am. Knowing him I targetting 7am to leave from home. ETA given by Abhimanyu moved to 7:30am on the morning.





I reached the gurgaon toll first - and after a few mins which I used for photographing usual stuff - bike, the sun rising etc, these guys turn up. We headed out after a few mins. Felt good to meet them after ages!




We took an internal route through Gurgaon to reach Sohna road - which was pretty pathetic. No matter what the govt says that it is the Millenium city, the city roads are probably worse than a Gaon's road.

Near the BSF camp there is a road which goes off into the jungle. We plunged in. This lead us past the BSF encampment and up a hill, where the road just vanished. After a few mins we headed into the jungle. Saw quite a bit of wildlife here - peacocks, tree pies, bablers, parrots. What a contrast to the cacophony of traffic just an hour back! Lovely!






Sumeet asked to turn on a tracker - so we downloaded one on my phone as it was the one with the most charge. Seriously man - these guys dont even charge their phones or carry water before a ride. And they shrug it of as "we are bulleteers" ! :P

First we went to a babaji's temple - but then the decision was to just go and ride in the jungle first. So we headed away into the jungle.

Damn, this road was ... well... not a road. I was thinking this is more like a road where I would like to treck, but taking a plastic bike - i was sure that today either I will fall or some part of my bike will fall. We pushed on through thorn bushes and clinging grasses.

Finally we reached a place where there was a good view. Also we were a bit skeptical of whether the road goes on or not. Just a few hundred meters back we had met a couple of villagers who assured us that the road does not go on. Stopped and took a few pics. We could see the tall buildings of Gurgaon shrouded in early morning smog. Picturesque to look at. Like Abhimanyu said later "Even Gurgaon looks good from far!".












We decided to check out the road down on foot to see if there was really any road, and soon came up to a dead end. Sumeet and me were talking about what animals would be in this forest, and Sumeet was of the opinion that he would punch a leopard if it comes here. lol !

We headed back and I was told that we would now head to a Shiv mandir and the road was even worse than the one we had been through. "uh-huh" I thought.

However, either I was becoming more experienced on these roads, or maybe because the other road was a bit better, we did not have too many scares on the way. We did get a bit lost in the jungle but the tracker helped us get back on the route after going around in circles - which I suspect was deliberate on Abhimanyu's part.

We reached the mandir after reaching a small open ground ( check the panorama ) and where Sumeet was reluctant to take his bike as there were cows grazing there who seemed to be quite fond of his Bull in the last adventure he had there ! Anyways we headed down towards the temple.





There was a group of families which had come from Gurgaon whom we met there. One of the guys was quite happy to see us there on bikes ( though he was a bulleteer ) . We had a good chat with him and he had got all the kids and families there to the spot as otherwise they all ended up in the malls. Apparently there was a road which ended quite near to the temple and then it was a short hike up.

Time to head back , and the group extended their hospitality to us by giving us some much needed food and water !

We headed back to the open ground an the entrance of the jungle where there was a sutta break and I found out that there is a photoshphere feature in the camera, though I did not really use it for a sphere but for a panorama.








The route back was now a breeze after the initial climb where our bikes wanted to come down and we wanted to go up. Abhimanyu's bike developed a love relation between his front mudguard and the wheel... so he had a bit of problem turning the bike. But all in all, we reached the road safely and then headed to Manesar's McD for breakfast ( though the breakfast menu was over by the time we reached!)

Then I peeled off from the group and headed back as the bulls were doing 60kph and that was a bit too slow for the highway.

Great ride. Thanks to Abhimanyu and Sumeet for springing this on me. If I had known about the road before, I may have had two thoughts, but this worked out well for me !

Oct 8, 2013

PGSQL Common Commands

This is my short list of the psql commands I need to use. PgSql is something of black magic for me at this time, and I do not have time enough to go into its nitty gritties so far. So, short steps to log in , drop database , create database etc. I am more used to MySQL and these commands are weird for me.

1. To login :

sudo -u postgres psql

If you get an error like:
psql: FATAL:  role "vibhu" does not exist

It means you are not using the correct psql user. For some reason, here the user is a user named postgres and that has administrative rights on the table.

2. To see the databases:
postgres=# \list

Self explanatory. Instead of show databases; just \list

3. To drop a database
postgres=# drop database somedatabase;

Do not forget the ; at the end. In example above 'somedatabase' is the name of the database.

4. To create a database
postgres=# create database somedatabase with owner vibhu;

Where 'somedatabase' is your database name, and 'vibhu' is the person who has ownership over the database. This I do as I do not want the admin user to be always working on the database.

5. Bonus : To reset the db on heroku ( I am using django on heroku )

heroku pg:reset DATABASE



The Overview Effect

A must watch video of the view from space, and the thoughts of the astronauts who have had the profound experience.


OVERVIEW from Planetary Collective on Vimeo.

Some things to watch out for:

  • The description given by the astronauts
  • Thunderstorms from space
  • Auroras from space


Also check out the music :

Oct 1, 2013

On Hindutva

In the recent months, I have been bewildered by the news channels and politicians giving a negative connotation to Hindutva. Their angst seems to be pointed towards Modi as they feel that he is a threat to their rule, but in the churn they are also sullying the image of Hinduism - in the birthplace of this grand old religion.

I came across the Article When Germany is Christian, is India Hindu? and it really puts the reasoning in a much more coherent way than I would have been able to. I strongly suggest you read the article. Here are a few points that strongly resonate with me.

I find hard to understand – for example why many so called educated Indians on TV discussion forums become agitated whenever ‘Hindutva’ is mentioned. The majority of Indians are Hindus. India is special because of its ancient Hindu tradition. Westerners are drawn to India because of it. Why then is there this resistance by many Indians to acknowledge the Hindu roots of their country? Why do some people even give the impression as if an India that values those Hindu roots was dangerous?

That is exactly my thought when I see these debates of anti-Modi. I just cant understand how the association of being a Hindu is something that is now being branded as being evil ?

Hinduism comprises a huge body of ancient literature, not only regarding Dharma and philosophy, but also regarding music, architecture, dance, science, astronomy, economics, politics, etc. If Germany or any other western country had this kind of literary treasure, it would be so proud and highlight its greatness on every occasion.

This is something that I am also ashamed of. Before the start of this year, I had not even gone through the Gita - one of the most popular pieces of literature of Hinduism. Somewhere around the later part of last year I realized that most people do not even know what the Bhagwad Gita is all about - though they espouse one or two famous shlokas out of it. A little knowledge is dangerous and thats when I started reading it - 2 pages at a time - everyday. I am in my 2nd reading of the book, and I think I do not still understand the underlying message perfectly.

There is a “Copernicus Marg’ in New Delhi and Indian children do not get to hear in school that the rishis of the Rg Veda knew already that the earth is round and goes around the sun – thousands of years before westerners ‘discovered’ it. (Rg 10’22’14)

Here, even I did not know that. And I do lament the teachings we have had which do not talk about these things. I have recently got a condensed book about the vedas which I hope to read this year. Unfortunately, these books are not easy to get. 

All in all, I believe we have been paying just lip service to one of the grandest religions either by ignoring it or being fanatical about the customs. It would be better if everyone with an iota of thinking capacity should do what the rishis of old did - think and esquire into the truth. For one, I am going to be reading all these immense literature ( apart from the Ramayana and Mahabharata ). The Challenge is getting copies of these which are not influenced by the translators dogmas. 

If you know of good books or links, please do leave them in the comments below, and I will add them to the main article here. 

Links: 


Sep 11, 2013

iPhone5S in short

If I have the money, I would buy it. But man... too damn expensive :'(

In short this is what the new iPhone5S has:

  • The slate color ... definitely the one I want. 
  • 64 bit processor: This is a game changer. People just talk about like how they are just changing to 64bit on the desktop and what difference does it make on the phone. I think its a big deal.
  • Fingerprint scanner: It is a feature that has been around in laptops for sometime - and the feature that most people disable first. Here's hoping that Apple really gets it to work on the iPhone5s. 
  • iWork available free ... good bye Office knockoff apps. This is a full step into enterprise domain. 
  • Camera ... ooh the camera. I wish all phones had cameras like this. Unfortunately this means that the 16GB camera phone is too less of disk space. And the slo mo capture where you can playback the entire video normally, but select a region to play in slo-mo - that is brilliant. 

You asking about the iPhone5C ? Just an iPhone5 with a plastic body. Don't bother with it.