Monday, July 12, 2010

Kolmogorov complexity using R(statistical language)

"Jijh yzvzn hsdj ljsd kjads kajaa kajkas"

Kolmogorov complexity is a way of measuring information i.e. a way to measure how much information is present in a message.


To be continued...

Information Theory

What is information ??

Logically speaking information is inversely propotional to uncertainity.When the uncertainity about a certain thing or even dissappears then what we have is information.

For instance when you flip a coin you are uncertain whether it would show heads or tails. The moment it shows heads/tails the uncertainity is gone and what you have left is information , information that the coin showed up HEADS..

Now suppose you have an unfair coin(heads on both  side). Now in this case there is no uncertainity because the coin will always show up heads. Since in this case uncertainity is zero thus we have no information to attain.

To be continued....

Saturday, April 24, 2010

How to install linux from hard disk (save your cd's & dvd's)

A couple of months ago,while i was looking for a shift from mandriva to backtrack my laptops cdrom went down. So i googled for "installing linux from iso image without burning cd" etc etc...
But a lot of those articles were missing the exact how to or shall i say the proper procedure and explanation.
After tinkering for a while i got the installation working on my system. Here's a how to on how i did the same.

My environment :
Host = mandriva 2010 ,
Iso image = backtrack.iso ,
Only single hard disk on my system.


Partition table :

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 20G 670M 97% /
/dev/sda5 79G 79G 479M 100% /home


Herein my i have 2 seperate partitions for root and home.
But for installing another distro I need to have another partiotion. So im going to make another partition using cfdisk utilty (you can also use graphical qtparted)of 10 Gb, type = ext3 (you can choose ext4,xfx etc). After that my partition table read :


Filesystem Size Used Avail Use% Mounted on
/dev/sda1 20G 20G 670M 97% /
/dev/sda5 79G 79G 479M 100% /home
/dev/sda6 9.6G 100M 9.5G 1% /mnt/backtrack


First of all u need to copy or move the iso image to your host linux.
Suppose your iso image is in /home. Then proceed as following
Move the iso image to root partiotion

$] sudo mv backtrack.iso /
Now i will mount this iso image to a mount point (/mnt/iso)
$] sudo mkdir /mnt/iso
$] sudo mount -o loop /backtrack.iso /mnt/iso

Why we mounted the image is so that we can copy the initrd.gz(initial ram disk) and vmlinuz(statically linked executable file which contains the Linux kernel). Now that the image is mounted at /mnt/iso, so we will copy the desired files to root (i.e. / ) partition.

$] sudo cp /mnt/iso/boot/vmlinuz /
$] sudo cp /mnt/iso/boot/initrd.gz /

**NOTE: For ubuntu based systems you can substitute the "boot" with "casper" in above commands
**NOTE : Since backtrack is based on slackware so vmlinuz and initrd.gz are located inside boot directory of the iso image, for other distributions you can find them as : -

$] cd /mnt/iso
$] find . -name vmlinuz
$] find . -name initrd*

Now we will edit our /boot/grub/menu.lst and insert an entry for location of initrd.gz, vmlinuz and iso image.

If you have followed this tuturial throughout,then you need to edit /boot/grub/menu.lst as follows : -

Make a backup of original menu.lst before making any changes to it
$] sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.orig
$] sudo vi /boot/grub/menu.lst
Now add the following entry (after the last entry already present in menu.lst)

title install bt4
root (hd0,0)
kernel (hd0,0)/vmlinuz ramdisk_size=9999 root=/dev/ram0 rw rootdelay=20 nocd iso-scan/filename=(hd0,0)/bt4-beta.iso
initrd (hd0,0)/initrd.gz

**NOTE :
  • You can write anything after title,coz whatever you write after title is what gets displayed at grub boot prompt when you reboot your system.
  • If your iso image,vmlinuz and initrd.gz are at other location, for instance /home, then replace "(hd0,0)/vmlinuz" with "(hd0,0)/home/vmlinuz" & "(hd0,0)/initrd.gz" with "(hd0,0)/initrd.gz"

Thats it !!!!! We are done . Now reboot your system and select the title and you are ready to rock...
In case you faced any problems leave your comments & I assure of a promt reply.

Friday, August 28, 2009

getting BSNL-EVDO to work in linux

Device : ZTE EV-DO AC8700 800M

Product Vendor : Qualcomm, Inc.

First of all connect your device to any of the usb port. 

$ lsusb

The EVDO USB card provided by BSNL is manufactured by ZTE Corp. But when it is probed using lsusb , the device vendor will be shown as Qualcomm.


The output of lsusb looks somewhat like this : -

# lsusb
Bus 005 Device 004: ID 046d:08c6 Logitech, Inc.
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 027: ID 05c6:6000 Qualcomm, Inc.
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 004: ID 0a5c:4502 Broadcom Corp.
Bus 002 Device 005: ID 0a5c:4503 Broadcom Corp.
Bus 002 Device 002: ID 0a5c:4500 Broadcom Corp.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

The above output gives us the vendor id (05c6) and product id(6000)


Now we need to make sure that our linux kernel identifies this device.For that we need to insert driver module, specific to the make of the device(which is Qualcomm in our case). In order to do so we will run modprobe with the product and vendor id as

# modprobe usbserial vendor=0x05c6 product=0x6000


Thereafter we will again run lsusb and grep for qualcomm and the output shows a lot of info on bus id,device id,vendor id etc ensuring that your linux machine has accepted the device and its ready to be used. 

#lsusb -v | grep Qualcomm
Bus 003 Device 018: ID 05c6:6000 Qualcomm, Inc.
idVendor 0x05c6 Qualcomm, Inc.


Now we need to create a dialup profile which will contain our account info(username ,password etc). But prior to that we need to install wvdial. To do that simply search for wvdial in your distributions package/software manager else on your command line run :-

#sudo urpmi wvdial(mandriva)

#sudo rpm -ivh wvdial(redhat/fedora etc)

#sudo apt-get install wvdial (ubuntu)

Thereafter on the command line run the following command to generate your dialup profile :--

#wvdialconf /etc/wvdial.conf


Check the contents of your wvdial.conf file by running the following command :-

# cat /etc/wvdial.conf

[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone =
ISDN = 0
; Username =
Init1 = ATZ
; Password =
Modem = /dev/ttyUSB0
Baud = 460800


Now you need to change the phone no. to #777 .Username and password needs to be set to the EVDO number provided by BSNL.


Now you need to add another necessary line to this file.(on the next line just after the  Baud ) : ---
Stupid Mode = 1

 
***What is stupid mode
When wvdial is in Stupid Mode, it does not attempt to interpret any prompts from the terminal server. It starts pppd immediately after the modem connects. Apparently there are ISP’s that actually give you a login prompt, but work only if you start PPP, rather than logging in. Stupid Mode is disabled by default.


Now we are ready to go. Simply execute the following command on the terminal :-

#wvdial

ENJOY !!!!!

Monday, July 7, 2008

Chaos Theory : 'God in details'

Since I was in school  I would always have this weird thought in my mind that -- "This thing wouldnt have happened the way it is hapenning had I not done what I did that time" Eeeeks confusing...ok here's an excerpt from a conversation with my friend..."Hey jammu you know what,if I hadnt dropped my pen an hour ago,things would have been on a different track right now",,,his reply and the rest of the excerpt I cant type here as it had lot of F*** bombs. Whatever, then one fien day while surfing on the net I came to read about - The Chaos Theory, and I knew I wasnt insane. 

It has been said that something as small as the flutter of a butterfly's wing can ultimately cause a typhoon halfway around the world.

Simply put chaos is measurement of randomness or disorder.

 

The phenomenon, common to chaos theory, is also known as sensitive dependence on initial conditions. Just a small change in the initial conditions can drastically change the long-term behavior of a system. Such a small amount of difference in a measurement might be considered experimental noise, background noise, or an inaccuracy of the equipment.

Chaos theory has found lots of application varying from economics to biological sciences.

to be continued...

"Colours"

Nature teaches us a lot about freedom. None of the plants , clouds, mountains ,valleys ,plains show resemblance, they are all unique.The pattern of leaves, the petals of flowers.Nature gave us the freedom of choice, choice as in 'i like red', 'he likes blue','i like cabbages' and 'u like bitter gourd'. These choices add a uniqueness and actually shape up one's personality.This world would have been seriously depressing,were it all black and white. So its against the Nature to supress one's freedom, one's freedom of choice,of thought,of expression. So feel free and put your colours on.

Tuesday, June 24, 2008

MBA -- " Main Bhi Aaya "

Some 3 years ago, while i was in college, i saw this herd of people marching with this "MBA" anthem on their lips, making those who didnt want to jump on their band-wagon feel miserable. Even i was shaken n stirred, looking at this mass hysteria.
So i went to some 3-4 friends of mine (who had by that time enrolled for mba coachings) and asked the same question to al of them - " why mba ? ". The answers that they all gave can be summarized as --" Engineering and mba makes a lethal combo" ; "Because that's what everybody does after engineering";"I couldnt think of anything else ".
Astonishing as it may sound, people in india dont have a choice. Till graduation level we can enjoy flexibilities along with a decent standard of education(like iit's, rec's and lots of other colleges). But as we go hunting for P.G. colleges we dont have that much flexibilities and choices, nor is the indian system that accomodating for research people. You dont get a lucrative job ,moreover research work is pain in the ass, as we still lack the infrastructure required for a world class research centre.
For instance,during my 4 years tenure of B.tech in biotechnology, our studies were more theoretically inclined rather than research and practicals. The most advanced equipment ,that we got to lay our hands and thus became dextrous working on with was this 4 feet tall- "autoclave" ( a biotech lingo-jingo for pressure cooker). Even during our practical exams we would get done with those so trivial 'lab experiments' in a jiffy. But still there was a batch of people who were immensly in love with biotechnology and had firm faith that it will definitely make it to the mainstream, despite those hollow claims,which tipped biotech as the next boom. So the people from that faithful lot went on for their ms(us /australia/germany). But some of those faithful lot, who couldnt afford MS tried for J.N.U ,while the rest of them joined somewhere as research fellows(again honing their skills at autoclave and slide smear experiments). But the indian counterpart of that faithful lot is still struggling to carve out a niche for themselves in the biotech industry. Eventually most of them gave up under the peer pressure of financial stability,and are pursuing some short term management courses or aligning their last sem projects on terms of management/market research.
I myself, joined btech. biotech under the impression created by media ,that biotech is going to be the next boom, also i hated computers coz of the way we were taught computers during our school days, i found it immensely boring. Moreover i had no reasons to go for an MBA, as i didnt want to end up doing the same mistake again,when i decided to go for biotech.So i decided to go for an introspection as to what to do after my graduation.I went to my college library and came out with piles of these "whatever i could lay my hands on" books. For some 2-3 months i was in this indefinite while loop of 'going to the library, issuing books , having a glance , return(book) '. Finally that while() loop came to Ctrl+D(end) , as i found myself stuck with linux and that passion finally landed me with a job in the C.S. domain. But now im haunted by the thoughts of 'growth' 3 years down the line in this domain. And the only choice im hovering over right now is MBA. Though i dont have reasons strong enough to go for it right now.
So the situation is clear, its like we dont have too many options in india. We have responsibilities (financial and others) and we want to enjoy life,and for that we need a hefty pay package, which comes easily with a mba degree. So may be , in near future , i myself too will join this band-wagon of "M.B.A."(main bhi aaya).