Essential Cinema According to Lovefilm

Given there’s a bit of lovefilm bashing going on in Wales at the moment, I thought I’d chime in with the most frustrating thing I found with communications from lovefilm.

Check out the following weekly email I used to receive (I’ve since unsubscribed), along with my annotations.

I really couldn’t care less about who lovefilm are sending into cinema’s to perform reviews and certainly don’t want it to be the first text I see in relation to that image.

Also, the first thing I’m drawn to is the image. Why lead me away from the title of that movie and make work to find the text for the heading? Don’t make the title and preview exactly the same size, or divide them up!

End of rant.

Recovering Images from SD Cards with PhotoRec

I had the horrible situation last Sunday following removing a number of pictures using an SD reader from my SD card that when I inserted it in my camera, it registered nothing upon it. My heart sunk, because this card is stuffed full of images of me and my family (along with my 1 year old son growing up) and I was unsure of which ones I’d actually backed up. After perusing the hidden files on the card, all I could discover was the files I’d most recently transferred from the card….great…

Partly this was my own fault – I’d already experienced problems with the reader in question when trying to write images for my Raspberry Pi and shouldn’t have used it for transferring images I care about. The card in question is a uber cheapo Integral USB 2.0. Despite what the amazon reviews say, steer well clear of it – this has been a pain from day one, with intermittent transfer problems which triggered this situation.

After a little more digging, I came across Photorec, a commandline utility which seemed like it would hopefully help recover some of the images. I attempted to use it with my card reader, but given it’s credentials I’ve given above, found the scanning process would cut out and couldn’t get through the whole card. At this point the card was being reported empty….great…Given the way PhotoRec works, I understood it would still be possible to extract the images despite this. I decided to order another reader and hold fire until it had arrived – this time I opted for a Kingston USB 3.0 (which I haven’t had any such problems with so far).

The Solution

Here are the steps I followed after receiving my new sd reader to recover images from the card using PhotoRec. I’m listing them for anyone else who may have the same horrendous stomach wrenching problem I did last Sunday. It seems to have worked pretty well, with only 1 movie file coming out corrupted and about 500 images recovered.

Firstly, I wanted to take a copy of the card as it currently stood following my investigation. For this I used df, diskutil and ddrescue.

To determine where the card is currently mounted (look for the one that’s about the right size):

df -h

To unmount the card so we can fiddle with it:

sudo diskutil unmount /dev/disk1s1

To backup the card to a disk image on your macbook:

sudo ddrescue /dev/disk1s1 ./sdbackup/image.img backuplog

Finally, using PhotoRec scan the disk image that was just created. My image was FAT formatted I scanned the whole thing rather than just unallocated blocks.

sudo ./photorec ~/sdbackup/image.img

The final piece of this saga was to rename all the files PhotoRec created so they were in folders according to their exif data. My photos are all in folders like “2012_06_30″, so to have 500 files named “f0677440.jpg”, “f0688768.jpg” in a random PhotoRec directory would be pretty annoying. I had looked at setting up an automator task for this, but I ended up using PexifTool for simplicities sake (I’m sure there are other alternatives). I believe if you go the Automator route, you may well have to install plugins in order to be able to extract exif data from files.

A Scientist in an Adventure with Pirates

This is a talk I did back in May at unifieddiff about my time working as a web developer at Aardman Features. I talk quite a bit about the production process and what we take from staff in order to help them do their jobs properly. I quite enjoyed giving this talk – more so than those I’ve given in an academic capacity in the past.

You’re Nowhere Near as Good a Hacker as You Think

What are you doing? Why would you go down that road? Shouldn’t you be building something else? How long have you been doing this?

Sure you can fool your clients into thinking you’re adding value to their product. I know the truth. But how did you – with all your expertise get to the point in thinking that’s what you’re really doing?

This is your first project? Shouldn’t you be focusing on your clients problems?

Why are you busily building a framework, when you’re already overdue? You know there’s any flavour of ORM available already right? What’s wrong with you? Where are your requirements?

Do you think that you’re going to be able to produce something better than the thousands of contributors to that open source project you’re avoiding using? They’ve been doing it for years already, for thousands of use cases. You think somehow yours falls outside it’s catchment area? Seriously? How arrogant are you?

You’ve been blinkered into thinking you’re an expert in areas you’re not. When your time is spent solving the wrong problems and you’re not invited back, I hope you’ll realise that you’re nowhere near as good a hacker as you think.

Where does Steam store Indie Game The Movie?

A quickie – but for all those that have downloaded “Indie Game the Movie” today from steam and are wondering where the video files are stored, you can find them here:

Steam/SteamApps/common/Indie Game The Movie/data/movies

If You Build It

If my years in academia have taught me anything, it’s that insight obvious to you isn’t often obvious to others.

As a result, I’ve pretty much adopted a gung-ho hacker attitude towards getting my own ideas built whereby I’ll just often work to get an iteration of an site out as fast as possible. The only factor here is my own time and I’m in the fortunate position to have some of that available now and again. There’s a variety of reasons why I might attempt a project, ranging from it may later evolve into something able to draw an income further down the line, that I’m excited by learning from the tools I choose to use or that I feel moved enough by a problem to do something to try and prompt change.

I had one of these ideas last weekend, whereby I was wondering what the specifics of the fees of kickstarter projects broke down to. The information on what fees are taken is published on their site, so I set about a simple phantomjs script (available on github) that could scrape the information from kickstarter. After doing so, the idea moved on to graphing said information via an app to a simple raphaeljs and again further once I’d realised some other stats that could be gathered from the info I was grabbing. The end result is Starter Stats – which is, (I think) a neat little site for showing stats on any kickstarter project.

It took a little longer than I’d hoped, but I’m really pleased with the final site as it stands. You should also be able to just replace the beginning of any kickstarter project page (http://kickstarter.com) with “http://starterstats.com” and you’ll be sent to the relevant stats page on the app. Pages are generated on-demand every 15 minutes. Go on, take a look and let me know what you think.

I could have not spent my time on this, instead kicking back and waiting for someone else to build such a tool. But I couldn’t see that happening. No, better for me to build, learn whilst doing so and move on to my next project. What do you get by not building?

How to Switch Your VPS in 2 Hours

Friday last week I woke up to a barrage of emails coming into my inbox. All of these were coming from notification of spam comments upon this very blog. By the time I’d woken up I’d had something like 75 emails. This was pretty strange given that Akismet was there guarding my blog ever since it’s been available and I’d never had a email about a dodgy comment since I’d set it up (something like 5 years ago). They continued to flood in during my breakfast as fast as I could delete them.

The problem stemmed from the fact that network connectivity from my slicehost account had been knocked out of action – which had never happened before. I presumed this was down to the migration of slicehost over to Rackspace infrastructure, which I’d been informed of, but the network dying was probably unintended.

Either way, it was frustrating and I instantly decided to finally migrate away from slicehost and setup a second linode account. The funny thing is, that most of this was aided by slicehosts own documentation on configuring your server. If you’re doing little more than hosting a number of mysql / php driven sites, it is in fact really simple to switch. Here’s how I went about it, my sites all experience fairly low traffic, so I’m aware this solution might not be right for everyone.

Backup All Your Important Data

First of all, you’re going to need to backup everything you have in your sites directory. For me, that’s everything under /var/www.

tar -zcvf backup-feb-2012.tar.gz /var/www

Next, you’ll want to do the same for your Apache sites:

tar -zcvf backup-apache-feb-2012.tar.gz /etc/apache2/sites-available

Finally, I took a mysqldump of my entire mysql setup:

mysqldump —-all-databases -u root -p password | gzip >dbbackup-feb-2012.sql.gz

Setup Your New VPS

Having done that, you have pretty much everything you need to bring your server back to life as it is now. Go and grab a new vps from linode or somewhere else and set it up using the details starting from here: http://articles.slicehost.com/2010/10/18/ubuntu-maverick-setup-part-1 I configured my vps to have exactly the same accounts and passwords as my original vps, to make life easier for me. Once SSH and your firewall has been setup and you’re all updated, you’ll be able to transfer all the files you just created onto your fresh vps setup, using filezilla, or a direct connection between the two machines. You’ll then need to install Apache: http://articles.slicehost.com/2010/5/19/installing-apache-on-ubuntu, PHP: http://articles.slicehost.com/2010/5/19/installing-php-on-ubuntu and MySQL: http://articles.slicehost.com/2011/3/10/installing-mysql-server-on-ubuntu

On your new machine, you’ll need to restore the files you backed up to /var/www.

tar -xzf backup-feb-2012.tar.gz
sudo cp -r var/www/* /var/www/
sudo chown -R www-data:www-data /var/www/*
rm -rf ~/var

Then the apache site files:

tar -xzf backup-apache-feb-2012.tar.gz
sudo cp etc/apache2/sites-available/* /etc/apache2/sites-available/

For every file that exists in the sites directory and is to be enabled, we need to enable it. You can use a2ensite for this if you like.

cd /etc/apache2/sites-enabled
sudo ln -s ../sites-available/ianwootten.co.uk.conf ianwootten.co.uk.conf (for each site file)

Install any apache modules you might require and restart apache. If you’re using wordpress or a php framework like me, you’ll most likely need mod_rewrite.

sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

You’ll then need to repopulate your new mysql install with all your old data.

gunzip -c databasebackup.sql.gz | mysql -u root -p

Configure Email

I use msmtp to handle all my email on my server, which sends through a single gmail automailer address for my domain. If you want to send email that way do the following:

sudo apt-get install msmtp ca-certificates
sudo nano /etc/msmtprc

Paste the following setup in the file:

defaults
tls on
tls_starttls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt

account default
host smtp.gmail.com
port 587
auto_from off
auth on
user automailer@somedomain.com
password mymailpass
from automailer@somedomain.com
maildomain somedomain.com
logfile /var/log/msmtp.log

sudo chmod 0644 /etc/msmtprc

You can test whether it’s working using a the command as:

echo -e "Subject: A Test Email\r\n\r\nThis is a test" |msmtp --debug --from=default -t mymail@gmail.com

Configure DNS

You need to configure how your vps is going to handle particular requests for various domains. You’ve probably had to do this already with your current vps, so just copy the entries through whatever management system your new host provides. For sites that have a fairly simple setup, your host may provide a simple set of default entries to use, or you can clone entries that have the same setup as each other.

We’re now at the point where we have a complete copy of our vps up and running, and the vps knows how to handle requests for domains, however currently our domain registrar points to our old vps, so the requests will never reach our new server. Head to your domain registrar and change the entries for a single domain, to point to your new vps (ns1.linode.com, ns2.linode.com etc). Now sit and wait patiently….Once that domain has propagated correctly (ping it to see if has a new or old ip), and you’re happy your site is working as expected, go ahead and change all of your domains dns entries to the ip address of your new vps.

Relax…

All in all, I don’t think this took me more than a couple of hours working with the terminal open. I certainly didn’t worry about migrating in the way I have done previously. As I opted for a uk datacentre with linode, a side effect of the change is all my sites are much much faster – and a better setup with linode is in fact cheaper than slicehost. I left my slicehost account running for an entire week prior to shutting it down yesterday – just in case…

Where’s my Full Stack Payment Service?

Unless you’ve been living under a rock, you’ll realise that there’s an uprising against paypal amongst developers. Most of this stems from the multitude of crazy requirements they put upon sellers and the locks they can put upon your account without notice.

This in part has led to a number of payment alternatives cropping up. Here in the UK for instance, you have Google checkout and checkout by Amazon pitching up against paypal. None of these solutions are ideal though if you’re looking to make say, a service that bills on a monthly basis.

Enter the subscription billing tools – there’s recurly, Chargify and Saasy, to name 3. All of these go some way to ease the management of customer subscriptions. This is great if you have an established banking history as a business and are able to get hold of a merchant account. Not so great for me – an independent developer with neither of those.

Enter Stripe, a full-stack payment processor for developers which has no requirement on merchant accounts or gateways. Integration with your own website is as simple as pasting in some javascript. Sounds great…..Except I need to be in the US to use it. *Facepalm*. I even had beta access to stripe in it’s infancy and just had to smile at my invitation code.

Recently here in the UK, Go Cardless has appeared with an interesting model, based around the use of direct debits to set up subscriptions and make payments. That strikes me as a little weird from a customer point of view. I’m ok paying my gas by direct debit, but would I be ok paying for a piece of software? Given it’s unusual for a website to bill this way, I’d argue most people wouldn’t be.

Unfortunately for us independent developers in the UK, Go Cardless really is our best option until Stripe or some other full stack offering lands here. I know Stripe are supposedly working hard on doing so, but payments are at an incredibly frustrating point here right now.

New Adventures 2012 – Self Help for Web Designers

Last week, like many others working on the web, I took the trip to Nottingham for New Adventures 2012. I’d seen the wonderful praise dished out for it last year and felt like I wanted to see what it was all about first hand.

I’ve learnt from experience that the most important part of any conference is not the talks or speakers involved, but the community around it and therefore I headed up the night before to ensure I didn’t miss a thing.

Colly and his team had done a lovely job of organising enough to keep us busy what with bowling, screenprinting, fr00tball, the after party and of course the main event.

Despite not actually branding myself as a web designer, it was great to feel welcomed and able to chat one on one with others about our day to day work. Dan Mall’s talked helped somewhat here, forcing introductions with everyone around me. I’m pretty much work in solitary confinement as a developer and to discuss the thoughts and ideas I have with other like minded creatives is always welcome.

During a dinner following the conference, another dev commented that the most of the presentations weren’t specific to web design. They were in fact so abstract, that it was more a “Self Help Class for Web Designers”. I pretty much agree with this. But that’s with a caveat – what else do you attend these presentations for? NA Conf is there to share, inspire and enable designers to be better designers. I want to leave giddy eyed with possibilities. Remember there are workshops too for specifics…

After the whole conference, I feel like there’s a whole lot more I could do to better myself at my craft. Hopefully over the course of the year I’ll do something about it. Most of the notes I made are to this effect too and I’m sure I’ll take away something different each time I look at them.

There’s only so much that can be covered in 45 mins, and for me I want to see a speaker paint me the big picture. After NAConf, I’ve got a whole bunch of big pictures to get through.

Goodbye 1 & 1

I just sent the following email to 1 & 1′s billing department. I’ve been with them for coming up to 7 years now and they were, when I first used them, the only registraar I knew about and I was really happy.

As the number of domains I own has grown, their account admin has become really totally useless to manage them all. I recieved a payment request out of the blue today and it tipped me over the edge.

> We contacted you regarding a declined payment or an expired credit/debit card and have not yet heard back from you.
> Our records indicate that there is an unpaid balance in your 1&1 customer account no.: K####### as listed below.

Firstly – No you didn’t.

Secondly – It would be far more useful telling me which domain name in my account a payment demand is in reference to rather than my account number, as I have more than 1 domain with you.

Thirdly – The steps you’ve listed here to find my payment details miss steps and references links that don’t exist.

Fourthly – Threatening action when you haven’t actually sent a primary payment request email is rude, forceful and obnoxious.

> Please be aware that if this matter is not resolved, you may be sent to a debt collection agency. If the account is sent to a debt collection agency a £15.00 > charge will be added to the unpaid balance.

I’ve decided to take all of my business elsewhere at the earliest opportunity. I’d hope you’d take heed of these comments and pay your other longstanding customers the respect they deserve.