Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Removing "/Subtype /Watermark" images from a PDF using Linux

· 3 comments · 500 words · Viewed ~391 times


The PDF file icon with a big red line through it.

Problem: I've received a PDF which has a large "watermark" obscuring every page. Investigating: Opening the PDF in LibreOffice Draw allowed me to see that the watermark was a separate image floating above the others. Manual Solution: Hit page down, select image, delete, repeat 500 times. BORING! Further Investigating: Using pdftk, it's possible to decompress a PDF. That makes it easier to look …

Improving PixelMelt's Kindle Web Deobfuscator

· 5 comments · 900 words · Viewed ~7,089 times


An eReader with a pen.

A few days ago, someone called PixelMelt published a way for Amazon's customers to download their purchased books without DRM. Well… sort of. In their post "How I Reversed Amazon's Kindle Web Obfuscation Because Their App Sucked" they describe the process of spoofing a web browser, downloading a bunch of JSON files, reconstructing the obfuscated SVGs used to draw individual letters, and running O…

Get alerted when your Kobo wishlist books drop in price

· 1 comment · 550 words · Viewed ~663 times


Screenshot of an email showing cheap books.

The brilliant kobodl Python package allows you to interact with your Kobo account programmatically. You can list all the books you've purchased, download them, and - as of version 0.12.0 - view your wishlist. Here's a rough and ready Python script which will tell you when any the books on your wishlist have dropped below a certain amount. Table of ContentsPrerequisitesGet your wishlistSort the …

Automatic Kobo and Kindle eBook Arbitrage

· 8 comments · 1,000 words · Viewed ~1,495 times


Logo of the Python programming language.

This post will show you how to programmatically get the cheapest possible price on eBooks from Kobo. Background Amazon have decided to stop letting customers download their purchased eBooks onto their computers. That means I can't strip the DRM and read on my non-Amazon eReader. So I guess I'm not spending money with Amazon any more. I'm moving to Kobo for three main reasons: They provide…

Liberate your daily statistics from JetPack

· 2 comments · 750 words · Viewed ~1,123 times


Bar chart showing how many times a blog has been red over a year.

Because Ma.tt continues to burn all of the goodwill built up by WordPress, and JetPack have decided to charge a ridiculous sum for their statistics, I've decided to move to a new stats provider. But I don't want to lose all the statistics I've built up over the years. How do I download a day-by-day export of my JetPack stats? Luckily, there is an API for downloading all your JetPack stats! …

Is "Dollar Cost Averaging" a Bad Idea?

· 5 comments · 950 words · Viewed ~462 times


A tiny lego Storm Trooper eats a chocolate coin.

It's sometimes useful to run experiments yourself, isn't it? New investors are often told that, when investing for the long term rather than chasing individual stocks, it is better to be invested for the longest possible time rather than trying to do "dollar cost averaging". DCA is the process of spreading out over time the purchasing of your investments. That way, you don't lose it all if the…

Drawing PPM images on the Tildagon in MicroPython

· 2 comments · 500 words


Various circuit boards showing images.

The Tildagon has 2MB of RAM. That's not enough to do... well, most things you'd want to do with a computer! There's not much processing power, so running complex image decoding algorithms might be a bit beyond it. Is there a simple image format which can be parsed and displayed? Yes! The ancient Portable PixMap (PPM) format. The standard is beautiful in its simplicity. Here's the header: …

Setting the time on the Tildagon

· 1 comment · 400 words


Hexagonal circuit board with circular screen. It is showing the date and time.

I'm beginning my adventures in MicroPython in the hope that I'll have something interesting working on the Tildagon Badge for EMF2026. Here's a basic implementation of a clockface. Here's how to set the time on the badge. There's a hardware clock which should keep time between reboots. Install mpremote on your computer. Connect the Tildagon to your computer using a USB-C data cable On your…

Displaying a QR code in MicroPython on the Tildagon Badge

· 2 comments · 900 words · Viewed ~722 times


A hexagonal circuit board with a circular screen. The screen displays a monochrome QR code.

This was a bit of a labour of love - and something I wanted to get running during EMF Camp. I'm documenting in the hope it'll be useful for EMF 2026! Here's the end result: Background I'm going to assume that you have updated your badge to the latest firmware version. You will also need to install mpremote on your development machine. You should also have successfully run the basic Hello,…

Untappd to Mastodon - Updated!

· 450 words


A bottle of beer outside on a sunny day.

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying. First up, you'll need a file called config.py to hold all your API keys: instance = "https://mastodon.social" access_token = "…" write_access_token = "…" untappd_client_id = "…" untappd_client_secret = "…" Then a file called u…

There should only ever be one way to express yourself

· 7 comments · 150 words


Logo of the Python programming language.

I've been thinking about programming languages and their design. In her book about the divergence of the English and American languages, Lynne Murphy asks this question: wouldn’t it be great if language were logical and maximally efficient? If sentences had only as many syllables as strictly needed? If each word had a single, unique meaning? If there were no homophones, so we’d not be able to mi…

Compressing Text into Images

· 12 comments · 350 words · Viewed ~5,900 times


Random grey noise.

(This is, I think, a silly idea. But sometimes the silliest things lead to unexpected results.) The text of Shakespeare's Romeo and Juliet is about 146,000 characters long. Thanks to the English language, each character can be represented by a single byte. So a plain Unicode text file of the play is about 142KB. In Adventures With Compression, JamesG discusses a competition to compress text…