skip main content

Archive for May, 2006

Nike and Apple do running

posted by Duncan at 9:58 am on May 24th, 2006

Nike and Apple have collaborated with a bunch of running products. The coolest of which is the a pedometer / ipod combo.

You stick the sensor on your running shoe as per a normal pedometer. The cool bit is that you plug in the receiver to your ipod and you get a hole load of functionality. It not only gives you all the normal stuff, pace, distance covered etc, but it will also speak it to you through your headphones to save you averting your concentration from the road. And the piece-da-residence allowing you to upload this information onto the nikeplus website to keep track of your running program.

The problem is, we’ll have to wait until July 13th to get hold of this stuff. Never has the anticipation of just running been so great.

Deploying wordpress using capistrano

posted by Duncan at 2:47 pm on May 21st, 2006

[update] I have written a new post called Deploying WordPress to SliceHost using Capistrano and Git, which uses new versions of Capinstano and WordPress, and although also now uses Git as the SCM, may still be useful.

So I was running typo up until last week. I was gradually getting more and more hacked off with it’s problems, and decided to change over to WordPress. I feel like I’ve ran every blogging tool out there, but WordPress is the most polished I’ve seen so far, and I’ve a PHP background which helps.

Don’t get me wrong, I’m loving Ruby and RoR ( Hell, it’s all I’m doing at the moment at work ) but I just want to post stuff up fast and easily, and also make changes to the blog and post them up fast and easily. After reading this article on nubby on rails, I decided to try it with wordpress. I’d been using Capistrano to deploy my old Typo blog and at work we use it to deploy all our apps. It really is a clever bit of kit and I wanted to continue to use it even though I was not gonna be running a RoR app.

Well, no problem. Although Capistrano makes a bunch of assumtions i.e. you are running a RoR app, you are using Fast CGI etc you can overide all this stuff.

First, what I wanted from all this:

  1. Easy deploy and re-deploy of my WordPress blog
  2. The image uploads when posting stuff to be seperate from the app. This is so I could override the app whenever I wanted without having to worry about overwriting all the images

Step 1.

Created a folder called wp_<app_name> and stick a public and config folder in there. Put all the files and folders that make up wordpress into the public folder. In the config folder you put the deploy script. You can either use one created in a rails app ( this gives you lots of comments on what the various sections do ) or you can just create a file called deploy.rb and stick all the code in Step 2. inside. How I got this file the long was was creating a dummy rails app and running cap -A . inside to get the default deploy.rb created for me in /config/deploy.rb.

rails dummy_app
cd dummy_app
cap -A .
mv config/deploy.rb /path/to/wp_app_name/config/
cd ..
rm -rf dummy_app

Now you should have the file/folder structure as below. This is mine:

wp_whomwah
  |- config
  |    |- deploy.rb
  |- public
  |    |- <your wordpress files>

Step 2.

Edit the deploy.rb file to suit your setup. I changed the information in the various sections as seen below:

set :domain, "www.whomwah.com"
set :application, "wp_whomwah"
set :user, "duncan"
set :repository, "http://#{domain}/svn/repos/trunk/#{application}/"
role :web, "#{domain}"
role :app, "#{domain}"
role :db,  "#{domain}"
set :deploy_to, "/users/home/#{user}/sites/#{application}"
# setting use_sudo to false means you can use
# cap cleanup ok without needing to be a sudoer
set :use_sudo, false
desc "This is here to overide the original :restart"
task :restart, :roles => :app do
  # do nothing but overide the default
end
# create a symlink to where I store all my images on
# the server. 
desc 'Link to central uploads folder'
task :after_symlink do
  run "ln -nfs #{deploy_to}/#{shared_dir}/uploads/" 
    "#{deploy_to}/#{current_dir}/public/wp-content/uploads"
end

Step 3.

You should now be ready to go. Check all this stuff back into SVN and the you should be able to run:

cap setup

You might want to look on your server to make sure capistrano has created your app and all the folders in your :application path as stated above. Once you are happy it’s there and in the correct place you can run:

cap deploy

this should then checkout a copy of your app from subversion and stick it in the releases folder. It will also create a symlink called current, pointing to the latest deployment. It is this current folder that you need to point the server at when displaying your site.
Update: I have stuck up a copy of the deploy.rb file I use. It differs slighly from the one above. When you run the cap deply line it will:

  1. deploy app
  2. symlink uploads folder
  3. dump a backup of the db
  4. run cleanup to leave a max of 5 releases

Happy Deploying!

Radio 1 rents virtual tropical island

posted by Duncan at 10:54 am on May 19th, 2006

This is probably old news to some but I really like the idea of this. Radio 1 have rented an island in the virtual world of Second Life and plans to use the island to debut new bands over the next year. They have started by hosting a virtual party that mirrored BBC Radio 1′s real-world, One Big Weekend event, held in Dundee. At the virtual festival, festival goers got a virtual radio to take home to their virtual homes so they can tune into Radio 1 anytime.

virtual radio

Could this be the future though? big companies releasing new consumer products virtually to test the water. I heard that Adidas has realeased a pair of virtual trainers in this way ( not sure if that’s true though ). As computers get more powerful there is no reason why not. I can imagine checking out a new telly, radio, mp3 player, or even car virtually. The pictures you see in magazines of such products are after all, ofter CGI versions of the real thing.


back to the top