alt.adrianshort

Less is always an advantage

| Comments

Let’s think about backups for a moment. I don’t have a fiendishly clever or minimal backup scheme to share with you, but let’s imagine.

If you’ve got less than 2GB of data then life is very easy. You can backup the whole lot with a free Dropbox account. You can also carry all your data around on a tiny, cheap flash drive or SD card. If you want to make extra offsite backups you can get a small stock of flash drives and hand them out to friends, spread them around your world, drop them down the side of the sofa. Even though USB 2.0 is relatively slow your whole digital life can be copied in just a few minutes.

If you’ve got more than 2GB of data and less than 8GB you can forget about getting it all in a free Dropbox account but you can still pick up a bunch of fairly cheap flash drives and spread them around. Copying time is still quite reasonable. Start paying for Dropbox if you can afford it.

Once you’re over 128GB you can forget about flash drives. Now you’re looking at portable hard drives, which go up to 1TB, for a price. Multiply that by the number you’ll need. Probably at least three: one onsite, one offsite and one for rotation. At current UK prices these drives are about £80 - £100 each. It adds up.

Dropbox tops out at 100GB whether you’ve got the money to pay for more or not.

When your backup set gets over 1TB you can’t use portable drives. Though full-sized drives cost less per GB they’re a lot more bulky and need a power supply and socket. Life just got that bit harder.

But this isn’t about backups. It’s about thresholds.

What can you fit your stuff into? Your pockets? A small bag? A suitcase? A room? An apartment? A house? A big house… and a storage unit…?

Rather than trying to accommodate what we’ve got, we should work the other way. Find the threshold that makes sense for you, that you’ve got the time to maintain, that you can afford and that creates an acceptable amount of work and complication for you.

Then work down towards that level. Less is always an advantage.

And the backups? I think I need to shrink that 1TB of data I’ve got down to less than 100GB.

Boris hijacks official @MayorOfLondon Twitter account – and he knows it

| Comments

Boris Johnson is sailing very close to the wind by renaming the official Mayor of London’s Twitter account – @MayorOfLondon – to @borisjohnson and using it to campaign for re-election.

The GLA’s Code of Conduct prohibits the mayor from using public resources for political purposes. But some are saying that the account has always been Boris’s personal account and he can use it as he pleases.

But that’s not the case and Boris knows it. In October 2009 he was “given guidance” by the GLA’s Monitoring Officer after a member of the public complained about a tweet he’d sent celebrating The Sun deciding to back the Tories for the forthcoming general election. He tweeted:

The sun has got his hat on, hip hip hip hip hooray

and linked to The Sun’s home page.

In deciding the complaint, the GLA found:

… it was not clear from the Mayor of London’s twitter page whether the tweet was written by the Mayor of London, or by someone on his behalf. However, it was clear that it was written by or on behalf of the Mayor of London, as the hyperlink to the twitter account was found on the Mayor of London page on the GLA website.

… in respect of all acts complained about, Mr Johnson, the Mayor of London, was clearly acting in his official capacity, and was therefore required to comply with the GLA’s Code of Conduct.

See the full report of the complaint and the GLA committee’s decision.

It follows that if the Mayor was not permitted to send a party political tweet from @MayorOfLondon in 2009 he’s certainly not permitted to rename the whole account and take its 253,000 followers with him when he’s campaigning for re-election.

Poor show, Boris. Give London it’s mayor’s Twitter account back and get one of your own.


For those that fancy a bit more digging, I’ve captured the whole of the Twitter account into this Google spreadsheet.

Quick and dirty Twitter data analysis with the Unix command line

| Comments

There are many tools you can use for data analysis. You can dump your data into a database, but that often requires a fair bit of setup for defining schemas, etc.

If you want to do something more ad hoc you could use a spreadsheet if your data is small enough. This isn’t a bad option in many cases.

But the command line is another option that will let you do basic analysis in a fast, fluid and ad hoc way. It’s happy with handling fairly large files too.

The data

newsrw_final_sorted.tsv.zip (188 KB) is an archive of tweets from journalism.co.uk’s News Rewired conference on 3 February 2012 that used the #newsrw hashtag. Download and unzip the file and move it to a working directory somewhere.

The tools

head and tail show us the top and bottom few lines in a file.

wc by default counts the number of lines, words and characters in a file. For our purposes we’ll generally use the -l option just to count the lines.

sort will sort a file alphanumerically, or with the -n option, numerically.

uniq will output a file showing only the unique lines provided that the file is sorted first. The -c option shows a count of the number of identical lines.

cut takes a vertical slice from a file. Using the -f option you can cut one or more fields (columns) which are separated by tabs by default. The -c option lets you specify a cut from one character position to another, e.g. cut -c 1-10 will return the first 10 characters of every line (cut’s numbering starts from 1, not 0.)

The analysis

Before we start, let’s save some typing (or tab-completing) by setting a variable for the name of the file we’re working with:

$ export f=newsrw_final_sorted.tsv
$ echo $f
newsrw_final_sorted.tsv

So now we can use $f in place of the filename everywhere.

Now eyeball the file to see the kind of data we’ve got:

$ head $f

will show that the file is tab-separated with the following fields:

  1. timestamp
  2. tweet ID
  3. Sender’s username
  4. Message (Twitter calls this the “status”)
  5. Client
  6. User replied to (if any)

How many tweets?

Easy. There’s one tweet per line so just count the number of lines in the file:

$ wc -l $f

3683 newsrw_final.tsv

What date/time range do the tweets cover?

The file is sorted in timestamp order with the earliest tweet on the first line of the file and the latest tweet on the last line.

The timestamp is in the first field.

So use head -1 to grab the first line of the file and cut -f1 to grab the first field from the output. Remember to specify the filename as the input to head.

$ head -1 $f | cut -f1

2012-01-27 10:06:25 +0000

and do the same at the end of the file:

$ tail -1 $f | cut -f1

2012-02-06 22:31:11 +0000

How many tweets were sent on each day?

Our file covers the range from 27 January to 6 February. If we summarise the number of tweets per day we can very easily see the day of the conference.

First we need to extract the dates from the file. The dates are stored in a fixed-width format and always occupy the first 10 characters of each line. So:

$ cut -c1-10 $f

will output just the dates:

2012-01-27
2012-01-27
2012-01-27
2012-01-27
2012-01-27
...
2012-02-03
2012-02-03
2012-02-03
2012-02-03
2012-02-03

Not that useful in itself but we can use uniq -c to count all those repetitive lines. uniq requires all input to be sorted (it suppresses adjacent lines) so even though our file is already sorted we’ll sort it again just to show that this isn’t something you can always assume.

$ cut -c1-10 $f | sort | uniq -c

   7 2012-01-27
  10 2012-01-30
  13 2012-01-31
  19 2012-02-01
  97 2012-02-02
3345 2012-02-03
  48 2012-02-04
  45 2012-02-05
  99 2012-02-06

Who were the most prolific tweeters?

The tweeter’s usernames are in field 3. So start by extracting that on its own using cut -f3.

$ cut -f3 $f

SourceAdam
newsrewired
GabrielleNYC
newsrewired
GabrielleNYC
AndrewGrill
Kred
marksimpkins
currybet
elanazak
...

Then if we sort the output we’ll get a long list of all the tweeters with each user’s repetition grouped together. Used without options, sort sorts in alphanumeric order.

$ cut -f3 $f | sort

04SophieLouise
04SophieLouise
04SophieLouise
04SophieLouise
04SophieLouise
04SophieLouise
10Yetis
10Yetis
10Yetis
10Yetis
...

Now that’s sorted we can use uniq -c to suppress and count the repetitions.

$ $ cut -f3 $f | sort | uniq -c

 6 04SophieLouise
 7 10Yetis
 2 123makingmoney
 1 21WFMJ
 1 3mil
 1 ALStranne
 2 AboutTheBBC
 1 AbsintheSpirit
 1 AdamReed
 2 AdamWestbrook
 ...

This output now needs to be sorted in numeric order. We also want a list with the highest numbers at the top, so that means sorting in reverse order. The command we need is sort -rn – sort in reverse order, numerically.

$ cut -f3 $f | sort | uniq -c | sort -rn

 175 SarahMarshall3
 156 newsrewired
 154 journalismnews
 104 GarrettGoodman
  95 aaroscape
  82 mikemullane
  79 journochat
  77 BBCCollege
  69 Jackdearlove
  65 GabrielleNYC
  ...

Pipe this output to head or tail to return only the top or bottom ten rows from the output if required.

  $ cut -f3 $f | sort | uniq -c | sort -rn | head

Which Twitter clients were people using?

You can tell a lot about a group of tweeters by looking at the clients they use to send tweets.

The client data is in field 5. We can use exactly the same method as we did for the prolific tweeters: extract the field, sort the output to group runs of the same client together, count the repetitions with uniq -c and sort the results numerically in reverse order.

$ cut -f5 $f | sort | uniq -c | sort -rn

1284 <a href="http://www.tweetdeck.com" rel="nofollow">TweetDeck</a>
 427 <a href="http://twitter.com/#!/download/ipad" rel="nofollow">Twitter for iPad</a>
 381 <a href="http://twitter.com/">web</a>
 314 <a href="http://twitter.com/#!/download/iphone" rel="nofollow">Twitter for iPhone</a>
 238 <a href="http://www.echofon.com/" rel="nofollow">Echofon</a>
...

This is giving us the right result but unfortunately it’s quite messy with all those HTML entities.

Tweets per hour during the conference

As luck would have it ;) the timestamp is at the start of every line, so we can extract all the tweets for a specific day just by grepping the file using the ^ anchor to say we want to find the pattern at the start of the line:

$ grep ^2012-02-03 $f

From here we use similar techniques as we did finding the number of tweets per day.

The hour part of the fixed-width timestamp field is stored in columns 12 and 13. We can extract that in the usual way using cut -c to grab that range of characters:

$ grep ^2012-02-03 $f | cut -c12-13

05
06
06
06
06
06
06
06
06
06
...

Now just sort that output and count the adjacent repetitions with uniq -c:

$ grep ^2012-02-03 $f | cut -c12-13 | sort | uniq -c

   1 05
  11 06
  20 07
  54 08
 103 09
 381 10
 515 11
 543 12
 294 13
 284 14
 439 15
 352 16
 209 17
  38 18
  27 19
  38 20
   9 21
  17 22
  10 23

and there’s your visualisation with the hours in the second column and the number of tweets in that hour in the first.

Luke MacKenzie, the councillor who kicked the hornets’ nest

| Comments

Conservative councillor Luke MacKenzie claimed his 15 minutes of fame yesterday after a provocative tweet brought a Twitter mob to his virtual doorstep. Reacting to UK Uncut’s protest against disability benefits cuts at Oxford Circus, he tweeted:

Luke MacKenzie’s use of the #UKUNCUT hashtag had the presumably desired effect of ensuring that his comment would be seen by many people following and participating in the protest. This provoked a flood of retweets and responses that saw “CllrMackenzie” trend in London.

I have the very slightest sympathy with Luke MacKenzie because I feel that many people’s concerns that he was insulting disabled people because of their disabilities is a little misplaced. Reading through his recent tweets, he’s used the term “unwashed” three times when referring to Occupy protesters in London and Davos:

I see the "Great Unwashed" are on @SkyNews #occupylsx complaining that they can't continue with unwashed gathering [Twitter status 159674487024001024]

The most generous interpretation of Luke MacKenzie’s comment yesterday about the UK Uncut protest is that “unwashed” is his favoured term of abuse and dismissal for protesters generally rather than disabled protesters specifically, but this is ultimately a pedantic distinction. Whether he was abusing disabled people for being disabled or simply abusing protesters – many of whom are disabled – for objecting to being made worse off, the general sentiment is the same: kicking people when they’re down. This would be nasty enough behaviour from anyone but it’s particularly arrogant coming from an elected representative of the party leading the government that’s making the cuts. Disabled people getting even poorer? Diddums. Suck it up, losers.

Yesterday’s “unwashed” tweet was of a piece with Luke MacKenzie’s general approach to online engagement. At the time of posting, his Twitter profile photo was this Bullingdon-esque image of the man himself posing in black tie with what appears to be his employer Stephen Metcalfe MP and others:

His profile description read:

25. Basildon Councillor, Assistant Member to the Leader. Work for an MP. Small State Conservative. Economic Liberal. Views expressed in tweets are my own.

The subtext is clear. To whatever extent it’s true, Luke MacKenzie presents himself as writing from a position of privilege and influence, if not necessarily power. When one Twitter user commented previously that his profile picture resembled that infamous Bullingdon Club shot of David Cameron and Boris Johnson, he was delighted:

After the reaction to his “unwashed” tweet got too hot, Luke MacKenzie dropped the “Bullingdon” photo in favour of a more neutral full-face shot and changed his profile to remove any trace of his public office and political affiliation. Now it reads:

Economic Liberal. Views expressed in my tweets are my own.

It’s unclear whether this is because he wanted to protect his colleagues by distancing himself from them or whether they’d requested it themselves. Perhaps he’s just been sacked.

Basildon Conservatives should withdraw the whip from Luke MacKenzie if they haven’t done so already. Not for yesterday’s tweet alone but for his persistent juvenile and provocative behaviour online. If Basildon Conservatives and Stephen Metcalfe think that Luke MacKenzie is a good ambassador for their party let alone fit to hold public office then they are sorely out of touch with the mood of people generally – or should we say ”the great unwashed”? Someone whose response to protesters against government policy is “if you don’t like it, move to North Korea” should struggle to find a position in sixth form politics let alone in institutions that have real power over people’s livelihoods and lives. Political discussions should be robust and forthright – we’re never always going to agree – but Luke MacKenzie’s stock in trade is abuse and condescension not argument and debate. He is the councillor who kicked the hornets’ nest and didn’t like the sting. If Basildon Conservatives don’t do the decent thing and bring Luke MacKenzie’s political career to an overdue end then let’s hope that local voters will do the job for them when he comes up for re-election.

This story elsewhere:

Social media tips

“Personal views only” disclaimers have limited use

As Standards for England’s guidance explains, there is no automatic distinction between blogging and tweeting as a councillor and doing so as an individual. Of course, if you post the view that you prefer coffee over tea, no fair-minded person would interpret that as a party policy statement. But once you start engaging in political issues with people it makes no difference whether you’re using an official blog or a personal one, or whether you think you’re tweeting as a councillor or as an individual. If you misbehave online then that will reflect badly on your affiliations and certainly has the potential to undermine any public office that you hold. In Luke MacKenzie’s case, his profile clearly stated his position as a Conservative councillor in Basildon so he hasn’t got a leg to stand on there either way.

By the time you’re trending it’s too late to clean up your profile

The internet as a long memory at the best of times but once you come to public attention people will start screenshotting and Googling you like crazy. Think about your online presence as a whole: Is it accurate and up to date? Does it present you and your colleagues in a good light? Would you change or remove anything if you suddenly hit the headlines? If so, now’s the time to do it.

Sorry shouldn’t be the hardest word

Sometimes the person who’s wrong on the internet is you. We all make mistakes, even when we sometimes say things that are open to negative misinterpretation. Stay in the conversation. Engage with critics intelligently. Clarify. Apologise sincerely where necessary. Don’t compound any offence given by taunting your critics or simply disappearing. If you don’t know how to dig yourself out of a hole rather than digging yourself further into one then perhaps it’s best to stay away from politics and social media generally.

Treat everyone with respect, including those you oppose

For some people this is the hardest thing of all. Contrary to Basildon Council deputy leader Steven Horgan’s views, treating people with respect isn’t being “nice” to them, it’s just not abusing them. As a councillor you should be intelligent and mature enough to make your case robustly without resorting to name-calling and putdowns. Unlike everyone else online, you’re elected to represent everyone in your ward and borough, not just those that agree with you. Posing as a poor-man’s Paul Staines might be amusing to your and your friends but it’s undignified and arrogant for someone holding public office. Smart politicians know how to cause maximum damage to their opponents. That’s not the same as causing them maximum offence. Language and sentiments that wouldn’t be acceptable in the council chamber are best avoided online too.

The internet is not a rehearsal

| Comments

Two things have come onto my radar recently which, while different in context and origin, reveal a common underlying mindset.

Shortly before Christmas, Sutton Council published a set of 43 photos on Flickr and linked to them from the top of its homepage. The photos show historical Christmas scenes from Sutton around 100 years ago that have been acquired and scanned by the borough archives. Each photo is defaced with two or three watermarks of the council’s logo.

Merton Council recently published a 98-page planning consultation document. It’s available as a PDF file (13 MB PDF). The document doesn’t contain an active table of contents so it’s hard to navigate to the section you want. Worse, all the maps within the document are rotated 90 degrees and are effectively impossible to read from a screen unless you happen to be lying down.

The common factor? You wouldn’t get away with this anywhere else but online.

Try producing a leaflet or a book with watermarked photos and see how long your local government career lasts. How about a map rotated by 90 degrees pinned to a noticeboard? What would that say about your council and your consideration for people who might want to read it?

Yet we tolerate this kind of thing online because… what? Internet people don’t mind looking at defaced photos? Internet people don’t mind lying down to read a planning document? Internet people are a different species with lower standards and quieter voices?

Hardly.

The internet is not a rehearsal and government needs to stop treating it as one. There may be times when the urgency to put something online might trump fine attention to production values but those occasions are rare. It’s hard to see how that’s the case in either of these two examples. With Sutton’s photos, adding the logo watermarks took extra time and effort that would have been better spent removing defects from the scans rather than introducing new ones. Merton’s planning document is presumably the result of many months’ work. An extra hour adding bookmarks for each section and rotating the maps correctly is the difference between a document that’s readable (and therefore, read) and one that’s not. Don’t know how to do that? Don’t have the right software? Sort it out. You’ll be doing plenty more of them.

The internet is the pre-eminent communications medium of our time. Getting it right might require new skills but it also requires adhering to old values. Websites, online photo galleries and PDFs have been with us for many years now and they aren’t going to go away. It’s worth investing in the skills and tools to make the most of them.

Publishing online might be relatively cheap but producing the content isn’t. Your visitors’ time is incredibly valuable. Think of all the other things they could be doing rather than visiting your website or reading your document. If you’d take the trouble to get a magazine or a leaflet or a poster right, take the same amount of trouble to get your web content right. After all, it’s the same people who are going to be reading it.

How to deal with Jeremy Clarkson

| Comments

Jeremy Clarkson is in hot water over his ill-judged comments about public sector strikers on BBC’s The One Show. His suggestion that strikers “should be taken out and shot in front of their families” caused consternation on parts of the internet and earned a mild rebuke from Mr Cameron. The public sector union Unison has called for Mr Clarkson to be sacked and is taking legal advice on other measures.

Now imagine if the interview had gone like this:

PRESENTER: So what do you think about the strikes?

CLARKSON: Public sector workers have every reason to be concerned about their pension rights. With many public servants’ jobs under threat and the spending power of their salaries being eaten away by inflation, the very least we can do is to ensure that our nurses, paramedics and bin men can afford a stable and secure retirement.

No doubt this would have delighted Unison, caused consternation on different parts of the internet and earned a mild rebuke from Mr Cameron.

But in the row over his comments and Unison’s response, no-one seems to be asking the most pertinent question: why do we care about Jeremy Clarkson’s political views at all?

Jeremy Clarkson is a motoring journalist and a light entertainer. He has an audience who appreciate his efforts to inform them about motoring and to make them laugh. So when did he become a credible commentator on politics, economics and current affairs? He’s got an opinion but then so do many people. Moreover, his position as an extremely highly paid entertainer means that Mr Clarkson moves in very different circles from most of the rest of us and likely has very different concerns.

Mr Clarkson’s comments earlier in the interview are telling:

PRESENTERS: Do you know anyone who’s out on strike today?

CLARKSON (dismissively): Of course I don’t. What, someone in public service? No I don’t.

Take aside the snobbish tone in which the remarks were delivered and you get to the heart of the matter. 20% of the UK workforce is in the public sector. If Mr Clarkson genuinely doesn’t know (or at least, count as a friend) anyone in public service his detachment from the reality of working life in the UK makes his views on public sector pay considerably less interesting than anyone on an average income, however they earn it.

Jeremy Clarkson shouldn’t be sacked. He shouldn’t be prosecuted. No-one should take legal action against him, no matter how offensive or unfunny his views are. A far better approach would be this: get him to stick to motoring. He can probably recommend a good value family hatchback, but don’t ask him about public sector strikes or the economy – he knows nothing about them. Don’t ask him about tax – he earns more in a year than just about everyone else earns in a lifetime. It’s probably best not to ask him about the radical theatre of the Weimar republic or the research opportunities afforded by the Large Hadron Collider. Just motoring.

If we applied the same principle to everyone that can sing, dance, act, cook a meal, play sport or has the dubious fortune of being related to the head of state we might just have a better informed and more civilised political culture in this country.

Twitter direct message etiquette

| Comments

Currently I follow around 1500 people on Twitter. My direct message (DM) inbox is only useful because 99.9% of those people and organisations don’t abuse Twitter direct messages.

This is for the 0.1%.

Despite having a relatively large number of friends and followers on Twitter, I rarely have more than one or two DM conversations per day. Looking back through my DM inbox there’s a very clear pattern:

  • The person I’m having the conversation with is almost always someone I know very well. Many of them are people I know in real life. Otherwise, they’re someone I’ve probably been engaging with online for at least a year. There’s no absolute rule but that’s the pattern.

  • The conversation is about something private that can’t be conducted publicly using @ replies. Sometimes it’s one of us asking a favour of the other where it might be embarrassing to decline (or accept!) publicly. Sometimes the conversation contains privileged information. Sometimes it’s just a topic of no general interest that we don’t want to bore our followers with.

Every welcome conversation in my DM box is with a personal Twitter account rather than an organisational account.

As such, DM conversations get a high priority. There are so few of them it’s easy to keep track of them. DMs trigger a notification on my phone. If you DM me I will generally see it within five minutes unless I’m asleep. When or whether you get a response depends on the content of the message and what I’m doing otherwise.

So DM priority is really like a phone call. If you’re someone I know and you’ve got something that I really need to hear about right now your DM will be very welcome. If you’re someone or particularly a business that I don’t know and you just want to tell me about your product or service I will hate you forever. This kind of inbound communication isn’t sustainable for me. It’s spam.

These kinds of DMs are never welcome and will lead to an unfollow, either with or without a curt response:

  • “Thanks for following! Sign up for XYZ on our website at www.spamheaven.com.” It’s implicit that you’re happy that I follow you. No need to waste my time mentioning it. If I’m following you I know what you do and how to find your website. I’m good at internets like that.

  • Follower verification services like TrueTwit. If you think that your organisational Twitter feed is so important to me that I’m going to waste five minutes of my time jumping through a CAPTCHA verification process you’re massively deluded and probably need to stay away from social networks and any form of marketing entirely. If you haven’t got bigger fish to fry than worrying about whether bots follow your Twitter account I don’t want to deal with you, especially as you think I should spend my time helping you with that.

  • Content that’s so generic it could just be posted to your public timeline.

It’s as simple as that. Important conversations with people I know, great. DM is not a mass marketing channel of any kind. If you use it as one it’s the last you’ll see of me.

Remembering Remembrance

| Comments

On a hill above the village of Thiepval in northern France stands a grand and imposing tower. It is the British memorial for the missing troops from the Battle of the Somme.

Architectural historian Gavin Stamp writes:

[W]hat stands at Thiepval is a war memorial – perhaps the ultimate British war memorial. It commemorates a terrible event which changed the course of British history. Carved on the stone panels which line the inner faces of the sixteen massive piers formed by the interconnecting tunnels are the names of over 73,000 British soldiers most of whom disappeared in the desperate struggles which took place around here ninety years ago in 1916 – men whose bodies could not be found or identified. They were but some of the huge casualties (420,000 British dead and wounded) in an unresolved exercise in industrialised slaughter which we have learned to call the Battle of the Somme – victims of one extended campaign in the four-year-long struggle between Christian nations of Europe waged with unprecedented ruthlessness by their governments.

Imagine those 73,000 missing soldiers. I think of my school – a thousand boys lined up in rows in the cold yard, multiplied by 73. Or imagine a nearly-full Wembley Stadium. Now visualise all those people dead. Walk through field after field of broken bodies as far as the eye can see, every one a mother’s son, a child’s father, a wife’s husband, a family torn apart.

Those 73,000 are just the dead that couldn’t be found or identified from one battle in one place in one war. A fraction of a fraction of the total loss in all our wars since 1914. World War I alone killed nearly a million British troops and wounded another 1.6 million.

Every parish in Britain has its own war memorial dedicated to the people from World War I up to our present generation who went off to war and were killed. On the anniversary of the armistice that ended World War I on 11 November 1918 and on the following Sunday we keep two minutes’ silence and lay poppy wreaths in solemn memory of the fallen.

As we honour the dead we also support the living, giving to charity to support the wounded soldiers and bereaved families from our wars in Iraq, Afghanistan and elsewhere. The Royal British Legion’s Poppy Appeal runs every year from late October through to Remembrance Sunday.

According to its website:

The Royal British Legion is the nation’s custodian of Remembrance, ensuring that people remember those who have given their lives for the freedom we enjoy today.

Sadly, despite all its fine charitable work, the Royal British Legion has become a careless custodian of our Remembrance traditions. Under its stewardship in recent years Remembrance has become an orgy of bad taste, bad attitudes and conspicuous consumption.

Take the poppy itself. As a symbol of war and sacrifice it is simple and unaffected. Poppies grew wild in the fields of the Somme around Thiepval, springing up through the mud of soldiers’ graves as if they had been nourished by the blood of the dead. Paper poppies serve both as a token of respect and a vehicle for collecting donations.

But for the Royal British Legion, today’s poppy isn’t so much a token or a symbol as a product – sold in dozens of varieties at a range of prices to suit every budget and taste in the inevitable Poppy Shop. You can spend £3 on an enamel lapel pin or £50 on a gem-studded designer poppy brooch. But poppy badges and brooches are the least of it. Why not treat yourself to some poppy cufflinks (£15.50), a selection of poppy umbrellas (from £12.50 up to £23.25), a poppy-shaped air freshener (£2.10), a poppy spoon rest (£5.40) or perhaps some poppy-branded hand sanitiser (£2.50)? “You’ll be amazed by our range of poppy products, something for everyone”, says the website. Truly, I’m amazed. Remember the dead while you clean your hands. They gave their lives so we might rest our spoons in peace.

How did we get from the grand monument at Thiepval and the simple paper poppy – both in their way the embodiment of dignity – to a poppy-branded hand sanitiser? Why is the custodian of our national Remembrance flogging off its symbol on a range of sub-Argos-catalogue tat?

Much has been said about so-called “poppy fascism”, the process of social pressure and expectation that effectively coerces many people to visibly support the Poppy Appeal, particularly those in public life. Woe betide any British politician or celebrity not sporting a poppy pinned to their lapel this week. If you’re not wearing one you might as well be swinging off the Cenotaph or torching wreaths with the jihadis.

The England football team’s insistence on wearing embroidered poppies on their shirts (and now boots) for this Saturday’s match at Wembley has brought it into conflict with the sport’s governing body (it’s against the rules) and apparently required the intervention of not just Prince William as president of the Football Association but the prime minister himself. Having already agreed to the laying of wreaths before the match, no-one seems to be prepared to question the necessity for the players to wear poppies while actually playing football. Might the players’ obligation (for that’s what it is) to publicly observe Remembrance be sufficiently discharged by laying wreaths and wearing poppies on their suit coats before and after the match? Must they wear them on the pitch and in the bath too? Is footballing an act of remembrance?

From sport to light entertainment. Over at the X Factor singing competition, contestants and judges alike can be seen with an increasingly bizarre and tacky range of poppy accessories on their bodies, on their fingers and in their hair. Do these outsized rhinestone-encrusted monstrosities trouble the spoon rest vendors at the Royal British Legion?

Here’s Royal British Legion spokesman Robert Lee:

If you are performing on X Factor and Strictly and you are performing on spangly, glitzy programme then it is fitting that you observe Remembrance in a spangly, glitzy way.

This isn’t just Remembrance as conspicuous consumption (“Lovely cufflinks, Alan”), it’s Remembrance as self expression. Pick the poppy that suits your style and mood. If you’re spangly and glitzy you can have spangly and glitzy Remembrance. If you’re sporty you can have sporty Remembrance. Presumably if you’re a horror fan you can drench yourself in fake blood, shred an Oxfam suit and chew poppies down by the war memorial. Do it any way that pleases you but make sure that you do it and do it publicly. It’s hard to escape the conclusion that Remembrance has got so weird because we’re all expected to play the game and the Royal British Legion and many of us are simply bored of playing it straight.

This is where conformity leads: rebellion. Just as schoolchildren love to subvert their uniforms by tying their ties in unconventional ways (narrow end at the front; the world’s widest Windsor knot), the inmates of the Poppyplex dick around with things vaguely red and bulgy until all dignity and meaning is extinguished. Remembrance becomes about forgetting, serving primarily to fill a grey week and some vacant column inches somewhere between Halloween and Christmas. The dual aims of remembering the dead and supporting the living are jettisoned in favour of an edgy by-any-means-necessary marketing campaign and the gratification of tin-shakers and poppy shoppers alike. The Royal British Legion, the supposed custodian of our national Remembrance, isn’t deploring the whole farce, it’s cheering it on. As a brand – because that’s all it is now, no more, no less – the Poppy Appeal is in exactly the same place as Burberry was in its baseball cap era.

We need to get back to the simplicity and egalitarianism of the plain paper poppy. Donate ten pence, £1000 or nothing at all. Wear your poppy or don’t. No more designer confections or spoon rests or bling, just one poppy for everyone that wants to wear it and private, discreet donations. We don’t need the prime minister’s spokesman to inform us that Mr Cameron paid £10 for his poppy, nor a file photo of him performing the deed with his furled note. There’s no need to strap a huge poppy to the front of your car, let alone four of them. Your car remembers very little. If you’re agonising over which poppy product to buy to signify the scale of your income, the refinement of your taste or the depth of your concern you’re doing it wrong. If you want to dance, sing and play football, knock yourself out. Gather ye rosebuds while ye may and save Remembrance for when you’re not having fun. Most of all, let’s stop assuming that anyone not wearing a poppy hates our country and dishonours our dead.

I’ve already donated to the Poppy Appeal this year. I will honour the dead of our wars. I will support the living casualties and their families who deserve our respect and need our help. I will observe the two minutes’ silence. But I will not wear the Royal British Legion’s poppy until once again it’s a solemn, dignified and unifying symbol of our nation’s Remembrance. The road from Thiepval to Wembley has been a long one. We need to find our way back.

Create multiple forks of a GitHub repo

| Comments

We all know how to fork someone else’s repo on GitHub – just click the Fork button.

But this only works once. Forking a repo for the first time creates a new repo in your account with the same project name. A fork of anyuser/blah becomes adrianshort/blah in my account.

The second time you click the Fork button on someone else’s repo, GitHub just transfers you to the page for your original fork.

Here’s how I created a second fork of imathis/octopress into adrianshort/ggw when I already had a fork of Octopress in adrianshort/altadrianshort.

If you want to create multiple forks of a repo you need to:

Clone the original repo to your local machine

$ cd ~/Sites/

$ git clone https://github.com/imathis/octopress.git ggw

Cloning into ggw...
remote: Counting objects: 5608, done.
remote: Compressing objects: 100% (2224/2224), done.
remote: Total 5608 (delta 3206), reused 5167 (delta 2900)
Receiving objects: 100% (5608/5608), 1.20 MiB | 362 KiB/s, done.
Resolving deltas: 100% (3206/3206), done.

$ cd ggw/

Create a new empty repo in your GitHub account

Go to the GitHub home page and click New repository.

Manually create the necessary remote links.

$ git remote -v

origin  https://github.com/imathis/octopress.git (fetch)
origin  https://github.com/imathis/octopress.git (push)

There’s nothing magical about remote names. By convention the origin remote points from our local repo to our remote GitHub repo for our own project. The upstream remote points to the project we’ve forked from.

So let’s rename origin to upstream and add our new empty repo as the origin.

$ git remote rename origin upstream

$ git remote add git@github.com:adrianshort/ggw.git origin

$ git remote -v

origin  git@github.com:adrianshort/ggw.git (fetch)
origin  git@github.com:adrianshort/ggw.git (push)
upstream    https://github.com/imathis/octopress.git (fetch)
upstream    https://github.com/imathis/octopress.git (push)

Push from your local repo to your new remote one.

$ git push -u origin master

That’s it. You’ve now got a local repo with remotes to the correct origin and upstream and a GitHub-hosted repo where you can push your local changes.

Thanks to @threedaymonk for help with this.

Unix shell commands cookbook

| Comments

Redirecting output to a file

Most Unix commands will send their output to the standard output – STDOUT – by default the screen. You can redirect the result to a file using the > character:

$ cat file1.txt file2.txt > output.txt

file1.txt and file2.txt will be combined and written into the file output.txt.

You can also append output to the end of an existing file, that is, add the new content to the end of that file. If the file doesn’t already exist it will be created. Use the >> operator:

$ cat file1.txt file2.txt >> output.txt

Piping the output of one program into the input of another

You can daisy-chain programs using the pipe character – |. So to find the number of rows that contain “adrianshort” you could search using grep and pipe the output to the wordcount program wc using the -l (line count) option:

$ grep adrianshort file.txt | wc -l

Although in this case you could just get grep to do the counting:

$ grep -c adrianshort file.txt

Joining files together

Concatenate/combine several files:

$ cat file1.txt file2.txt file3.txt

or

$ cat *.txt

Showing the first or last few lines of a file

Show the first 10 lines of a file:

$ head file.txt

Show the last 10 lines of a file:

$ tail file.txt

With head and tail you can specify the number of lines to show using the -n option. So to show the first 30 lines of a file:

$ head -n 30 file.txt

or just use the - option symbol with the number of lines you want to show:

$ head -20 file.txt
$ tail -15 file.txt

which is handy when you just want the first or last line of a file:

$ head -1 file.txt
$ tail -1 file.txt

Extracting rows from files

Show only the rows containing “adrianshort”:

$ grep adrianshort file.txt

or show only the rows that don’t contain “adrianshort”:

$ grep -v adrianshort file.txt

Extracting columns from files

Extract the second column from a TSV file:

$ cut -f2 file.txt

Extract columns 2-5 from a TSV file:

$ cut -f2-5 file.txt

cut uses the tab character as the field delimiter by default. You can specify a different delimiter using the -d option, e.g.:

$ cut -d : -f 3 file.txt

for a colon-delimited file.


Sorting

Sort the rows in a file alphanumerically:

$ sort file.txt

Sort the rows in a file numerically:

$ sort -n file.txt

Use the -r option to reverse a sort order. e.g. to sort a file Z-A:

$ sort -r file.txt

Or to sort a numeric file high to low:

$ sort -rn file.txt

Counting

Count the number of words in a file:

$ wc -w file.txt

Count the number of lines in a file:

$ wc -l file.txt

Count the number of unique lines in a file:

$ cat file.txt | sort | uniq | wc -l

Count the number of occurrences of each value in column 2 of a TSV file:

$ cut -f 2 file.txt | sort | uniq -c | sort -rn

Count the number of lines in multiple files:

$ wc -l *.txt

Now sort that output:

$ wc -l *.txt | sort -n