Archive for September, 2008

Password Protected Directories

September 27, 2008

Have you ever seen those links which when you click on, it asks for a user name/password with an “Authentication Required” message? You should enter a valid u/p to get access to the content of that directory. This method for authentication or authorization is popular especially in the academic web pages. For example in the course pages it is common that home works are public, every one can download and watch them. But answers are not public, so when you are trying to view them it asks for u/p by a message like this

Authentication Message

Authentication Message

In this post I am going to help you to set up a directory like that in your home page. The important thing is that this method works just (I am not 100% sure) on Apache web servers. So first make sure that your web server is Apache. A simple method is to enter an address that does not exist and see the message. Here is an example

Apache Error

Apache Error

And here is the Microsoft’s Internet Information Services (IIS) error message

IIS error

IIS error

So you can see the name of serer and make sure that you are on the right track. Before I start to explain the method I am going to explain 3 linux commands which you will need in the following. So if you are not a naive linux user skip this part ang go straigtly to main section.

Linux 101

  • Connect to the server: To connect to the server you need a ssh client. Previously telnet method was popular but because of its lack of security it is not used widely anymore. Here is an example

    ssh access

    ssh access

  • make directory: If you want to make a new directory naming NewFolder then you can use this command
        mkdir  NewFolder
  • current path: If you want to know the current path which are working in it you can use the pwd command. You will see something like this in the output
        pwd
        /usr/root/web_docs/
  • changing the permissions: For changing the permissions of users to a file or directory you should use chmod command. For example when I say change access of temp.txt file to 644 it means that you should run this command in the terminal:
     chmod 644 temp.txt

If you didn’t understand anything then you need more help. I suggest this breif manual by Paul Stothatrd.

Making a password protected directory

Make a new folder which you like to add protection. Let say the folder name is temp and its path is /usr/root/web_docs/temp/ . Give this folder 755 permission using the chmod command. You need to make two new files and put them in this folder in order to add authentication to it. The file names are .htaccess and .htpasswrd  in the following sections you can find what is their contents

.htaccess

this file should contain these lines:

AuthUserFile /usr/root/web_docs/temp/.htpasswd
AuthGroupFile /dev/null
AuthName "Restricted Access"
AuthType Basic
<limit GET>
require user shalam
</Limit>

The red parts must/may be changed for your purpose. Red part in the first line is the path of your folder, you MUST replace it with your folder address. The second red part is a message which is shown to the user (see first image pf this post). The last red part in the user name which should be used to access this directory; You may change it to anything you like. After saving this file give it 644 permission.

.htpasswd

This file contains the user name and MD5 coded password which should be used to access your protected directory. The file contains something like this

shalam:$1$xdT/7VZ4$fp0kk3Jvq.53YDYRoeUti0

Username, a colon sign, and then coded password. You can make content of this file using several tools available on the Internet. Just search for “.htpasswd generator” and then you will find thousands of links; this one currently is the first result of google. Don’t forget to set the permission to 644 .

I guess you are done, enjoy it!

Childhood Cancer Awarness Month

September 27, 2008

Based on this page September in USA is considered as childhood cancer awareness month. The page contains 19 sad pictures related to child’s cancer accompanied with a short note. They are really moving, especially if you have had direct experience with cancer treatments. In my eye this picture is the saddest one

Looking outside the window

Looking outside the window

The whole story is a good motivation for me to work harder on my research. This words are to me: “smn, try to use Patways with DNA microArray data, its result will be promising. “

Anyone can be student in Stanford

September 19, 2008

Do you like to be a student in the Stanford University? Computer Science department? Then go for it. There is a new program called Stanford Engineering Everywhere (SEE) which allows you to have full access to a bunch of CS course’s materials. Why it is called “Engineering”? I don’t know too.

I read somewhere that their Machine Learning course is the best one on the web. I have no doubt about that, even I think it is probably the best one in all over the world. There were another post in that blog which talks about other online video lectures. Topics there are not limited to computer science and cover a wider range of science: Physics, Mathematics, Computer Science, Machine Learning, Neuroscience and biology, and finally finance and economics. I thinks I worthes to take a look.

The Edge of Heaven

September 16, 2008

Last weekend I went to Princess theater with Gus and watched “the edge of heaven” (imdb, wiki). That was a nice movie, all characters were well defined and whole plot had a good structure. Not too complicated, and also not too simple. There were some scenes which camera was fixed and pursued the main subject just by changing the focus. Music was beautiful and consistent with the whole story.

Edge of Heaven Cast

Edge of Heaven Cast

Maybe I am not the right person to ask about the movie because a lot of things in the movie was similar to my cultural background. Music, and scenes filmed in the Turkey was the same as Kurdish music and natural views. The whole music theme of movie reminds me this Kurdish melody by Omar Dzayi. Hope you like it

Nezam’s opinion

September 6, 2008

I found this blog really accidentally. It is written by a French couple who have traveled almost all of the world by their bikes. The problem is that blog is written in French, or maybe I should say the problem is I don’t know even one French word. Thanks to google automatic translation system I read the part of their memories which is about my home country, here is the translated version. The funny thing is that they have been in my home town, which is not so big to visit it normally. They also talk a lot about Kurd people and Kurdistan which is my mother land. I really liked it, not only because it was about my home town, but also because it was very realistic. They have talked with a bunch of Kurd people who among them I like Nezam the most.

So let’s give a big cheer to the brave writers of this blog Chloé and Olivier. Here is a picture of them in Kurdish custom

Chloé and Olivier

Chloé and Olivier

Loneliness

September 2, 2008

It doesn’t matter how many friends you’ve got, if you had a new hair cut and nobody noticed then you are alone.