Thursday, December 31, 2009

Disabling splash screen in ubuntu 9.10

The splash screen is shown when you boot up ubuntu. You can stop showing it and display lot of details about your boot process as below.
Run gedit in su mode and edit the file /etc/default/grub
 sudo gedit /etc/default/grub
Locate the line that shows the floolwing
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Remove quiet and splash
GRUB_CMDLINE_LINUX_DEFAULT=""
Then save and close out of your editor

Run the following command to update grub.
Code:
sudo update-grub
This may take a couple of minutes with out any visible feedback. You will come back to bash prompt eventually.
After the previous command is finished you should be able to reboot and when you boot up you will have a verbose boot with out a splash screen. You can experiment with "splash" alone removed from the config file.



Sunday, December 13, 2009

Mounting Remote Directories with SSHFS

Recently, I was demonstrating ssh tunneling to some of my students. One of them asked me how they access remote directories in GUI. This can be achieved in several ways. Let us try mounting via ssh.

Install the sshfs package on the machine you want to mount the remote directory.

$ sudo apt-get instlall sshfs

You need ssh server running on the remote machine and you must have a valid username and password on that machine.
In the example below, I am assuming that you have an account named ubg on a remote_server . Replace remote_server with its IP address. /home/ubg/remote is the local folder into which the remote folder will be mapped. Now let us mount the remote directory.

$ sudo sshfs ubg@remote_server: /hume/ubg/remote

This will mount the home folder of the user ubg on remote_server to the folder /home/ubg/remote on the local machine. You can mount any folder on which you have read permission to the local machine. See this example.

$ sudo sshfs ubg@remote_server:/usr/share/doc /hume/ubg/remote

Now, you can access the remote folder via nautilus like a local folder.

You can unmount the remote folder with

$ sudo fusermount -u /hume/ubg/remote

Tuesday, December 1, 2009

Some wget tricks

The wget is a command line utility that can download files from web servers and FTP servers.
For example , you can download the DVD image of Karmic Koala using the following command.

$ wget http://cdimage.ubuntu.com/releases/9.10/release/ubuntu-9.10-dvd-i386.iso

If an FTP server requires a login and password, you can enter that information on
the wget command line in the following form.

$ wget ftp://user:password@ftp.example.com/path/to/file

You can use wget to download a single web page as follows:

$ wget http://unixlab.blogspot.com

A file named index.html will be created in your current directory

If you open this index.html in a web browser , you will find some of the links broken especially images. . To download all the images and other elements required to render the page properly, -p option can be used.

$ wget -p http://unixlab.blogspot.com

This will create a folder named unixlab.blogspot.com with index.html in it.

But if you open the resulting index.html in your browser, chances are you will still
have all the broken links even though all the images were downloaded. That’s because
the links need to be translated to point to your local files. So instead, do this:

$ wget -pk http://unixlab.blogspot.com

Sometimes an HTML file you download does not have an.html extension, but ends
in .php or .cgi instead. . If you wget files from such a site , your browser will complain when you try to open the file. To solve the problem , you can ask wget to append .html to such files using the -E option:

$ wget -E http://unixlab.blogspot.com

I use the following command line to keep a usable copy of the website on my hard disk.

$ wget -mEkK http://unixlab.blogspot.com