September 25, 2010

Installing Wordpress 3.01 In Ubuntu 10.04

Wordpress is an Open CMS and often used for blogging.


1. Make sure you have Apache, MySQL and phpMyAdmin installed.

2. Download the source from the Wordpress website.

3. Extract the source mv it to /var/www/.

4. Next, we need to create a database for Wordpress. This can be done using phpMyAdmin or MySQL.

(a) Using phpMyAdmin,

i) Log in to phpMyAdmin, and enter a database name of your choice, for example wordpress. Click Create.

ii) Go to Privileges, and see if there's a user for wordpress. If not, then create one. Click on Add a new user, and enter a user name and a password for the user. Make sure you have Use text field: selected in the drop down menu.

iii) Click Go.

iv) GO to Privileges again and click the Edit icon in the last column Action of User overview for wordpress.

v) Under Database-specific privileges, select wordpress from the Add privileges to the following database drop down menu. The page refreshes. Click Check All to select all privileges, and click Go.

(b) Using MySQL,

i) varsha@varsha-laptop:/var/www$ mysql -u root -p
Enter password:

ii) mysql> CREATE DATABASE wordpress;

iii) Assuming you are creating a user wp_user for the database wordpress (you may use a different username),

mysql> CREATE USER wp_user;

iv) Choose a password of your choice.

mysql> SET PASSWORD FOR wp_user = PASSWORD("password");

v) mysql> GRANT ALL PRIVILEGES ON wordpress.* TO "wp_user"@”localhost” IDENTIFIED BY "password";


vii) mysql> EXIT


1. Go to the wordpress directory.

varsha@varsha-laptop:~$ cd /var/www/wordpress

2.We need a configuration file for Wordpress.

varsha@varsha-laptop:/var/www$ sudo cp wp-config-sample.php wp-config.php

varsha@varsha-laptop:/var/www$ sudo gedit wp-config.php

Go to the 19th line and make changes accordingly.

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wp_user');

/** MySQL database password */
define('DB_PASSWORD', 'password');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Save and exit.

3. Open your browser and in the address bar type: You'll get a Wordpress Welcome page. Enter a Site Title, Username, Password and Your E-mail. Check Allow my site to appear in search engines like Google and Technorati, if you opt for it. Click Install Wordpress.

Installation complete!

September 24, 2010

Installing C/C++ Plugin In Eclipse

Eclipse has long been used for developing Java applications. When it comes to C/C++, developers familiar with Eclipse would like to use the same, rather than shifting to another IDE.

After Googling for quite long, I came across many links, but most of them were tutorials for downloading Eclipse CDT (C/C++ Development Tooling) IDE. I prefer a plugin for the existing IDE, instead of a separate IDE, even though Eclipse.

Installing Eclipse CDT IDE

1. Download from here.

2. Extract the archive, configure, compile and install.

Installing C/C++ Plugin In Eclipse IDE

1. From Help-> Install New Software..., go to the Install window.

2. Enter the location for Eclipse Galileo (3.5) or for Eclipse Helios (3.6). Click Add.

3. Select the items you need to install. I selected the following.

(a) Under CDT Main Features

i) Eclipse C/C++ Development Tools

(b) Under CDT Optional Features

i) CDT GNU Toolchain Build Support
ii) CDT GNU Toolchain Debug Support
iii) CDT Utilities
iv) Eclipse C/C++ Development Platform

Note: If you select all, some of the items may not be installed.

Then click Next.

4. You get a review window. Click Next.

5. Accept the terms and conditions and click Finish.

6. After completion of the plugin, Eclipse asks you for a restart. Click Yes.

Installation successful!



September 23, 2010

Installing Drupal In Ubuntu 10.04

Drupal is a an Open Source Content Management System. Installation of Drupal on Ubuntu 10.04 is relatively easy. Just follow the simple steps below:

1. Open a terminal and type:

varsha@varsha-laptop:~$ sudo apt-get install drupal6

2. You'll be prompted to select the database. With your arrow keys select mysql and press enter.

3. Enter your MySQL password when you are asked to. This creates a database schema called drupal6 in your MySQL RDBMS.

This is also supposed to auto-create the necessary files in the /var/www/ directory. But it didn't in my case, so I had to go for manual creation of files. Continue with the following steps only if you do not have a drupal directory in /var/www/.

4. Download the drupal6 source from Extract and do the following.

5. Create the necessary directory in /var/www/.

varsha@varsha-laptop:~$ sudo mkdir /var/www/drupal

6. Copy the contents of the extracted directory into /var/www/drupal/.

varsha@varsha-laptop:~$ sudo mv drupal-6.15/* drupal-6.15/.htaccess /var/www/drupal

7. Create a directory files in drupal/sites/.

varsha@varsha-laptop:~$ sudo mkdir /var/www/drupal/sites/default/files

8. Change the owner of the directory.

varsha@varsha-laptop:~$ sudo chown www-data:www-data /var/www/drupal/sites/default/files

9. Create the initial configuration files.

varsha@varsha-laptop:~$ sudo cp /var/www/drupal/sites/default/default.settings.php /var/www/drupal/sites/default/settings.php

10. Change the owner of the file settings.php.

varsha@varsha-laptop:~$ sudo chown www-data:www-data /var/www/drupal/sites/default/settings.php

11. Create a database drupal6 using phpMyAdmin.

varsha@varsha-laptop:~$ mysqladmin -u root -p create drupal6

12. Log in to MySQL if you already have lamp-server installed on your system.

varsha@varsha-laptop:~$ mysql -u root -p

13. Grant permissions to the root user (or the username you log into MySQL with) on all tables in drupal6 schema.


Here, 'username' is either root or any other username you use to log into MySQL and 'password' is the password of the username.

14. Open your browser and type http://localhost/drupal/. You'll get the following page if you haven't created a database for Drupal.

Enter the details and click on Save and continue.

15. Next you'll get a screen as follows.

Enter your email address under Site information. Under Administrator account, enter a username, email address and password. I used my phpMyAdmin username and password and my email address. Click Save and continue.

16. Then you get a page saying "Drupal installation complete". Go to your new site.

Installation complete!

Using GIT Behind Proxy

GIT uses GIT protocol. So if you need to clone any source, you need to do the following:

1. varsha@varsha-laptop:~$ git clone git://

2. If the above works fine for you, then you don't have to do anything else. Otherwise, if you get the following error, then proceed to Step 3.[0:]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

3. Check if you have set up your system proxy.

varsha@varsha-laptop:~$ echo $http_proxy

4. If not, set the proxy.

export http_proxy="<address:port>"

5. Try cloning from GIT again, but this time use http:// instead of git://.

varsha@varsha-laptop:~$ git clone

September 6, 2010

Installing Apache Mahout In Ubuntu 10.04

Apache Mahout is a project that helps in making intelligent applications.


1. JDK 1.6 or higher
2. Ant 1.7 or higher
3. Maven 2.0.9 or 2.0.10 (needed if you want to build Mahout source)


1. Download the sample code.

2. Unzip the downloaded file.

varsha@varsha-laptop:~$ unzip

3. Go into the extracted directory.

varsha@varsha-laptop:~$ cd apache-mahout-examples

4. Install.

apache-mahout-examples$ ant install

Possible errors you may encounter

1. Error: JAVA_HOME is not defined correctly. We cannot execute java Bootstrap FAILED ubuntu


varsha@varsha-laptop:~$ export JAVA_HOME=/usr/lib/jvm/java-6-sun-

Look into
/usr/lib/jvm/ to know what JDK is installed on your system.

/home/varsha/apache-mahout-examples/build.xml:92: The following error occurred while executing this line:
/home/varsha/apache-mahout-examples/build.xml:85: Connection timed out


i) Go to Line 81, and comment out:

<target name="get-enwiki" depends="check-files" unless="enwiki.exists">

<echo>Downloading Wikipedia Data - (~2.5GB)</echo>

<get src=""



ii) About five lines below that, comment out:

<antcall target="get-enwiki"/>

This is 2.5 GB of compressed wiki pages.

iii) Download manually enwiki-20070527-pages-articles.xml.bz2 and save in apache-mahout-examples/wikipedia/.

iv) Go down to 141st line and comment the following:

<echo>Downloading Clustering data (9.2M)</echo>

<get src=""


v) Download manually
n2.tar.gz and save in apache-mahout-examples/wikipedia/.

September 5, 2010

Tricks For Smooth Scrolls And Clicks In Firefox

You can find almost anything in the Firefox configurations page.

For smooth scroll

1. Type about:config in the address bar in a new tab.

2. Click on the warning I'll be careful, I promise!

3. Type smooth in the filter bar.

4. Double click general.smoothScroll. This changes it value from false to true.

For smooth clicks

1. Type dom.ipc.plugins.enabled in the filter bar.

2. Set the value to true by double clicking on the name.

3. Restart the browser for both the effects to take place.