Blog

Password-Protecting your pages with .htaccess

If you develop websites or adminster them, you’ve probably been asked or required to password-protect parts of a website. 

So, to help you out, here’s a quick how-to in Apache using .htaccess:

  1. Open a terminal window and navigate to the folder or page(s) you’d like to add a password requirement.
  2. Once there, type the following: htpasswd -c .htpasswd username.  BTW, you can name .htpasswd to another name (something that is hard to guess is preferable).
  3. Enter the password you’d like to associate with the username (from above).  This will create the user and an encrypted password.
  4. Next, create the .htaccess file by typing: vi .htaccess, and add the following in the .htaccess file:

To protect a folder

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName “Your Secret Folder”
Require valid-user

To protect a page

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName “Your Secret Page”
<Files “yourpage.html”>
  Require valid-user
</Files>

Note: You can use a different name for .htpasswd so it’s harder for a hacker to figure it out.

5.   Type :wq! to save and exit. 

6.   For better security, perform a chmod on .htaccess, like so: chmod 644 .htaccess.

As you can see, the steps above are pretty straight-forward.  Also as an FYI, Apache blocks any requests for anything that start with “.ht”.

That’s basically it, I hope this post helps you out.  =0)

SideStep.com: What technology used?

My sister’s been shopping around for airline tickets to go to Asia without any luck.  So, the geekness in me felt the need to help her out. 

Scanning through some blogs I read regularly, I came across SideStep.com.  It is one of the “newer” travel websites that search a lot of other websites’ flight information, which got me curious as to what technology they use. 

Watching what other people/companies are doing and using helps me stay up-to-date with all these technologies.

I initally wasn’t able to figure out what technologies drive their website until I:

  1. Used Steve Gibson’s excellent ID Serve tool to find out what web server they were using
  2. Looked for file extensions and came across the .do extension on one of their links. 
  3. Checked out the HTML code and scanned for methods that buttons and other input controls were calling.

So, for the web server, it’s none other than Apache (yeah!):

HTTP/1.1 301 Moved Permanently
Date: Fri, 13 Apr 2007 21:32:05 GMT
Server: Apache
Location:
http://www.sidestep.com/
Content-Length: 294
Connection: close
Content-Type: text/html; charset=iso-8859-1

For the back-end, it’s Java, most likely an Apache Struts implementation:

And of course, a ton of JavaScript code for client-side functionality.

From this brief investigation, I also learned that SideStep.com, though, a new comer is giving Orbitz and Expedia a run for their money.  Cool!  Better for us consumers.

To summarize: Try to regularly observe what other people and companies are doing, so as to keep yourself up-to-date.  And along with that, try the techniques I mentioned above for your investigation, as you might learn a thing or two.  =0)

Disclaimer: There are a lot of other techniques and tools that you can use, but the steps above, though, may be incomplete served the purpose of this post.

GTD anyone?

I read an article about GTD (Getting Things Done by David Allen) a few months ago but shoved it aside; however, with so many projects demanding my time recently, I started looking into it again (read: need better time management).

I have just barely started using Allen’s system, but have found it to be SO helpful (and quite easy to learn) that I’ve decided to spend more time incorporating it into my everyday life – see the GTD tab above? Sorry, it’s password-protected as it’s for my own use.

So, what is GTD anyway, you might ask? Well, let’s check out what Wikipedia says…

GTD is an action management method and it rests on the principle that a person needs to move tasks out of the mind by recording them somewhere. That way, the mind is freed from the job of remembering everything that needs to be done, and can concentrate on actually performing those tasks.

The premise of GTD, as I understand it, is do the tasks you’ve noted down (in the GTD way) based on the context you’re currently in (i.e., “In front of computer,” “In the car,” “At the office”). Of course, it’s not as simple as that, but it’s not very hard to understand and apply either.

Check out the diagram below to get a better understanding of this system.

Fig. 1.1 – GTD Flow Diagram (view top to bottom)

GTD Flow Diagram

If you have access to a LAMP server, I recommend installing gtd-php and jump right in – this was the fastest and only way I actually understood it.

To end, I recommend setting up some time to read up on it and give it a try. There’s nothing to lose and maybe a lot to gain… =0)

Too much in your mind, mind map it!

With the coming of the information age, comes information overload. If you’re like me who reads constantly to keep up with technology, your mind can get overloaded with so much – acronyms, concepts, theories, how-tos – you name it.

So the question is: what do you do with all that information stored in your mind (read: brain)? The answer is mind map it.

I’ve been fond of using mind map software because it helps me orgranize my thoughts and note them down. This gives me a lot of benefits, but the best one is it makes me see things clearer because I’m able to visualize it; it also affords me a knowledge-base of sorts, which I can later read again.

According to Wikipedia, a mind map is a diagram used to represent words, ideas, tasks or other items linked to and arranged radially around a central key word or idea. It is used to generate, visualize, structure and classify ideas, and as an aid in study, organization, problem solving, and decision making.

There are quite a few mind mapping software packages available (google it), but I use an open-source app called FreeMind.

Fig. 1.1 – FreeMind App

FreeMind App

Fig 1.2 – Sample mind map

Sample mind map

Check it out and start mind mapping and brain dumping all the stuff in your brain!

Yumex to the rescue!

Yumex is a yum extender that provides a GUI for package management.

So why am I writing about it, well, read on…

I had written recently about my upgrading from Fedora Core 1 to Fedora Core 6, and one major, annoying issue I encountered was with the yum updates.

I encountered approximately 5 conflicts and about 2 dependency errors.  I believe it was with php-do and php and some elib libraries.  I know, I know.  You’re thinking, “if it ain’t broke, don’t fix it,” right?  Well, unfortunately, I can only take so much of that.

So, with the mission at hand, I started googling for fixes and finally found a thread about yumex.  I yum installed it, went into init 5 (I run init 3 by default), vnc‘ed into my box and run it.

After having used it, I strongly recommend you give it a try, especially if you have problems updating via a terminal window.

What yumex gives you is the freedom to update only certain packages via a click-and-process method; for example to fix my problem, I updated 15-20 packages at a time, continuously went through the list until I came across the offending package.  I then took care of problematic ones one-by-one.

Pretty cool, ey…All you need to complete this process is patience and a book.  =0)