Year: 2010

Make backgrounds transparent

This is the simplest way that I’ve found to make the background colour of an image transparent.

  1. Download GIMP
  2. Open your image. I’ll pick this one:
  3. Optional: Select Image – Mode – RGB if it’s not RGB.
  4. Select Colors – Colors to Alpha…
  5. Click on the white button next to “From” and select the eye-dropper.
  6. Pick the green colour on the image, and click OK

The anti-aliasing is preserved as well.

Web freedom survey

There was a time when workers were searched when they left, to make sure they weren’t stealing. They were paid by their hour, and had to clock in/clock out. They had supervisors to ensure that they didn’t slack off. They weren’t allowed to make calls at work. After all, people were lazy and thieving in those days.

Nowadays, we’re enlightened. We respect and trust our employees. Like a family. We don’t micromanage their activities. We don’t tap their phone calls.

We don’t restrict or monitor their web usage.

Now, your company is enlightened, of course. Surely you can access these sites I believe essential for work? (If you work out of different offices, you should fill one for each office.)

So, please tell me: which sites can YOU access?

(View results)

Dear Tesco, your books are expensive

Dear Tesco,

I do like you. Really. Your products are invariably cheaper than I can find at most other places. I am a methodical, crazy gadget freak, and I find your gadget pricing impressive. I don’t always find what I want, but you often have the items I finally pick as the best value for money, and at very low prices.

But.

Your books are expensive.

Of Amazon’s bestsellers, just 2 out of the 100 books are cheaper on your site. And this is apart from the fact that I’d get free delivery from Amazon on 37 of those books (over £5), while you’d give me free delivery on 5 (over £15).

On average, that book list costs £5.66 on Amazon. With you, it’s £7.20. I don’t fancy paying 27% more. (36% if I include delivery.)

I’m not making this up. You can check: the books in red are cheaper at Amazon.
(as of 6pm on a cold, rainy Tuesday the end of March.)

Book Amazon Tesco
The Girl Who Kicked the Hornets’ Nest 3.86 3.86
The Girl with the Dragon Tattoo 3.48 3.86
The Girl Who Played with Fire 3.79 3.86
Wolf Hall 3.86 3.86
61 Hours 9.49 9.49
Solar 8.90 13.00
One Day 3.79 3.86
Mums Know Best: The Hairy Bikers’ Family Cookbook 8.98 13.00
The Lovely Bones 2.98 2.98
Breaking Dawn (Twilight Saga) 7.49 14.99
Eclipse (Twilight Saga) 3.99 6.99
New Atkins for a New You: The Ultimate Diet for Shedding Weight and Feeling Great 3.99 5.99
The Return: Nightfall (The Vampire Diaries) 3.49 6.99
New Moon (Twilight Saga) 2.98 6.99
Twilight (Twilight Saga) 3.44 6.99
The Struggle: Bks. 1 & 2 (The Vampire Diaries) 3.48 6.99
Brooklyn 3.86 3.86
Vampire Diaries: Bks. 3 & 4 (The Vampire Diaries) 3.49 5.99
Hamlyn All Colour 200 Slow Cooker Recipes (Hamlyn All Colour Cookbooks) 2.48 2.48
Shutter Island 3.98 3.59
101 One-pot Dishes: Tried-and-tested Recipes (Good Food 101) 1.97 1.97
The Secret Ingredient: Delicious, Easy Recipes Which Might Just Save Your Life 5.97 5.98
Percy Jackson and the Sea of Monsters 3.48 6.99
Percy Jackson and the Last Olympian 3.99 6.99
The Guernsey Literary and Potato Peel Pie Society 3.49 3.49
The Double Comfort Safari Club (No 1 Ladies Detective Agency) 7.99 12.00
The Hummingbird Bakery Cookbook 8.49 8.49
The Gruffalo 2.96 5.99
Percy Jackson and the Titan’s Curse 3.99  
Percy Jackson and the Battle of the Labyrinth 3.48  
The Big Short: Inside the Doomsday Machine 12.50 17.50
The Secret 4.55 4.55
The Time Traveler’s Wife 3.82 3.86
Miss Dahl’s Voluptuous Delights 11.50 13.00
Ching’s Chinese Food in Minutes 9.98 9.98
The Little Stranger 3.86 3.86
ReWork: Change the Way You Work Forever 5.50 7.69
Percy Jackson and the Lightning Thief 3.48 6.99
The Girl Who Kicked the Hornets’ Nest 9.49 9.49
Dead and Gone: A True Blood Novel (Sookie Stackhouse Vampire 9) 5.20 5.20
The Forgotten Highlander: My Incredible Story of Survival During the War in the Far East 9.48 9.48
Room on the Broom 2.98 5.99
Lord Sunday (The Keys to the Kingdom) 3.49 3.49
The Official Highway Code 1.65 1.65
The Gruffalo’s Child 2.94 5.99
The Return: Shadow Souls (The Vampire Diaries) 3.50 5.24
Three Cups of Tea 4.98 4.98
The End of the Party 12.50 12.50
The Very Hungry Caterpillar [Board Book] 2.97 5.99
Annabel Karmel’s New Complete Baby and Toddler Meal Planner 8.69 8.69
Bad Science 3.57 3.57
The Snail and the Whale 2.96 5.99
True Blood Boxed Set (Sookie Stackhouse Vampire) 19.95 19.95
Gone Tomorrow 3.86 3.86
The Italian Diet 6.98 6.98
The Snowman 6.48 9.09
Wedlock: How Georgian Britain’s Worst Husband Met His Match 3.86 3.86
Little Darlings 4.89 8.00
Eat, Pray, Love: One Woman’s Search for Everything 3.98 3.98
101 Meals for Two: Tried-and-tested Recipes (Good Food 101) 1.97 1.97
The Immortals: Blue Moon 3.48 6.99
The Host 3.82 3.82
The Catcher in the Rye 4.48 4.48
The Final Fantasy XIII Complete Official Guide 11.24 14.24
The Book Thief 3.95 3.95
Mexican Food Made Simple 9.99 9.99
Tea Time for the Traditionally Built: The No.1 Ladies’ Detective Agency: The No.1 Ladies’ Detective Agency, Book 10 (No 1 Ladies Detective Agency10) 3.86 3.86
The Oxford Companion to Food (Oxford Companions) 20.00 28.00
Sacred Hearts 3.86 3.86
A Squash and a Squeeze 3.00 5.99
Pokemon HeartGold/ SoulSilver Official Guide 9.74
Cutting for Stone 3.86 3.86
Trespass 8.98 8.98
Wheels on the Bus (Pre School Songs) 2.44 4.76
Alone in Berlin (Penguin Modern Classics) 4.98 4.98
The Good Man Jesus and the Scoundrel Christ (Myths) 7.50 10.00
Twenties Girl 3.85 3.86
The Last Straw (Diary of a Wimpy Kid) 3.48 6.99
Rodrick Rules: Diary of a Wimpy Kid (Book 2) 3.48 6.99
The Natural Navigator 7.48 10.49
The White Queen 3.99 6.39
The Shack 3.95 3.95
Good Food, 101 Cakes and Bakes 1.97 3.45
Faces (Baby’s Very First Book) 2.48 4.99
Lustrum 6.38 6.38
Blacklands 3.86 3.86
The Lost Symbol 8.78 9.00
A Touch of Dead (Sookie Stackhouse Vampire Myst) 5.20 9.09
The Spirit Level: Why More Equal Societies Almost Always Do Better 4.96 4.96
Jamie’s Ministry of Food: Anyone Can Learn to Cook in 24 Hours 15.00 15.00
Ottolenghi: The Cookbook 12.50 16.25
The Ice Cream Girls 5.89 9.00
The Best of Times 3.79 3.86
Whoops!: Why Everyone Owes Everyone and No One Can Pay 11.50 11.50
The Children’s Book 3.86 3.86
Twilight: v. 1: The Graphic Novel (Twilight the Graphic Novel 1) 6.49 12.99
Too Big to Fail: Inside the Battle to Save Wall Street 7.48 7.49
Dark Days (Skulduggery Pleasant – book 4) 5.84 12.99
It’s Only a Movie: Reel Life Adventures of a Film Obsessive 6.00 5.98
The Smartest Giant in Town 3.00 5.99

I do like you. Really. (Despite trying to stop me scraping via user agent detection.) I don’t mind that you don’t have every book. I trust you to pick what I’d most likely want. You’re good at that.

Please make your books less expensive?

Shopping with Cooliris

John Lewis jackets scrolling on CoolIris plugin

Zoom-in view of a jacket at John Lewis

I just put together this little demo that scrapes John Lewis’ site and creates a MediaRSS file out of it.

CoolIris has got to be the best way to shop. Apart from being really pretty, it’s quite useful when you know what something looks like, but don’t quite know how to search for it. For example, I was trying to look for a headphone-microphone (you know, the ones that connect into an iPhone or a Blackberry). I didn’t have a clue what it’s called. (TRRS, if you’re interested. I found out later.) The only way I could get it was to browse the wall…

Amazon search for ear microphones on CoolIris

For the curious, here’s the 50-line source code.

ImportHtml doesn’t auto-refresh

A cool thing about Google Spreadsheets is that you can scrape websites using external data functions like importHtml. It’s really easy to use. The formula:

=importHtml("http://www.imdb.com/chart/top", "table", 1)

imports the Internet Movie Database top 250 table on to Google Spreadsheets.

Since you can publish these as RSS feeds, it ought to, in theory, be a great way of generating RSS feeds out of arbitrary content.

There’s just one problem: it doesn’t auto update.

There are claims that it does every hour. Maybe it does when the sheet is open. I don’t know. But it definitely does not when the sheet is closed. I wrote a simple script that logs the time at which the script was accessed, and prints the log every time it is accessed.

#!/usr/bin/env python
 
import datetime, os.path
 
print 'Content-Type: text/plain; charset=utf-8'
print ''
 
logfile = 'timenow.log'
try:    timelog = open(logfile).readlines()
except: timelog = []
timelog.append(str(datetime.datetime.now()) + '\n')
open(logfile, 'w').writelines(timelog)
print ''.join(timelog)

Then I importHtml’ed it into Google spreadsheets, and left it on for the night. Result: absolutely no hits when the document is closed.

Pity. Guess YQL is still the best option.

Recruiting smart people

Recently, I have ended up giving bits of advice to people recruiting at start-ups, and a few patterns have emerged that are worth sharing.

Before I go ahead, I should warn you that I have no qualifications whatsoever. (All consulting advice should come with this caveat, perhaps!) You might be better off reading Joel Spolsky’s Smart and Get Things Done (read). I haven’t read it myself, but from what little I see of it, the thoughts seem similar.

The key is to realise that smart people are probably 10 times as productive. OK, that may be wrong. It probably originated with Fred Brooks, and has been debated to death. But it seems fairly well accepted that the best people contribute more than they are better paid. (The best guy is probably paid twice the average, but is worth more than twice the average guy.)

This isn’t because they do more work. It’s because they solve harder problems. You can get two people to do two people’s work. You can’t solve a problem twice as hard even with twenty people.

For a startup, the problem is acute. You don’t have the luxury of being able to manage a large number of people.

Since smart people typically work for a lot less than they’re probably worth, it’s a bargain to hire smart people. You pay them twice as much, and they’ll solve problems twenty others couldn’t solve.

The problem boils down to finding smart people and getting them on board.

Finding smart people

You need to go after the smart people. They won’t come to you. Many reasons. You’re not big enough. There aren’t that many of them. They’re not in the market that much (no one lets go of them anyway).

So that just demolishes the traditional recruitment model straight away. You don’t advertise for people and filter their resumes. You find the people you want and go after them.

The good thing is, smart people cluster. They tend to know other smart people, meet up with other smart people, read the same things as other smart people, etc. That gives some useful starting points.

Matt Biddulph talks about Algorithmic recruitment with Github. The premise is that smart programmers are at the centre of the social networks in their respective areas. Just go after them. I advised a friend similarly: to look for the network (or at least the smart people) that hang out on Stack Overflow for a given topic. Last year, when I was looking for a Django developer, I scoured the Infosys internal blogs for similar networks. (Found only a few, but it sure introduced me to a lot of really smart people that I didn’t know existed!)

Conferences are another place to look for them. I tend to periodically check out Upcoming and Meetup to see who’s taking part in what, go over, meet them, and see what they do. I find it a great way of figuring out who’re the experts in a field. (I once met one of the guys who wrote TiddlyWiki, and it was immediately obvious that he was in a different league from the others that day at the Javascript Meetup.)

You can go a step further. Since smart people cluster, they form networks, and control of that network is power. So why not organise those conferences? A lot of these smart people just need a place to hang out and learn from each other. I know the Javascript Meetup was struggling to find a place to meet. Pubs don’t give you the quiet atmosphere needed to learn from each other, and it’s certainly impossible to have a talk there. The folks at Hackspace have done this really well, renting a place and equipment for people to tinker with electronics.

That’s what smart people want, mostly: a nice quiet place, good company, and perhaps pizza. Skills Matter does this beautifully. They organise free workshops every now and then. The list of people that attend these is invaluable.

Getting them on board

Once you’ve spotted a smart person, what do you offer them?

Remember – they’re probably 10 times as productive. Money is quite likely to be worth offering. If that works, great. But if you’re a startup, you probably don’t have the money. You probably could offer a stake in the firm. That might work too.

But, to quote Dan Pink: “One of the most robust findings of social science is that incentives dull the mind and hamper creativity. Yet, businesses ignore it.” Some people aren’t motivated by money. You might get better results if you didn’t pay money than if you did. (Read this story on motivation by Peter Bregman.)

Suppose you said, “I have this problem… I’ve no idea how to solve it. Would you be able to help me?” Most smart people would probably help you. For free. The feel good feeling is worth more than the transaction cost of extracting payment from you.

Or you might be championing a worthy cause – anywhere from world hunger, rural poverty or cure for cancer down to organising a scout camp. The thing about this is they are intrinsically attractive. You probably just need to open up and say “This is what I’m doing, can you help?”

The flip side of it is loss of control. Jonty told me about how Hackspace London was run: “it’s as loosely organised as possible without falling apart”. You don’t manage these people like traditional organisations. You manage them like a community of volunteers. Like parents at a school day function. Like family at a wedding. You don’t pay them. You don’t order them around either.

Part of that is the flexibility of being a startup. You can afford that loss of control. Yes, you don’t have the money. No, not everyone’s working for money. (The planet as a whole is fairly well off. Smart people particularly so.) But you might offer something interesting. Just as long as you’re willing to let go of some control in your mind…

SSH Tunneling via Rackspacecloud

I wrote about SSH Tunneling through web filters using Amazon’s EC2 at 8 cents/hr. With Rackspacecloud, you can get that down to 1.5 cents/hr. This turns out to be a lot simpler than EC2 as well!

Ingredients

  1. Rackspacecloud account (sign up for free – you won’t be charged until you use it)
  2. Putty (which may be available on your Intranet, if you’re lucky)

Directions

  1. On the Rackspacecloud console, click on wordpress website hosting– Cloud Servers – Add Server and select Ubuntu 9.10 (Karmic Koala). Actually, you can pick any other instance. I’m going to talk through this using Ubuntu 9.10 as the example.
    ssh-1
  2. Type any server name, pick a 256MB RAM instance, and click on Create Server.
    ssh-2
  3. Once the server has started, you’ll get the screen below. Click on the Console to open a session.
    ssh-3
  4. Your password would have been e-mailed to the account you registered with. Log in as root with that password. Now type the following:
    sed –i "s/^Port 22/Port 443/" /etc/ssh/sshd_config
    /etc/init.d/ssh restart

    ssh-4

  5. Run Putty. Type in root@<server-IP-address> as the host name, and 443 as the port
    putty1_thumb4
  6. Under Connection > Proxy, set HTTP as the proxy type. Type in the Proxy hostname and Port you normally use to access the Internet. Select Yes for Do DNS name lookup at proxy end. Type in your Windows login ID and password.
    putty2_thumb2
  7. Under Connection > SSH, select Enable Compression.
    putty5_thumb3
  8. Under Connection > SSH > Tunnels, type 9090 as the Source port, Dynamic as the Destination, and click Add.
    putty4_thumb2
  9. Now click Open. You should get a terminal into your Rackspacecloud instance. Log in with the same password as before.
  10. Open your Browser, and set the SOCKS server to localhost:9090. For Internet Explorer, go to Tools – Options – Connections – LAN Settings, select Use a proxy …, click on Advanced, and type localhost:9090 as the Socks server. Leave all other fields blank.
    ieconfig_thumb2
  11. For Firefox, go to Tools – Options – Advanced – Network – Settings and select Manual proxy configuration. Set the Socks Host to localhost:9090 and leave all other fields blank.
    ffconfig_thumb2
  12. Also, go to URL about:config, and make sure that network.proxy.socks_remote_dns is set to true.