Archive for June, 2009

Pad a Numeric Field with 0 in DB2

June 10th, 2009 by Jim Olding | No Comments

Say you’re storing a time in a 6 position numeric field in DB2 (in HHMMSS format), and you need to pull the hour. SUBSTR(FIELD,1,2) will work great as long as the time is 10am or later, but before that, you’ll start pulling weird times like 91:00. This is because SUBSTR does not pad a numeric field with zeroes in query. To force a prepended 0, do SUBSTR(DIGITS(FIELD),1,2).

Tags: ,

Backing Up with Virtualmin and S3

June 3rd, 2009 by Jim Olding | 3 Comments

Virtualmin is a great open source server management tool. In fact, its what I use for my hosting. Amazon S3 is a great, affordable online storage service. What do you get when you combine them? A great way to back up your servers.

Virtualmin has had support for local and remote backups for some time now, but the idea of weekly 8GB FTP sessions to my home server doesn’t seem so grand (it would interrupt the Linux ISO torrents). So I signed up with S3, and for less than the cost of a egg mcmuffin, I can keep 4 weeks of full system backups available for restore at a moments notice.

This guide assumes you’ve got Virtualmin Pro (not sure if the free version does S3 – it does, give it a try!), and an active S3 account.

(more…)

Tags: , , ,