elliot's blog

Removing a password from a PDF on Linux

I just bought a PDF, legally, from a publisher's website. However, in their wisdom, they decided it would be a good idea to password protect all legally-purchased PDFs. This means that each time you open the PDF using Acrobat Reader, you have to remember and type in the password to read it. (Evince, the built-in PDF viewer in Linux, allows you to permanently save the password, but I tend to use Acrobat as it copes better with some PDFs.)

So, if you know the password for a PDF and want to remove it, you can use the command line tools pdftops and ps2pdf to free your PDF from its chains.

  • Install pdftops. On Ubuntu, you can do:
    apt-get install xpdf-utils
  • Install ps2pdf. I think this is already included with a default Ubuntu.
  • Convert the PDF to a postscript file, using the password:
    pdftops -upw <password> <file>.pdf
  • Convert the resulting postscript (which is now sans password) back to a PDF:
    ps2pdf <file>.ps

The only thing you lose are any PDF-specific features which don't translate to postscript, e.g. hyperlinks.

Remember, this only works if you know the password for the PDF: it doesn't break the PDF password for you.

Dell laptops with Ubuntu have arrived

Finally, you can now, in the UK, buy a laptop with Ubuntu pre-installed. This is fantastic news. I'll definitely be getting my next laptop there. Just imagine: a laptop with no hardware/Linux compatibility issues. How cool that would be?

I tried putting one together and managed to get 2048Mb RAM, dual core 1.73GHz Celeron processor, plus the basics (basic DVD/CDRW drive, no accidental damage cover, basic screen etc.) for £512. Not bad at all.

The Two Petes

Some tracks by a misguided but utterly engaging pub band. Their rendition of Macarthur Park seguing into Popcorn has to be heard to be believed, including a slightly out-there moog solo. The singer sounds like the pub singer as rendered by Vic Reeves.

LUGRadio Live this weekend

LUGRadio Live 2007 is running tomorrow and Sunday. I can't make tomorrow (which is a shame, as most of the good talks seem to be on Saturday), but will be popping in for Sunday. See you there if you're going. If you're not going, I'd recommend it if you're at all interested in free and open source software: I've been to the previous two events, and thoroughly enjoyed both. This year (unlike last year) I'm not doing any talks or BOF sessions, so will be able to just have a good nose around and enjoy the talks. At £5 to get in, it's a snip.

Open source showcase report

The Open Source Showcase at OpenAdvantage on 20th June 2007 was a great event. I enjoyed putting it together (along with the other staff at OpenAdvantage, of course), and was pleased at the turnout (50 people) and the number of speakers we managed to get (13). Despite my chicken timer (to keep speakers to the 10 minute time limit) almost breaking, everything went swimmingly. Though it was a bit like a wedding, in that I was so busy trying to organise everybody that I didn't get to sit and enjoy it; I just hope the attendees and speakers found it fruitful.

I've written up a report on the event on the OpenAdvantage website.

Online tax returns - DONE!

April of this year marked the end of my first year's trading as mooch labs. I didn't make much money, to be honest, but I thought it best to declare what I had made :).

Last year, I attended two excellent, free workshops organised by HM Revenue and Customs; if you're starting your own business, I recommend you book onto the Becoming Self-Employed and Self Assessment for self-employed people courses. I found them immensely useful in helping me to cut through the masses of forms.

And this week, I've been using the HMRC Online Services to complete my first tax return. It's a really nice web application: not without a few oddities, but very clear, taking you step by step through the process. You have to wait until they send you your first self assessment form, then apply for a PIN to use the website, which I turned around in about a week. Once I got that set up and logged in, it took me perhaps 2 hours to sort out my paperwork, read the guidance, fill it in (though because I have very low profits, I don't have to put much detail in), and submit it. I also rang the business support team at the local tax office with a couple of queries and found them very helpful.

Turns out tax doesn't have to be taxing, like they say on the adverts. Now I just have to pay the bill...

Progress on Drupal Last.fm module

I had another issue with my Last.fm module the other day, which is why it's currently turned off. I think it happens if the Last.fm feeds are unavailable; causing the module's HTTP requests to time out; which in turn causes the whole of Drupal to time out as it waits for the response; which means my whole site falls over.

I've been using the drupal_http_request() function to run my HTTP requests, but unfortunately you can't adjust its timeout setting. So I dug around in that code, and have submitted a feature request and patch which enables you to customise the timeout when using this function. I then rewrote my module with shorter timeouts when making requests to Last.fm, which seems to do the trick.

Hopefully, if this patch makes it into Drupal, I will be able to release the new version of my module, complete with timeouts, so it won't cripple my site or anyone else's. It also adds a Last.fm recent tracks listing to user profiles (if they've set up their username) and has a block (only for one user - I just put it in for myself, really). It still needs a bit of work, and only handles recent tracks, but it's coming along fine.

Don't you Windows users get fed up?

I've switched my Windows machine on today, as my sister sent me a CD which won't open on my Linux machine, but inexplicably will on Windows. I'm currently copying a load of music tracks from it to my laptop. However, every 5 minutes or so, Windows pops up a dialogue box which says it has updated itself and needs to restart, with two buttons: Restart now and Restart later. It also has a countdown progress bar, which gives me 5 minutes to decide which I want to do: presumably if I left it, it would restart once the progress bar reached zero. Despite me pressing Restart later, the Window has popped up 3 times already. When I click Restart Later, I mean "later, when I've decided I want to restart"?! Not "I can't decide, ask me again in 5 minutes"!

Do you people out there using Windows find this enjoyable? How on earth do you stop yourself putting your fist through the monitor with the constant nagging?

By the way sis, if you're reading this, thanks for the MP3s.

Packt Open Source CMS Awards

I'm a judge on the panel of the Packt Open Source CMS Awards, in the category of Best Overall CMS.

Nominations open on 16th July 2007, so remember to twitch your voting fingers. There's a $5000 prize to the winner in the category I'm judging, plus prizes of $3000 for second place and $2000 for third. Other categories include Most Promising, Best PHP, Best Other, and Best Social Networking; but I'm not a judge for any of those.

(By the way, despite using Drupal myself, I will be scrupulously objective as always.)

Syndicate content