Archive for December, 2004

xmas cheer?

Thursday, December 23rd, 2004

Having to work on xmas eve totaly sucks, but eh, at least I have a nice break in Piha before I get back to work next year. :)

All I really want to do is stop thinking about work…this is a lot harder than it sounds. At the moment my life seems to be consumed by work. If I’m not working I’m sleeping or trying to stay awake in front of the telly…

Anyway - I really shouldn’t bitch right before xmas…I’m looking forward to the break, and am pleased I got all my xmas consumerism done early. I went to Browns Bay shops at lunch time and it seemed like it was the last shopping day ever….thank god I managed to get out before some silly shop owner accidently said ‘We’ve sold out of that partucular [insert item here]’ cos there would have been bloodshed.

I’ve been trying really hard not to get into this ‘top 10 for 2004/highlights for 2004′ thing, but, well…here’s my (small) list anyway - in no particular order:

Those are the things that stand out (or I can remember) from 2004.

I hope you all have a great holiday time. Enjoy the sun, enjoy the surf and drink as much as you can! Happy whatever! :)

Amanda’s Reindeer!

Sunday, December 19th, 2004



Amanda’s Raindeer!


Merry Xmas

shell scripting

Thursday, December 16th, 2004

I’ve been having a hell of time trying to find decent server space. I was using space on a friend’s machine, but I realised I needed to have a little more control. Moving to a reseller hosting account with iWeb was the next logical step.

For the past few months I’ve been slowly moving all my sites over the new host. I hate migrating servers! Hate it, hate it, hate it! Today, however, I had enough and decided to investigate various ways of automating (to some degree) this process.

There are heaps of really large scale solutions out there but none to suit my needs. I knew what I needed to do, and I knew everything I needed to do could be achieved from the command line.

Enter the bash script.

Get a mysqldump of my database
mysqldump --user user_name --password=password database_name > output.sql
Zip/archive my entire web root directory
tar jcvf web_root.tar.bz *
Copy the archive over to the new server
scp username@server:~/public_html
Unzip it into the web root of the new server
tar jxvf web_root.tar.bz
Import the mysqldump into the new databse
mysql -u -ppassword database < output.sql

It gets fun when we start running commands on the remote server through SSH…

Confused? Have a look at this bit of code:
ssh username@server "cd /var/www; tar jxvf web_root.tar.bz; mysql -u -ppassword database < output.sql"

It opens a secure shell connection to the remote server and runs some code. Love it.

I’ve compiled all those commands above into one handy shell script. Have a look at the source code below, or click the download link at the bottom of this post.

#!/bin/bash
#host_migrate.sh

# (C) 2004 - darren [at] dontcom [dot] com

# Use this script to migrate from one linux environment to another.
# I used this script when I swapped hosts.
# it does a mysql dump; tars the entire web root up; scp's it to
# the new server; unpacks the files;dumps the .sql file into new database
# dont forget to chmod +rx on this file :-)

# SET VARIABLES HERE

# New server settings
NEW_SERVER='' #new server name ( eg IP|domain name )
NEW_SERVER_DIR='' #web path on new server ( eg /var/www/ )
NEW_SERVER_USER='' #new server username
NEW_SERVER_PASSWORD='' #new server password
NEW_SERVER_DB='' #new server db name
NEW_SERVER_DBA='' #new server db username
NEW_SERVER_DBPASSWORD='' #new server db password

# Old/Current server settings
MYSQL_USER='' #mysql username
MYSQL_PASSWORD='' #mysql password
MYSQL_DBASE='' #mysql database name
OUTPUT_SQL='' #mysql output file
WEB_ROOT_ARCHIVE='' #archive name of all files

# the actual code. - no need to modify this...
mysqldump --user $MYSQL_USER --password=$MYSQL_PASSWORD $MYSQL_DBASE > $OUTPUT_SQL
echo "dumped $MYSQL_DBASE database to $OUTPUT_SQL"
tar jcvf $WEB_ROOT_ARCHIVE *
echo "tared all files in folder to $WEB_ROOT_ARCHIVE"
scp $WEB_ROOT_ARCHIVE $NEW_SERVER_USER@$NEW_SERVER:$NEW_SERVER_DIR
echo "scped $WEB_ROOT_ARCHIVE to $NEW_SERVER_USER"

Download the script here.

moving house

Thursday, December 9th, 2004

So about 3 months ago my family purchased a new apartment.

Amanda and I are lucky enough to be the tenants of the newly aquired flat. We spent the weekend shifting all our stuff from the old apartment to the new one. We moved about 250 metres down the road so no moving truck was required (SCORE!).

The new place (dubbed 4Seasons) is way bigger than the last place. We’ve still got quite a bit of stuff to unpack and sort out, but all in all we’re totally loving the new place.

Be sure to check my flickr photos as there are likely to be a heap of new photos.

gimp 2.2 splash screen contest

Wednesday, December 1st, 2004

GIMP 2.2 is due out any minute and it needs a new splash screen. The people at GIMP have officially opened the contest and submissions are rolling in.

Competition entries should be attached to the live.gnome.org wiki before midnight next Sunday.