Pages

Tuesday, March 29, 2011

Paid internships.

Once upon a time, interns got paid by companies for the work they did and presently its the other way round. Providing internship has become a very good business model. Just like coaching for IIT-JEE, GRE and other technical certificate examinations, this business is also booming and startups on this model are mushrooming in every nook and cranny. Their delegates boldly invade campuses and classrooms to tell students "we will teach you what your teachers could not".

Isn't even the existence of such organisations a big bold question mark on the effeciency and credibility on the educational institution and its faculties whose students have to even consider opting for it? What do the colleges charge the tution fee for if these "internship-providers can dare to make the above? What do the educational institutions stand for if the students have to look for knowledge outside its premises?

About students now. If the experienced teachers were not able to insert something substantial into your thick skull, how do you expect these money-minded-mushrooming-startup to do so? Remember !! its YOUR interest level which determines how much you learn and NOBODY can force things into your head. Why are you paying the hefty college fees if whats being taught is not reaching you? If you do not have the desire to learn, you are not even elegible for education.

If you have to pay for internship / training you should better go back to  the stone age! You use internet for facebook and po*n, why not use it for what its worth? How can you forget what your best homework help, wikipedia stands for? Knowledge is freely available on the internet and if you really have the desire to learn you should look no further. Especially if what you intend to learn is computers and electronics. Others should also consider it as reference.

Since adivce is freely available in India, let me also slam one on your face. If you couldn't get an internship get yourself a computer and an internet connection and lock yourself in a room with it. Use the money you would pay for internship to get all the necessary stuff you would need for practically playing around with things. Eg microcontrollers and soldering irons if you are an electronics enthusiast or books etc. 

Since you can copy homework and tutorial sheets, it shouldn't be hard on your conscience to get a forged certificate for your internship.

Here is a random list of sites which may help you get started.
www.duckduckgo.com - search the internet - nothing is better.
www.youtube.com - nothing is better than a video lecture.
www.spoken-tutorial.org - IIT Mumbai initiative
http://p2pu.org/webcraft - free online peer to peer learning - a mozilla initiative.
ocw.mit.edu - MIT initiative for free oniline learning

and the list is endless....

If you have to pay to learn, pay your internet bills. 

Note: Do comment irrespective of whether you like it or not.

Wednesday, March 23, 2011

Bootsplash screen

Hey I just changed my bootsplash screen. I remember having tried do do so in the old Grub Legacy and it was a chain of tangled steps. Grub2, i.e the one that comes with present versions of ubuntu makes it fairly simple. All that needs to be done is to edit the /etc/default/grub file and add the path of image to it. eg
$ GRUB_BACKGROUND=/path/to/your/image/file
then fire
$ sudo update_grub 
on your terminal.
Upon next reboot the favourite image shall be set up as the bootloader's background.

Reference
https://help.ubuntu.com/community/Grub2#Splash Images and Theming

Tuesday, March 22, 2011

Grasshopper !!!


grasshopper hopped in front of my camera :)
I was strolling away, and suddenly a grasshopper hopped in front of my camera and I couldn't resiste the temptation to click a few pictures of it ;)

Wednesday, March 16, 2011

Partitioning your hard drive for multiple operating systems

Note: Do check out the hyperlinks in the post and use internet search for terms that you don't full understand. This whole scheme is a production of my idle brain and you can use it at your own risk.


The most crucial step while installing Linux is partitioning your hard drive. This is where most of the first time users end up loosing all their data. I had lost mine too ;). Don't worry I am not trying to scare you off. Its just that you need to be a little more careful and back up all your data before you proceed.
Most of the user friendly distros provide you with appropriate disk management tools for setting up your filesystem. What boggles the first time users is the invisibility of C: and D: drives that they have been so used to. Here they are referred to as /dev/sda1 and /dev/sda2 and some more alien symbols :P. Here is more information on the naming convention for partitions.  And here is  more gyan about primary and extended (or logical) partitions.
One more thing that is worth noting is that there can be a maximum of four primary partitions on a harddrive whereas there may be any number of logical partitions and most Windows OS boot from a primary partition only while Linux is capable of booting from logical partitions also.
Basic needs while installing a dual boot system may be

  • obviously, being able to boot into both OS at will.
  • access data from both OS.
  • have space to install and try more distros.
This is a wikipedia article on UNIX / Linux filesystem hierarchy. A bare-bone Linux installation needs two partitions to work properly: root (/) and swap. With this said and done I would like to show my own partition scheme and then explain what made me do so.
My stable partition scheme - developed after months of tampering and reinstalling.
The screenshot is pretty much self explanatory, however, what needs a little bit of introduction are the following:
  • Repository (NTFS) partition: One thing that the windows operating systems are famous for (apart from their baseless user-friendliness) is their proneness to crashes and viruses. One should prefer keeping data on a partition other than the one containing system files so that a reinstall of windows does not wash them away.
  • Swap: This partition is used by all Linux / UNIX based operating systems for the purpose of paging. More info on Swap space is available here.
  • Home partition: My idea of a separate and central home partition shared by all the Linux distributions is something that allows me to keep all my files on one drive irrespective of the location I OS I work from. And hence I do not have to hunt for files on different OSs when I need them. 
  • The other partitions you see are the root partitions of different OSs that I tried followed by the free space available for me to try more distros ;)
Although its not much of a problem form me now a days but ext (or Linux partitions) can not be accessed from Windows. Although many tools are available for facilitating that, I didn't find anything that would work flawlessly. So one should refrain from storing files on the Linux partition that might be required while running Windows, otherwise switch over to Linux completely.
This is something I found to be a stable configuration for my harddisk partition scheme and the idea is an independent production of my idle brain after months of wondering and tampering and re-installations. Hope this helps a troubled soul lost in the fromatting dilemma finding peace and decide on a partitioning scheme.
There shall be more posts on easily and successfully how I configured a multi-boot system.

Wednesday, March 9, 2011

36 hours in a train

It has been 8 hours since I got off the train which brought me from Delhi to Bangalore in 36 hours, but as I type this piece of my thoughts, I feel the to and fro swaying as if I was still in the train. Quite unusually and against the reputation for Indian Railways, the train left from Nizamuddin and reached Yesvantpuram on time.

This time I decided to travel by the non-AC sleeper class as the weather was pleasant and it just didn't seem sensible enough to pay thrice the usual fare just for being able to charge and use Laptop the whole way. To my demise there were just two charging slots working in 9 sleeper cars and they refused to charge my laptop as they couldn't take the load. This made me feed hungrily on Digit's March issue I was carrying with myself. After I was done with it I started with John Grisham's Theodore Boone which a co-passenger was trying to read. Alas that even lasted for hardly 4 hours. So what I did all the way was sleep, admire the scenery and think.
Scenery was really great but I didn't bother taking pictures because I knew from my previous experience that in such a condition (moving train) I would have to take thousands of pictures out of which only a few would turn out good. Then I thought of getting down the train and taking pictures which triggered a dream in which I was trekking along the mountains with just a d-SLR and a GPS.
I couldn't help but think about the plight of Indian Railways. Why do they assume that people travelling in sleeper won't be having laptop computers or the other way round people with laptops will not travel in sleeper class? The standard of travel in Indian Railways needs to improve a lot. I have a suggestion of creating a non AC first class sleeper in which people with proper reservation would be treated in the similar way as the AC ones so there is more sense of security more comfort and less wait-listed passengers would think of tagging along somebody. The train was almost empty the whole way so the wait-listed passenger problem was not there but I couldn't help but imagine in how many ways the standard in which the Indian mass travels can be improved. eg there is perhaps a design flow due to which water from the tank over wash-room and presence of mirrors in every compartment instead of most desired plug-points. Thoughts also came flashing by when swarms of trans-gender beggars (hijras - as they are popularly called) and asked for money as if I owed them all I had. Seriously, this problem is out of hands and needs controlling now. For most part off the journey I couldn't find electric poles which meant we were travelling in diesel, and I wondered how, if at all, were all engines going green. On the whole the journey passed with its share of daydreaming, conversing, sleeping, actually dreaming and reading.


Trust me, I have experienced the worse train journey once http://bit.ly/h6Ksh9  and nothing can strike that chord again. So this journey was a good one.

Tuesday, March 1, 2011

Portrait of a Rat

There are rats in my hostel .. and this is the proof.

One day I requested Mr Rat to pose so that I could take a picture  and post it on my blog ;) .
Just kidding !! It got caught accidentally on new years eve and I couldn't let it go without taking a few pictures :P. For the Animal Rights Evangelists, I took it far from my hostel and released it near a gutter on the New Years Day. There are still many that keep plundering my food stuff. :(

Monday, February 28, 2011

NO STOPPING NO STANDING

It is meant to be followed while driving but people tend to abide by it while LIVING.
chalna hi zindagi hai ... chalte hi jaa rahe hai 
NO STOPPING NO STANDING

Sunday, February 27, 2011

A worthy candidate for my desktop wallpaper.


I have no idea what its called, it was attractive enough to grasp my camera's attention :)

Tuesday, February 22, 2011

kill a non responsive process

So what do you do when you a process running on your Linux box hangs? Obviously you terminate it and start it again. But how do you terminate it is the question - series of commands or few clicks in System Monitor?
Frankly this post is for those who use the terminal - the "geeks".
Until today I used to kill programs "in this case" like 
$ ps -e | grep firefox
which gave me output like
2472 ?        00:00:00 firefox
2480 ?        07:16:45 firefox-bin  
And I used to fire
$ kill  2472 2480
to terminate the programs.
But today it just occurred to me to automate the process of looking up the process number and killing them. So I set out to use gawk and xargs.
Using gawk I got the process numbers extracted from the output of grep like this:-
$ ps -e | grep firefox | gawk '{print $1}'
2472
2480
and then pipelined this output to xargs kill to invoke kill on each pid.
$ ps -e | grep firefox | gawk '{print $1}' |xargs kill
It kills two processes but for completely restarting the application go to a terminal and type
$ ps -e | grep firefox | gawk '{print $1}' |xargs kill; firefox &
$ firefox & # starts firefox in the back ground
This served my purpose. Terminating two processes manually is not a big task, but why not automate it and make the computer do it for you if its possible?
And don't forget to have a look at man pages of gawk xargs and grep because that is the ultimate source of knowledge :)

Saturday, February 19, 2011

calculate 5000th fibonacci number

This year programming competition in tech-fest at college, was organised by the friend with whom I team up for participating in competitions of other colleges. It was obviously better than previous years. I mean,questions were good, had considerable participants and most importantly, programming was supposed to be done using gcc/g++/java.
There was a question which asked to print the n^th term of Fibonacci series where 0<=n<=5000. Frankly such a large number does not fit in whatever predefined data type you can think of. Creating something like BigInteger of java would have been impossible during the competition and I am not an expert when it comes to java, so I skipped the problem. The coordinators accepted solution for 20 to 30 terms from other teams but demanded it for 5000 from me :P (being famous has its drawbacks !!!). Still I concentrated on other problems  (got through this one but couldn't go to the finals because its timing clashed with another one :( ).
Later that night, after the competition was over, one of the coordinators pinged me on gtalk and asked sarcastically for the solution. This got on my nerves and I determined that I will smack the 5000th element on their face.
There was a bigint library I had created about an year ago which stored numbers in character arrays and manipulated them. I shuffled through my code directory, found it and quickly created a recursive function using memorisation to serve the purpose. The problem was that it worked fine for inputs upto 1302 but gave a segmentation fault for numbers above that. Puzzled and perplexed I resorted to Internet search and discovered that it was because of default stack size of 1MB allocated to every process. A few minutes later I stumbled upon the solution to increasing it which was as simple as adding
ulimit -s unlimited  
to
/home/<user_name>/.bashrc  
file and starting a new session. This increased the stack size to unlimited i.e now my program could use all the RAM available.
After this was done, my program successfully calculated and printed the sequence upto 7000 but ran out of RAM after this and gave Bus Error. 
I redirected the output of the program to a text file, attached it to a mail and sent it to the coordinators ;)
Here is a screenshot showing a terminal window with the 7000th Fibonacci number and  the state of my system while calculating it.

P.S: The code for my program is hosted at www.github.com/bhanuvrat/bigint .