Posted by & filed under IT, Web.

A colleague bought a new Google Nexus 7 recently, and astonishingly when he first turned it on it knew his Google account! Basically, the first time it was powered on in his house and he went to sign in to Google, it knew his username.

 

So, is this one of these two possibilities?

a) He purchased it with his Google account on Play and so Google were able to insert this account username into the build/after the build of the Nexus 7 – possibly, a bit presumptious that you will be the end user and if all they add is the username, is there much point? Surely more customisation would be prefereable, eg select some apps and they’re installed.

b) Google knew his home router’s MAC address and wireless network SSID – either via the StreetView fiasco or via a phone/browser app – and that his Google account was used with this wireless network and then put two and two together when the Nexus 7 started up – the scary option and again possible and would explain why this username is the only customisation done.

 

Hopefully someone, can answer how and why Google does this to satisfy my curiosity and fears!

 

 

 

Posted by & filed under Amazon Web Services, IT.

Simple command to SCP files to an Amazon EC2 instance – using ssh keypair

 


scp -i ~/.ssh/SERVER-key.pem /path/to/local/file.txt ec2-user@EC2-HOST.compute.amazonaws.com:/path/to/remote/dir

 

Posted by & filed under Linux, Ruby.

I had a server with a manual installation (local compilation -> ./configure && make; make install) of Ruby v1.9.2 and I needed to upgrade this to v1.9.3 – How did I do this?

 

Technically I didn’t… it worked out to be too much hassle long term to upgrade the manual installation on a production server so I installed Ruby Version Manager over the top which overwrote the underlying links to the previous version of Ruby. I believe it is best practise to use a version manager for Ruby such as RVM which not only allows you to manage Ruby versions server-wide but also per-project versions and gemsets.

 

The steps I took to install and use RVM were as follows;

  1. Check Ruby version
  2. Install Ruby Version Manager as per guide
  3. #rvm install which ever Ruby versions you require
  4. Sort out webserver configuration; for example point to new Ruby version or per project version
  5. Restart webserver

 

And thats it, also in future it is really easy to upgrade again by just letting RVM do the hard work.

 

 

 

Posted by & filed under Javascript, Mapping, OpenLayers.

I have created a quick implementation of the OpenLayers WMS class to use Ordnance Survey’s OpenSpace tile servers. The Openspace service is usually accessed via they’re Javascript API but this is tied to an old version of OpenLayers and so this is just a quick workaround to use the latest Openlayers library with OS backdrop mapping. You still need to register for an API key so head on over to the OS website to get one.

 

My project is hosted at github – check it out.

Example usage:

<script type="text/javascript">

var map, layer;
var key = "YOUR_KEY";

var e = 437303;
var n = 115542;
var zoom = 5;

function init(){
    map = new OpenLayers.Map( 'map' );

    layer = new OpenLayers.Layer.OSOpenSpace("OS Openspace",key, {});

    map.addLayer(layer);

    map.setCenter(new OpenLayers.LonLat(e, n), zoom);
    map.addControl( new OpenLayers.Control.LayerSwitcher() );
}

</script>

 

 

Posted by & filed under Ruby, Web.

Update [29 July 2012]: Twitter disabled the @Mr_Correcter account :(

Not sure if anyone complained or automated analysis of the account’s posting history (many replies) flagged it up as annoying. Probably best for everyone all round.

 

I created the Twitter account as a development exercise and funny test… little did I know I would start getting abuse – He is only trying to help!

@Mr_Correcter is a friendly guy, he searches Twitter for spelling mistakes and replies to the tweets pointing out to the tweeters that they have misspelled a word, what’s not to like about him? OK. So he’s not real. Of course he’s not. @Mr_Correcter is a real Twitter account but he is just some Ruby code I came up with to test playing with the Twitter Ruby Gem – at certain periods it uses the API to find pre-defined spelling mistakes and posts automated status updates (reply_to) as the @Mr_Correcter account.

The interesting point from this exercise is not me writing the code, it has been the replies to @Mr_Correcter – or should it actually be the linux user that runs the code?! – from annoyed Twitter users. He has only been running a few days and look at some of the replies below! Note from these is that most are American; so Americans seem to have problems spelling (had better double check this website) and most replies are from Americans so they also seem intent of writing rubbish back!

 

Here are some replies to @Mr_Correcter:

 

Took me a while to work out what brah and dgaf mean!

 

You will slap the shit out of a bit of software? wow. hard.

 

At least he got you’re right. And wrong about the faggot, @Mr_correcter has no sexual preference, he just likes spelling mistakes.

 

Sorry, @Mr_correcter is not interested in what you have done today, only spelling.

 

Straight and to the point. I like it.

 

@Mr_correcter likes compliments.

 

 

Posted by & filed under Coffeescript, Javascript, Programming.

Here is a Javascript implementation of a message queue that displays the messages in the ui – it is written in Coffeescript and compiles down to Javascript. Source available on github here.

ui-message-queue is a Javascript implementation of a message queue allowing you to push messages (String) to the queue and display via a First In First Out (FIFO) method. This means that you can load up messages and they each have a defined display time after which will be overwritten with the next message or cleared.

 

Example usage [for more info checkout the demo on github]:

 

 

 

Posted by & filed under Web.

Over the past few years I have had some experience of choosing hosting providers to run various websites and just thought I would share my advice for things to pick up on. This guide is talking about the smaller end of the scale; shared hosting, virtual private servers but I guess could be applied upwards too.

The Good, The Bad and the Cheap

I have had endless problems with Cheap hosting providers, even if you just want to upload static pages I still don’t think it pays to go with the cheapest. Aside from the possibility of hidden costs somewhere I have found their systems are not reliable and if I care about the content I upload, I want it to have a reasonable uptime which is quite often nowhere close to acceptable from the cheaper options. I had countless problems with a shared hosting package from Dataflame; there would be constant problems with the server I was on – yes with this package you are at the mercy of others, if someone has some crap code or a poor SQL query then it can bring down the server – sometimes it would be down for a long time, rebooted during the day (UK time – it is a UK company). Had problems with the admin side of things, even when I didnt have a site hosted they still managed to remove some DNS entries for a website name I purchased through them.

Things to look for

These are not the only things to identify a good service from a bad one but should help you make a decision, at the end of the day it should come down to your own requirements and opinion.

 

  • Member of a regional Internet registry (RIR) and have their own Autonomous System (AS) – this to me indicates that they operate their own ‘presence’ on the internet, they can allocate their own IP addresses and take their networking seriously. Suggests they know what they are doing and are not just renting a server from someone else and then passing it on to you at an inflated cost.
  • Search their support forums and outage notifications – I like reading the outage notifications and if there are common themes or continuing problems or lots of ‘Sorry, human error’ then probably best avoided. The support forums give an idea of the issues customers face from using this provider.
  • New technologies? – I like it when a provider has a service using a new technology or is trying something new. For example a provider that I have used is Bytemark and they have developed their own virtual machine platform to provide IaaS, called BigV which I guess is a cloud hosting solution, but designed and built themselves. Things like this to me say they know what their customers want, they know what they’re doing and are happy to build something themselves.

 

Of course there are other options, you dont always need a shared or dedicated server from a provider like this; there are plenty of ‘cloud’ based IaaS and PaaS providers such as AWS or Heroku. Info about platforms like this needs another post or better explained somewhere else already.

Posted by & filed under Thailand 2012.

The last week or so has been fantastic, beautiful weather, pretty islands, relaxing beaches and great diving. It has been quite hectic to get around, everything involves boat journeys but has been worth it as I have been to the few islands planned.

So hectic that have needed about 6 days where I currently am; Koh Toa – a great island in the gulf of Thailand, although is remote is very pretty and has some great diving.

The previous few days were spent on the island of Koh Phi Phi Don – in a group of islands made famous mostly by the scenery but also because of fiilms; amongst others, The Beach, James Bond – The Man with the Golden Gun, Good Morning Vietnam were filmed on these islands.

Unfortunately things have to come to an end and set off back to Bangkok on Thursday for a flight early on Friday morning so will be back Friday night GMT – very distressing to leave!

See all soon!!

PS. have uploaded more photos. Not many the www is very slow!

 

Check out my route here and photos.