Geek Dinner with Dr. Richard Clayton [Wrap-up]

Posted on February 8th, 2008

So my first Geek Dinner is a wrap, and although I got a lot of people telling me they really liked it, I still think some things need to go better next time. First off, we didn’t get the dinning area in the venue, but the rather warm attic room instead. It was “ok” for this time as we didn’t have that many people but next time I will make sure they understand what room I want. Then there was the food that wasn’t ordered, even though I gave them the number of guests 2 days before. So, we ended up with a weird selection of food, including some rather tasteless pathe. Next time we will have some more variety in the food.

Finally, it was a bit unfortunate that London is plagued by the flue, disabling at least 4 guests from coming. Combine that with some people only noticing the event a day before the date, and you end up with about 20 people instead of maybe 30+.

Geek Dinner with Dr Richard Clayton

In the end though, the Geek Dinner was a success, with a very interesting talk by Dr Clayton. Ian was able to film the talk (part 1, 2, 3, 4), although he had to switch batteries twice in his camera. Guy West took a audio recording, and I took some photos but was to distracted to take any really good ones. I am already thinking of the next guest to have on, because things an only go better from here. See you next time?

The Invisible Shield for iPhone

Posted on February 7th, 2008

I used to have this crystal clear case for my iPhone, which protected all but the screen and looked incredibly bulky. Still, I thought it necessary as I didn’t want scratches on my precious iPhone. The problem with almost all enclosures though, is that they result to the iPhone not fitting into any accessories (e.g. the dock). As I got tired of removing the case every time I wanted to put my iPhone in any dock, I decided to get something a bit less visible. In comes the Invisible Shield.

The Invisible Shield is pretty cheap ($24.95 and free shipping worldwide), covers the entire phone, takes a moment to apply, and seriously rocks. I can now use my iPhone as if it was a bare naked iPhone, without being afraid of damaging it with my keys or other sharp objects. Below are the photos.

My Bookmarks For February 1st - February 6th

Posted on February 7th, 2008

Site5 Backup Script Revised

Posted on February 5th, 2008

About 2 weeks ago I wrote about a little script I used to backup some of my Wordpress installs automatically to Subversion. A serious problem arose with this method though, and the main reason was this line:


svn add --force *

I used this line to automatically add any new files to the repository. This was handy because often new files are created (e.g. attachments for posts in a blog), as you wouldn’t want to do this by hand every time.

This code doesn’t keep in mind deletes though. If you delete a plugin in your Wordpress, SVN will miss it and start complaining. Additionally the method above overwrites SVN:Ignore settings, which means you can’t ignore certain files (e.g. cache files that change constantly).

So instead I decided to come up with a new solution: see what files are new and what are removed, and perform “svn add” and “svn remove” actions on those files. I used a bit of code from this blog to come up with a fairly good solution.

And replace it with:


svnstatus=$(svn status)
added=$(printf "$svnstatus" | sed -n 's/^[A?] *\(.*\)/\1/p’)
removed=$(printf “$svnstatus” | sed -n ’s/^! *\(.*\)/\1/p’)

What this does is run the “svn status” command that will return a text output of all the modified files (starting with a ‘M’), added files (starting with a ‘?’) and deleted files (starting with a ‘!’). The next 2 lines do a regex to figure out the file names of the new and missing files.

Now add the following two pieces of code after the previous bit of code (and before the svn commit).


if [ "x$added" != "x" ]
then
echo adding “$added” to repository
svn add $added
fi


if [ "x$removed" != "x" ]
then
echo removing “$removed” to repository
svn remove $removed
fi

Both pieces of code use the previously regex calculated paramaters and sees if there are any files to be added or deleted. In then runs the “svn add X” and “svn add Y” commands to update the svn status. After this, a svn commit will include all new files and remove all old files from the repository. This does not remove the backup, so you always go back in time!

The “echo” commands used in these lines of code will show up on the command line, and if your cron job forwards output to an email address this can be used to check if the cron job is working correctly. If it becomes annoying, just remove them.

© Cristiano on Tech/Life • Powered by Wordpress • Themed based loosely on the Swiss Cool theme.