On Textpattern, Apache and Git

This weekend I’ve re-started on a website that I was meant to have finished ages ago. Now that I have all of those extra minutes per day having extracted myself from Facebook’s clutches, I’ve resolved to get it finished and get it finished I shall.

Rather than re-inventing wheels, like I did with my own website, I’ve opted to build this site using Textpattern. So far it seems pretty straightforward. This is ideal as I don’t intend to maintain the new website (another good reason not to hand-crafting my own Perl, PHP or Python).

One thing that did take a while to get working, however, is getting ‘Clean URLs’, those without question marks and ampersands all over the place, to work. Thankfully like so many things, this is a solved problem. For future reference, the solution was easy for the virtual host on my MacBook Pro, with just one AllowOverride line needed in /private/etc/apache2/extra/httpd-vhosts.conf

<Directory "/path/to/website">
    Order Deny,Allow 
    Allow from all 
    AllowOverride FileInfo
</Directory>

Incidentally, I’m keeping both /path/to/website and /private/etc/apache2 under source control with Git, as I am doing with pretty much everything I do these days. Git is version control done correctly. Thank you, Linus!

TDD in Vim

Happy new year, folks!

Here’s a little utility I knocked together yesterday to decrease the number of key-presses needed to switch between unit test and production code:

toggle_unit_tests : plug-in for toggling between source and unit test files

I’ve tested it with C++ and Python and it works nicely, but should work well with other languages too.

If you find yourself doing TDD in Python using Vim, you may find the following page useful:

Integration with PyUnit testing framework.

That is all.

Facebook No More!

I’ve deleted my Facebook account. Hip, hip, hooray!

Having never much liked Facebook, it bugged me that it still occupied far too many minutes of my days. I complain too much these days that I don’t have enough time to do this and that, so spending fewer minutes declining invitations to install applications letting me know who thinks I’d make a good rock star should mean that I can spend more minutes of my day playing bass. Makes sense, doesn’t it?

I appreciate that it’s a good method for some people to stay in touch, but there are many better (and in my opinion, more appropriate) ways to do this and they work for me, thank you very much.

Here’s a YouTube video that highlights some of my many pet hates about Facebook. FaceBook In Reality - idiotsofants.com and BBC’s The Wall.

Moving House

Little Boxes by Johnsyweb, on Flickr

Life is in boxes; about fifty boxes of purest cardboard. The removalists came this morning and in three hours the lovely apartment in which we have lived for the past year and a bit was a warehouse.

One Last Look... by Johnsyweb, on Flickr

Tomorrow we move 18km (11 miles) across Melbourne to take up residence in our new house, which will be, I think, my nineteenth "permanent" address since I was born. It will be great to live in a house again, having lived in apartments since we moved to Melbourne in February 2006. I shall miss the terrific view that we have enjoyed from the tenth storey since moving in though. It really is glorious particularly on sunny days such as today.

Now we have mortgages in both of hemispheres, which seems terribly grown-up. I don’t feel terribly grown-up, not even just passed my 25th birthday.

The good news for those of you who are fed up with updating your address books each time that I move home is that the Post Office Box address, which you’ve had since we landed in Melbourne remains valid. You can thank me later.

The bad news for those of you who like to keep in contact via electronic means, such as Skype or (the other multitudinous instant mithering and social networks to which I am connected) is that it shall be a little while before we have broadband connected in the new abode. I shall sporadically check my email on the iPhone, of course. I may even tweet, who knows.

But first, we must celebrate K’s birthday. Just think of all of the presents (read: "boxes") she’ll get to unwrap tomorrow. Aren’t you jealous?

CIFS

This weekend I have upgraded my old laptop to run Ubuntu 8.04 (Hardy Heron). The experience was suitably painless and Hardy is running smoothly. Since I’ve had my MacBook Pro, I’ve hardly opened the lid on the old laptop, it has just sat (reasonably) quietly in the corner of the room listening for SSH connections and performing downloads for me.

Under Hardy’s predecessor, Gutsy Gibbon the connection to our HTPC (which is still running Windows XP Media Center Edition) had been a little flaky, which meant that often I would transfer files between the two using an SD card rather than simply copying them using smbfs.

It turns out that smbfs has been deprecated in Hardy and the time has come for me to move over to CIFS. This was actually pretty simple, but I understand some people have struggled with the conversion, so I thought I’d document what I did here.

  1. Unmount the old smbfs mounts for the last time:
sudo umount -at smbfs
  1. Grant all users full access to the mount point:
chmod 777 /media/<mountpoint>
  1. Update /etc/fstab to use cifs rather than smbfs, changing the mask_s to _modes and ensuring that the octal modes have leading zeros, thus.

Before:

//server/share     /media/mountpoint        smbfs
auto,credentials=/etc/smbcredentials,workgroup=WORKGROUP,gid=smb,uid=1000,fmask=770,dmask=770,rw 
0       0

After:

//server/share     /media/mountpoint        _cifs_
auto,credentials=/etc/smbcredentials,workgroup=WORKGROUP,gid=smb,uid=1000,_file_mode_=_0_770,_dir_mode_=_0_770,rw
0       0
  1. Mount the CIFS mounts:
sudo mount -vat cifs

And that’s it: fast and easy!

Hong Kong

As reported elsewhere, I’m in Hong Kong (or more correctly, the Hong Kong Special Administrative Region) for work. It has been a long time since I last travelled for work and had to stay anywhere overnight (the last time I stayed in a Travelodge on the M1 motorway near Sheffield).

I arrived late on Friday night and was pretty bleary-eyed as I caught the hotel shuttle from the airport to Causeway Bay, having got up very early on Friday morning to go to our office in Sydney en route. However, a few things struck me (and thankfully not the bus!) as we journeyed to the hotel. Firstly, it was the first time I had ever seen rows of identical skyscrapers. In fact I don’t think I had ever seen even a pair of identical skyscrapers before. Then I noticed that vehicles have yellow registration plates to the rear and white ones to the front, evidence of the British influence still present. I was amazed at how much traffic there was, too.

The Hongkongers love their cars! The grey concrete veins and arteries around the city are constantly brimming with high-performance cars. There are also lots of buses, which seem to raise the temperature of the streets by a degree as they pass by.

Yesterday afternoon I took a walk in the drizzle and found an area where each street seemed to consist almost entirely of small commercial garages, each of which seems to feature mechanics working on German sports cars. I don’t think I have ever experienced such a smell of engine oil!

Last night, after a very nice meal, I took a wander around the shops. I was amazed at how bright it was as I left each of them. The sky remained the same grey as it had been during the day, except rather than the sun illuminating the cloud from above, it was the city lights illuminating the cloud from below. I shall not be seeing many stars here!

I think it’s too misty to bother going up to Victoria Peak today, so the City Centre beckons for a bit of exploration. I shall leave you with a link to a website I read about on the flight over: We Are What We Do.

Freecycle

I’m sure I have mentioned Freecycling before. It’s a fantastic way to prevent perfectly usable items from ending up in landfill before their time has come. Today we had a bit of a clear-out and put a few items on our local Freecycle group and now they have gone. Brilliant!

Thus I’d like to recommend Freecycling to you all. I offer you a top tip if you are advertising something such as a digital camera or a laptop or something else that generates a lot of requests. Once you have a single taker for your item and then send a ‘Taken’ message back to the list and then delete your original message (using the Yahoo! Groups page). This should prevent you receiving countless emails long after your item has been taken. We’ve started doing this ever since K got an email over a year after advertising some things on the Crawley group.

That was all.

Happy New Year

Well, it’s well past midnight here, so I thought I’d take the opportunity to wish you all a very happy, healthy and prosperous 2008.

It Ain't 'Alf Hot Mum

Stay cool, won’t you?

Life Through a Lens

Those who follow My Flickr Feed are probably bored to tears of sunset shots by now. To them I can only apologise as there are some more uploading as I type this.

The difference between the previous shots and today’s is the equipment due to the fact that I was playing with my new toy. For those interested in such things, my new camera is a Samsung DX-10 (which is essentially a Pentax K10D with the word ‘Pentax’ crossed out and ‘Samsung’ written in in crayon). I went for the Samsung over the Pentax as I got a better lens bundled in with it than I would have with the Pentax. I also invested in a telephoto lens (the Sigma 70-300mm F4-5.6 APO DG Macro, for the geeks). So this is what I was using this evening when I took these photos.

Obviously I need to hone my photographic skills, but Melbourne presents many opportunities for practice, so I should be able to take some decent snaps at next year’s Grand Prix.

What a victory!

We were up at 5 o’clock this morning so that we could witness a great sporting event. Today was Victoria’s other grand prix, the Moto GP down on Phillip Island.

Having been to quite a number of motor sport events, this was actually my first trip to see two-wheelers fighting it out on the tarmac and I have to say that it was really very enjoyable indeed.

Starting from third on the grid, it was excellent to see (Australia’s) Casey Stoner in the last as he passed us into Turn 1. Stoner retained the lead from there to the chequered flag but there were some great battles going on behind him. Very exciting to watch. It was great to see the World champion win on his home soil.

The circuit itself is one of the nicest I have been at; even with general admission tickets, we could see the majority of the track from the grass opposite the pit exit. The fact that the sun shone all day form about 10am really helped matters. It was pretty parky when we arrived there, I can tell you.

Now I’m (really) looking forward to the Formula 1.

Page 6 of 13