Wednesday, December 30, 2009

Underhanded C

The Underhanded C Contest is great. This year's contest is out...you have to write code to surreptitiously lose luggage. I wonder if I can remember enough C coding to enter...

Friday, December 25, 2009

Nokia N900

I've had my Nokia N900 for about a day now, and I can report that it is an awesome phone. It is the ideal geek phone. I have never had a phone that I could drop into a command line if I wanted to. Not only that, but I can ssh into (or out of) the phone.

There are obviously not as many apps for this phone as there are for the iPhone or Windows (which my previous phone was), but nearly everything I used to use is there and many things are much easier (like the simple SSH connection to the phone, which makes transferring music or pictures on or off as easy as a network operation between two computers).

Saturday, December 19, 2009

Apache virtual hosts

Just saw an article which helped me easily create a virtual host for Apache on a Debian install (Sites and Modules, Linux Format #126, p63, but I can't find the article online to link to it). In any case, it made setting up a virtual host on my Ubuntu laptop very simple. The article explained the debian setup for Apache.  The virtual host setups are in the sites-available directory (there is also a mods-available directory which works similarly to sites).

Friday, December 18, 2009

Drupal multisite


I needed to create a new website with Drupal.  I have existing basic hosting with drupal set up on the main site.  To extend it to add another website, I did the following:

Wednesday, December 16, 2009

Use fail2ban


If you have Linux with ssh exposed to the internet, fail2ban is a must.  I have a Linux VM which allows SSH connections via the internet.  It doesn't have a static ip address, but I am using dyndns to make it easier for me to access from outside.

Within a few days of opening the port on the firewall, the logs started filling with attempts to break in.  There are repeated attempts to login with an alphabetical list of usernames, all from an IP address which is located in China.  Fail2Ban lets you set limits on how many times a single IP address can fail login before that IP address is banned for some specific amount of time.

It is found in most of the repositories, and is easy to set up.  Check out the website for configuration details (http://www.fail2ban.org/)

Using Git locally for revisions and backups

Git is great. You will probably see me mention it alot here. Or you might not, since it is one of those tools that should just become invisible in the background. If you are used to working on a centralized version control system (like Subversion) you probably have a scenario like this:
  • Create a branch on the server for your changes and copy from the trunk.
  • Work locally, and periodically commit changes back to the branch as a backup.
  • Merge the changes back to the trunk when they are ready.
That all works well. But when you are working on something locally (for example, some CakePHP web pages in a local www directory for your local apache installation) you want the same kinds of benefits: you want to be able to roll back to previous versions if needed and you want to have the assurance of backing up your code somewhere. In git, you can do those as two separate functions.