Ubuntu Linux Codenames

February 23, 2008

It’s just been announced on the Ubuntu mailing list that the next version of the Ubuntu OS will be codenamed the Intrepid Ibex. From the mail:

During the 8.10 cycle we will be venturing into interesting new
territory, and we'll need the rugged adventurousness of a mountain
goat to navigate tricky terrain.

I love the Ubuntu codenames, all based on animals. I also really like the version numbering. Incase you didn’t know the version numbers are based on the year and month of release. So 8.10 is planned for release in October 2008. Ubuntu 6.06 was released in June 2006, etc.

I switched to using Ubuntu from Gentoo Linux in mid-2005. The version then was 5.04, codename Hoary Hedgehog. Since then we’ve seen Breezy Badger, Dapper Drake, Edgy Eft (a baby newt apparently!), Feisty Fawn, Gutsy Gibbon, and Hardy Heron (currently in Beta).

With the exception of the first few codenames the codenames go up the alphabet, meaning the next one will start with J. The Ubuntu wiki has a codename page which already has some suggestions including the Jabbering Jackal, Jovial Jackrabbit, and my favourite, the Jiggly Jellyfish.

Adding www to your domain with Apache

February 18, 2008

A question I see asked in lots of places online is how to ensure that a visitor to your site is visiting www.yourdomain.com and not just yourdomain.com. There are lots of good reasons for wanting your visitors to visit the one address rather than both, such as making sure all link and bookmarks count towards the one page, rather than being shared between two.

Some of the solutions I’ve seen have been crazy, like editing every php file on your site to check what the address is, and redirect depending on whether the www is included or not. If you’re using Apache then a very simple solution exists with mod_rewrite. All you need to do is create a .htaccess file in the root directory of your website and add the following lines:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

Mod_rewrite is very powerful, and allows you to do far more than just add www. to your URLs. If you’re interested in more information then official documentation is a great place to start, and contains lots of examples.

Design Patterns

February 8, 2008

Knowledge of design patterns can be really useful when designing software. If you don’t know what a design pattern is, then from Wikipedia:

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.

Design patterns were made famous by the book Design patterns: elements of reusable object-oriented software, written by the Gang of Four, or GoF. Although I’ve never got round to reading it, it is fairly high on my to-read list!

Design Patterns by the GOF

Despite not having read the GoF book I’m still aware of some of the more common design patterns, such as the singleton, factory, and iterator patterns. Such is the nature of patterns that I’ve probably used some without even being aware,after all they are just common reusable software designs.

I recently came across an excellent website that gives details on all of the GoF design patterns, including descriptions, UML diagrams, and sample code in Java, C++ and PHP! The site isn’t good enough to displace the GoF book from my to-read list, but I’m sure I’ll find it useful for the mean time.