Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Importing IntenseDebate Comment XML into Commentics

· 1,050 words


The Logo for WordPress.

This is ridiculously niche. If this is of help to anyone other than to me... please shout! The IntenseDebate comment system is slowly dying. It hasn't received any updates from Automattic for years. Recently it stopped being able to let users submit new comments. So I've switched to Commentics which is a self-hosted PHP / MySQL comment system. It's lightweight, pretty good at respecting users'…

Build your own "On This Day" page for WordPress

· 1 comment · 350 words


A graphic of a calendar showing the date "February 25 Sunday"

I blog. A lot. Too much really. One of the things I like to do is see what I was rambling on about this time last year. And the year before that. And so on. So, here's my On This Day page and here's how I built it. WARNING Extremely quick and dirty code ahead! This allows you to add a shortcode like [ edent_on_this_day ] to a page and have it auto generate a list of posts you published on this …

How to make the Watchy vibrate

· 3 comments · 400 words · Viewed ~391 times


Watch with a big USB cable plugged in.

I am enjoying playing with the eInk Watchy. It is a cute package and is everything I want in a Smart-Watch; geeky, long battery life, and not obnoxious. But - fuck me! - the documentation is atrocious! Well, that's a lie. There is no documentation. It has the "Chat to us on Discord" anti-pattern that infects so many otherwise great projects. So I'm left to figure out how to make the Watchy's…

Style your WordPress Atom feed

· 8 comments · 500 words · Viewed ~509 times


A nicely formatted RSS feed.

I recently read Darek Kay's excellent post about styling RSS feeds and wanted to do something similar. So, here's my simple guide to styling your WordPress blog's RSS / Atom theme. The end result is that if someone clicks on a link to your feed, they see something nicely formatted, like this: Prerequisites This involves editing your WordPress blog's theme. If you don't know what you're…

Getting Auth0 user information on non-firewall Symfony pages

· 250 words


Logo of the Symfony project.

I am using Auth0's Symfony library to allow users to log in with their social network providers. It works really well. Using this firewall configuration, a user who visits /private is successfully taken through the login flow and I can then use $this->getUser() to see their details. security: password_hashers: Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface: …

Symfony - multiple paths to the same route within a controller

· 1 comment · 100 words · Viewed ~1,935 times


Logo of the Symfony project.

I couldn't work out how to use Route Aliasing within my controller. I couldn't find anything in the documentation about it. But, thanks to a StackOverflow comment it is possible. Suppose you want users to be able to access a page using /users/123 and /people/123 - with both routes displaying the same data? Normally you'd write something like #[Route('/user/{id}', name: 'show_user')] - as it…

Fixing a weird issue with Symfony's Cache

· 150 words


Logo of the Symfony project.

I'm just getting started with Symfony, so I'm blogging some of the weird things I'm finding. Symfony has a concept of Cache Contracts. You can call an expensive / slow / intensive operation and immediately cache the result for a specific time period. Next time you call the operation, the results are served from the cache until the expiry time has been hit. Nifty! But I couldn't get it to work. …

Doctrine - how to use LIKE with dbal prepared statements

· 1 comment · 150 words · Viewed ~415 times


Logo of the Symfony project.

I'm just getting started with Symfony, so I'm blogging some of the weird things I'm finding. I want to use Doctrine dbal to search a database for a partial match. For example searching for "smith" should find "blacksmith" and "smithy". I have a prepared statement like this: $queryBuilder = $conn->createQueryBuilder(); $queryBuilder ->select("whatever") ->from("table") ->where("name …

Using Pandoc to format a Dissertation from Markdown to HTML, PDF, and ePub

· 2 comments · 850 words · Viewed ~853 times


Cartoon showing Pandoc turning data into a document.

Metawork is so much more fun than real work. Sharpening your pencils. Colour coordinating your filing system. Creating Gantt charts of what you intend to do. Marvellous! In that spirit, here's how I used the venerable pandoc to convert my MSc dissertation from .md into a variety of more readable formats. Prep I've no idea what you already have installed on your system but, at a minimum, you…

Setting exa's preferences for a better ls

· 4 comments · 150 words


Unix is user-friendly — it's just choosy about who its friends are.

A few years ago, I wrote about my perfect ls command. I always want to see the most recent file at the bottom of the screen, with a human readable filesize, and nothing else. I've started using the exa tool to make that happen. Sadly, there's no configuration file to change its default behaviour. So, I add this to my ~/.profile file: # Better LS with exa alias lh='exa -l -s modified…

wget is much faster than scp or rsync

· 9 comments · 500 words · Viewed ~2,822 times


Unix is user-friendly — it's just choosy about who its friends are.

I needed to copy 3TB of data from my old homeserver to my new one. I decided to spend as much time "sharpening my axe" as possible. I spent ages dicking around with ZFS configs, tweaking BIOS settings, flashing firmware, and all the other yak-shaving necessary for convincing yourself you're doing useful work. Then I started testing large file transfers. Both scp and rsync started well -…

ZFS - how to use a file as a ZIL

· 200 words · Viewed ~255 times


Unix is user-friendly — it's just choosy about who its friends are.

ZFS sometimes benefits from having a logging drive. Usually, you need to assign a whole device or partition to it. Unfortunately, I had already partitioned my SSD and didn't feel like repartitioning it. So, here's how to create a file, mount it as a loopback, and then assign it to your ZFS pool as a logging drive. Create a 1GB file somewhere on your SSD: fallocate -l 1G zil.img Mount the…