Pages

dash...

If you are running ubuntu 6.06 or higher try the following

ls -l /bin/sh

The output would be some thing like this

lrwxrwxrwx 1 root root 4 2010-07-22 01:20 /bin/sh -> dash

If you look at it, you will realize that /bin/sh is actually a symbolic link to dash. 
Now if you are familiar with shells then the first thought that would come to your mind is, shouldn't it be bash ?. 
Well  no its not a typo by ubuntu, it is actually dash which actually stands for Debian Almquist Shell. 
This change was done not because the default bash does not have the features required, but because the bash is too big and the number of shell instances that are started during the boot process makes the size of the bash as a disadvantage. 
To counters this and make the booting quicker a quicker lighter  version was made and called dash. 
Now to change all the sh to dash in all the boot scripts would not have been very advisable so instead the usual /bin/sh was changed to dash by placing a symbolic link to dash. 

Grub Error 17

 Note: Most of the steps mentioned here are for grub Legacy not for grub2. There are multiple reasons for Grub error 17 and workaround given might or might not work for you. 

If you are encountering Grub error 17 while booting into a dual boot system, there are various causes for it.
If you have single hard disk which you have partitioned to install dual operating systems the simplest solution is to reinstall grub from a live CD.
1.Boot the system from a live cd
2. open a terminal
3. type the following commands
      sudo grub
      find /boot/grub/stage1
           you will see output similar to (hd?,?), the ? replaced by some numbers
     root (hd?,?)  same numbers are you got in the above output
     setup (hd0)
     quit
4. Reboot

You should have your grub up and working if not then you will have to explore the other possible reasons for the failure
The other possibility for the error is if you have multiple hard disks, with each hard disk for one OS, there are chances that grub is looking at the wrong hard disk while booting.

 Check your bios and see the order in which the hard disks are listed and make sure that the one that has Linux installed is the first one.

If that does not work, you will have to boot the system using a live CD.
 Mount the partition that has linux on it .
 Look at the contents of /boot/grub/device.map in that partition and compare the contents with the output of the command "sudo fdisk -l"
The entries in the device map basically map you hard disks between the bios and the  grub.
If the output of fdisk -l shows that linux is installed in /dev/sd?, where ? could be any alphabet.
The order in which the disks are listed in the device.map is the order in which the bios sees it with the number starting from 0 .
Where are the /dev/sd? is the way grub or linux sees it where the ? will start from letter "a".
Check entries are the same else edit them to the proper numbers. (you can use the size to figure out which /dev/sd? should be which hd? )
To edit the device.map file you will need root privileges, you can follow the following steps
1. sudo -i
2. mount /dev/sd? /mnt (replace ? with your drive letter)
3. chroot /mnt
4. cd /boot/grub
5. Edit the device.map to its correct values
6. run the command
        grub -- device.map=device.map
7. Run the command
       root (hd?,0)  ( where hd? is the hard disk on which linux is installed. you can                    
         also  try getting this info using the find command as explained above )
8. setup(hd?)
9. open the file menu.lst and if there are references to the wrong (hd?) as in the device.map then change them too
10. reboot

Hopefully you should see the grub menu back .
  

Creating Bootable USB using Ubuntu

If you have a iso image of the installation of any OS, you  need not write the image onto a cd to do the installation, here is way to easily turn your external hard disk or your pendrive into a bootable install device.

1. Plug in the usb device
2. In you ubuntu go to system->administation->startup Disk Creator.
3. This will open up a window with two fields
      Source Disc image(.iso) or CD
      Using the button "other" just below this option point to the .iso file that you have.
 4. The second option is the "Disk to use". By default your pendrive or the hard disk will be shown there, just click on the write one and click on "Make start up disk"


Once the above steps are done successfully, you can plug your pendrive or harddisk to any system that supports booting from external usb devices and run the installation.
The same steps can also be used to copy an installation "cd" to a pen drive and make the pen derive work as the installation media. For this you just have to put your "cd" into the "cd" drive and in the first step point to the cd drive.

Download Manager for Ubuntu

A download manager was some thing I always wanted in my Linux system and here it is, a nice cool download manager for ubutnu. 
Allowing you to pause resume downloads, search for them etc, in short manage your downloads effectively. 
Info and installation steps at 

Insmod explained

If you are interested in kernel programming for Linux or writing device drivers for linux  "insmod"  would be a command that you would use most often. 
insmod which can be expanded to insert module is a command that is used to insert modules into the linux kernel at runtime. 
A module can be defined any piece of code that is inserted into the kernel at runtime. 


What exactly happens when  "insmod" is used to insert a module into the kernel. 


Lets compare it with a real life scenario.  Assume your system is like a hotel and the memory like the rooms in the hotel,the kernel is the hotel manager and you are a module who wants a room in the hotel. 
The flow chart below gives the standard steps that would be followed if you ask for a room and relates it with what happens on executing the insmod command. 






Note : This is a very generic way of looking at insmod. There a lot of other things that also take place for eg the version dependency is matched, the module format is matched, the symbols used in the module should be available in the kernel. 









Commands to change the color of text and background in a terminal

Here are few commands to change the color of your terminal  background or the text

open a termimal and type the following command

printf '\e[1;34m'

this will make the text in the terminal to appear in blue.

To take it back to default

printf '\e[0;30m'

You can also change the backgound using

printf '\e[1;40m'

This will make the backgound black.

The effects are not permanent so if you close the terminal and open, you will get back your default terminal.

To know more about the working of these commands you can check out

http://bashscript.blogspot.com/2010/01/shell-colors-colorizing-shell-scripts.html

Configuring NTLMAPS on fedora

If you have an internet connection that runs behind a proxy , you could face problems installing packages using yum.
To work around this problem you can use ntlmaps
You can download the ntlmaps rpm from

http://sourceforge.net/projects/ntlmaps/

After downloading open a terminal and go to the directory where you have placed the file and run the command

tar -xzvf  ntlmaps-0.9.9.0.1.tar.gz 


cd ntlmaps-0.9.9.0.1  (or what ever folder got created after untar)


Open a file by the name server.cfg using the "vi" or"gedit" 


Update the following fields as required for your network. 


PARENT_PROXY:


PARENT_PROXY_PORT: 


NT_DOMAIN:


USER:


PASSWORD: 




Save the file and quit. 


In the folder ntlmaps-0.9.9.0.1 run the command 


python main.py &


You should see something like :


NTLM authorization Proxy Server v0.9.9
.....................
Now listening at ....... on port 5865




Press enter to get back your prompt. 


To start using yum run the following commands 


export http_proxy=http://127.0.0.1:5865
export ftp_proxy=ftp://127.0.0.1:5865


If every thing has worked fine, try 


yum update 




It should be able to get the updates. 


Note: If you use the above method, the ntlmaps will run only in the terminal where   you have run the export commands and the "python main.py " command. 



Broadcom Opens its Drivers

For all those Linux lovers who struggled to get their Broadcom cards to work with Linux here is a great news, the struggle is over as Broadcom has decided to open source their drivers.
With it the driver support available in the main line kernel will go up further making Linux even more user friendly :-).
Read the full article at
http://www.linux.com/news/featured-blogs/158:jim-zemlin/361472:good-news-for-linux-users-from-broadcom?utm_source=twitterfeed&utm_medium=twitter

Installing Directfb On Fedora

After much googling,  I have directfb up and running on Fedora 9 and 13.

After installing the fedora from DVD, ( DVD is preferable cause it has gcc and other development packages preinstalled)

Open a terminal and type

yum update.

If you get an error saying it could not connect to the repository try one of the following
1. If you are behind a proxy that needs authentication then download and run the ntlmaps. Set the respective proxies in the terminal using the "export" command

2. In the files /etc/yum.repos.d/fedora-updates.repo and /etc/yum.repos.d/fedora.repo  you will find lines starting with "mirrorlist" commented and the lines starting with the word "baseurl" uncommented. Reverse this, that is remove the "#" from the beginning of the lines that start with "baseurl" and add a "#" to the lines that start with the word "mirriorlist"

3. Check if the site that mentioned in the baseurl is working by putting it in a browser, if it is not get a new url closer to you geographically from http://mirrors.fedoraproject.org/publiclist/Fedora/13/i386/
and replace it in the two files mentioned above.

Once you have yum update working run the following

yum install libpng
yum install libjpeg
yum install freetype
yum install libpng-devel
yum install libjpeg-devel
yum install xorg-x11-xtrans-devel
yum install libsysfs-devel
yum install zlib


If libsysfs and zlib are not available download them from   

libsysfs: http://www.rpmfind.net/linux/rpm2html/search.php?query=libsysfs
zlib: http://www.zlib.net/


yum install libxext-dev
yum install kernel-headers
yum install kernel-devel-"your kernel version"
yum install directfb

If you can not find the directfb package in the repos you can download the rpm for your version from  http://rpm.pbone.net/ and run


rpm -ivh "rpm file name" 




Once the above steps work with out problems open the file  /etc/grub.conf
Note: You will have to have root privileges to edit this file so use sudo

In this file look at the kernel version that you want to work with and under that title go to the line that starts with word"kernel". At the end of this line add  "vga=791".
791 is basically to set the framebuffer resolution to 1024X768.

Now reboot your system.

Log in and run the command as root
/usr/sbin/fbset.

copy the ouput of this command and paste it at the begining of the file
/etc/fb.modes.
Note: you will need root privileges 

Now run the command "dfbdump"  if you do not see any errors your directfb is up and running.

To modify the resolution of the framebuffer you can do the following.
While the system boots press "esc" during the grub loading stage,
Press "e" after highligting the kernel version you want to boot.
Move to the line starting with "kernel"
press "e"
at the end of this line add "vga=ask"
press "b"

The booting will stop and ask you to press enter to view all the possible resolutions,  you can choose the number which ever you like and if it works, set it permanently in the file /etc/grub.conf. Remember to convert the hex number that you see during boot time to decimal.


Have fun with the directfb :-)

Networking Disabled.....

Ok this one is really trivial, but I actually spent aroud half an hour running various commands and then had to google to realize the trouble, so I guess its worth blogging it.

If your networking was wroking all fine and one fine moment you see that the networking symbol on the panel is showing networking disabled.
Then right click on the networking icon , and see if "Enable networking is ticked" ,if no then click on it enable the networking.

Uberstudent is here

For all the ubutnu fans out there, here comes one more reason to fall in love all over again. Ubuntu based distro,  UberStudent, a student oriented version for linux, designed and compiled with only students in mind has been released. (Thanks to anonymous commenter for correction)

http://www.uberstudent.org/mod/resource/view.php?id=4

Some features that seemed interesting on the first read were,
The interface to all the materials available on the cloud over the net.
Tools for writing research papers.
Nice tools to create good presentations.
Skype and pidgin for communication with every one.

Have put the full version for download, Will surely try it out soon, guess you too should grab one :-).