Thursday, May 24, 2007

Proxy settings for APT

Just add the following lines into your /etc/apt/apt.conf if you require a proxy to connect to the internet.

Acquire {
Retries "0";
HTTP {
Proxy "http://www.yourproxyserver.com:port";
};
};

You can also export http_proxy variable and include the following in your .bashrc

http_proxy=http://username:password@yourproxyserver:port/
export http_proxy

Tuesday, May 22, 2007

Ubuntu 7.04 (Feisty Fawn) on an external USB drive

First of all make sure you're using an ubuntu alternate cd instead of a live cd. The alternate cd lets you do a lot more than the live cd , it also includes the rescue mode missing in live cd's.

The alternate cd can be downloaded from here .

Boot from the cd , and use the text mode to install. Follow the instructions till you reach the point where you are asked to choose to partition the harddrive .

1 - Do a ALT - F2 , and find out what is your external drive. Simpy execute fdisk -l.

2 - I didnt choose the LVM install , sometimes people face problems . Choose your usbdrive . it should be more like sda , sdb . Mine was the second drive so it was sdb.

3- Let the wizard do the package installation , you can do a ALT-F4 to see if its really installing the packages as at times it seems to get froze.

4- When you are asked to choose the location to install grub make sure you type/choose the name of your usbdrive . In my case it was /dev/sdb.

5 - You'll be asked to take the cd out and do a reboot after everything is done.

6- Dont take the cd out do the reboot , get into the rescue mode . You need to go through a few steps again like language settings , keyboard and all that. Finally you'll be presented with a screen to choose the partition where the root filesystem is installed / to be rescued.

Choose the correct partition , in my case it was /dev/sdb1. The installer will mount this partition can leave you at a Shell prompt . Do a ALT F 2 to open another shell and do su - t get a root shell.

7- vim /etc/initramfs-tools/modules add the following modules
ehci-hcd
usb-storage
scsi_mod
sd_mod

8-
vim /etc/mkinitramfs-tools/initramfs.conf , add the line
WAIT=12

9- Recompile the initrd.img
mkinitramfs -o /boot/initrd.img-kernal-version /lib/modules/kernel-version

10-
Edit the /boot/grub/menu.lst . Search for groot , change it to groot(hd0,0). Also just after the comment "End Default Options" change the root to (hd0,0) , repeat the same for rescue and memtest entries . Also change the entry for Windows incase you have a dual boot with windows , for this change root to (hd1,0).

Take the cd out , Reboot . Make sure you enabled boot from usb in the bios .
Modified from the original article from Ubuntu forums article for Ubuntu 5.10 Breezy Badger

Sunday, May 06, 2007

Saturday, May 05, 2007

Experimenting with VOIP

Recently i tried to bring up a small experimental Softphone setup on linux.

Installed linphone on two different linux distros and tried to establish connectivity , worked like a charm ; voice clarity was pretty decent as well. The most interesting thing was to see the packets captured through tcpdump/ethereal , the SIP messages and then the RTP packets with 20ms worth of payload data ( valid for ulaw/alaw).


Calculation of packet size for G.711 ( two versions alaw/ulaw )
bitrate(kbps) * packet size(ms) = packet size (bytes)
64kbps*20ms=1280bits=160bytes

This was my first experiment with voip , it went really well so im happy .

Mixed thoughts on FreeBSD

I was always curious to know what makes BSD different from linux, so i gave it a try last weekend.

I picked FreeBSD 6.2 and a spare HP Vectra box we had in our lab.The whole installation process was kinda different from most of the linux distros i have experienced so far.

The complete CLI based BSD installation can make you feel little uncomfortable if ur too used to Redhat's Anaconda. Sometimes i felt like im running in circles, configuring and choosing the same install parameteres twice, but well everything takes its little sweet time so in a few mins i got used to the interface. Harddrive partitioning was a little confusing but glad figured a way without getting messed and made a clean Standard Install. Choosing the packages is difficult , but worse was yet to come. Installer repeatedly asked for switching the cd's , i was kinda pissed with that part but then cant really help it.

The naming conventions for the drives are totally different in BSD , the same applies for the ethernet interfaces. Ethernet interfaces were named like dc01,dc0 , fxp0 .I had a single SATA hardrive on the HP box , BSD gave it a strange name /dev/ad0s1a unlike the usual hda0,hdb0 and so on.

The installation finally got completed now it was time boot up the box and put it on network. I struggled to bring the network , only after getting too disappointed i came to know about the "netif " , the network startup script in /etc/rc.d. So the network was up , now how to setup routes, again BSD has its own way of doing things, a different "route" syntax than usual linux box. Also BSD gives you a default csh instead of a regular bash.

Finally everything was set. The routes , IP Adresssing , DNS and i smiled , at least didnt had to switch the cd's again for something i had missed.

bsd01 # uname -a
FreeBSD bsd01 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP i386

Finally trying to learn Guitar

It took me such a long time to get started with guitar, i wish i did it when i was in highschool or university maybe. I hope its not too late now.

I go for guitar sessions twice a week. Its been like two months now since i started , i must say its not too hard to learn but again its not like learning some new programming language or reading a book. It really needs your quality time and attention on daily basis.

If you love music, there's no greater feeling than being able to make your own music, play your own songs . Just sitting in front of TV watching & listening songs like a passive observer doesnt even come closer to pleasure of actively playing it. Once you learn it , you'll be able to appreciate the music you experience in a lot better way , at least now i have a greater sense of respect for people who make music , its not easy at all .

Playing guitar is all about how nicely you can change the chords , its an art that you will only learn with time; there are no short cuts. But then its something that will remain a part of you forever , its worth all that hardwork . Right body posture and holding the notes correctly will always help you learn things quicky.

Well so far ive learned a few songs , and some chords like A, E, D . I hope i get past this A7 chord soon , been practising for a week and im not getting any better.

sleep walk

A while ago i came across a very beautiful guitar composition from the movie "Sleepwalkers" , i was so much in love with it . I didnt know who plays but at one time i really tried hard to find it. Only a few days back a friend of mine shared the same song.

Its beautiful , its called "Sleep Walk" by Johnny and Santo , Thanks a lot my good friend