Adding a Tweet button to a self-hosted WordPress blog

Yesterday, Twitter launched their official button for websites and keen-eyed observers will have noticed that markwilson.it now sports a shiny new “tweet” icon at the head of each post.  It’s pretty easy to do (Twitter generates the code for you – and has an FAQ for developers) but there may be a couple of things to watch out for, depending on your blog’s content management system.

I use self-hosted WordPress, and these were the changes I made to the site:

  • For my single posts, I just added the Twitter-generated code to an appropriate position in the single.php file.
  • For my main index page, I edited index.php, but didn’t want the generated link to be to the current page (my home page with several recent posts) – I wanted it to relate to the particular post that the viewer is tweeting from.  Adapting a tip from David Teng, I added two parameters to the link code (data-url="" and data-text="").

Now, by clicking the Tweet button on this post, the link generated relates to the post – and not the home page for the blog.

Yikes! My computer can tell websites where I live (thanks to Google)

A few months ago there was a furor as angry Facebook users rallied against the social networking site’s approach to sharing our personal data.  Some people even closed their accounts but at least Facebook’s users choose the information that they post on the site.  OK, so I guess someone else may tag me in an image, but it’s basically up to me to decide whether I want something to be made available – and I can always use fake information if I choose to (I don’t – information like my date of birth, place of birth, and my Mother’s maiden name is all publicly available from government sources, so why bother to hide it?).

Over the last couple of weeks though, I’ve been hearing about Google being able to geolocate a device based on information that their Streetview cars collected.  Not the Wi-Fi traffic that was collected “by mistake” but information collected about Wi-Fi networks in a given neighbourhood used to create a geolocation database.  Now, I don’t really mind that Google has a picture of my house on Streetview… although we were having building work done at the time, so the presence of a builder’s skip on my drive does drag down the impression of my area a little!  What I was shocked to find was that Firefox users can access this database to find out quite a lot about the location of my network (indeed, any browser that supports the Geolocation API can) – in my case it’s only accurate to within about 30-50 metres, but that’s pretty close! I didn’t give consent for Google to collect this – in effect they have been “wardriving” the streets of Britain (and elsewhere).  And if you’re thinking “thats OK, my Wi-Fi is locked down” well, so is mine – I use WPA2 and only allow certain MAC addresses to connect but the very existence of the Wi-Fi access point provides some basic information to clients.

Whilst I’m not entirely happy that Google has collected this information, it’s been done now, and being able to geolocate myself could be handy – particularly as PCs generally don’t have GPS hardware and location-based services will become increasingly prevalent over the coming years.  In addition, Firefox asks for my consent before returning the information required for the database lookup (that’s a requirement of the W3C’s Geolocation API)  and it’s possible to turn geolocation off in Firefox (presumably it’s as simple in other browsers too).

What’s a little worrying is that a malicious website can grab the MAC address of a user’s router, after which it’s just a simple API call to find out where the user is (as demonstrated at the recent Black Hat conference).  The privacy and security implications of this are quite alarming!

One thing’s for sure: Internet privacy is an oxymoron.

IT Tweet Up number 5 (#ITTU5)

Next week sees the latest in the series of “tweet-ups” that have been running every few months for UK-based IT professionals to meet up over a drink and a bite to eat.

This time, the venue has changed – someone didn’t like the toasties in Ye Olde Mitre so we’ve moved to the Melton Mowbray pub in London (make sure you get that the right way around – this is nothing to do with pork pies in Leicestershire) but you can register your interest and get directions on the ‘net. Hopefully I’ll see you there.

Publishing: yet another industry clinging on to an outdated business model

One would hope that, after the much publicised issues that the music industry experienced whilst grappling with digital music distribution, other digital content producers would avoid making the same mistakes. Apparently that’s not so – at least not if the publishing industry is anything to go by.

I love books. Real books. Dead tree editions full of glorious photographs. I’ll even pay good money for them. But, for magazines and run-of-the-mill text content, I’m increasingly looking towards digital media.

Take, for example, a well-known personal computing magazine – PC Pro. Last week I was convinced that subscribing to the magazine would be a good idea but I don’t want a paper copy to carry around with me – I have a tablet computer for that – an iPad that, somewhat ironically, one of the magazine’s Contributing Editors, Jon Honeyball, convinced me to part with several hundred pounds to buy. Now the fact that it was Jon who “sold” the iPad to me is not really relevant – there are many reasons that was a good purchase and that’s the subject of another blog post – but I would hope that a computer magazine would be at the vanguard of digital publication. Unfortunately not – the answer I got from the magazine’s publishers was that if I wanted a digital copy, I could download an application from Zinio and read it that way.

Er… No thanks. I’ll just hold off on that and PC Pro will pick up one less new subscriber this month.

My problems with this approach to magazine distribution are threefold:

  • Apple provides me with iBooks – a perfectly good eBook reader with support for PDF documents and features such as brightness control.
  • If I buy a magazine from a shop, I can read it and then recycle it, store it (forever if I choose to), or give it to a friend to read (if they don’t mind getting their news/reviews a few weeks late) but the Zinio approach imposes digital rights management on me (or at least some form of copy control).
  • I don’t want another application just to read magazines – not unless its truly innovative and enhances my experience (as the Wired iPad application does by integrating content that’s not available in paper form, such as video).

Then there is newspaper publishing. I don’t buy a newspaper every day but I will read one of the free newspapers on the way to/from work, catch up on the latest news via the ‘net, and either my wife or I buy a newspaper most weekends. Even though my preferred newspaper is The Sunday Times, Murdoch’s paywall means I will not consume their online content because there is plenty of quality content available elsewhere (e.g. The Guardian website and podcasts such as Tech Weekly, or BBC News – either via the web or in their excellent iPad application). I did consider the Financial Times iPad application – and I even tried it whist it was free last month, but it didn’t give me enough to justify a regular subscription. I’m sorry to say that paid newspapers are a dying medium – which is a shame – as the standard of journalism available for free is not up to the same standards but there is just not enough there to convince me that parting with money to subscribe to a newspaper (physical or online) is a worthwhile investment.

Books on sale in WH SmithFinally, there are books. I’m not talking about coffee-table books here, but about normal books – the sort of thing you might see in WH Smith or Waterstones. I’m completely at a loss as to why the same book costs the same price, regardless of whether I buy a paperback copy or an e-book. Indeed, given that most of the books I buy tend to be on a “buy one, get one half price” or similar offer the digital versions actually cost more – ludicrous given that there are no printing costs, almost no distribution costs, and that the content creator (i.e. the author) gets paid less.

[Update: 6 August 2010 @13:06: My assertion that e-books cost around the same as paperbacks was based on Apple’s prices – I’ve since found that Kindle eBooks are available at a substantial discount, just as paper books from Amazon are]

I did actually buy an e-book last weekend: after my half-read copy of Alexander McCall Smith’s 44 Scotland Street got soaked during a rainstorm on a camping trip, I downloaded the iBooks version and was soon reading again; but I can’t give it away when I’ve finished. Indeed, because e-books cannot be passed on to a friend or given to the charity shop, they have the potential to decimate the second-hand book trade, which should result in even more first-time sales – in itself a reason why the prices should be lower as book sales increase.

So it seems that publishers – be they magazine, newspaper, or book publishers – are clinging on to a business model that is in decline. I’m sure that we’ll have books on our shelves for many years to come, and printed magazines will survive a while longer (although their days are numbered) but newspapers are already suffering,  photojournalism has pretty much been killed off (the last NCTJ accredited photojournalism course has only just given a reprieve)., and real journalism (I mean journalism, not bloggers regurgitating press releases) is becoming increasingly endangered.

If only the publishers could learn from the music industry’s mistakes we might see something new, something innovative, something that makes people want to consume their content but, based on what I’ve seen recently, theres little evidence to suggest that they have learned anything.

Another of my “How Do I?” videos available on the Microsoft TechNet website

Over the last couple of years, I’ve produced a few of the TechNet How Do I? videos for Microsoft and have linked to most (if not all) of them from this blog as they’ve gone live.

A few days ago, I was reviewing my community activities for the year and noticed one that had slipped through the net: running Hyper-V Server from a USB drive.

Unfortunately it doesn’t look as though I’ll be doing any more of these as the company I did the work through has lost the contract (and Microsoft produces a lot of this sort of content in house, reducing the scope for outsiders like me).  It was a nice gig, while it lasted – if a little time-consuming… hopefully the videos are useful to people!

So, where exactly is Silverstone?

As I carried out the school run this morning (on foot), I noticed that there seemed to be a lot of extra traffic in town today.  Then I realised it was due to the British Grand Prix, which is taking place in Silverstone this weekend.  The A43 is closed for non-event traffic, which puts pressure on the M1, which in turn pushes traffic onto other roads in the area, including the main road through our town.

It’s not really a problem – The A43 is only closed for 3 days a year and the knock-on effect of having the home of British Motor Racing on our doorstep is increased engineering jobs in the local area (it’s a shame that Aston Martin moved out of Newport Pagnell in favour of their new HQ at Gaydon) – indeed I’m pretty pleased that Donington Park couldn’t get it’s act together so the British Grand Prix has stayed at Silverstone!

What was interesting though was a local BBC news story last night… BBC East was covering a (non-) story about whether Silverstone is in Northamptonshire, or in Buckinghamshire.  It’s simple – Silverstone village is in Northamptonshire, but the circuit spans the county boundary.  Why that’s the cause of such controversy is, frankly, a mystery but, then again, I know what a big deal crossing the county boundary is to some locals (for reference, I was born in Northamptonshire and now live within the Milton Keynes unitary authority, in what was once Buckinghamshire… and it will take 3 generations to be accepted as a true local in the town where I now live!).

What amused me was one of the people that the BBC interviewed for its package on last night’s news – when asked which county Silverstone is in, one guy responded that it’s in Buckinghamshire because, when he googled for the weather, Buckingham was the nearest town!  I found it quite amusing that people today are happy to judge geographic boundaries by Google search results, rather than by a map…

So, if you’re at the British Grand Prix this weekend (I’d love to be there but will be watching on a television instead) it seems that the Grand Prix circuit from Becketts Corner to somewhere near Village Corner is in Buckinghamshire, otherwise you’re in Northamptonshire (Rose of the Shires).

Ordnance Survey Map showing Silverstone circuit spanning the county boundary between Northamptonshire and Buckinghamshire

Image produced from the Ordnance Survey Get-a-map service. Image reproduced with kind permission of Ordnance Survey and Ordnance Survey of Northern Ireland.

Useful Links: June 2010

A list of items I’ve come across recently that I found potentially useful, interesting, or just plain funny:

Installing Ubuntu (10.4) on Windows Virtual PC

I use a Windows 7 notebook at work but, sometimes, it’s just easier to drop back into a Unix or Linux machine – for example when I was checking out command line Twitter clients a few days ago (yes, there is a Windows one, but Twidge is more functional).  After all, as one of my friends at Microsoft reminds me, it is just an operating system after all…

Anyway, I wanted to install Ubuntu 10.4 in a virtual machine and, as I have Windows Virtual PC installed on my notebook, I didn’t want to use another virtual machine manager (most of the advice on the subject seems to suggest using Virtual Box or VMware Workstation, which is a workaround – not a solution).  My first attempts were unsuccessful but then I stumbled upon a forum thread that helped me considerably – thanks to MrDerekBush and pessimism on the Ubuntu forums – this is what I found I needed to do:

  1. Create a virtual machine in Windows Virtual PC as normal – it’s fine to use a dynamic disk – and boot from an Ubuntu disk image (i.e. an ISO, or physical media).
  2. At the language selection screen, hit Escape, then F6 and bring up the boot options string.  Delete the part that says quiet splash -- and replace it with vga=788 noreplace-paravirt (other vga boot codes may work too).
  3. Select the option to try Ubuntu without installing then, once the desktop environment is fully loaded, select the option to install Ubuntu and follow the prompts.
  4. At the end of the installation, do not restart the virtual machine – there are some changes required to the boot loader (and Ubuntu 10.4 uses GRUB2, so some of the advice on the ‘net does not apply).
  5. From Places, double click the icon that represents the virtual hard disk (probably something like 135GB file system if you have a default sized virtual hard disk). Then, open a Terminal session and type mount, to get the volume identifier.
  6. Enter the following commands:
    sudo mount -o bind /dev /media/volumeidentifier/dev
    sudo chroot /media/volumeidentifier/ /bin/bash
    mount -t proc none /proc
    nano /etc/default/grub
  7. Replace quiet splash with vga=788 and comment out the grub_hidden_timeout line (using #) in /etc/default/grub, then save the file and exit nano.
  8. Enter the following command:
    nano /etc/grub.d/10_linux
  9. In the linux_entry section, change args="$4" to args="$4 noreplace-paravirt", then save the file and exit nano.
  10. Enter the update-grub command and ignore any error messages about not being able to find the list of partitions.
  11. Shut down the virtual machine.  At this point I was left with a message about Casper resyncing snapshots and, ever after leaving the VM for a considerable period it did not progress further.  I hibernated the VM and when I resumed it, it rebooted and Ubuntu loaded as normal.

There are still a few things I need to sort out: there are no Virtual Machine Additions for Linux on Virtual PC (only for Hyper-V), which means no mouse/keyboard integration; and the Ctrl-Alt-left arrow release key combination clashes with the defaults for Intel graphics card drivers (there are some useful Virtual PC keyboard shortcuts).  Even so, getting the OS up and running is a start!

How to be an Internet private eye

This post makes me slightly uneasy… most of the information is taken from a presentation I saw recently – so I would like to give credit to the original presenter, except that he specifically asked me not to.  The reason for this is that he’s not a lawyer, and he was worried that perhaps some of this advice may not be legal in certain jurisdictions.  I’m not a lawyer either, so I’ll make a statement up front: I think the activities suggested in this post are legal in the UK (where I live), but I’m not qualified to give advice on this.  Before carrying out any of the actions in this post, it may be advisable to check the legal situation in the country where you live (and/or where the websites you are checking out are hosted).  I can not be held responsible for any actions taken by others based on the advice I have published here and my sole purpose in publishing this information is to share what may be useful to others when trying to protect their personal or professional identity online… in short, I am aiming to do the right thing here…

Your identity (whether it’s personal, or a corporate brand) is precious.  Sometimes, unscrupulous individuals, or those who may have a grudge against you, may impersonate you or your brand online.  When that happens, it can be useful to know a little more about who is using your identity as you attempt to reclaim it. Hopefully some of these suggestions will be useful in tracking down who is using your identity, whether it’s to send unsolicited e-mails, to (mis-) use your brand or trademark online, or just to get some idea of your own online footprint.

It can be quite interesting to understand your Internet footprint – and automated tools such as RapLeaf can be used to see the social profile for given e-mail address(es) on a number of popular sites across the web.  Companies can find out about their customers, but individuals can check their details too – I was surprised to find when I logged in that it had already identified me on Flickr and WordPress previously (suggesting that one of RapLeaf’s customer had already run a search on me)… it’s far from complete but may provide a few more clues about who someone is (or highlight to you the information that you publish online). Even more of an eye-opener was Gist which, once supplied with my public Facebook and Twitter accounts, found a huge amount of information about me from a variety of online sources and most of it was accurate (it had linked me to my employer’s sister company – probably because that was the information it gained on me from one of my contacts).

The next tool that may be useful Open Site Explorer.  This link popularity checker and backlink analysis tool can be used to understand where links to a given URL originate from, including the URL’s page authority, domain authority, linking domains and total links. So, if you find an anonymous blog, it will show where links to that blog – which may provide a clue as to whose site it is (i.e. an anonymous blogger may also have other online personas).

If you want to find something on the ‘net, Google is your friend: by searching for snippets of text, comments, etc. it’s possible to identify the original source of an item.  And Google’s cache is a goldmine – even after a website has been taken offline, its contents may well still exist in the Google cache!

Sites like Knowem can be used to see who is using a particular name (or trademark) on a variety of sites across the Web – that can be useful if you want to protect your brand.

IP tools can provide all sorts of information for would-be Internet sleuths. Many are just standard Unix tools, exposed via a website and not everything can be relied on (for example my IP address belongs to my ISP, who are several hundred miles away, but they know who I am if I’ve been up to no good). Domain tools information can provide a detailed site profile as well as whois information including reverse IP lookups to understand who else shares my server (noting that they may or may not be affiliated in some way).  You can also find out which sites share a given IP address using a decision engine such as Bing.  Try searching for ip:ipaddress to see all of the sites at a given address.

E-mail headers can be useful to find out where an e-mail originated (or which servers it passed through).  In Microsoft Outlook, view the message headers or, in Google Mail, select Show Original.  The resulting information (IP addresses, etc.) can be fed into some of the IP tools (e.g. traceroute or whois) to find out more about the message – e.g. to track down a spammer (and block them!).

Of course, if you wanted to find out who someone was, you could send them an e-mail and try and trap them using the same techniques that the phishers use… that wouldn’t be a good idea – it’s almost certainly illegal, and I’m not condoning it – indeed, the only reason I mention it here is to say “don’t do it”.

One more clue as to who is watching you online (unfortunately not free, but potentially useful when tracking down an impersonator) is a dashboard called Trovus, which can be used to build a profile of who accesses your website and from where.

If you discover that your identity is being used inappropriately, the first thing to do is to contact the relevant service providers (perhaps a hosting company for a website or mail server, or maybe a public website) and, even though you may not see a response, they may be taking action that’s not visible to you (e.g. offline, via another medium, or using lawyers) – hopefully you’ll at least get a response to say “thanks, we’ll be in touch”.  Whilst the actions in this post may not provide all the answers on who is impersonating you, they are at least the first steps to allow you to contact the appropriate organisations for further assistance.