Wednesday, October 15, 2008

Create USB networking with n810 from Ubuntu hardy

It seems that everything with maemo is pain to do at first. And its true. I just tried to set up usb networking and it took me around 3 hours to do it. I think its only because of the lack of community documentation. If you search for maemo resources in net, you will be amazed how reluctant a community can be in documenting. Anyway, lets start. I did this with Ubuntu hardy.

For the device:
Note: you need to do most of the things in root mode. TO be root you need to install "becomeroot" and the issue the command "sudo gainroot" in xterm. How to install become root can be found by searching the Internet.
You first need to install the g_ether module in the kernel of the device so that the usb networking is virtually working as ethernet connection. For that first connect the device with your computer and if the memory card is mounted in linux, unmount it, otherwise your usb interface would be busy and you will get something like device is busy. To unmount right click on the volume that is mounted on your desktop and unmount.
Then issue the following command in the device:
insmod /mnt/initfs/lib/modules/2.6.21-omapl/g_ether.ko
and that will load the g_ether module into your kernel. and if you issue the command lsmod, you should see something like this:
Module Size Used by
g_ether 26416 0 - Live 0xbf058000
g_file_storage 27560 0 - Live 0xbf050000
cx3110x 56200 0 - Live 0xbf041000
umac 258788 1 cx3110x, Live 0xbf000000 (P)

where you can see the g_ether module. Now your usb networking mode is enabled. You should issue the command
ifup usb0
to make your usb interface up. The usb interface is named usb0 and gets teh ip address 192.168.2.15 autometically. Now you need to configure your host.

Host machine:
Ubuntu normally is not equipped with usb networking mode. We need to enable it first. for doing this, edit the /etc/network/interfaces file and append the following lines to it:
auto usb0
iface usb0 inet static
address 192.168.2.14
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
and then restart your networking service using the command:
/etc/init.d/networkign restart
if you find some problem such as:
SIOCSIFADDR: No such device
usb0: ERROR while getting interface flags: No such device
then you know that your usb interface is busy so the networking daemon cannot capture it. Just unplug the usb cable from the socket and then try the restarting again. It will happen. Now you have a usb0 interface in you ifconfig. And should be able to ping the device after you attack the usb cable again.

Thursday, September 18, 2008

Problems with audio in hardy heron: culprit pulse audio

When i have upgraded to hardy, after that I started to have audio problems. It seems that one application is locking another application from playing. Then I found out that its a problem with flash enabled sites such as youtube. When they play, they prevent other applications such as VLC from playing. So I installed libflashsupport.
#sudo apt-get install libflashsupport

which solved the problem. But then again, when I am listen to youtube, I couldnt start a voice chat in skype. Oh GOD! it turned out to be pulseaudio, the audio server they are using with hardy instead of alsa is the main problem. It is not robust yet and many programs are not comfortable with it. To get rid of all the problems, you can return to alsa and remove pulseaudio. How to remove is told in this wiki.

Monday, September 15, 2008

Firefox in ubuntu is very slow

I was seriously doubting those who were the fans of firefox because whenever I logged in to Ubuntu and used firefox, my net connection was so slow. But with IE it was lightning fast. So I searched a bit and found the following solution which somewhat speeded it up a little bit.
  1. Open a new tab by typing Ctrl-t
    (That’s the Ctrl key on your keyboard and the letter t key at the same time)
  2. Enter about:config in the address bar of Firefox
  3. Enter ip into the Filter: text box
  4. Look for the network.dns.disableIPv6 entry in the table below the Filter: text box
  5. Double click the network.dns.disableIPv6 entry
  6. Restart Firefox
ref: http://techxplorer.com/2007/02/22/slow-browsing-using-firefox-on-ubuntu/

Saturday, September 13, 2008

Sony vaio CR11s webcam not working on ubuntu hardy

My web cam was not working in skype and I found this little solution which worked very well. The essential thing is the module r5u870 which makes the video device to work. We will first bring the latest module from the svn development trunk directly and then install it. Thats all.

  1. Remove any r5u870 or the ry5u870 modules you may already have. (command:
    #modprobe -r r5u870
    )
  2. Install svn if you dont have it installed already (it should be already installed)
  3. Issue the folliowing commands to download, make and install the new module into your karnel.
    svn co http://svn.mediati.org/svn/r5u870/trunk ~/r5u870
    cd ~/r5u870
    sudo make
    sudo make install
    modprobe r5u870
Thats it!! Your webcam should start working now. You can check it out with skype->option->video call or with ekiga. Have fun!!!

ref: http://ubuntuforums.org/showthread.php?t=821343

Suspend / hibernate problem with hardy heron in Sony Vaio VGN CR11s

I think most of us have the problem of suspending the computer with gusty/hardy. I have read so many threads and nobody seems to have an answer to it. Everybody is boasting like "yeah! I know I can do it, but haven't take a look at it yet." funny huh? Why dont you take a look when u know u can do it!!! And some other threads are scary and tells that we really need to recompile kernel and so some other scary stuff. And it was then when I stumbled into a nice little thread where a guy said to issue the command
#sudo rmmod uvcvideo
before suspending the laptop. I did it, and with some doubt slowly close the lid of my vaio. And, magic :) it worked. It went to suspend mode and wake back again :)
ref: http://ubuntuforums.org/showthread.php?t=712331
For other issues with the sony vaio and hardy please take a look at the following thread...
(i lost the address, I will add it as soon as i find it again)

Thursday, September 11, 2008

Ubuntu: adding more space to root partition

I had given a mare 2.5 gigs of space to my gusty when I installed it and over the time it proved to be pretty miser :) So, I decided to add more space to it. I went to windows vista right click on my computer->properties->manage->disk to get disk management snapshot. From there I shrank my D: drive 4 gigs. Then comes the question of how to add this 4 gigs to my ubuntu root drive. If we boot to ubuntu then we cannot do any partition task as the root drive is mounted. So, we need a live CD. Every ubuntu CD is live, so if u got one then just boot from it and it will start a live session. From there, start gParted (the partitioning tool of ubuntu system->administration->gparted) and if the unallocated space is beside the ubuntu root partition you can just resize the root partition and grow it to include the unallocated storage. But here I faced another problem. My D: drive was a primary partition and so the unallocated space resulted from the shrinking of D: drive was just after that. But my linux installation is insize an extended partition. And, sorrowfully, I can see from gparted that the extended partition is locked and I cannot resize it due to the fact that the swap partition which is in extended partition is in use and locked. To recover, I right click on swap partition and unmount (unswap) it, so my extended partition is no longer locked. Then I resized the extended partition to include the unallocated space just preceeding it, and then resize the root partition of ubuntu to include the new unallocated space that I included inside the extended partition. And that was it!! Just apply the changes, and you are done :)

Friday, July 18, 2008

IPv6 Workshop-DNS

In the top of DNS tree there are 13 root servers. Why 13? Because, UDP packets, which is used for DNS, have a header size that can only accomodate 13 entries.
Root servers are called using A, B, C.........M. And some roots are also replicated.

Bangladesh has a replica of F-root.
Underneath root there are top level domains.
Open recursive name servers finds answers for any query coming from anyone. But, the case should be, it should only find answers for his clients. Due to this open recursiveness, there are many DDoS attacks. Reverse DNS is used for security purposes. Many secured servers will not comply to your request if you do not resolve to a reverse DNS query.

In IPv4 for mapping we use 'A' records in zone files, such as
www. A 10.23.2.1
mail. A 10.23.3.1
In IPv6 we use 'quad A' records, such as
www. AAAA 2001:AA::1
A records and quad A records can be mixed in the same zone file.
If zone files have wrong entries about name servers, it is called lame delegation.

For reverse zone records, there is a top level domain named 'arpa', and under that 'in-addr' for inverse address. And then, underneath that we have /8, /16, /24 and then /32 quads in hierarchical order. So while reading we need to read from the bottom, such as, 2.23.10.in-addr.arpa
The catch is, the DNS system is arranged at the classful boundary, but if we have a CIDR addressign like /21 then how can we resolve that? Then we need to go to the nearest classful boundary that we own. For a /21 address, we need to create reverse zone files for all the block of /24 that we own, i.e., all the 8 /24 blocks that are in our /21 domain. And this kind of records are called pointer records or 'ptr' because they point to actual names. So, at the beginning of the reverse zone file, we put the origin of our site which includes everything upto the network part. For example: origin 2.23.10.in-addr.arpa, and then we start putting the seperate machine addresses in different lines. And the lines contain only the machine addresses. For example:
1 PTR www.sumanta.com
2 PTR mail.sumanta.com
Remember, if we dont put any dot after the digits in the left column, DNS assumes that it is not a fully qualified domain name and it appends the origin after it. But if we put dot after it, then the DNS assumes it as a FQDN and doesn't put the origin after it.

Glue records are the records in my name server where I put the name server entries of my own subdomains. For example, if I am sumanta.com and my customer is computing.sumanta.com, then I should have a record in my zone file pointing to the ns server of computing.sumanta.com

Reverse for CIDR addresses:
For CIDR address such as 202.159.0/26 where you cannot keep zone files for any classful boundaries which is lower than the actual classless boundary we use a different trick. They use something like a range. In DNS conf file, the ns server is defined as:
0-63 NS ns.computing.sumanta.com
and in reverse zone files we have records like

$origin 0-63.0.159.202.in-addr.arpa
1 PTR www.computing.sumanta.com

Now, as we didn't put any dot after the left column digit, so the DNS engine will derive the address as 1.0-63.0.159.202.in-addr.arpa, but that is not what we want, we dont want the 0-63 part in the address. That's why we use another trick called CNAME. CNAME is used for synonyms. If we put something like
1.0-63 CNAME 1
then the erroneous 1.0-63 part will be replaced by only 1, which is correct.

IPv6
For IPv6 the hierarchy is root->arpa->ip6->ip6 address divided at every hex boundary
So, at the reverse zone file, we have to write something like 1.0.0.0.0.0E.F.0.0.A.2.2.so on.ip6.arpa PTR www.sumanta.com
But fortunately, we can use the $origin and write all the common part only once and then just write the last part at the PTR records.

Use "DIG" for checking the configuration of the DNS servers.