Monday, February 05, 2007

Subdirectories of Website

What a lousy title. What I wanted to jot down here is how you can prevent your webpage from showing the subdirectories and the contents of the directories online. For example, if someone has a geocities account and the webpage is geocities.com/XYZ with two subdirectories A and B. If A and B are used mainly for storing files and not part of the links to your webpage, you can prevent the files in those directories from being shown by adding an index.html file in the subdirectories. In the index.html file, you can enter whatever you want, e.g. Forbidden / No authorization to view this page / Go away / Whatever. Therefore, whenever someone opens geocities.com/XYZ/A, instead of getting a list of files which you have kept in A directory, they will only be able to view the index.html page. Ta da! That is probably elementary but it took me a while to figure it out.

Sunday, February 04, 2007

Vim Syntax Highlighting

I've been trying to understand how to get the syntax highlighting to work. I know that it works because when I create files like index.html or when I edit files like .bashrc or .bash_profile, there will be syntax highlighting. However, when I create a file for example 'fluxbox' in order to enter my startup script there, no colours appear even with setting ":syntax on". I was puzzled about that. After looking for a very long time, I finally found out:

1. The type of highlighting will depend on the extension of the file, which I have created. For example, if I create index.html, the colors will appear automatically. If the file was just named index, there will not be any automatic syntax highlighting even with html codes in it. I had to go through a few tutorials, before I found one which actually mention this!

2. You can force syntax highlighting for files with odd, different or no extension.
set: syntax=sh
set: syntax=html
set: syntax=php

and so on

3. You can check for the supported languages in /usr/share/vim/vim70/ftplugin

Thursday, February 01, 2007

Time

Being a time freak, I've started timing some of the processes using the command time.

1. $ time updatedb
real 11m23.021s
user 0m2.532s
sys 0m6.276s

2. $ time emerge qt
real 46m19.128s
user 28m45.472s
sys 3m7.316s