@madpilot makes

The Original Social Network…

I just gave this presentation to the PRIA Young Guns –  a group for younf marketing and PR people, along with Justin Davies and Ronnie Duncan (from Meerkats – sorry, haven’t got a link).

As you all well know, I’m very much from the technical side of the web, and have been known to be a little critical of some of the more, let’s say, marketing focused people, so the focus of my talk was to show that social networking isn’t all about selling, it’s about interaction. At the end of the day, online social networks should be an extension (not a replacement) for real-life networks and should be treated as such. In real life, if you only call on friends when you want a favour, you aren’t going to have any friends left – and the same applied to online social networks.

I got asked a number of times “How many hours do you spend on social networks?”. It really is the wrong type of question to be asking, because I hang put on Twitter and the port 80 forums (Yes – forums are social networks too) because I have a genuine interest is what is going on with in these groups. It’s not about ROIs or won leads, it’s about conversation. If work comes out of that (and it does) – then fine.

So how was this relevant to a bunch of marketing kids? Well, the point I was trying to make was that interaction creates an association with your and your product, which encourages online “word of mouth” marketing. It’s less in your face and more targeting that whacking whopping great ads all over numerous sites. It’s probably a little harder to quantify, but it is still a solid methodology (says the man with the Computer Science degree).

It really enjoyed listening to Justin and Ronnie. Justin has a marketing degree, but is currently working heavily in the technical side of things, which acted as a great conduit between my talk and Ronnie’s. He made some really interesting points about the changing face of PR (So what would have happened if Apache Gas had a blog?). Ronnie comes from the old school of marketing and advertising (that is the creative, clever side), and although he admitted himself that he had a long way to go to fully grasp what can be done with Web 2.0, his attitude to what can be done was pretty refreshing.

My slides are here.

JoikuSpot premium edition released

A couple of days ago, Joiku released the premium edition of their WiFi access software for Sybian phones: JoikuSpot. I’ve blogged about JoikuSpot before, and now for 15€ you can get the premium edition, which NATs mail, Skype, SSH, HTTPS and number of other protocols. They also seemed to have fixed the issue which stopped the EeePC using DHCP. This is really awesome – I can finally leave that USB cable at home. Let’s see your beloved iPhone do that!

A recipe for server migration

As any website grows, we often find ourselves having to move servers to deal with capacity, or better prices or whatever. This can be a right pain to do, but with a little planning and a few tricks, you can make the process somewhat smoother. In this quick howto, I’ll cover how to move a typical web setup: Web server, DNS, Mail and database. Of course there are more than one way to skin a cat, but this method works quite well if you have a couple of days up your sleeve and has the advantage of only costing you a few minutes in downtime. In this example, we will pretend to move http://www.mycoolwebapp.com from the IP address 192.168.0.1 to the new IP address of 10.0.0.1 (Fake web host, and fake, local IP addresses – substitute with real values).

Step 1. Move your DNS

DNS can be the most painful step, as it can take up to 72 hours to move from one primary DNS server to another. In a nutshell, DNS acts like a big phone book, which tells your browser that http://www.mycoolwebapp.com belongs to the IP address 192.168.0.1. When you enter http://www.mycoolwebapp.com in to your browser, it will ask the operating system for the IP address. If the Operating system has it cached, it will return it. If the cached value looks old (ie the TTL has expired), or it doesn’t know about it it will ask a parent DNS server (or root server) where it can find the updated records, and will then fetch the new records from the relevant DNS server. The TTL is usually set pretty high – in the range of days, as generally Name-to-IP address mappings don’t change much, but if you do change, there means there could be a couple of days before all the servers around the world are updated, meaning your site won’t be found during that time!

Most users don’t have control of the Time-to-live (TTL) value on the root servers, so you need to ensure that both your old primary DNS server, and your new primary DNS server mirror each other. This way, regardless of whether the user get old information or new information, they will still be directed to the same information.

Most users WILL have control of the TTL on their own servers, so we can set that to something small which will make switch over much easier. Make note of the TTL on your old DNS server – you will need to wait that long after changes things before you can switch over to your new server. Setup your new DNS server to point to the old server (192.168.0.1) – ensure that all of the values are exactly the same. Now, on both servers, set the TTL to something very small, say 10 minutes (which is 600 seconds).

As this can take a couple of days to for the root DNS changes to propagate, you may as well change the root DNS details now. This will usually done via the domain registrars control panel. Simply change the primary and secondary DNS server IPs from the old DNS servers to the new ones (192.168.0.1 to 10.0.0.1 in this example). Make sure you double check all the values, because if you make a mistake it can take days to rectify!

Step 2. Setup the new webserver

Now that the DNS is setup and in the process of re-delegating, you can setup website on the new server for final acceptance testing. This is usually the easiest part of the process. What I do here is deploy the current software to the new server, take a snapshot of the database (phpmyadmin helps here if you are on MySQL, but each database system has a mechanism for backing up the database) and copy over any uploaded files etc. Now, most shared hosts will use virtual hosts, which means it serves up different pages based on the domainname, not the IP address, and if your software relies on the domain name for functionality, it can be really hard to test all the functionality with out the having the name-to-IP address mapping in place (remember, at this point http://www.mycoolwebapp.com is still pointing to 192.168.0.1).

Hosts file to the rescue! You might not know this, but all the major operating systems have a “hosts” file, which is checked before a DNS check is made, so if the operating system finds the requested domain name in that file, it won’t even bother querying the DNS server. By associating the new server IP address with the domain name in this file, we can actually view what is going on on the new server (Just don’t forget to delete the entry when you are done!). Windows users can find the file in c:windowssystem32driversetchosts, and Linux (and I’m pretty sure OSX users) can find it in /etc/hosts. There is usually examples in the files, so it’s best to follow those, but I know these values work for Windows and linux:

10.0.0.1    www.mycoolwebapp.com

You may need to restart your browser for the change to take effect. Now if you go to http://www.mycoolwebapp.com you will be taken to the new server allowing you to set it up and check everything is working properly with out affecting the currently live version.

Step 3: Setup mail

Email can be pretty painful to setup, and is one of those things that will get you in a lot of trouble if you stuff it up. First off all you need to know all of the email addresses associated with the domain. If your hosting provider uses a web admin control panel like Plesk, this is usually pretty easy. Mirror all of the accounts on the new server, and make sure all of the quotas are either equal to or greater than the current values. If you need to setup new passwords for all of the accounts, note them down, as you will need to notify each user of their new password. Don’t forget to check for things like aliases and forwards.

Step 4: Check and double check

Make sure you note down any other bits and pieces that may have been setup, like cronjobs, other services and make sure that things like mail contact forms etc actually work. There is a trick here for young players with email forms – the resulting email may go to the new server, not the old one, so if you test a contact for and no email appears, check the new server.

Step 5: The big move

The way I usually play this is to replace the website on the old server with a “We are down for maintenance” page. This has the advantage of ensuring no one posts any new information whilst the the site is in flux and also gives you a visual confirmation that things worked. If your server can use .htaccess file, this is pretty easy using a rewrite directive. If the framework you use has friendly URLS, there will probably already be a .htaccess file that tells the server to rewrite the URLS to file – this is the simplest solution – just create a maintenance.html file and change the rewrite to look like this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ maintenance.html [QSA,L]

This allows you to still access CSS, images and JS files, so you can style the maintenance page, but any request to a file that doesn’t really exists will get piped through to the maintenance.html file.

If .htaccess isn’t an option or you have a lot of static file, you might have to do the old fashioned “move the current site root and replace with a new one” trick (There are rewrite rules you can do, but this just might be easier). Create a new directory that has the maintenance file (You would probably have to call it index.html in this instance) and put any associated images, CSS and JS files. Then move the current site root (for example public_html) to say, public_html.old and then move the new directory to replace the old one (ie public_html). When you view the site on the old server (you might need to remove the entry in the hosts file to see it) you should now see the maintenance message.

Next, re-sync the database and any new uploaded files and give the new server a final test (by putting the hosts file entry back in). Once you are happy everything is working, we can flick the DNS over.

Step 6. Flicking the DNS

On both the old and new server, change the IP addresses for all of the relevant entries from the old IP address to the new one. Within 10 minutes, everyone should be seeing the new server’s version of the site! This also means that all of the email will be heading to the new server to, so…

Step 7. Re-configure mail clients and syncing up folders

If you configured new passwords for all of the mail clients, they will need to enter the new password into their mail clients. I generally walk them through creating a NEW mail account on their clients – the reason for this will be revealed in a second.

If they have been using POP in the past, then they will probably already have local copies of their email, so your job here is done. However, if they are using IMAP (probably more likely now) you will need to sync up the two accounts. There are tools out there that can do it, but you will need to know the passwords on both servers, and they can be a bit hit and miss – thankfully you can use the users mail client to do the sync.

Simply create a new account on their mail client that points at the new server, and change the old account to point to the IP address of the old server. If done correctly, the user should now be able to access their old email and folders as well as any new email on the new server. Most mail clients will actually allow you to drag folders across servers – do that and your email will be synced up! (It might take a while, if they have a lot of archived mail). After that is done, you can delete the old account and set the new account to default.

Step 8. Shutdown the old server

The final task is to shutdown the old server. I usually leave it running for a week to be on the safe side, mainly to recover any email that the user forgot to move across (It ALWAYS happens).

Step 9. Do and get a drink

You deserve it – it’s probably been a big week!

I hope that this made sense, or at least acts as a resource when you try to explain to a client why it can take a week to move servers! Of course, these instructions are pretty general, so your mileage may vary. Golden rule is don’t rush and double check everything!

Proposal: An open inter-conversation microblogging protocol

Spurred on by Gary’s discussion on the number of micro-blogging sites around, the “Is it Distributed?” question made we wonder if we are going about this wrong. Cameron Adams was right when he said there is only one social network, so why are we flicking between a large number of them? Why aren’t we running out own?

Beyond a number of small superficial differences they all do the same thing – you add friends, post what your doing (usually in an arbitrary 140 characters or less) and read what others are doing. There really is no reason why this can’t be truly distributed, i.e. I can run my own micro-blogging site, and all my friends can run their own micro-blogging sites – all that is needed is some glue (a communication protocol) to bring it all together. The great thing about this, is we already have systems to make this happen – get your buzz-word bingo cards out people…

RESTful XML

The first part of this system is a RESTful API that allows friends to post information in your timeline and you to post to others. Everytime you post to your microblog, it will iterate through your list of friends and forward the message on to them. The same thing happens if you delete a post – if notifies all your friends to remove the post from their local database. To ensure that random people can’t spam our feeds, we can use OAuth to give “friends” permission to send us information.

Your own timeline

The reason that your microblog would need to be notified of other peoples posts would be so you can cache these posts on your own microblog, which gives you a twitter style public timeline. The advantage of this is that there is basically no database load to display YOUR feed – the only information in your database are the posts that you want to read!

Adding friends

So how can you add friends and allow others to follow you? This is actually pretty easy using OAuth – by adding your microblog to your friends microblog authorised list, they know that you need to be notified on an add or delete command. This gives us the side effect that we can manage not only who we follow but who follows us – if you want to stop someone from following you, you just de-authorise them. So what happens if a new friend adds your microblog to their timeline? A simple GET command could be made to receive all of the posts by the new friend, effectively syncing up the two databases – all future posts will obviously push to the new friend (and vice-versa) so there is no expensive polling.

Other peoples timelines

If someone has a public timeline, this is a no-brainer. Each persons microblog would just be available and others can just read it. But what about private timelines? Enter OpenID. If each of your friends provide an OpenID URL, they would be able to login to your microblog to read your private feed – no password required, but is still totally private.

Discovery services

Many twitter users scour the public timeline waiting for people to post things that they are interesting in. This is actually quite easy to implement on a distributed system – have a read only super node that everyone posts to. Voila, instant public timeline. This also means that you can easily create “channels”. Instead of only having one public timeline, you can have many based on different topics.

Unlimited extensions

One of the value-adds for Pownce is the ability to share attachments and events. In reality, all it does is provide a link to a file on a remote service. If you wanted to add this function to your microblogging site, you can quite easily – as long as you post the link to others. This means you have complete control over what your microblog does, as long as it still talks the protocol.

Advantages

  1. The obvious one is you aren’t at the mercy of servers doing a twitter (ie. being up and down like a yo-yo). If your friends server goes down you miss out on their posts, but no one elses.
  2. You have control over your data – you don’t have to worry about a service disappearing overnight and you not being get at it. It all on your server
  3. Distributed data – your server dies and your harddrive explodes, your data can be rebuilt from the data that is stored on one of your friends databases

Disadvantages

  1. If someones site is down they may miss some updates, so you would need a method for re-syncing all friends posts from a certain date – no biggie.
  2. It does make completely removing your account difficult as you can’t really ensure your friends are going to respond to delete commands correctly

So what do people how don’t have their own server to run this on? This is the kicker – you can still have hosted versions of the system. This works for blogs (I host my own, but some of my friends use systems like Blogger.com) and OpenID which makes it much more accessible.

If there is some interest in this, I’m sure we can start drafting some specifications. I’d be interested in your thought.s

One lost laptop: Returned

Yesterday, whilst being distracted by a phone call as I got in to me car, I did what we all dread doing – I left my EeePC on the top of my car as I drove away. I noticed that something was a miss a few streets away from me house, and promptly (after having that sinking feeling) re-traced my tracks to see if I could see it. But I couldn’t. After all of the stages of grief: Denial (Surely, I couldn’t be so stupid), Anger (Godammit!), Bargining (Maybe if I drive around again…), Depression (Why me!!!) and Acceptance (Well, maybe I can justify that 9″ version now) I got a phone call from Justin Gill at Perth college. One of the students there had founded on the side of the road and handed it in.

I for one am glad that there is still some honesty in this world. So to Justin, and the still anonymous student – thank you so much! You have made this geek very happy.

Use CSS to speed your unobtrusive JavaScript

Unobtrusive JavaScript does for JavaScript what CSS did for HTML design. Separating the design and business logic client side means better re-use and compatibility.

To make a truly unobtrusive site, you should start with a base, non-JavaScript version of the site, and then add functionality dynamically. One of the issues with this is quite often you are left with elements that are required for HTML-only functions, but not for the JS version. Obviously, it’s easy to traverse the DOM tree and hide elements that not required like this:

var elementToHide = document.getElementById('hide_me');

if(elementToHide) {
    elementToHide.style.display = 'none';
}

but this can be pretty slow if you have lot of elements to hide. Sure, you could use XPath, but it isn’t supported in many browsers.

CSS is pretty darn quick when applying styles (well, you would hope so – that’s what it is designed for), so by dynamically including a CSS file via JavaScript we can hide (and show) elements really quickly. It’s all pretty simple:

  1. Create the style sheet (We’ll call it /stylesheets/css.js)
  2. Set up the desired styles in the style sheet as you would any another CSS file
  3. Drop the following code is to a JavaScript file and include it in your header
function unobtrusiveCSS() {
    head = document.getElementsByTagName('head');
    head = head[0];
    link = document.createElement('link')
    link.href = '/stylesheets/js.css';
    link.setAttribute('media', 'screen')
    link.setAttribute('rel', 'stylesheet');
    link.setAttribute('type', 'text/css');
    head.appendChild(link);
  }

  FastInit.addOnLoad(unobtrusiveCSS);

Now, you might have noticed that I’m using the FastInit library (written by the ever so talented Andrew Tetlaw). Because we are modifying the DOM, we need to wait for it to load before we can append anything. I could have used window.onload, but that would defeat the purpose, as we would have to wait for all of the images on the page to load, negating the speed up we would get.

The FastInit library will fire the JavaScript as soon as the DOM is loaded. (Go to the site to find out how it works – it’s quite ingenious), At the end of the day, you would need to a library like this regardless of whether you use the CSS include hack.

Caveat: Another way of doing it would be to use document.write, which would eliminate the need for an external library, but hacks like that make baby jeebus cry.

88 Miles in the Business Review Weekly’s top 100 Australian Web 2.0 Applications

Business Review Weekly released it’s list of top 100 Australian web 2.0 lists today and 88 Miles came in at number 58!

There are some pretty cool apps on the list, including big players like Atlassian and of course our good friends Saasu.com, Scouta and Norg Media.

Rounding up the Perth list we have The broth, Minit, Buzka, Gooruze.

Congratulations to everyone who made the list!

An online version of the list can be seen here.

Wordle Meme – Crazy text clouds

To draw you all away from the fact that I’ve been lax in posting this month, here is some graphical distractions. The Wordle meme is simple: Cut and paste the copy from you blog or website, go to Wordle and it generates a crazy text cloud. Don’t let the Java Applet get you down to much. Mine is here:

MadPilot’s new(ish) phone number

Now that I’ve relocated back into my home office, I’ve decided to revert back to my old VoIP number: +61-8-6424-8234.

Although Skype was doing a perfectly good job at taking and making phone calls, the NetGear SPH101 Skype phone wasn’t really up to the task (the battery life isn’t that great and the call quality can leave a little to be desired) and I’ve got a perfectly good VoIP phone sitting here, which has much better voice clarity. (Oh, it it means my business cards will be correct now too!)

I’ll redirect my Skype number to the “new” number in the interim to give you all a bit of time to update your records. I’ll still leave the Skype phone around to Skype-to-Skype (handle: madpilotproductions if your interested) calls too I think.

For the safety of the swimmers…

For the past twelve months, I’ve been a house mate at the Silicon Beach House – the collaborative, shared office space in the Perth CBD. Having seen a number of arrivals and departures over the past year, it will see it final set of departures, as it closes and gets turned into a resort (Ok, some other company is taking over the lease, but I started this metaphor, and I’m going to finish with it god damn it).

Unfortunately, due to a number of factors, it wasn’t viable to keep it open so whilst the idea of having a shared working space isn’t dead, it’s been cryogentically frozen until sometime another suitable venue can be found. So if you are in town, don’t try to drop in any more, as, well you’ll freak out the new occupants. For those of you who want to find me, I’m back working from the home-office, so if you are in Mt Lawley, give me a call and we can go for coffee :)

Previous Next