Archived Geocaching Uncategorized

Melbourne heat + Geocaching = Exhaustion

It’s been so freakin’ hot recently that going out geocaching has been tough.  It’s been an exhausting but worthwhile experience, though.

Anyway, I got home from work and decided that I’d head out to grab a couple of geocaches that I’d been meaning to get for a while.  Most of them were easy, with one exception … it was downright mean!  Check this out …

Yes, it’s a fake piece of chewed chewing gum!  It actually has a tiny logbook on the inside … W.  T.  F.

Archived Software Uncategorized

Microsoft Excel – Delete duplicate rows

I’ve been meaning to put this online for some time but kept forgetting to get it done.  This article is simple and provides a small Excel VBA script that makes it easy to delete duplicate rows from an Excel worksheet.

All you need to do is copy the code into an Excel module or class, depending on how your Excel application works.  Then you just provide the relevant row ranges and the script will do the rest.

Sub DeleteDuplicateRows()
    ' Chris Rasmussen January 2011
    ' DeleteDuplicates
    '   goes through the range specified below and, if a duplicate value is found anywhere in the range, deletes that value's entire row
    Dim x As Long
    Dim LastRow As Long
    Dim duplicateCount As Integer

    duplicateCount = 0

    LastRow = Range("A300").End(xlUp).Row
    For x = LastRow To 1 Step -1
        If Application.WorksheetFunction.CountIf(Range("A1:A" & x), Range("A" & x).Text) > 1 Then
            Range("A" & x).EntireRow.Delete
            duplicateCount = duplicateCount + 1
        End If
    Next x
    If duplicateCount > 0 Then
        Results = MsgBox(duplicateCount & " duplicate rows removed.", vbInformation, "Duplicate rows")
        Results = MsgBox("No duplicate rowsfound.", vbInformation, "Duplicate rows")
    End If
End Sub

Easy.  🙂

Archived Geocaching Uncategorized

Another cool geocaching container

Even though I only wrote about Geocaching a day or so ago, I had to write another quick post to show another of the cool & inventive hide methods that cache owners have come up with.  This one was an easy enough find but I did have to use the hint, despite the hint actually being part of the cache name.  Check this out …

Cool Geocache container!

Cool, eh?  🙂

Spoiler Alert!

If you want to try and find this cache yourself, the GC code is GC2KFTJ. Be sensible and don’t click that link if you don’t want to know which geocache this is.  After all, the hunt is most of the fun, right?

Archived Geocaching Uncategorized

The craziness of Geocaching

Back in 2009 my friends Toni and Phil (now Mr and Mrs Cox!) introduced me to Geocaching.  I took to it with a vengeance back then when I was living in Melbourne and continued after moving back to NZ for a while.  I took an unintentional break from it for a few months and didn’t do a whole lot in 2010 but decided to get back into it again since I’m now back in Melbourne.

Nano caches … you suck!

Without trying to make this post into a Geocaching introduction I’ll just say that sometimes the caches are so small and clever that I’m left either grinning stupidly or silently cursing the cache owner under my breath.  🙂  Check these out … obviously it’d be silly to say which geocaches these are otherwise I’d be spoiling it for someone else.  

Bolt geocache container
Bolt geocache container
Another bolt geocache container
Another bolt …

… crazy!

Archived Design Uncategorized Wordpress

New blog design for Erin King Photographer

At the end of last week Erin decided that her Erin King Photographer blog, while really nice and functional, needed a bit of a face-lift. There were a couple of reasons for this:

  • The NextGen Gallery plugin being used didn’t work 100% correctly with the WordPress theme we chose.
  • The best way to showcase photography isn’t to use thumbnail-based galleries anymore.
  • The existing theme was getting a bit dated – not because it used old techniques but because it just needed a change.

What changed?

Without going into detail that people aren’t interested in, the basic way forward was to choose a new theme and modify it to suit our needs. I’m running the blog on WordPress 3, my blogging engine of choice for client sites that don’t require extreme levels of customisation. I’m also a bit of a WordPress fan, which helps. 🙂

So, with the blogging engine already well-established, the major decision had to be made – which theme to use. Now, when I say ‘which theme’ I’m sure there are a ton of people that always design their own. This isn’t ideal for Erin’s site because it needed to be updated quickly and still needed to retain the management/configuration options Erin was used to. For this reason I decided to use the built-in Twenty Ten theme and modify the CSS as required. For this particular redesign I was kinda the "hired hand", with Erin dictating how the site should look.

I’m pretty happy with the result because it’s not garish or over-the-top and doesn’t have a stupidly high number of on-screen elements. It retains all the customisation options that Erin needs (widgets etc) but now shows the blog posts’ photos full-size without the use of any 3rd-party gallery plugin.

What does it look like?

Here’s a low-resolution view of what the site looks like now. It’s clean, simple, and draws the reader’s eye to the photos, not away from them. To visit the real site, please feel free to check Erin King Photographer’s blog.

Erin King Photographer Blog - Screenshot

Archived Design Uncategorized

HTML5, div and section elements

Finally, some clarity!

When I started making the version of Digital Formula before this one, I decided to have a go at creating semantically-correct markup that also validated using the industry-standard W3C Validator.

This turned out to be more difficult than I thought but not for complexity reasons. I was battling with figuring out which elements to use and when, mostly because the number of articles online that spout various opinions number in the tens of thousands. Not what I was looking for at all. So, here’s what I came up with.

Resources – are any of them correct?

The WhatWG draft says the following:

The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element’s contents would be listed explicitly in the document’s outline.

That’s one of the resources that makes the most sense to me, especially when talking about semantic markup. I couldn’t go any further, though, without mentioning A Blog Not Limited, the website of Emily P. Lewis. Emily’s series The Beauty of Semantic Markup contains what I’d consider to the best 1-person collection of articles re markup semantics. Part 3 of that series includes the following:

<section> is used for content that can be grouped thematically. A <section> can have a <header>, as well as a <footer>. The point is that all content contained by <section> is related.

That makes perfect sense & combined with the draft specification from WhatWG really helps clear things up for me.

So I guess, no. None of them are correct as such but taken in appropriate measures any resource can be used to help your understanding of semantic markup.

Archived Linux Mac & OS X Uncategorized

Using rsync to synchronise folders

I keep most of my primary files on my iMac. Needless to say, this would be a pretty dumb move if I kept them there, and there only. However, I’m a paranoid freak when it comes to data, having lost 7 years worth of work in 1 go a few years back – I’m not letting that happen again. I use an Apple Time Capsule and Apple Time Machine for my primary backups and it’s saved me once or twice already.


Anyway, because I also have a Macbook Pro, that means I’m sometimes working where my iMac isn’t. I needed a solution to synchronise a specific set of folders on my iMac and my Western Digital portable USB drive. There are a ton of ways to do this but because I’m a geek I chose to use the command line (Terminal, in OS X) and write a small script. I’m using rsync for this – here’s the script, should you need something like it yourself.

The Script

Synchronise with rsync:


# sync the files
rsync ~/Data/Solutions /Volumes/Backup --recursive --verbose --delete --progress --human-readable --exclude="tmp*"

# unmount the external drive
sudo diskutil unmount /Volumes/Backup

What does it do?

Simple! The script script above does the following.

  • Synchronises all files in the sub-folder Data/Solutions in my home folder onto my USB drive (called ‘Backup’). All files matching the file pattern tmp* are skipped.
  • Ejects the USB drive when finished.
  • All sub-folders are included.
  • Files that exist in the destination but not in the source are deleted.
  • Progress of each file is displayed as it is copied.
  • All output is in human-readable format … because I’m human.

The eject part prompts for my password before ejecting because the diskutil unmount command is a privileged operation and requires elevated rights before it will be allowed,

Simple, but useful. 🙂

Archived Software Uncategorized

Easy schedules for HP Data Protector

On a number of sites now, including 5 main current ones, I’ve used HP Data Protector, one of HP’s enterprise-level backup software packages … depending on who you talk to.

Anyway, because Data Protector, originally called HP OmniBack, was ported over from the UNIX platform it means that most of the configuration can be done by editing plain text files.  This includes the schedules, although the schedule text files can often get pretty messy once you’ve made a few changes.  Below are a few backup schedules that have had all the fat trimmed out and don’t have anything you don’t need in them.

Daily & weekly full at 1830

This job runs a full backup every Monday-Friday at 1830 excluding the first Friday of each month.  I usually choose to run a monthly backup on the first Friday of each month so this is a necessity for me.

      -day Mon Tue Wed Thu
      -at 18:30

-day 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-at 18:30

-day Sat Sun
-at 18:30

Daily differential at 1830, weekly full at 1830

This job runs a differential backup (incr1 in DP) every Monday-Thursday at 1830 and a full backup every Friday at 1830, excluding the first Friday of each month.

-incr 1
      -day Mon Tue Wed Thu
      -at 18:30

-day 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
-at 18:30

-day Sat Sun
-at 18:30

Monthly full on the first Friday of each month at 1830

This job runs a full backup on the first Friday of every month at 1830.  It fits in with the schedules above.

	-day 1 2 3 4 5 6 7
	-at 18:30

	-day Sun Mon Tue Wed Thu Sat
	-at 18:30
Archived ExpressionEngine Featured Uncategorized

Move ExpressionEngine to a different server

Why move ExpressionEngine?

Good question! I run a local development environment at home so that I can simulate the production environment at ICDSoft as much as possible. When I make significant changes, however, this means I have to up and move my ExpressionEngine instance from my development server to my production server.

What do I need to do before beginning?

The process is actually fairly simple.  That said, always take the appropriate precautions before making any changes to a production environment, i.e. backup everything now including your existing file and the ExpressionEngine database.  After that it is highly recommended that you check your backup to make sure it’s recoverable later.

Ok, I’ve backed up.  Now what?

You’ve backed everything up?  Good.  Here are the steps I followed to move my ExpressionEngine instance from my development server to my production server.

Prepare the database

  • Clear all ExpressionEngine caches.  DO THIS FIRST.
  • On the new server, if it doesn’t exist already, create the database ExpressionEngine will use.
  • On the new server, if it doesn’t exist already, create the database user that ExpressionEngine will use to connect to your database.
  • Dump the existing database to a backup file.  How you do this is up to you but I personally use phpMyAdmin to backup the database to a ‘zipped’ file.
  • Upload your database backup to the new database.
  • Confirm that your database user can connect to the ExpressionEngine database.

Prepare the ExpressionEngine files

  • Compress your existing site, probably to a ZIP file.
  • Upload the archived files to your production server.  
  • Uncompress the archived files into the appropriate directory.  Please note that most people simply FTP the files to the new server but I choose to do it this way as it’s much quicker to transfer a single ZIP archive than it is to transfer the thousands of files ExpressionEngine uses one at a time.  I use a small PHP script to decompress the uploaded archive – you’ll need to make sure your host allows this before it’ll work for you.  Anyway, here’s the source.

Decompress uploaded archive:

echo "Unzipping ...";
echo "Done!";

Obviously you’ll have to change to the name of your uploaded archive …

Archived Development Linux Uncategorized

Slow FTP running ProFTPD on Parallels for Mac

My current web development server is a Debian GNU/Linux 5.0.5 machine running under Parallels for Mac (which I’m trialling right now). It was all working great until I tried to access the FTP server running on it from my Macbook Pro over the Airport. It worked but maaaaan was it slow! The Debian server is running ProFTPD, one of the many free FTP server options out there.

Thankfully the solution to the slow FTP access is very simple.  There isn’t a DNS server running here as it’s not something I need for local development (although it would’ve solved this problem, too).  The problem was caused by reverse DNS lookups failing – this is something ProFTPD has enabled by default if you use apt-get install proftpd to install ProFTPD.

Turn off Reverse DNS lookups

Turning off reverse DNS lookups in ProFTPD is as simple as checking /etc/proftpd/proftpd.conf for the following lines.

  • IdentLookups off
  • UseReverseDNS off

The IdentLookups line may already be set to ‘off’ – that’s fine and you can leave it that way.  The UseReverseDNS value may not exist at all – if that’s the case just added it to the proftpd.conf file and set the value to ‘off’ by following the format of the other configuration lines:

UseReverseDNS in ProFTPD

Restart ProFTPD

While logged in with appropriate privileges the following command (from the Terminal) should restart ProFTPD.  Rebooting your Debian GNU/Linux server will also restart ProFTPD but the whole point of running Linux is so you hardly ever have to reboot … right?

Restart ProFTPD:

/etc/init.d/proftpd restart

Obviously your own configuration may differ so only follow these instructions if it won’t break everything – be warned!