Tutorials


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. I couldn’t find a neat tutorial to do this and this was not of great help either. So, let us see how to get this done.

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. If you have a Debian based machine,

sudo a2enmod

Which module would you like to enable?
Your choices are: actions alias asis auth_basic auth_digest authn_alias authn_anon authn_dbd authn_dbm authn_default authn_file authnz_ldap authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cern_meta cgid cgi charset_lite dav_fs dav dav_lock dbd deflate dir disk_cache dump_io env expires ext_filter file_cache filter headers ident imagemap include info ldap log_forensic mem_cache mime mime_magic negotiation php5 proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http proxy rewrite setenvif speling ssl status suexec unique_id userdir usertrack version vhost_alias
Module name?rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

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.

<Directory /var/www/>
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

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

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.

I’ve put down few steps to make your own Hackergotchi in less than 10 minutes. I’ve used the GIMP. Nevertheless, it should be easy to use these steps in other Image Editing Softwares as well. (Click on the thumbnails to view full size)

Original

1) Find a good photo of yours, preferably with a plain background. If you can’t find one such photo, you’ll realize the power the Fuzzy Select tool (also called Magic Wand by some others). We start with this photo (Google was generous enough to find a picture of a baby this purpose :-) ).

HGC5

2) Now, use the Fuzzy Select (Magic Wand) Tool. Play around with the option called threshold. You always have Ctrl+Z to go back. Select any region which does not fall under what you define as Face and keep deleting them. ( Process can be made faster by holding down the Shift key while selecting. This will keep adding all the selections)

Be sure to have the Feather Edges option checked. We don’t want rough edges.

HGC73) Now use the Free Select Tool (Lasso) to select and delete the areas that are still left over. Magnifying the image will be of great use to remove unwanted areas very close to the face. Edges of the selection come out better when the image is magnified.

HGC8HGC9

There, we have the face. To get better edges, we could do a few more things.

HGC24) Select the white region (area other than the face). This can be done by clicking on the white area with the Fuzzy Select Tool.

Now, do Select -> Grow.. and grow the selection by 1 px. Delete.

HGC35) The edges should be better now. Select the white area again using the same method described above. A good idea is to make this area transparent. Select Colors -> Color to Alpha. If you can’t find this under the Colors Menu search somewhere else. Basically, we want to make the white region transparent. Select White in the Color to Alpha dialog box and press OK. We just have to drop a shadow and we’re done.

HGC126) To add a shadow, select the face. For this, select the transparent area using the Fuzzy Select Tool just as we did for the white area. Invert this Selection by doing Select -> Invert or Ctrl + I. We now have the face selected. Now select Filters -> Light and Shadow -> Drop Shadow. Again, if you can’t find this option, search somewhere else.

    final

    We’re done!

    Scimನಮಸ್ಕಾರ வணக்கம் सुस्वागतम्

    Recently I got this urge to type in Indian Languages on my comp. And so I came across SCIM and m17n. I use Debian GNU/Linux and the GNOME Desktop Environment. Getting this to work was a cakewalk!

    Here are the steps to follow.

    • Open a terminal. And install the following packages.
    • sudo apt-get install m17n-db m17n-lib-bin
      sudo apt-get install scim scim-m17n scim-gtk2-immodule scim-modules-socket scim-modules-table

    • That’s it! You now have everything needed on your computer.
    • Run scim . You’ll notice a keyboard-shaped icon SCIM Keyboard Icon on your GNOME Panel. Right click on this and go to ‘SCIM Setup’. Play around with this. There are lots of interesting features like Keyboard shortcuts which you can configure to make life easier switching languages.
    • Now right click on the area where you are typing and Select SCIM Input method.
    • Once this is done, you can Left Click on the above icon, select your language and start typing!

    Mac OS X users could try this. Others, maybe you could try this.

    ನಮಸ್ಕಾರ வணக்கம் नमस्कार