sebflipper

MySQL backup as separate sql files with rotation

March 10th, 2010

A few days ago I accidentally dropped a MySQL database from my home development server. While my computer does automatically run a daily backup using:

mysqldump --all-databases

It does mean that all my databases are backed up into one massive single file; so it makes it a little bit tricky to pull out the database I was after, however I stumbled across a MySQL backup bash script that will automatically separate out the databases into their own files making it allot easier to manage.

I decided to change the script slightly so that the mysqldump command is a bit more reliable (handling UTF-8, stored procedures, not breaking foreign key indexes etc) and so that it can handle multiple config files. It can also automatically rotate archive backups for x number of months, weeks and days.

Being the open source kinda guy that I am; you can download modified script here: Download Source

iPhone and HTML5 Experimentations

September 21st, 2009

iPhoneSMS-ComposeAfter my trusty mobile phone which I have had for the last 4 years gave up the go on me I decided to replace it with a shiny iPhone.

For the most part its been a very good experience, however there where a few things that my old phone did slightly better like running multiple applications at the same time, letting you choose your own SMS ringtone (rather than limiting you to only 6!) and my biggest annoyance:

When composing a new text message every phone I owned in past told you how many characters you have left (before it starts sending multiple messages) and how many messages it was going to send in total.

This crucial feature surprisingly seems to have been left out on the iPhone! Which could leave me accidentally wasting my credit by sending 2 messages at once and annoying people with 2 messages (when I go over the 160 character limit). As the iPhone has one of the most advanced web browsers Safari built-inĀ (with copy and paste support) I set out to try and fix it myself.

My solution: http://www.sebflipper.co.uk/iPhoneSMS (best viewed on an iPhone)

Update: Source is now available on GitHub

Read on for technical details…

Online Backup

August 17th, 2008

Backing up data is normally something most people usually neglect (unless your on a Mac), and even if you do backup what happens if you get your stuff stolen or lost by hard drive failure or worst case scenario fire?

Enter the cloud, online backup is nothing new the only difference these days is you normally get more storage for your money. Over the last few weeks I have been keeping an eye out for different solutions:

Service Pros Cons

Drop Box

Drop Box

  • Backs up all your documents and photos online incrementally
  • Keeps things synced across machines (and cross platform)
  • Keeps revision history (so you can go back to previous versions of a document)
  • Allows you to make files or folders public and gives a link to download or generates a photo gallery for you
  • Works on Windows, Mac and Linux
  • Currently in beta (no public signup)
  • 2GB for free account
Flickr
  • Unlimited storage (paid accounts)
  • Social network for sharing with friends/family and tagging
  • Easy to manage and setup galleries
  • Photos and videos only
  • 100MB upload per month on free accounts
  • Manual backup process

Mozy

Mozy

  • Unlimited automatic incremental backups
  • Set it up and forget it
  • 2GB free account
  • Doesn’t support Linux

Self Hosted

Self Hosted

  • Can be used for backup as well as hosting websites, blogs and galleries etc.
  • Backups work with open-source software like rsync
  • Most hosting companies normally provide 100GB+ of storage space
  • Manual setup
  • Complex to initially setup

Find out which one I chose after the jump.

Read the rest of this entry »

Setup up Subversion (SVN) for multiple users, with permissions

April 19th, 2008

SVN is a useful application allows you to keep track of revisions/changes made to files (mainly for web development or even writers!) and keep projects up to date easily (which is what we use at work). It seems to be allot harder to setup on a shared web host.

So after much playing around with it and getting it up and running I thought I would create a how to guide on the Site5 Wiki about setting up Subversion for multiple users, with permissions and desktop setup (this guide should also work on other shared web hosts).

http://wiki.site5.com/SVN/Subversion_(SVN)_Setup_Guide

GPS Tracks

April 6th, 2008

Last week I decided to use my mobile phone and bluetooth GPS receiver to log a weeks worth of commuting to see which route is the best and what days are the worst. I used a freeware tool called NoniGPSPlot on my mobile and TrailRunner on my Mac, which is geared more towards running, and biking etc but also works well plotting driving routes. It basically shows a line graph of speed allowing you to click on a curtain point and see where you were at the time, it also has nice integration with Google Maps, Live Maps and OpenStreetMap.

Bizarrely with the amount of accuracy with GPS these days you can actually see what lane you were in at the time and even if you were changing lanes. My findings are it takes longer in the mornings to get to work, in the worse case it took 1 hour 9 minutes to get in, where as it only took 41 minutes to get home, almost 30 minute difference! I think the main problem is the school run in the mornings seem to clog the roads quite a bit. Going different ways didn’t seem to save much time unless the motorway was totally jammed.

I can see people like TomTom building this sort thing into their next generation of GPS devices so that they can accurately model and predict what roads and at what time they will be jammed, as well as sending back live data to a central database to which can inform other GPS users to avoid certain roads.

You can also monitor my dodgy parking with the previous route overlays!

iTunes External Drive Detection

March 29th, 2008

If your like me and have far too much music you will have probably transferred it all to an external hard drive, which is great as it frees up some space on your computer, but not so great if you forget to turn it on and you start up iTunes.

iTunes has the habit of marking all the files all the files it can’t find with an exclamation and then not syncing with iPods etc, which is why I wrote a an Automator script for my Mac to detect if my hard drive is connected:

tell application "Finder"
	if exists folder "LaCie 500GB Mini Hub:Music:" then
		launch application "iTunes"
		tell application "iTunes"
			launch
		end tell
	else
		display dialog "Please turn on LaCie 500GB Mini Hub" buttons {"OK"} default button 1
	end if
end tell

To use, open up Automator paste the code in and change “LaCie 500GB Mini Hub:Music:” to the name of your drive and location of your music collection, then save as an application, then just drag it on your dock and remove the original iTunes icon (you can even give it the same icon as iTunes by following this guide). If it detects your drive it will automatically load iTunes otherwise it display a message.

Norway

March 23rd, 2008

After sorting though some 300 photos from last week, 25 of them made the grade:

Norway
Norway

I took a few panoramas as well, 3 of them came out quite well:

Venabu-DNT-Mountain-Range-Panorama

Venabu-Panorama

Venabu-Mountain-Range-Panorama

Cross-country skiingĀ  is pretty good fun, but does involve allot of up hilling e.g. climbing a mountain for 2 hours for a 10 minute ski down! Though you do get the reward of conquering the mountain, next time I will have to try down-hilling and let the ski lift do all the hard work.

Today I spent a fair chunk of time trying to find a solution to the never ending problem of syncing PIM, e.g. syncing Thunderbird email, calendar and contacts with Google Mail/Google Calendar and a mobile phone. Email is fine, as that just uses Gmail’s IMAP which works pretty much anywhere and with the aid of 2 extensions for Thunderbird and 1 application for my phone:

I have now got everything talking with each other via ScheduleWorld, the only downside is that contacts aren’t synced with Gmail, but they will sync with Thunderbird (which isn’t all that bad as Gmail tends to add any email address you use to its address book). Handy if my phone goes walkies as I will have all the data backed up.