Sunday, 28 December 2008

Intresting modules in Drupal



ACL module

It is an API for other modules to create lists of users and give them access to nodes.

Sub modules to be installed for enabling its capability:
  • Content Access (uses ACL to provide by-user access control, if it's installed)

Content Construction Kit (CCK)

It allows you to add custom fields to nodes using a web browser. CCK builds on that ability by allowing you to add custom fields to that content. If you use the Views module, CCK also makes all your custom fields available in any View.

CCK is actually a group of modules. The primary module is called 'Content' and it is required in order to use any other CCK modules. The tarball includes a few other modules, which comprise the 'Core CCK' modules. They include:

  • Text
  • Number
  • Nodereference
  • Userreference
  • Optionwidgets
  • Fieldgroup

Views

You need Views if:
  • You like the default front page view, but you find you want to sort it differently.
  • You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
  • You use /tracker, but you want to restrict it to posts of a certain type.
  • You like the idea of the 'article' module, but it doesn't display articles the way you like.
  • You want a way to display a block with the 5 most recent posts of some particular type.
  • You want to provide 'unread forum posts'.
  • You want a monthly archive similar to the typical Movable Type/Wordpress archives that displays a link to the in the form of "Month, YYYY (X)" where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.

Views can do a lot more than that, but those are some of the obvious uses of Views.

Pathauto

The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias.

Better Select

Better Select module overrides all multiselect HTML elements in Drupal and replaces them with checkboxes, in an auto-scrolling div so they don't take up much room on the page.

Automated Logout

This module provides a site administrator the ability to log users out after a specified time of inactivity. It is highly customizable and includes "site policies" by role to enforce logout.

Chat Room

This module enables chat rooms to be set up on Drupal sites. No additional software is required. Chat Room uses AJAX to update chats without page reloads. Chat rooms are nodes that provide access to chats and chat archives. This module does not support pop-up windows or invitations.

Porter-Stemmer

This module implements the Porter-Stemmer algorithm to improve English-language searching with the Drupal built-in search.module.

It reduces each word in the index to its basic root or stem (e.g. 'blogging' to 'blog') so that variations on a word ('blogs', 'blogger', 'blogging', 'blog') are considered equivalent when searching. This generally results in more relevant results.

Google Custom Search Engine

Google Custom Search Engine (CSE) is an embedded search engine that can be used to search any set of one or more sites. No Google API key is required. More info at http://www.google.com/coop/cse/

After installing this module, configure it by entering Google's alphanumeric ID for your CSE. Once you have granted permission for one or more roles to search the Google CSE, the search page can be found at search/google, and a search block can also be enabled.

Due to Google and Drupal both making use of "q", this module requires that clean URLs be enabled.

Features available only in the Drupal 6 version:

In addition to the CSE functionality, SiteSearch on one or more domains or URL paths can optionally be configured. Radio buttons allow users to search on either the SiteSearch or the CSE, and searches can default to either option.

The "Google CSE search" module is an optional glue module that integrates Google CSE with Drupal's core Search API. After enabling this module, search queries will be logged by the Search module and users can click between available search tabs: "Content", "Google", "Users", etc.

An additional "Google CSE results" block can be enabled, assigned to a region, and set to display on certain paths. This block allows any page on your site to host a self-contained CSE search form and results display. When entering search terms, the user will be returned to the same page (via GET request) and the results will be displayed.

YUI Rich Text Editor

This module integrates the YUI Rich Text Editor into drupal to edit content. Similar to a WYSIWYG editor.

World Clock

Features

  • Displays any number of locations (countries/areas).
  • Automatically adjust for DST of each location.
  • Many customizable options, such as display time format, DST mode, footnote, etc.
  • 107 countries/areas are supported right now.

CAPTCHA

A CAPTCHA is a challenge-response test most often placed within web forms to determine whether the user is human. The purpose of CAPTCHA is to block form submissions from spambots – automated scripts that harvest email address from publicly available web forms.

The CAPTCHA module provides this feature to virtually any user facing web form on a Drupal site. The administration settings for CAPTCHA are available at admin/user/captcha.

Cumulus

Cumulus allows you to display your site's tags using Flash that rotates them beautifully in 3D. It works like a regular tag cloud, but is more visually exciting. Cumulus depends on the Tagadelic. Tagadelic is a small module, without any databases, or configuration, that generates a page with weighted tags. Cumulus also requires a JS script called SWFObject. This script is licensed under the MIT license and can't be hosted on Drupal.org. So, you need to get the file from http://pratul.in/files/cumulus.js and put it in your Cumulus folder in your modules directory. module.







Drupal 6.6+ and Proxy related issues


To solve proxy related issues in drupal 6.X follow issues addressed at http://drupal.org/node/7881.

or

Step: 1
++++++
Apply patch: (http://drupal.org/files/issues/proxy6.6.patch)

--- includes/common.inc Wed Oct 22 20:26:02 2008
+++ includes/common.inc Fri Oct 24 10:22:30 2008
@@ -416,6 +416,11 @@
function drupal_http_request($url, $headers = array(), $method = 'GET', $data = NULL, $retry = 3) {
static $self_test = FALSE;
$result = new stdClass();
+
+ //PROXYHACK
+ $proxy_not_required = TRUE;
+ ///PROXYHACK
+
// Try to clear the drupal_http_request_fails variable if it's set. We
// can't tie this call to any error because there is no surefire way to
// tell whether a request has failed, so we add the check to places where
@@ -449,7 +454,19 @@
case 'http':
$port = isset($uri['port']) ? $uri['port'] : 80;
$host = $uri['host'] . ($port != 80 ? ':'. $port : '');
+ //PROXYHACK
+ $proxy_not_required = is_in_no_proxy_list($uri['host']);
+ if ((variable_get('proxy_server', '') != '') && (FALSE == $proxy_not_required)) {
+ $proxy_server = variable_get('proxy_server', '');
+ $proxy_port = variable_get('proxy_port', 8080);
+ $fp = @fsockopen($proxy_server, $proxy_port, $errno, $errstr, 15);
+ }
+ else {
+ ///PROXYHACK
$fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
+ //PROXYHACK
+ }
+ ///PROXYHACK
break;
case 'https':
// Note: Only works for PHP 4.3 compiled with OpenSSL.
@@ -472,10 +489,19 @@
}

// Construct the path to act on.
+ //PROXYHACK
+ if ((variable_get('proxy_server', '') != '') && (FALSE == $proxy_not_required)) {
+ $path = $url;
+ }
+ else {
+ ///PROXYHACK
$path = isset($uri['path']) ? $uri['path'] : '/';
if (isset($uri['query'])) {
$path .= '?'. $uri['query'];
}
+ //PROXYHACK
+ }
+ ///PROXYHACK

// Create HTTP request.
$defaults = array(
@@ -492,6 +518,15 @@
$defaults['Authorization'] = 'Authorization: Basic '. base64_encode($uri['user'] . (!empty($uri['pass']) ? ":". $uri['pass'] : ''));
}

+ //PROXYHACK
+ if ((variable_get('proxy_username', '') != '') && (FALSE == $proxy_not_required)) {
+ $username = variable_get('proxy_username', '');
+ $password = variable_get('proxy_password', '');
+ $auth_string = base64_encode($username . ($password != '' ? ':'. $password : ''));
+ $defaults['Proxy-Authorization'] = 'Proxy-Authorization: Basic '. $auth_string ."\r\n";
+ }
+ ///PROXYHACK
+
foreach ($headers as $header => $value) {
$defaults[$header] = $header .': '. $value;
}
@@ -569,6 +604,25 @@
$result->code = $code;
return $result;
}
+//PROXY_HACK
+function is_in_no_proxy_list($host) {
+ $rv = FALSE;
+
+ $proxy_exceptions = variable_get('proxy_exceptions', '');
+ if (FALSE == empty($proxy_exceptions)) {
+ $patterns = explode(",",$proxy_exceptions);
+ foreach ($patterns as $pattern) {
+ $pattern = trim($pattern, " ");
+ if (strstr($host,$pattern)) {
+ $rv = TRUE;
+ break;
+ }
+ }
+ }
+ return $rv;
+}
+///PROXY_HACK
+
/**
* @} End of "HTTP handling".
*/
--- modules/system/system.admin.inc Thu Oct 16 21:23:38 2008
+++ modules/system/system.admin.inc Fri Oct 24 10:19:54 2008
@@ -1362,6 +1362,79 @@
drupal_set_message(t('Caches cleared.'));
}

+//PROXYHACK
+/**
+ * Form builder; Configure the site proxy settings.
+ *
+ * @ingroup forms
+ * @see system_settings_form()
+ */
+function system_proxy_settings() {
+
+ $form['forward_proxy'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Forward Proxy Settings'),
+ '#description' => t('The proxy server used when Drupal needs to connect to other sites on the Internet.'),
+ );
+ $form['forward_proxy']['proxy_server'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Proxy host name'),
+ '#default_value' => variable_get('proxy_server', ''),
+ '#description' => t('The host name of the proxy server, eg. localhost. If this is empty Drupal will connect directly to the internet.')
+ );
+ $form['forward_proxy']['proxy_port'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Proxy port number'),
+ '#default_value' => variable_get('proxy_port', 8080),
+ '#description' => t('The port number of the proxy server, eg. 8080'),
+ );
+ $form['forward_proxy']['proxy_username'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Proxy username'),
+ '#default_value' => variable_get('proxy_username', ''),
+ '#description' => t('The username used to authenticate with the proxy server.'),
+ );
+ $form['forward_proxy']['proxy_password'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Proxy password'),
+ '#default_value' => variable_get('proxy_password', ''),
+ '#description' => t('The password used to connect to the proxy server. This is kept as plain text.', '')
+ );
+ $form['forward_proxy']['proxy_exceptions'] = array(
+ '#type' => 'textfield',
+ '#title' => t('No proxy for'),
+ '#default_value' => variable_get('proxy_exceptions', 'localhost'),
+ '#description' => t('Example: .example.com,localhost,192.168.1.2', '')
+ );
+ $form['forward_proxy']['proxy_skip_selftest'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Skip HTTP self test'),
+ '#description' => t('Skip HTTP request self test.'),
+ '#default_value' => variable_get('proxy_skip_selftest', '0'),
+ );
+ $form['#validate'][] = 'system_proxy_settings_validate';
+
+ return system_settings_form($form);
+}
+
+/**
+ * Validate the submitted proxy form.
+ */
+function system_proxy_settings_validate($form, &$form_state) {
+ // Validate the proxy settings
+ $form_state['values']['proxy_server'] = trim($form_state['values']['proxy_server']);
+ if ($form_state['values']['proxy_server'] != '') {
+ // TCP allows the port to be between 0 and 65536 inclusive
+ if (!is_numeric($form_state['values']['proxy_port'])) {
+ form_set_error('proxy_port', t('The proxy port is invalid. It must be a number between 0 and 65535.'));
+ }
+ elseif ($form_state['values']['proxy_port'] <>= 65536) {
+ form_set_error('proxy_port', t('The proxy port is invalid. It must be between 0 and 65535.'));
+ }
+ }
+}
+///PROXY_HACK
+
/**
* Form builder; Configure the site file handling.
*
--- modules/system/system.module Wed Oct 22 20:26:02 2008
+++ modules/system/system.module Fri Oct 24 10:20:54 2008
@@ -406,6 +406,16 @@
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
);
+ //PROXYHACK
+ $items['admin/settings/proxy'] = array(
+ 'title' => 'Proxy Server',
+ 'description' => 'Configure settings when the site is behind a proxy server.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('system_proxy_settings'),
+ 'access arguments' => array('administer site configuration'),
+ 'file' => 'system.admin.inc',
+ );
+ ///PROXY_HACK
$items['admin/settings/file-system'] = array(
'title' => 'File system',
'description' => 'Tell Drupal where to store uploaded files and how they are accessed.',
@@ -1877,6 +1887,10 @@
// Check whether we can do any request at all. First get the results for
// a very simple page which has access TRUE set via the menu system. Then,
// try to drupal_http_request() the same page and compare.
+ //PROXYHACK
+ $skip_selftest = variable_get('proxy_skip_selftest', '0');
+ if (0 == $skip_selftest) {
+ ///PROXYHACK
ob_start();
$path = 'admin/reports/request-test';
menu_execute_active_handler($path);
@@ -1884,6 +1898,12 @@
ob_end_clean();
$result = drupal_http_request(url($path, array('absolute' => TRUE)));
$works = isset($result->data) && $result->data == $nothing;
+ //PROXYHACK
+ }
+ else {
+ $works = TRUE;
+ }
+ ///PROXYHACK
variable_set('drupal_http_request_fails', !$works);
return $works;
}

Step:2
++++++
Then download the module "Http Request Fail Reset" from 'http://drupal.org/project/http_request_fail_reset' and enable it.


Step:3
+++++
You will find a 'Proxy Server' link under Home / Administer / Site configuration


Enter proxy details and save your configurations !!!!!!!

Thursday, 25 December 2008

Rounded / curvy corners in Photoshop !


Check this nice way to accomplish this effect by Matt Thommes.

Perfect, simple and effective.

http://matthom.com/archive/2004/09/10/fast-rounded-corners-in-photoshop

Wednesday, 24 December 2008

Drupal not loading pages except homepage


Its due to clean URL. You have to enable mod_rewrite for rectifying this. If you are using Windows OS and want to enable mod_rewrite module then
  1. find the httpd.conf file (usually you will find it in a folder called conf, config or something along those lines)
  2. the httpd.conf file uncomment the line LoadModule rewrite_module modules/mod_rewrite.so (remove the pound '#' sign from in front of the line)
  3. find the line ClearModuleList is uncommented then find and make sure that the line AddModule mod_rewrite.c is not commented out.

Import large file into MySQL : use SOURCE command

Just use SOURCE command. Or, if you want to be clever and have system privileges, just copy the original MySQL database file from the origin server and put it into the MySQL data directory of the destination server. MySQL is really a file system and not actually a relational database system and it knows how to read it’s own binary database files.
  • Put the '.sql' file into a convenient location (the MySQL/bin or MySQL/MySQL5.X.XX directory would be perfect)
  • Create/open the destination database in MySQL
  • SOURCE sqlfilename (if you put it outside mysql bin, you probably need the full path)

**********
$ mysqldump -u -p >> somedatabasetable.sql
$ mysql -u -p
mysql> create database `xxxdb`
mysql> use `xxxdb`
mysql> source xxxdb.sql

Tuesday, 30 September 2008

IEEETrans on ubuntu


If you get the following error on ubuntu....

./IEEEtran.cls:366:Font OT1/ppl/m/n/10=pplr7t at 10.0pt not loadable: Metric (TFM) file not found.

then install the font package on ubuntu using the command:

sudo apt-get install texlive-fonts-recommended

On Ubuntu install the following packages for IEEE related document preparation
sudo apt-get install texlive texlive-latex-extra texlive-math-extra texlive-pstricks texlive-science latex-beamer


Sunday, 24 August 2008

They awarded me with - "Nerd King" title grrr.....


The second version was worst....... I doubt this tool!!!!!!!!

My Score Summary
******************


NerdTests.com says I'm a Nerd King.  What are you?  Click here!


My Nerd Score........


I am nerdier than 82% of all people. Are you a nerd? Click here to find out!

Friday, 15 August 2008

Installing omnetpp on Ubuntu

Here are the steps :



1. Download the simulator archive from omnetpp.org

2. sudo tar zxf omnetpp-3.4b2-src.tgz -C /usr/local/ ; sudo ln -s omnetpp-3.4b2 omnetpp ; cd /usr/local/omnetpp

3. sudo apt-get install bison flex blt lmodern giftrans doxygen libxml2-dev graphviz imagemagick

4. sudo apt-get install tcl8.4 tk8.4 tcl8.4-dev tk8.4-dev

5. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/omnetpp/lib

6. export TCL_LIBRARY=/usr/share/tcltk/tcl8.4

7. export PATH=$PATH:/usr/local/omnetpp/bin

8. sudo ./configure;

9. sudo make

(Step 5,6,7 may be added into ~/.bashrc for future convenience. Remember to remove the word export!)

Following all those step should be no problem. It will be a problem once you in step 9 where compiler will be complaint about some command not found. Example :

opp_msgc -Xnc -Xns sim_std.msg

make[1]: opp_msgc: Command not found

Solution :

10. sudo -i

11. cd /usr/local/omnetpp;export PATH=$PATH:/usr/local/omnetpp/bin

12. make



I have successfully install omnet++ using the steps mention above but when installing it in my pc,i have error: Standard C Math Library not found when running steps 8.

Solution: sudo apt-get install build-essential

Well, that’s all. enjoy your omnet++

Thursday, 14 August 2008

Root login in Ubuntu


Basically in almost all linux machines we will be having root access for login. But in ubuntu by default that option was not enabled.If u want to have root login in ubuntu then u have to do some changes in ur Ubuntu machines.

Steps to follow
1. First enter into ubuntu as your user login.
2. Then open the terminal and type the command sudo -s,it will ask for root access and type the password.
3. Then type passwd root it will ask for new password
4. Open terminal and go to the path /etc/gdm/
5. Open gdm.conf
6. search for AllowRoot=false
7. and then change AllowRoot=true
8. now restart ur machine
9. now u can enjoy with root access



Storage engines in MySQL


When you create a new table in MySQL then there is the possibility to define the table type or storage engine at the end of your table definition. This is not a mandatory part of your table definition. If you don't define an engine then the default one will be used. Later you can change the storage engine by ALTER TABLE command.Here is an example how to create a table specifying a storage engine:

CREATE TABLE demo
{
username VARCHAR(50) NOT NULL,
age SMALLINT NOT NULL
} ENGINE=MyISAM;

Instead of ENGINE keyword you can also use TYPE, however the preferred one is the ENGINE as the TYPE is only for backward compatibility.

MySQL Storage engines

In MySQL you have the possibility to select from the following storage engines:
  • MyISAM
  • InnoDB
  • MERGE
  • MEMORY
In older MySQL version the BDB and ISAM table types were also available but in the new versions they are not more supported. Besides this in MySQL 6 there will be a new table type called Falcon.I

MyISAM
MyISAM is the default storage engine in MySQL. It is the improved replacement of the old ISAM table type. Using MyISAM storage engine every table is stored in 3 different files:
  1. .frm file which stores the table structure
  2. .MYD file, which stores the table data
  3. .MYI file which is the index file
MyISAM storage engine is optimized for speed and supports extensive indexing. You can index BLOB and TEXT and also supports FULLTEXT indexes.

However MyISAM tables do not supports foreign key constraint and row level locking.

InnoDB
InnoDB is a transaction-safe storage engine in MySQL. Table data are managed by the InnoDB tablespace. These table type supports foreign key constraints and row level locking as well. However FULLTEXT indexes are not supported.

MERGE
The MERGE storage engine is a bit special. In this case the data are not stored in the MERGE table, but in the MyISAM tables from which the virtual MERGE table was made up.

MEMORY
In case of MEMORY storage engine the data are stored in the memory and are available only as long as the MySQL server is available. The MEMORY tables are very fast and so they are ideal for temporary tables.


Creating MySQL Users...


The first thing we need to do is create a new user. You could have your application access MySQL as the root user, but that has serious security risks.
There are more ways how you can do this
  • Using CREATE USER and/or GRANT commands
  • Inserting a new record into the mysql.user table
First let's see how to use the CREATE USER command. Here I have to mention that thi s command is available only in MySQL 5 (5.0.2) and newer releases. The syntax is the following:

CREATE USER user [IDENTIFIED BY [PASSWORD] 'password']

Here is an example:

CREATE USER 'user1'@'localhost' IDENTIFIED BY 'pass1';

Now if you check the mysql.user table you can find a new record in it. Notice that all privileges are set to No so this user can do nothing in the DB. To add some privileges we can use the GRANT command as follows:

GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user1'@'localhost';

Here we have added only the most important privileges to the user. With the setting above this user is good to run a CMS or a blog, however with such settings this user will not able to install them as it cannot create tables. To add all privileges to the user you don't have to list all of them but you can use the ALL shortcut as follows:

GRANT ALL ON *.* TO 'user1'@'localhost';

You can create a new MySQL user in one step as well using again the GRANT command with a small extension as here:

GRANT ALL ON *.* TO 'user2'@'localhost' IDENTIFIED BY 'pass1';

The above examples used dedicated commands, but sometimes you maybe want to add a new MySQL user via directly editing the mysql.user table. In this case you just inserts a new record into the table with a normal INSERT command:

INSERT INTO user (Host,User,Password) VALUES('localhost','user3',PASSWORD('pass3'));

Or you can add some privileges as well in a form like this:

INSERT INTO user (Host,User,Password,Select_priv,Insert_priv)
VALUES('localhost','user4',PASSWORD('pass3'),'Y','Y');


Setting-up of PHPMyadmin


The phpmyadmin configuration file is located at: /etc/phpmyadmin folder. To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf:

Include /etc/phpmyadmin/apache.conf


Now restart Apache:


/etc/init.d/apache2 restart

Point your browser to: http://domain/phpmyadmin That's it! MySQL and phpMyAdmin are ready. Log in with your mysql root password and create users to connect to database from your php script.



Installing MySQL and phpMyAdmin on debian platform

To install MySQL,

sudo apt-get install mysql-server

If this is a clean installation of MySQL, it will prompt you to set your root password. Make sure that you type it correctly, as it will only ask you once. If you've upgraded, or installed MySQL before, it may not prompt you for a password.

Testing MySQL

Once MySQL is finished installing, we can test MySQL by connecting to it, using...

mysql -uroot -pyourpassword


After filling in your own password after -p, you'll see a MySQL prompt.
That's it, you're done! You can type 'exit' to get out of MySQL.

Installing phpMyAdmin

if you want to install phpMyAdmin to administrate your MySQL, you can type...

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin


Again, like MySQL, if this is a clean installation, it will ask you to choose a webserver to configure automatically. If you have had phpMyAdmin installed before, it won't prompt you to choose. You can use the space bar to select apache2 and then enter.

Once that's finished, restart it one more time and enter the webserver as apache2.


Adept gives a message that the packaging database is locked by another program


Try

1. sudo dpkg --configure -a

else

2. ps -ewf| grep adept|grep -v grep|awk '{print $2}'

This will list all process being used by adept, one per line. Next kill these processes:

sudo kill -9

else Use this command....

3. $ sudo fuser -vki /var/lib/dpkg/lock

This will ask you if you want to kill the process using the file. Now you can run:

$ sudo dpkg --configure -a

to make sure all packages are fully installed.


Drupal 5.x and Clean URLs on Ubuntu


The default unclean URLs that Drupal provides with question marks lurking around, could be annoying. But it does offer an option to have clean URLs.

Step 1

Check whether the rewrite module for your apache is enabled. Assuming you have an apache2 installation, you can do this by

ls /etc/apache2/mods-enabled/

If you don’t find rewrite.load, it means that the rewrite module is not enabled. Drupal’s clean URLs feature requires this module to be enabled. In ubuntu / a debian based machine try..

sudo a2enmod

This will ask you the enter the module to be enabled. Type

rewrite and press enter

This can also be done as

sudo a2enmod rewrite

This can also be done like this (say for a non-Debian based OS):

cd /etc/apache2/mods-enabled

sudo ln -s ../mods-available/rewrite.load rewrite.load

There! We have enabled the rewrite module for apache.

Step 2
We have to edit /etc/apache2/sites-available/default. Look out for the following lines.


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny

Change AllowOverride None to AllowOverride All. Save the File.

Step 3
Make sure that the .htaccess file under your Drupal installation folder has the following lines


RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


Step 4

Restart the apache server sudo /etc/init.d/apache2 restart

Step 5
Go to your Drupal administration page for clean URLs and enable them.

Wednesday, 13 August 2008

Installing PHP5 for Apache2 on Ubuntu 8.04

PHP5 - Scripting Language
PHP is a general-purpose scripting language suited for web development. The PHP script can be embedded into HTML. This section explains how to install and configure PHP5 in Ubuntu System with Apache2 and MySQL.

Installation
To install PHP5 you can enter the following command in the terminal prompt:
sudo apt-get install php5 libapache2-mod-php5

You can run PHP5 scripts from command line. To run PHP5 scripts from command line you should install php5-cli package. To install php5-cli you can enter the following command in the terminal prompt:
sudo apt-get install php5-cli

You can also execute PHP5 scripts without installing PHP5 Apache module. To accomplish this, you should install php5-cgi package. You can run the following command in a terminal prompt to install php5-cgi package:
sudo apt-get install php5-cgi

To use MySQL with PHP5 you should install php5-mysql package. To install php5-mysql you can enter the following command in the terminal prompt:
sudo apt-get install php5-mysql

To verify your installation, create a php file named info.php and write the following script into it.
print_r (phpinfo());
?>

If you need to have universe source list in your sources.list file
For php4 support
sudo apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi
For php5 support (as discussed earlier)
sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi

Next open /etc/apache2/apache2.conf file and check the index files are correct
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml
If you want to enable some Apache modules (SSL, rewrite, suexec, and include)
sudo a2enmod ssl
sudo a2enmod rewrite
sudo a2enmod suexec
sudo a2enmod include
Restart Apache to make sure all is well.
sudo /etc/init.d/apache2 restart





Apache2 on Ubuntu

Apache is the most commonly used Web Server on Linux systems. Web Servers are used to serve Web Pages requested by client computers. Clients typically request and view Web Pages using Web Browser applications such as Firefox, Opera, or Mozilla.

Installation
To install Apache2:

At a terminal prompt enter the following command:
sudo apt-get install apache2

Enter the user password on promt and confirm on question promt.


To stop/start apache2 write:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start

Your default public folder shall be in: /var/www/ If everything is OK you should see an ordinary HTML page when you type: http://localhost in your browser.

Monday, 11 August 2008

How to reset MySQL password.

Follow the steps below:
  1. Stop the mysqld daemon process.
  2. Start the mysqld daemon process with the --skip-grant-tables option.
  3. Start the mysql client with the -u root option.
  4. Execute - UPDATE mysql.user SET password=PASSWORD('password123) WHERE user='root';
  5. Execute the FLUSH PRIVILEGES; command.
These steps reset the password for "root" account to "password123".

Saturday, 26 January 2008

Land of Indescribable beauty

Kerala the land of indescribable beauty and infinite wisdom famed the world over for its breathtakingly beautiful backwaters, lush greenery and ayurvedic heritage. Legend states that Parasurama, the sixth incarnation of Lord Vishnu created the place by throwing his axe into the sea. Archeological research points to the presence of stone age Paleolithic and Neolithic people in the region. Search of spice brought Jews, Greeks, Romans and Arab muslims to this part in the first centuary AD. Thus migrations of people from different parts of the world facilitated the convergence of various cultural practices, beliefs, world-views and knowledge systems in that region.

The state has made enormous contributions to various filed including architecture, mathematics, astronomy and medicine. Atleast three centuries before Newton and Lieniz, Madhava a prominent mathematician-astronomer have developed infinite series approximation for a range of trigonometric functions. His discoveries opened the doors to what has today come to be known as mathematical analysis. It is believed that the writings of Kerala school of astronomy and mathematics founded by madhava have been transmitted to Europe via missionaries and traders who were active around the ancient ports at Cochin, Calicut and Kodungaloor.

Later in 1497 Vasco de gamma, a Portuguese explorer, with a desire to find spices started an expedition from Lisbon on July 8, 1497 with a group of four ships and a crew of 170 men. One year later their dream was successful with the historic landing near Calicut. Subsequently Dutch, French and British arrived. Slowly colonization began. But still princely states of Travancore and Kochi were able to preserve a nominal independence.

Later in 1936 Sree Chithira Thirunal Maharaja Varma of Travancore made the historic temple entry proclamation, opening the temples of Travancore for all irrespective of caste. In 1957 history was created again when Kerala became the first place in the world to elect a communist government led by EMS Namboothiripad.

Pilgrimages
After Tirupathi the state is the home town to two of the most famous pilgrim destinations of India – Sabarimala Ayyappa temple and Guruvayoor Krishna temple. Unique feature of Sabarimala is that it is open to people of all faith. Pooram festival of thrissur is famous for its elephant procession.

Festivals
Onam a festival celebrated by people of all religions is the calibration of the harvest, tied with the memory of Mahabali’s rule which was considered as the golden age of prosperity.

Boat Race
Vallamkali is a traditional boat race conducted during the harvest festival Onam. To keep up the spirits of the boatsmen highly rhythmic songs were also created called Vanchipattu.

Cultural heritage
Oldest classical dance form in Kerala is Koodiattam, a kind of Sanskrit drama. UNESCO recently declared is as a masterpiece of the oral and intangible heritage of humanity. World famous Kathakali with its wonderful combination of dance, drama, music, poetry, costume, makeup and ritual also originated from Kerala in 17th century. Traditionally performance of this art begins in the evening and continues throughout the night culminating at the auspicious hours of dawn, when god finally conquered evil. Mohiniattam, one of the most lyrical classical dance forms also originated from Kerala.

Folk dances
Theyyam, with its rare combination of dance and music reflecting the tribal culture is a popular ritual dance of north Kerala. Thiruvathirakalli is another popular dance. According to the Indian mythology, Parvathi performed religious penances in order to win shiva as her husband. Siva pleaded and agreed to take her as his wife on this very day of Thiruvathira.

Martial Art
Kalarippayattu, said to be the mother of all martial art was practiced widely in Kerala. It is clamed that a skilled person with a knowledge of Marmams can disable or kill their opponent by a mere touch in a marmam.

Music
Its tradition in Kerala starts from Panchavadyam an orchestra of 5 Instruments originated from Kerala to Sopanasangeetham which is recited only when the inner sanctum of temple is closed for customary ceremonial offerings to god & to Yesudas, Hariharan and Kim Thayil who was named 100th best guitarist of all time by Rolling Stone magazine.

Movies
Directors from Kerala like Priyadarshan (virast) and Santhosh Sivan (Ashoka) literally rocked the bollywood. While Rajeev anchal (Beyond the soul) and Manoj Night Shyamalan (Sixth sense) stormed Hollywood.

As we come out from the history to the current world it is worth mentioning that, in this modern era of knowledge the state still keeps its tradition of richness through Literacy. The state stands first among all other states in education initiatives. A tech savy Kerala is also seen years ago, when mobile phones were the gadgets of the well headed in other parts of the country, Kerala’s fishermen brilliantly used them to negotiate price for their catch and showed the world how intelligent technology can bring benefit to grass root level.

Renowned Personalities
A child who was born in 1920 in a small thatched hut in Kerala like millions of similar dalit families had a dream to be educated. With this he walked 10 KM each day to the nearest school and even further to his college. Faced be social discrimination and poverty he struggled for a better living. Being so poor to eat, he wa taken by a family friend who fed him for two years ensuring that he completed his degree. But he was forced to refuse BA degree finally as he was denied the lecturer job simply because he was from a low caste. Later after working as part time lecturer for some time he borrowed 500 Rs from someone and left to Delhi. After working as a journalist for some time he received a scholarship from JRD Tata to study at London School of Economics. Later he became the tenth president of the Republic of India. From untouchable/socially handicapped to unbelievable and remarkable heights is truly an inspiration to all Indians.

Starting from Sashi tharoor(UN Under secretary), Devan Nair ( President Singapore), K G Balakrishnan ( Current Chief Justice), A K Antony (Defence minister), AKG (1st opposition leader in Indian parliament, Communist leader), Sreedhran (M D Delhi metro), G MAdhavan Nair ( Chairman ISRO, NRSA, Space commission, & secretary to department of state) the land is also a breeding place for many renowned personalities.

Monday, 21 January 2008

Restoring GRUB through rescue CD

Entering Rescue Mode

Rescue Mode environment exists in the system RAM. This is mainly used to perform some system maintenance or repair tasks. To enter this mode you can use any of the “Live CDs” or use your distribution’s installation media if they provide such an option.

As you are going to boot from the CD, boot sequence will have to be adjusted in your motherboard’s BIOS. Having done this, insert the proper CD into the drive and reboot. An interactive menu will appear, type "linux rescue" & enter. Answer questions related to your language, your keyboard, network interfaces etc.

Re-installing GRUB

You need to know what the proper partitions and filesystem types are. I will use sda8 as the root partition and ext3 as the filesystem in this example; change those for your personal setup.

~# cd /
~# mount -t ext3 /dev/sda8 /mnt # Where 8 is the partition containing linux
~# mount -t proc proc /mnt/proc
~# mount -t sysfs sys /mnt/sys
~# mount -o bind /dev /mnt/dev

To install the bootloader, it is necessary to "chroot" into your existing linux system.

~# chroot /mnt /bin/bash

Finally the program grub-install installs GRUB on your drive using the grub shell. You must specify the device name on which you want to install GRUB, like this:

~# grub-install /dev/sda

grub should now be installed on /dev/sda.

Errors

If you get errors that says the file /boot/grub/stage1 not read correctly, it probably means that your fstab/mtab is incorrect for some reason and needs to be fixed. These files are /etc/mtab and /etc/fstab. Edit them and make sure they point to the correct partitions, then try to rerun grub-install.

If you get an error that says can't read /boot/grub/device.map: No such file or directory, it means that you need to use the --recheck option with grub-install.

~# grub-install --recheck /dev/sda



Alternative method (After chroot command)
(In some distributions the above method wont work. In such cases follow the method given below.)

open a terminal and enter.:


~# sudo grub

This will get you a grub> prompt. Execute the following command at the prompt location.

~# find /boot/grub/stage1

This will return a location which you have to use in the next command.

~# root (hd?,?)

Next enter the command to install grub to the mbr

~# setup (hd0)

Exit the grub shell

~# quit
Hope this guide was helpful!

good luck!