Archive for the ‘Internet’ Category

iPhone 2.1 Update

Saturday, September 13th, 2008

I’ve been reading around on the net and there doesn’t seem to be any information on the 2.1 firmware update based on actual results. By this I mean people who have installed the 2.1 update and written about it.

So, here goes! The only fix I’ve noticed is the reduction in lag, in almost everything. It was particularly noticeable when sending text messages or opening a standard app (ipod / contacts / phone / settings).

This is a great fix, and I’m pleased Apple did fix it before they released new features - it now works as a phone as well as any other phone out there.

I’ve never had any problems with calls dropping, and I charge it every night so I doubt I’ll see any improvement in these areas. I am going to do the recommended monthly total de-charge this weekend though.

In the last few weeks I’ve found some great apps, which I’m going to list here. But in the mean time I’ve got an assignment to be working on.

Good work Apple on the update, lets see some cool new features in 2.2!

HP ML110 G5 Power Consumption

Thursday, September 4th, 2008

As mentioned in a previous post I’ve been looking into a solution for maintaining an iTunes server, to stream music across my apartment to various AirPort Express units. Instead of going out and buying something, I thought I’d see if a HP server I’ve got would be cost effective to leave on 24/7. I’ve only used it for Xen testing before and never in a place where I pay the bills!

I hacked together a rig to measure the current being drawn and plugged it in, the results were totally shocking.

The Server has a dual core Xeon 2.4 Ghz CPU, 2GB of RAM and 4 hard disks so I wasn’t expecting the power usage to be low, and I was right. It averaged out at 440mA during almost everything from peak load to idle.

IMG_0040

This calculates to roughly 100 Watts (230volts * 0.440 amps = 101.2 Watts). Where I live this would cost £2.27 a week running 24/7. This is about what I’d expect - about a pint a week - affordable but certainly not green. What really surprised me was the current when the unit was switched off - 140mA!

IMG_0042

That equates to 32.2 Watts or £0.72 a week - switched off. When I say switched off I don’t mean in standby or hibernating, I really mean off. This, I expect, will be the same for most ATX based PC’s (that means nearly all). I think its absolutely disgusting that this device has such a high power requirement when off.

Imagine an office of 50 PC’s - 1.6kW and £25 a week (based on average office opening hours 9  - 5). A figure of over £1000 a year for powering devices which are thought to be switched off soon emerges.

Because of these findings I’ve gone all anal about this and I’m making an improved device for measuring a mix of devices. My hacked together one wasn’t really what you’d call safe to have around the home & was hard wired to a IEC connector.

Back to the iTunes server, I’m going to try out FireFly Media Server on the ML110 - under Xen. More on low power PC’s another time!

iPhone Amazingness

Sunday, August 31st, 2008

A week ago I took the next plunge into geekdom and got an iPhone. My overall impression is that its great, even though there are still a few flaws with the software (it hangs and its slow). The best use I’ve got for it - other than the standard email / web / blah - is the Remote application (Link - will open iTunes). Remote allows the iPhone to control iTunes, which in itself is pretty spectacular, however adding an AirPort Express to the mix makes it the best thing ever. Seriously.

The AirPort Express allows you to play music from iTunes wirelessly. This results in the ability to play your entire music collection on the stereo you connect the AirPort Express to - while controlling it with your iPhone.

There is a decent setup guide at LifeHacker which tells you everything you need to know to set this up. One thing that LifeHacker didn’t get entirely correct is the part regarding the access point - you only need WDS support if you want the AirPort Express to extend the range of your network. I’m using the router Sky sent me (some Sky branded Netgear thing) with no configuration changes and its working fine.

The next part of the challenge is scrubbing my MP3 collection and finding a decent low power device to stream it.

Dynamic Subversion Backup Tool

Saturday, December 15th, 2007

As I said in this post I’ve been exploring and using Subverison a lot recently, and with plans to start a hosted subversion arm to the web hosting business I need to keep working on the web based management tool. As everyone knows backups are crucial, so the first step towards my web based subversion management tool is the backup side of things. This is the first version of the script, I’ve been running it nightly for about 2 weeks now and it’s behaved very well so far.

I started with the script provided by Mark Shead (Backing up Subverison Automatically) however with plans for expansion I didn’t want to end up with a backup script for each repository. In addition to this I wanted the script to integrate with my envisaged web based SVN management tool, that meant database integration. In setting up the above script I found this article very helpful.

I ran with several versions of Marks script all running via cron and sending the output as email for a few days, then decided that now was a good time to integrate the script to a database and backup all of the repositories in the database. For a guide to using the script via cron see the end of the article.

I would include a SQL dump from PHPMyAdmin - but wordpress won’t let me include that in the post -but you need a single table called repo with three fields (repo_id, repo_location and repo_prefix). Any questions or comments leave a comment or email me.

Watch out for the mis-spelled SE!!!L!!!ECT - wordpress also won’t let me save the post with that line (or this line!) for some reason. I’m looking into why.

#perl modules to use
use DBI;
use DBD::mysql

#DBI config values
$host = "localhost";
$database = "database_name";
$user = "user_name";
$password = "password";

#Data Source Name
$dsn = "dbi:mysql:$database:localhost:3306";

#Perl DBI Connect
$connect = DBI->connect($dsn, $user, $password) or die "Unable to connect: $DBI::errstr\n";

#write the query
#Perl DBI Connect
$connect = DBI->connect($dsn, $user, $password) or die "Unable to connect: $DBI::errstr\n";

#write the query
$query = "SE!!!Insert L!!!ECT repo_location, repo_prefix FROM repo";
$query_handle = $connect->prepare($query);

#run the query
$query_handle->execute();

$query_handle->bind_columns(undef, \$repo_location, \$repo_prefix);

while($query_handle->fetch()) {

#my $svn_repo = $repo_location;
my $bkup_dir = "/subversion/backup";
#my $bkup_file = $repo_prefix;
my $tmp_dir = "/subversion/tmp";
my $bkup_svr = "backup.green-host.co.uk";
my $bkup_svr_login = "root";
my $remote_path = "/home/green/svn_backup";

print "\n-------------\n";
print "Backing up Repository $repo_location";
print "\n-------------\n";

$bkup_file = $repo_prefix . `date -Is`;
chomp $bkup_file;
my $youngest = `svnlook youngest $repo_location`;
chomp $youngest;

my $dump_command = "svnadmin -q dump $repo_location > $bkup_dir/$bkup_file ";
print "\nDumping Subversion repo $repo_location to $bkup_file...\n";
print `$dump_command`;
print "Backing up through revision $youngest... \n";
print "\nCompressing dump file...\n";
print `gzip -9 $bkup_dir/$bkup_file\n`;
chomp $bkup_file;
my $zipped_file = $bkup_dir . "/" . $bkup_file . ".gz";
print "\nCreated $zipped_file\n";
print `scp $zipped_file $bkup_svr_login\@$bkup_svr:$remote_path`;
print "\n$bkup_file.gz transfered to $bkup_svr\n";

#Test Backup
print "\n-------------\n";
print "Testing Backup";
print "\n-------------\n";
print "Downloading $bkup_file.gz from $bkup_svr\n";
print `scp $bkup_svr_login\@$bkup_svr:$remote_path/$bkup_file.gz $tmp_dir/`;
print "Unzipping $bkup_file.gz\n";
print `gunzip $tmp_dir/$bkup_file.gz`;
print "Creating test repository\n";
print `svnadmin create $tmp_dir/test_repo`;
print "Loading repository\n";
print `svnadmin -q load $tmp_dir/test_repo < $tmp_dir/$bkup_file`;
print "Checking out repository\n";
print `svn -q co file://$tmp_dir/test_repo $tmp_dir/test_checkout`;
print "Cleaning up\n";
print `rm -f $tmp_dir/$bkup_file`;
print `rm -rf $tmp_dir/test_checkout`;
print `rm -rf $tmp_dir/test_repo`;
}

Why you need (sub)version control

Saturday, December 8th, 2007

I’ve been meaning to write about version control for a while, its seen to be an incredibly boring and geeky subject. I started using it for my dissertation project in my final year - and now I’m using it for almost every document, script or spreadsheet I have. I think that not oly can anyone use subversion, most people should use it!

I like using it so much I’ve started to get interested in the stuff behind the scenes, the stuff that makes it work - and how that can be used to improve it. So much so I’ve setup a subversion server with plans to start selling it. Free, time unlimited, trials will be available.

So, why is it so good and how can you use it?

Well, assuming you use a repository that’s hosted on a different physical machine, the first advantage is an automatic backup. That’s a plus, but not the main event - let me explain how it works. Every time you ‘check-in’ your work subversion notes the changes that were made from the previous revision and remembers that. So you can go back and see all of the previous versions - and what was changed in each version.

This really comes into its own when you figure out that last Friday you deleted a paragraph that you just realised you want to keep. You can simply view the version before that paragraph was removed and get it back.

There is a lot more to subversion that that, especially when you get more than one person working on the same thing. But I really think if you have the tiniest inkling that subversion might be interesting then give it a go!

If you fancy giving subversion a go then you’ll definitely need TortoiseSVN, if you can’t find anyone offering a free trial repository then drop me a line. I’m working on a web client for managing subversion repositories so testers are needed!

I’m trying to find a decent beginners tutorial to TortoiseSVN - but not having much luck so watch this space.

Your very own music station…

Sunday, June 17th, 2007

This site has changed how I listen to music, simple as. Its got to be the best implementation of any ‘Web 2′ type of site I’ve seen, more people should take a leaf out of the book those guys were reading when they created that service. Pandora lets you create a personalised radio station based on bands and songs you like, it then plays songs that are deemed to be similar to that music. In my opinion the best bit is that to use the service all you have to do is type in a artist / song name into the funky flash based player- no need to sign up.

That’s important, so many people don’t bother using really good sites simply because they don’t want the hassle of signing up. With Pandora you can use the service for a limited time and then decide if you want to sign up, I defy anyone who listens to music on their PC and has broadband not to sign up after a few minutes of using Pandora.

The really cool part of Pandora is highlighted in this video interview by Robert Scoble with Pandora’s CTO Tom Conrad, its really worth a watch. Pandora (if you live in the US) will work on your mobile phone, advertisement free, for $3 /month. Thats something I’d love to try, the ability to listen to any music on the move without having to actually have it with you is really cool.

Aside from DMCA restrictions (thats a whole other post) potentially ruining this I think its going to be the way that we’ll access music, I hope so anyway.
The interesting part of all this is, is this the end of the iPod? If my phone could access Pandora there is no way I’d buy a MP3 player that cant.