@madpilot makes

WAWAs onVoiceOver

Ok, ok, I know I should be publishing part II of my fantastic “Three development tools you simply must have…” series, but I just got news of the following article about the WAWAs: http://www.onvoiceover.com/articles/wawa/. Not a bad write up if I do say so my self :)

A big thanks to John Lampard for the article.

Three development tools you simply must have… Part I

As a web developer, there are a number of tools in my toolbox that I find it hard to live with out. These tools for the basis of my development and deployment procedures and have not only made my life easier on many occasions, but saved my arse on more times than I care to admit.

Although these tools excel when used by a team of developers and designers, I still use then when I’m developing my own projects, such as 88 Miles. I’ve split this mini tutorial up into three parts, so that I can be a little bit more descriptive about the actual process.

Application #1: Subversion

Developing without subversion (SVN) is like throwing rocks at your house. Sure it may be fun, but sooner of later you’ll hit a window and lose all of your source code… I’ll leave the unmixing of that metaphor as an exercise for the reader. Subversion is a source code versioning system which you can think of as a safe for your source code. The concept is simple:

  1. You take a copy of the source code (checkout) and you work on it.
  2. When you have made your change you save the change back in to the repository(commit)
  3. When you delete or stuff something up, you check the previous version out of the repository and no one is any the wiser.

SVN uses a copy-merge system which allows many people to check code out and work on it at the same time. This is handy if you have a lot of developers. Many other version control systems use the exclusive-lock in model, where a developer checkouts the file, which locks it until they are finished, which is fine too – both have their pros and cons.

Copy-merge pros:

  • You can have many developers working on the same code at the same time
  • If a developer leaves a project, goes on holiday falls in to a mighty cravass, there is no risk that they will have an exclusive lock on a file, stopping other developers working on it.

Copy-merge cons:

  • This can get messy if two developers work on the same file at the same time. At check in time, they will need to merge their changes, and if they have been making major changes, this might not be trivial. Solving the issue requires some heavy communication (not really a bad thing) and some planning (again, not a bad thing). On small projects, the likely hood of this is pretty small

Exclusive-lock pros:

  • It is impossible for two developers to work on the same file at the same time, eliminating a situation where one developer destroys another developers work

Exclusive-lock cons:

  • It is impossible for two developers to work on the same file at the same time :)
  • See Copy-merge pros

One of the greatest things about SVN is it’s price tag – nothing! (Don’t let that freak you out though, there are many big projects that use it – Ruby on Rails is one that comes to mind) and there are clients and servers for Windows, Mac and *nix.

Although setting up SVN itself is probably beyond the scope of this article, I’ll out line the basic procedure to set up a repository, and to work with that repository.

Setup

There is a command line utility bundled with the package called svnadmin. This, funnily enough, is the administration tool for subversion. To create a repository, you do the following:

svnadmin create /path/to/repository

Where /path/to/repository is the location of the repository. So, say you want to create project called foo in the directory /home/subversion, you would execute

svnadmin create /home/subversion/foo

And it is setup! You will probably have to play with the permissions by editing the /home/subversion/foo/conf/svnserve.conf file, for the sake of this excercise, we will allow unlimited access to the world. Obviously, in real life, you would lock it down so only those that you wanted to be able to access the code could. Check out the subversion manual for details on how to do this.

Open the svnserve.conf file and find the line that says:

# anon-access = read

Change it to

anon-access = write

SECOND WARNING: THIS IS INSECURE. DON’T DO THIS FOR A SERIOUS PROJECT. And if you do, don’t come looking for me when some one steals your code.

Now you can checkout the empty repository in to your working directory – so called because it is the directory that you work in. The command will probably look something like this (depending on our server setup of course)

Right! now you are read to start coding! Once you have finished, you can add any new files, delete any old file and then commit the changes. Just so I know what is going on, I will first check the status of the directory

A new_file_2

U modified_file

D deleted_file

The letter before the filename gives you a hint as to what you need to do – A is add, D is delete, U is modified. To complete this commit, I would run the following commands:

/path/to/working/directory% svn delete deleted_file

/path/to/working/directory% svn commit -m “Created some files, deleted a file, modified a file”

And if all goes well, subversion will return the new revision number. Revision numbers in SVN are global, so every time you run the commit call, the number will be incremented. The -m flag stands for message, if you don’t put it in, a text editor will pop up asking you to add a message. The message you enter needs to be descriptive of what you do, so that others (or yourself) can go back and see why each commit was done.

Want to rollback the changes from a commit? Say you made a BIG mistake in revision number 5 and you need to go back to revision number 4, running the following command should do the trick:

_/path/to/working/directory% svn merge -r 5:4 svn://svn.myserver.com/foo

/path/to/working/directory% svn commit -m “Undoing BIG mistake”

So revision 6 will now be the same as revision 4. Notice though that revision 5 still exists, so if you later realise that the mistake wasn’t that big after all, you can revert back to revision 5!

This is just touching the tip of what subversion can do – you can do all sorts of other funky stuff, but I’ll leave that up to you to read up on. 99% of the time, this is what a subversion session looks like for me.

Next: Trac bug tracking

New JavaScript framework – Tennaxia

I just received an email a couple of days ago from one of the developers of a new JavaScript framework called Tennaxia. The point of the email was to ask permission to use my JavaScript colour picker as part of the library which is pretty cool. They also included the fabtabulous library from my mate over in Queensland, Andrew Tetlaw.

The library is a group of JavaScripts based on Prototype which provide widgets to use on web pages. Andrew’s widget, for example converts divs into panel tabs. There are a number of demos on the Tennaxia page.

It all looks pretty cool, so go and check it out.

Setting up a Rails app on a Media temple grid server

Now that I’m back from Sydney, I have had a bit more of a change to play with my shiny new MediaTemple grid server account. It looks like I will be pushing 88 Miles over to it over the weekend – everything is setup and ready to go, and just have to do the migrating. I though I would share with you a few thinks I found out along the way…

Setting up the Rails environment

The instructions on the media temple site are pretty good, there are just a few caveats I would make. Firstly, I’ve now started using capistrano to deployment, so I decided to change a few of the directory structures away from how MT suggests. The steps I took are as follows changes from the MT instructions are emphasised (replace testapp with you apps name – obviously):

cd $HOME/../../containers
mkdir rails && cd rails
mkdir testapp && cd testapp
mtr add testapp $PWD/current

For those of you playing at home, you may have noticed that the /current directory, doesn’t yet exist. Correct! This will get created by capistrano.

Setting up Capistrano

Everything was pretty straight forward in the deploy.rb file. The only gotchas I cam across were specific to my installation:

If your svn repository has a space in it, wrap it in single quotes when assigning the :repository variable, i.e:

set :repository, “‘svn://svn.server.com/path/to/your repository'”

If your svn repository requires a username and password for checkout or export, use the :svn_username variable, i.e:

set :svn_username,
Proc.new { “username –password password” }

The only other modification I needed to make to the deploy file was the addition of the restart task. Because MT uses custom scripts to restart containers, the restart script needs to call them reather than trying to mess with the Apache or Mongrel processes. I also discovered that my secure certificate wasn’t functioning correctly (I’ll explain why in a second) so there is a fix for that here as well.

desc Restart the rails container
  task :restart, :roles => :app do
    run mtr generate_htaccess test_app
    run echo RequestHeader set X_FORWARDED_PROTO https env=HTTPS >> #{deploy_to}/current/public/.htaccess”
    run mtr create_link test_app
    run mtr restart test_app
  end
end

Line 3 uses a MT script to make some modifications to the apps .htaccess file. Because Mt proxies all requests to the apps Mongrel server, the standard .htaccess doesn’t cut the mustard.

Line 4 makes another modification to the .htaccess file. Because I’m slack, I pull a neat trick when I do SSL. I maintain a global list of pages that require SSL – when a user browsers to that page, they automatically get redirected to the secure version if required. And the same works the other way – if they browser away from a secure page to a non-secure page, they get re-directed to the non-secure version. Unfortunately, because of the way MT proxies the request, the Mongrel server knows nothing about whether the connection is secure of not (i.e request.ssl? always returns false). Thankfully, there is a fix for this in Rails – if you include the X_FORWARDED_PROTO=https header in the request, rails knows what is going on. This line checks for the environmental variable HTTPS (Which is a flag that is set if the server is in SSL mode) and if it is, sends the modified header, which makes everything good again.

Line 5 links the web directory to the rails container and line6 restarts the server. Nice and easy!

MediaTemple’s new grid server services

What can you get for $20 per month these days? A Basecamp account? 4 88 Miles accounts? An account of a Grid server with 100Gb of disk space, 100Tb of traffic with support for upto 100 sites? Yeah. Media Temple has just released an insamely priced grid server setup that offers all of that FOR $20 PER MONTH. They even support Ruby on Rails using containers and mongrel. Needless to say, I signed up for account. hopefully it will come through before I leave for Sydney tomorrow afternoon, otherwise I’ll have to wait a week to play.

What is a grid server?

A grid server is basically lots of little servers that acts like one big server. This means that if a server becomes loaded, they can through more hardware at the problem. Google and Amazon use similar systems, infact Amazon offers a service where you can upload a virtual linux machine on to their grid.

If they pull this off, it will pretty much revolutionise server hosting. I’ll keep you posted how I go with my 88 Miles migration.

The Eftos web tradition lives on…

And what a rich, long living and all-encompassing tradition it is. Ok, there is actually only two of us, and I’m the one that has been in the web biz for the longest, but I’m sure that there may or may not be more to follow in our footsteps. And no, I haven’t gone nuts and started speaking in the third person again – the additional body that makes up the other half of “our” is my little brother, Cyrus, who just released his new and improved portfolio and blog site.

He obviously has a designer bent, which is cool because it means he might be useful to me some day :)

Seriously though, I quite like the look. So a big “Nice” goes out to him. Check it.

Who could have thought an umlet could be so funny…

I was just catching up on the tawdry adventures of workmate Simon’s trip around Europe. Possibly one of the funniest travel blogs I’ve read (Also probably the ONLY travel blog I’ve read, but if I’d read more, I reckon it would still be up there) and I got a flash back to a couple of weeks ago when he popped up on MSN.

He was in the middle of Sweden and we were basking in the light of umlets and agraves (As we do – Simon is a typography enthusist and I just love the sound of the word umlut). Of course funky inflections on characters is almost exclusively an Ikea thing over here in Australia, our alphabet isn’t blessed with anything more interesting than an X. So, anytime I see a swedish word, I immediately think flat-pack furniture, and so our new swedish car game was borne

Happy birthday Bloggy Hell!

Wow. I’ve been blogging for 12 months today. Crazy. So as a birthday present to my blog, I decided to give it a nice coat of (pixilated) paint. Still needs a little work, but it definately an improvement :)

Thankyou to those that still read this thing. I’ll send you all a virtual hug.

And that’s a wrap…

I can’t believe web directions is over already. Two days of talks, meetings, greetings, server admin (more on this later) and drinking. Here is a quick over view of what happened for those of you playing at home:

Thursday

  • John Allsopp talks about Microformats. All this talk of contact databases and vcards gives me an idea…
  • Derek Featherstone rounds up the day with is (from what I have heard) always enteratining talks. This was no different. However, I’m mildly distracted, as I start hacking a new Ruby on Rails site whilst listening to the talk (See talk given by John Allsopp). Yes, if any of you remember seeing a guy testing a website during the talks that was me.
  • And the drinking begins… The Port80 committee is a little late after having an impromptue Port80 committee meeting. However we soon catch up. I have a good long chat with the campaign monitor guys – they are top guys. It’s almost sickening :)
  • Onwards to the Landsdowne for cheap food. Miles is talking up the $5 meals. I soon realise why they are $5 meals. Never the less, the beers are heaping my headache. At this point many of our crew (we have acquired a few Melbanians, some Adelaidenese and a Brisbanite) part, touting tomorrow nights drinking and Andy Clarke’s early morning talk as reasons for an early night. Not so much this entrpid reporter!
  • Myself, Grant and Sarah head over the The County Claire hotel. This has been where the cool kids have been hanging out – many of the speakers and helpers were already there getting tired and emotional about web standards. Drink some more. Meet numerous people. Alas, all too soon, last drinks was announced, and this is where I should have listened to the little voice in my head.
  • A group of four decided that the Landsdowne would once again be an appropriate venue to discuss the finer points of modern dance. A pearl of wisdom if I may. If someone challenges you to an arm wrestle, say no. Although I wasn’t defeated, I still can’t really use my arm properly. Another pearl: If you need to be at a conference session at 9am, don’t get up at 9:30. Yes. I missed Andy Clarke. Everyone has consistently re-iterated how this may have been the talk of the conference, and I missed it. Yeah. That’ll learn me.
  • Next I sat in on Laurel Papworth talking about viral marketing and user-generated content. Pretty interesting. I was listening to the talk, while continuting to hack my new application.
  • The man in blue, Cameron Adams and Kevin yank from sitepoint gave a pretty kick-arse talk on using APIs and mashups, and at this point I actually caome across a term I hadn’t heard of – JSON-P! I use JSON all the time, but this P bit is new and foreign. I will read up shortly. (Still hacking new app)
  • After lunch Jeremey Keith talks about degradable Ajax in a presentation entitled hijax. At this point I start to write the Ajax handlers on the new mystery app, then realise that I really should stop cutting corners and should right it degradably. Thanks Jeremy – you just added a good hour or two on too my app development time. Grrr! To makes matters worse, my battery runs out, so no more app dev for me – my dreams of having it finished before the end of the conference are ruined! :)
  • Next is Derek with a thought provoking and almost forums like presentation on accessibility. He went in to the nitty gritty of how screen readers work. But I think the most important part was that no matter how much tech you throw at the accessibility problem, there is no substitute for sitting down with a user and watching how they work.
  • Now the final keynote address is where the interesting stuff started. Not from a conference point of view (Everything was interesting but from a work point of view). At Bam we went live with three sites a couple of days before I went away (Dumb idea, but they couldn’t wait). Miles gets a message that there was a problem with one of them, no worries – I’ll logged in to MSN and had chat with those left in the office and realised that I’d have to login to fix it. No biggie, except my laptop was out of batteries, as was Miles’. So we borrowed the laptop of one good samaritan, Adrian and we were on our way. Unfortutately, we were in bigger trouble than I thought. We have a rather large client that was been hammering our server the past couple of days, and it was really proving a problem.
  • After the keynote was over we headed back to the port80 hotel (AKA The Vulcan) and I continued to look into the server issue. The server was running at a load of about which means it was running SLOWELY. After a number of phone calls back to Perth, more work on another borrowed laptop at the after party (Thanks Adam), we finally got the server laod to stabilise. If you were wondering, I was the guy sitting cross legged outside the dance room with the black Macbook Pro working :(
  • Finally I could go party (Things weren’t 100%, but they would do). John Allsopp took us to possibily the dogdy-est pub in Sydney – the Star Hotel. This place looked like a mini casino – Coming from Perth where pokies are illegal evey where except the casino, it is weird seeing one-armed bandits all over the place. And I love anywhere which shows harness racing and greyhounds on one of many plasma screens. All class. After that, we took a walk along a street that was littered by asian restaurants. After making fun of the fact that these places usually have gross looking birds hanging in the window, presumably as a sponge for salmonella, we settled on the Superbowl restaurant WHICH HAS A PICTURE OF GROSS LOOKING BIRDS HANGING IN THE WINDOW. You couldn’t make this stuff up.
  • Onward, we continued travelling see weird signs for shops, one of my particular favourites was: Doctor Friend Chinese Medicine Acupunture Massage Skincare center. I’m so tempted to register http://www.doctorfriendchinesemedicineacupunturemassageskincarecenter.com
  • It is decided that we should go and meet the cool kids (See County Clare) at Purple sneakers. So We drop myself and Grant walk Miles home (trying to convince him to come out with us – he’s so soft) and we start our journey the 50m up the road we need to go. Or so we though. How would have though that Sydnesy has more than one main road!? We got lost. In a 50m square radius. Then Grant fell over and nearly busted his ankle. It was funny. I guess now in hindsight it would of sucked if he couldn’t walk, but it was still funny :) After offering him a shopping trolley, and his refusal, we finally get to Purple Sneakers.
  • Not only is Purple Sneakers a name of a You Am I song, it is the name of a cool, grungy little Amplifier-esce club in Ultimo. Was much dancing to be had with such classics as “Wave of Mulitlation” by the pixies and Parklife by Blur. Other notable mentions included the Strokes, Regurgitator and much, much more. We left there about 4am.
  • The final parts of the night (now early morning) was to sit up and drink beer with Leon on his balcony that over looks the city and watch a magnificant sunrise.

So all in all a fun-filled couple of days, with both ups and downs, but we worth it. Roll on WD07!

Web directions update #3: Campaign monitor

I just attended the talk given by Dave Greiner & Ben Richardson who created Campaign Monitor and it was the first talk of today that really hit home. Don’t get me wrong, the other talks have been excellent, but this one, for me anyway was about something that REALLY interested me. That is, creating and marketing a online application that solves a specific problem, all while working somewhere else full time. For those of you plpaying at home, I’m doing exactly that with 88 Miles.

It was very reassuring that these guys went through simple experiences that I have had or am currently having. I’m going to stalk, erm, filnd them after all the talks finish and picks their brains.

I’m currently in John Allsopp’s microformats and mashup talk. It is filling my geek quota quite nicely…

More soon.

Previous Next