Category Archives: Snippets

Tids and bits of code.

Password protecting folders with nginx

Ever wondered how you can password protect a folder and the underlying content with nginx the same way Apache does? Pretty simple.

First create a htpass-file like so:

Edit your site’s configuration file by adding the following lines of code inside the server-block:

And your folder should be password protected. :)

Converting an avi to the Nokia E71 size

This is a oneliner to convert an avi-file to the correct dimensions of a Nokia E71. The screen is small, but sure beats to buy an iTouch if your cell already can play movies for you. :)