Posted by Dave Mark on Jan 27, 2009 in
tutorial
Have you ever wanted to password protect a folder on your server? For example, suppose you had a Word doc that you wanted to share with the folks you work with, but wanted to keep away from other prying eyes. One way to do this is to use the .htaccess mechanism. In a nutshell, you’d build a list of usernames and encrypted passwords in a file named .htpasswd, then put a link to that file in another file named .htaccess. You put the .htaccess file in the directory you want to protect and, voilĂ , anyone who steers their browser to the specified directory will have to login using one of the username/password pairs before they are able to access the protected director.
Best way to show you what I mean here is with an example.
Click on this link.
You should be prompted for a username and password. Use a username of “friendodave” and a password of “secret”. All without the quotes of course.
When you get in, you should see a link to a secret picture. Did it work? Cool! Leave me a comment either way, just to let me know if it worked for you.
Want to learn more? This is a great tutorial on using .htaccess. As you can see, there’s a lot more to this mechanism than simply password protecting a directory. Pretty powerful stuff.
– Dave
Tags: htaccess, password protect server, tutorial
Posted by Dave Mark on Jan 21, 2009 in
tutorial
Want to see something interesting? Use this process to have the Finder show you hidden files:
- Start by making sure you have a complete backup of your Mac.
- Did you backup your Mac?
- Bring up the Terminal. You’ll find it in the Applications folder, Utilities subfolder
- Type this command at the prompt:
defaults write com.apple.finder AppleShowAllFiles TRUE
- Now type this command
killall Finder
That’s it. Now use the Finder to explore some directories. Notice all the files that start with “.” – there are a ton of them. Do NOT delete or move anything. Resist that urge. Every one of those files has a purpose and you most likely do not know what that purpose is. But this is interesting, no?
Now let’s put things back the way they were. In my next tutorial, I’ll show you another way to see those files and we’ll delete some files that contain personal info, to make sure you don’t accidentally distribute them.
Reversing what we just did:
- In Terminal, type this command:
defaults write com.apple.finder AppleShowAllFiles FALSE
- Now type this command
killall Finder
That should do it. Now you can just quit Terminal and resume your day-to-day lives. 
– Dave
Tags: Terminal, Unix, view hidden files