dmvrtx

Always delete by primary key

TL;DR: Deleting records by primary key mitigates the risk of write-lock on the table and full-table scans.

When working on a task to delete multiple records from a populated table based on a value of a column that is not a primary key, it is tempting to write batch flow like this (in pseudo-code):

Configuring local IPv6 network with Pi-hole

Short version Check the “Enable IPv6 support (SLAAC + RA)” in the Pi-hole Settings → DHCP Enable IPv6 on your router Set your router to tell clients to use Auto Config for LAN. E.g. for Netgear routers this option is in the LAN Setup section of the Advanced → Advanced → IPv6 settings page. Explanation IPv6 was built on the idea that clients do not require centralised configuration distribution, like DHCP in IPv4.

Look where you want to be

I often welcome opportunities to refresh my knowledge, usually about tooling, since documentation can provide many insights on best practices which tend to change over time. And recently I applied the same to a different skill set and took a driving skills improvement class. It’s been a long time since I was in the driving school and it sounded like an opportunity to learn a few tricks. Truth is, it was a blast.

True problems to be solved: Connecting flights management

This might be one of the most stressful issues for the travellers. Suppose, airline offers you a reasonably timed, yet short connection between the flights that well matches your plans. However, while at the airport, waiting for the first leg of your flight, you notice that plane is not yet there and the reasonable transfer time shrinks until it is clear that you won’t make it on time. Or even worse, the first leg gets rescheduled, but not the other parts, and the whole itinerary is now a mess.

Hugo & Atom feed

It is 2023, yet Hugo is packaged with a feed template that uses poorly standardised RSS format. However, thanks to its extensibility it is easy to make it produce a well-supported Atom feed. Let’s start with configuration update to support Atom feed output. In the hugo.yaml we should declare support for the appropriate MIME-type: mediaTypes: application/atom+xml: suffixes: - xml outputFormats: Atom: mediaType: application/atom+xml baseName: index isPlainText: false Next, set the homepage output formats to support Atom:

PHP 7.4 on Debian Bookworm

Debian 12, or Bookworm, comes with PHP 8.2, which is a great way forward. However, I had to deal with the project that for the time being is stuck with PHP 7.4. Since I’m using VMs for my project work I decided to create one with Debian 12 and PHP 7.4. Ondřej Surý does an amazing job of keeping a repository with main PHP versions for Debian based systems. For Ubuntu systems PPA approach is a no-brainer, but for Debian some manual work is required to make things work.

Keyring plugin for WordPress tips & gotcha’s

Keyring is a wonderful WordPress plugin that makes it easy to develop features against different services, e.g. Google APIs. However it has its own set of gotcha’s that are not covered in the documentation or not made clear at all.