Saturday, 17 August 2013

Jailbreak old iPod - Convert to hand held computer

Swami Nikhilaananda said:
"An Apple a day will definitely make me bankrupt"

[The purpose of this post is not to tell you how to get themes, mod or dropdown menus]

I have an old iPod - 2nd Generation 8 GB one lying around. With the rapid rate at which technology becomes obsolete, I often wonder if investing money into buying gadgets really makes sense. Apple promptly stopped support for the older generations of devices, with no software updates beyond 4.2.1 and none of the newer apps work on my device either. Which means, I have to be happy with whatever apps I had installed. It suddenly went from a savvy gadget to ordinary music player - something that phones do as well.

I also have a Raspberry Pi and I thought - it would be really cool if I can somehow make my iPod a screen for the Raspberry Pi - Act as a monitor. That'll give me a small computer of sorts. My first thought was to run a VNC server on the Pi and a VNC player on the iPod because I was looking for a GUI. However, the VNC thing didn't really pan out because the apps are no longer compatible with my old device.

So I jailbroke
There used to be this great site called that would let me jailbreak my device just by going to that site and sliding a button. But that site no longer supports older devices. Greenpois0n came to the rescue

I followed instructions and jailbroke my device in about 5 minutes or less. Then I was able to do some very interesting things. Jailbreaking gives you root access to your device.

To log in as root, type in:
su - root
and the default password is - alpine

If you install OpenSSH through Cydia on your iPod, you can SSH into your iPod from your computer. Also, it is highly advisable that you change your passwords.

Next, install MobileTerminal. This is where most of your cool stuff happens. This gives you a Terminal Emulator in which you can run commands like ls, locate, grep, find etc. It also gives you 'apt-get' abilities.

Install Python. And Python setup tools to get easy_install. There's also Ruby if you prefer that.

Clearly you need an editor to stuff. So I installed VIM with sudo apt-get install vim. You can do all your regular vim stuff.

SSH to your computer
Just for kicks, ssh into your computer from your iPod and shut it down :P Or list files or whatever. Which means I can ssh into my Pi as well.

Install sudo
Root access is always dangerous. Install sudo with apt-get. Then Add yourself to the sudoers list using visudo.

Install wget. While typing small commands is fun, typing out large files is pretty time consuming in a small keyboard. I was trying to type in a config file that was six lines, but considering the special characters were more than a few, it was time consuming switching between keyboards. So I typed it on my laptop and did a wget to my iPod.

iFile is a great tool that I greatly recommend. It gives you a file explorer and also the ability to view, upload and download files from your laptop by making your iPod into a webserver. It's a shareware and I think is a small price to pay for the great features.

I thought nginx would be cool to run, but since I didn't find it, I installed lighttpd and got it up and running. I couldn't believe it when "It works" on my laptop screen. My iPod was actually hosting a page

I think sqlite is already installed, there's Postgres and mysql too! I haven't really explored much.

Other Tools
Other tools such as awk, sed, zip etc. are also available.

There's a lot more to explore
I was just excited to share this small finding with the rest of you who might have thought that your old iPods are useless. Now you can do a lot of things with it. Also, not all commands work on the iPod, for example, I could not add another user. But still, it's pretty cool. And share your findings with me as well.

Friday, 9 August 2013

The Rama Krishna Paradigms

Swami Gulagulaananda said:
"The moral fabric is netted, the sizes of holes not constant"

Let me start off by saying that the attitude in this post is intentionally cynical

As kids, we are taught a series of moral lessons - "Don't hurt others", "Don't steal from others"... and as we grow up "Don't covet others' wives" and so on. As children, we are taught to take these statements as truths, we don't question them, we simply accept them. The reason being that we don't have the maturity and experience to validate them. So we accept them, and we follow them.

As we grow up, we gain both experience and maturity. At this point, we can begin to validate our lessons and accordingly strengthen those that matched with reality and discard those that didn't. AI junkies will consider this as strengthening of synapses and those who've read 'I'm OK, You're OK' will relate this with the PAC model.

This is however true if we have the maturity and intelligence and more importantly, the disposition and inclination to validate what we were taught.

Consider a person whose father is a criminal. He is taught that all policemen are evil. If the child has not been taught to think independently, the child will continue to see policemen as evil. A man who is an absolute believer of God will teach his child about God and imbibe it deeply into him. He will also warn him of others who will dissuade him away from the path of God, calling those people are heretics... This is precisely how religious fanatics or fanatics in general are created. They lack the ability to be unbiased.

This example above makes one wonder what is correct. For, a person teaches his child the kind of wisdom he has gained over the years, the kind of things that HE thinks is correct. If he is a criminal, then he and policemen are natural enemies and therefore it is the truth for him. Now this lesson is not an absolute truth - but just truth from his perspective.

Extending this, lessons such as "Don't lie", "Don't steal" etc. are also truths from someone's experiences or view points. To summarise, all moral lessons and moral truths are someone's opinions.

Now the moment something becomes subjective or true from someone's perspective, it is not necessarily true for everyone. It is therefore bendable, flexible, mutable and expendable. The entire system of morality is therefore flexible and varies from people to people. Morality therefore boils down to what most people around you think it is.

People in the past anticipated or would have observed this kind of thinking and therefore they associated morality with God. If you do this, you will go to heaven and if you do that, you will go to hell. By portraying paradise and burning flesh, and associating it with judgment based on merits accumulated, they tried to ensure people will stick by what they thought was best for society. Note that I am not saying good or bad because they are subjective. Stealing is bad, revenge is bad and so on - lessons such as these kept people from doing things that would bring about an entire system of anarchy and lawlessness, and if such an environment existed, society couldn't have progressed to what it has today.

Why you ask? Many of the scientists who brought about revolutionary technologies are perhaps wimpy looking and powerful muscular people could have broken necks. But fear of being judged by God prevented  them from doing such things. If God didn't judge them, society would definitely. There are always people who don't care about judgments and therefore the system of law was needed.

Rama and Krishna are two great heroes of our past, God to many, mythological to some, historical characters to some. But Rama and Krishna are quite different in their personalities. While both of them appear to be perfect in all ways, knew all the arts, stood and fought for justice, were good looking and made all girls around them swoon, great warriors and so on, they were also very different.

Rama was an ideal person. He followed all the rules of Dharma, dotting all the i's and dashing all the t's. He was a boy scout, flawless in his execution. On the other hand, Krishna bent many rules. The simplest example was tricking Drona by getting Yudhishtira to say Ashwaththama was dead and blowing his conch when Yudhishtira was saying that it was the elephant Ashwaththama, thereby intentionally getting Drona to think incorrectly that it was his son Ashwaththama who was dead. Rama would have never done it.

Now the question is, was Krishna right in doing it? Purists (Rama) will say that it is fighting dirty, you were misleading him intentionally while others will say that it was right, he wanted to win the war and he got things done. Morality is full of examples such as these. Not everything is in absolute black and white, rather everything is in varying shades of grey.

However, it cannot be told with absolute certainty that Rama would have behaved in the same way he did if he was there during Krishna's time. For, our actions are also largely governed by those around us. Rama's world was one filled with more overall "goodness" - where more people were (conventionally) just. Even Ravana was like that, he never forced himself upon Sita. Krishna's time was more corrupt, with people like Duryodhana and Dushasana having no limits to how low they would stoop (nothing compared to the world we live in though, again, the lowness being subjective)

What I have noticed is that we live in a hypocritical society. We are taught to do a lot of things, but in reality, none of them is followed. Everybody bends rules when it is convenient. And we only point fingers at those who do things that we wouldn't do because we are afraid of repercussions (either legal or of being talked about), not because we think it is right. We all have rules, but as situations arise, we start dropping them one by one. We pass comments about how immoral strip clubs are and then when you get a chance to go to Las Vegas, you are immediately asked "So, you went to strip clubs huh?" because it is expected that people will go. The so called moral fabric is basically a material made of nets with holes all over.

The society that we are in currently exists in the way it is, not because of the inherent goodness of people, not because people in general are good but because of rule of law. Imagine for a moment, a world where you cannot be penalised for anything. Imagine a world where you cannot be jailed or punished. What would happen? If people don't fear accountability, if people don't fear being talked about, if people don't fear punishments, will they continue to live by following the rules of Dharma? Of righteousness and justice and ideals?

Chanakya said that straight trees are cut first. So to be a Rama in this modern world doesn't seem viable. One must therefore not live based on ideals that have been taught or handed to us, rather constantly learn from the surroundings and from others' experiences and adapt one's policies, beliefs and principles continuously. One must therefore attempt to be a Rama in Rama's world and a Krishna in Krishna's world and definitely not a Rama in Krishna's world for it is as incongruous as it is fatal.