Archive for the 'Tutorial' Category

Opensolaris and Ubuntu Dual boot

Open Solaris LogoYesterday I decided to try out the live cd of Opensolaris 2008.05 and decided to install it on my laptop after playing around with it for some time. The install process was painfully slow, but was very easy. If you already had Ubuntu (or any other OS for that matter), then OpenSolaris’s Grub menu would not have autodetected the other OS like Ubuntu does. There would be only one single entry for Open Solaris.

Ubuntu logoI wanted my Ubuntu back and so searched the web for info regarding this and found one. He has given steps to first install Solaris and then Ubuntu, but this holds true the other way round too.

You would need the desktop live CD of Ubuntu for this, so that you can recover Ubuntu’s grub.

  1. After booting to Ubuntu Live system, open up the terminal and type sudo grub.
  2. You will get a grub prompt - here type
    find /boot/grub/stage1
  3. Use this information to set the root device (this may be different for you)
    root (hd0,0)
  4. Then install grub
    setup (hd0)
  5. And quit

This would get back the Ubuntu’s old grub, but now you have to make an entry for OpenSolaris.

Edit the /boot/grub/menu.lst file and add this new entry at the bottom

title	Open Solaris
root	(hd0,1)
chainloader	+1
makeactive
boot

This would enable you to boot to Open Solaris too now. There were problems with my Atheros drivers as usual and I have to find a way to install the madwifi drivers as I did on my Ubuntu. If anyone got wifi working on Acer Aspire 5050 with OpenSolaris, please do leave a comment here.

Setup Wordpress on Nearly Free Speech

Nearly Free Speech.net logoYesterday I moved this blog over to NearlyFreeSpeech.net hosting, which I think has a great hosting plan for almost everyone. You only pay for what you use. The disk space is a bit costly than others ($0.01 per MB), but that cost is due to the numerous backups they take. The bandwidth cost is great, just $1 per GB. And there is no fixed cost for each month. I wanted to move FSLog to NFS, and finally did it. This is a small tutorial on getting wordpress installed and the various plugins I have used.

After you have setup an account with NFS and setup a site, you will be given the site details - like FTP, SSH, etc. I prefer using SSH if available, as it is faster to download and install directly than to get it on my machine and uploading it again.

Just ssh to the site and download the latest wordpress tarball and untar it


$ wget http://wordpress.org/latest.tar.gz
$ tar -xvzf latest.tar.gz

If you want to setup the blog at a subdirectory, just rename the ‘wordpress’ folder to something like ‘blog’. If you want it to be at the root of the site, just move all the contents of the wordpress folder to the parent directory.

Then visit your site http://your-site.nfshost.com or the domain if you have registered one.

It will guide you through the install process which is very easy. You just have to give the MySQL database details. You may need to temporarily give write permissions to the public folder, so that the installer can write a config file.

After this, login to your admin page and remember to change the password from Users menu.

Plugins

After you have your blog setup, its time to get some basic plugins installed. You can get more functionality by installing these plugins.

All you have to do is just download the zip files to the wp-content/plugins/ directory and unzip them. The plugins I have installed are:

WP-SuperCache
This caches your blog’s contents as plain old HTML, so that your server doesn’t have to process and fetch all the data from the database. Previously the install process was a bit difficult, but now it has become very easy. Just unzip and activate.
reCAPTCHA
Prevent comment spam by using CAPTCHA for your comments form, also help in converting books to electronic format.
Wordpress.com Stats
Track your popular posts and other statistics by using the wordpress.com’s stats.
Google Analyticator
Google Analytics is an excellent user metrics analysis tool with bright colorful charts and best of all, it is free. This plugin asks just for your Google Analytics’ UID.
Feedburner Feedsmith
Feedburner is a great service for your RSS feeds and I have been using that for this blog for a long time. This plugin is now the official plugin and it automatically redirectly your feeds to the FeedBurner link.

These are my list of plugins. So, what are the plugins that your have?

Acer Aspire 5050 Atheros AR5006EG wireless in Ubuntu 8.04

Atlast I got wireless working in my Acer Aspire 5050’s Atheros 5006 under the newly released Ubuntu 8.04 Hardy Heron with the madwifi drivers. (BTW the upgrade to 8.04 from 7.10 screwed up my X server and I reinstalled from scratch). Previously I was using the ndiswrapper drivers and they would only work the first 5 minutes. Anyway here is a tutorial on how to get WiFi working if you have one of the Atheros cards.

  1. First get the patched madwifi drivers from the site and extract them to some place (maybe your desktop)
  2. You need to compile these drivers, so you must sudo apt-get install build-essential.
  3. Then cd into that directory which you extracted recently and do a make, sudo make install
  4. Then add the following two lines to this file /etc/modules
    ath_pci
    wlan_scan_sta
  5. Then make sure that you disabled Atheros from System > Administration > Hardware Drivers (also called Restricted drivers management). If you don’t disable this, the modules which you added in the previous lines wont be loaded.
  6. Then restart your system to find a new device named ath0 (when you ifconfig)

PS: I know it has been almost 5 months since I posted here. I am giving the (s/l)ame reason here that I was busy. I haven’t been giving much attention to this blog. If you can give some ideas or suggestions on better managing my time it would really help.

Setting up a local DNS Cache

Whenever you type in a website, the domain name is converted to the IP address and sends the request to the machine. You can have a DNS cache which will speed up the domain name resolving time. I get a boost up of almost 250ms.

You just have to install a package called dnsmasq.

First install it by running (you need to enable the Universe repository)

$sudo apt-get install dnsmasq

Then, open this file /etc/dnsmasq.conf and uncomment(remove the #) the line listen-address=127.0.0.1

After that edit /etc/dhcp3/dhclient.conf and search for a line prepend domain-name-servers 127.0.0.1; and uncomment it. What this does is, whenever you get a new dhcp lease, the dhcp3 client tool on your computer gets the new lease and updates the /etc/resolv.conf file with the right values for the DNS server.

Using the prepend option, we make sure that 127.0.0.1 appears before the other DNS servers. So, if the details of a domain are already in the cache, it retrieves it fast - else it looks for the other DNS servers.

Now open /etc/resolv.conf and you can see that it doesn’t have 127.0.0.1 now.

search yourisp.com
nameserver 127.0.0.1
nameserver 192.168.1.1

The last line may be different for you. I have a router which is configured to use OpenDNS, so my entry points to it.

To check whether the cache really works, execute the following command.

$dig google.com

You will get something like ;; Query time: 252 msec

Executing the command again will get you ;; Query time: 1 msec.

Congrats, you have saved about 250msec by caching the DNS.

Install Emacs Snapshot on Ubuntu Feisty

GNU Emacs logoI am a fan of GNU Emacs, the second most popular programmers’ editor (after vi) and was till now using the old Emacs 21 version which doesn’t have great font. But now Emacs has a XFont backend which makes possible to use good looking fonts, like Bitstream Vera Sans Mono. I wanted to install this on my Ubuntu Fiesty and managed to do it with the emacs-snapshot packages by Alexandre Vassalotti.

Emacs Snapshot screenshot
Here is how you too can install Emacs Snapshot on your Ubuntu.

  1. First add the following lines to your /etc/sources.list file
    deb http://debs.peadrop.com feisty backports
    
    deb-src http://debs.peadrop.com feisty backports
  2. Then add the GPG key to the key database.
    wget --quiet http://debs.peadrop.com/DD385D79.gpg -O - | sudo apt-key add -
  3. Then update and install the following packages. These are only for the 32bit version of Ubuntu.
    sudo aptitude update
    
    sudo aptitude install emacs-snapshot-gtk emacs-snapshot-el
  4. Then you have to specify which font you want to use in the Xresources file.
    echo "Emacs.font: Monospace-10" >> ~/.Xresources
    xrdb -merge ~/.Xresources

This will do the magic and now you can enjoy the cool looking emacs. And also thank Alexandre Vassalotti for the nice packages.

Install Beryl on Feisty and Nvidia

Beryl LogoInstalling Beryl (the cool 3D desktop videos you see on youtube) in Feisty is super easy now. This is made possible because of the restricted drivers manager with which you can install non-free drivers for NVidia cards easily. Follow these instructions and you can easily have a cool looking Ubuntu desktop.

  1. First update your system by typing in the terminal
    $ sudo apt-get update
    $ sudo apt-get upgrade
  2. Then you need to add a repository to your sources.list file.
    Type $ gksudo gedit /etc/apt/sources.list
    Add this line to the end of the file and save it. deb http://ubuntu.beryl-project.org feisty main
  3. Then type this in your terminal
    $ wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -
  4. Then update your system.
    $ sudo apt-get update
  5. Install the latest Nvidia drivers
    $ sudo apt-get install nvidia-glx
    $ sudo nvidia-xconfig --add-argb-glx-visuals --composite
  6. Restart your X by pressing ctrl+alt+backspace
  7. Install Beryl and emerald themes
    $ sudo apt-get install beryl emerald-themes beryl-manager
  8. You can now run beryl by typing beryl-manager in the run application box by pressing alt+f2
  9. To make beryl start automatically every time you login,
    goto System -> Preferences -> Sessions
    In Startup Programs -> New add beryl-manager.

Install Flock on Ubuntu

Flock LogoI have tried Flock long time back when it was released. But wasn’t impressed by it. But now thought of trying it out. For all those who haven’t known what is Flock - it is called the social web browser.

To quote the website “Flock is an amazing new web browser that makes it easier to share media and connect to other people online. Share photos, automatically stay up-to-date with new content from your favorite sites, and search the Web with the most advanced Search Toolbar available today.”

As of now you can’t install Flock through synaptic. you have to download the archive and just run it.

Download flock from the website.
Extract the archive by typing

sudo tar -C /opt -xzvf flock-*.linux-i686.tar.gz

Create a symbolic link to the executable

sudo ln -s /opt/flock flock /usr/bin/flock

Now you can run flock by typing flock or you can instead create a menu item.

sudo gedit /usr/share/applications/flock.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Flock
Comment=Flock Web Browser
Exec=flock
Icon=/opt/flock/icons/mozicon128.png
StartupNotify=true
Terminal=false
Type=Application
Categories=Applications;Network

Then refrech the menu

killall gnome-panel

After that when you start flock it will automatically set up all your blog, photo, bookmark account and will be ready to use.

Blogged with Flock

Install Enlightenment on Ubuntu Edgy

Enlightenment LogoFor many days I wanted to try Enlightenment after reading and seeing many screenshots about it. Yesterday in the LUG meeting I saw it live and was impressed by E. Enlightenment is an open source window manager for X Window system which can be used alone or in conjunction with GNOME or KDE. It has extensive theming support and advanced graphics without sacrificing system performance. This window manager is fully configurable making it the best one out there
The latest stable version is 0.16.8.5 but the development release 0.17 also called DR17 is pretty usable and nice. I have installed DR17 on my Edgy. Here are the steps.

First you have to add a few repositories to your sources.list.

In terminal type sudo gedit /etc/apt/sources.list

Add the following repositories to the file

## E17 repository "edevelop.org"
deb http://edevelop.org/pkg-e/ubuntu edgy e17
deb-src http://edevelop.org/pkg-e/ubuntu edgy e17

You can replace edgy with dapper if you are using Ubuntu 6.06.

Then type the following lines to download the gpg keys and to add it

wget http://lut1n.ifrance.com/repo_key.asc
sudo apt-key add repo_key.asc

After the repositories are added, do a sudo apt-get update to update the packages list.

Then finally install e17 by issuing this command. sudo apt-get install e17

You have successfully installed e17 and can now logout of GNOME and again login by changing the session as Enlightenment.

Gimp Tutorials

Gimp LogoFor all those Photoshoppers who think that there is no other tool that can work for them, please take a look at Gimp. This is the Open Source alternative to the costly image manipulation tools. It has all the features of Photoshop and is being used by many people for their artwork. It is also developed at a very rapid pace. The next stable version is going to be 2.4.
Newbies to Gimp may be at first confused with the interface. It takes some time to get used to it. There are numerous website which carry tutorials for learning Gimp. Here is a collection of all those links. This site contains links to many tutorials for learning Gimp. Take a look at it and try to learn to use the Open Source alternative to Photoshop.

Linux Command line tutorial

Here is a comprehensive tutorial which teaches the new linux user - who has always used GUI tools to do his stuff. It starts with a nice example which can make a complex C++ program to find out how much space each user uses into a simple one line bash command. Just go and learn shell programming which can really improve productivity.