This post assumes that: The target host is running Ubuntu 26.04 The source host is running MacOS with Homebrew installed Preparing the target host Find the interface (usually ethernet) you want to wake on. This is usually something like eth0 or enp8s0 . Also find the IP and MAC address. Create a SystemD unit to enable Wake-on-LAN (WoL) on boot: sudo vim /etc/systemd/system/wol.service Make sure to…
I am a Senior PostgreSQL Engineer at Adyen. Prior to this, I was employed as a Senior Mission Critical engineer and Tech Lead at Conclusion Mission Critical, with a focus on highly resilient PostgreSQL clusters. I have a background in computer science, high performance computing and machine learning. This has guided my career interests towards profiling and tuning, and fault tolerant architecture.…
If you’re switching disks while the machine is running, the LVM bits might not be detected when the disk is added. Here’s a couple of commands you can use to rescan for the device, and then activate it manually. If your device is /dev/sdc , then run: lvmdevices --adddev /dev/sdc Now you can run the scans to see your physical volumes, volume groups and logical volumes: pvscan vgscan…
If you see both of these errors, make sure that your /etc/hosts file contains a line for your domain name, pointing towards localhost, for example: 127.0.1.1 ivdl.co.za
This script does the following: Provides a Swiftbar plugin with connect/disconnect options 1Password integration to fetch the VPN password AppleScript popup to request the one time pin Set up passwordless sudo : Edit the sudoers file: sudo visudo Change `%admin ALL=(ALL) ALL` to `%admin ALL=(ALL) NOPASSWD: ALL` and save and exit. Install the dependencies We’ll use Homebrew for this: brew…
Introduction Generally, DQL works with entities and time series metrics. In Part 1, we’ll start by having a look at entities, and how to view their properties, and filter them. In Part 2, we’ll look up adjacent entities (e.g. hosts and their processes) and time series metrics, how to split them, and how to retrieve their adjacent entities as well. This will allow you to combine metrics…
The regex in this post, explained via Regex101 Some applications can log multiple lines per log entry. PostgreSQL is a good example, when statement logging is turned on. Here’s a bare bones example with log_statement set to all : 2025-06-23 22:00:00.000 CEST [6316] LOG: statement: select * from t where t is not null; If, for example, we wanted to grep for all statements executed by process…
If you see a message like the following when running dnf update : Problem: package gcc-8.5.0-24.el8_10.x86_64 from @System requires libgomp = 8.5.0-24.el8_10, but none of the providers can be installed - cannot install both libgomp-8.5.0-26.el8_10.i686 from rhel-8-for-x86_64-baseos-rpms and libgomp-8.5.0-24.el8_10.i686 from @System - cannot install both libgomp-8.5.0-26.el8_10.i686 from…
Source In my case there were three matters preventing the drive from being detected: The BIOS version was too old The socket was not set to be recognised as a PCIe device (this requires a beta BIOS version) The drive was seated in the M2_1 socket instead of the M2_2 socket. The ASUS motherboards are terrible 1 , 2 for M.2 drives. Forums and Reddit are littered with complaints of M.2 drives not…
  This guide is for Mac, but the tools are platform agnostic, so you can adjust them to your environment. I'm assuming you have Vim 9 or newer, and Homebrew installed. Install LLVM: $ brew install llvm Then check that clangd exists: $ which clangd /usr/bin/clangd Now make a directory for the language server plugin on…
Photo by Kvistholt Photography on Unsplash It is common to run some commands via the postgres account as it is the de facto PostgreSQL super user. This means that if you’re running these commands remotely, you’ll need to chain sudo: ssh pg-host sudo -i sudo -u postgres ... If you’re in charge of the system, you can allow direct sudo -ing to the postgres user, but often that is…
Instead of copying (i.e. via scp or rsync ), you can sudo cat the remote file, and pipe it (since pipes cross the SSH boundary) to a local file: ssh <remote host> sudo cat <remote path> > <local path> For example: ssh example.com sudo cat /etc/shadow > shadow-copy.txt Happy copying!
Last year, Mozilla announced that they’re developing native vertical tabs for Firefox, and that it’s available in the Nightly release channel. Since then, despite generally keeping up with things, I hadn’t seen any more news. Turns out, if you look at the bug tracker, they’re still actively working on it. But it works fine, and you can switch it on with an about:config flag…
This does not have an impact on the functionality, and frees up space in the menu bar for other things. Open a terminal, and run the following: defaults write com.displaylink.DisplayLinkUserAgent ShowMenuBarIcon 0 Restart DisplayLink. The icon will no longer appear, but you can still use the software.
If you run either of the following queries on PostgreSQL 16 or higher: SHOW LC_COLLATE; SELECT CURRENT_SETTING('LC_COLLATE'); You’ll see the following error message: ERROR: unrecognized configuration parameter 'lc_collate' The LC_COLLATE parameter was removed in PostgreSQL 16.0 : Remove read-only server variables lc_collate and lc_ctype (Peter Eisentraut) § Collations and locales can vary…
Power management Some Radeon cards have aggresive power saving profiles switched on by default. Here’s a quick guide cobbled together from other sources on how to change the default to a more aggressive GPU clock ramp-up power mode to reduce stuttering in games on Linux: Set the power profile for the GPU using a udev rule, by adding the following lines to a new file called…
Working sensors! If you’re seeing no or very limited temperature and voltage sensors in Linux, it is likely that you need to make sure the right kernel modules are loaded at boot. In my case, on my ASRock B450M motherboard, I could only see GPU temperatures. For this guide, I’m assuming Ubuntu 24.04, but you can find the package names online for your distro. The fix is as follows:…
*Masquerading as the elephant in the room* Introduction In Part 1 we implemented the server handshake in Python. With our subterfuge now established, we’ll go ahead and respond to requests. Last time, we stopped short of responding: $ psql -h 127.0.0.1 -p 5433 psql (16.4 (Ubuntu 16.4-0ubuntu0.24.04.2), server 15.1) Type 'help' for help. postgres=> select 1; postgres=> Today, we’ll…
Photo by Namukolo Siyumbwa on Unsplash Running CloudNativePG (CNPG) allows you to run a replicated PostgreSQL cluster with similar characteristics to a production employment on your personal machine. This is convenient as you can rapidly deploy and destroy clusters as needed within one or two commands. This is an opinionated guide - it takes away the guesswork of things like “which Minikube…
Photo by Rita Candeias on Unsplash Having moved to the Netherlands a while back and spending some time in Amsterdam, I was wondering about the origin of the name of the most famous park in the Netherlands, Vondelpark. The Amsterdam Municipality website has a very brief blurb about Vondelpark, which, rather unhelpfully, does not note where the name comes from 1 . Wikipedia offers a somewhat more…
Ever wondered what happens if you switch an UNLOGGED PostgreSQL table to LOGGED while replication is active? Probably not, but now that you’re here you might as well find out. Photo by Timelab on Unsplash – WAL shipping in action? This is a bit of a rabbit hole, so let me explain. In brief: streaming physical replication ships the WALs from the primary to the standby servers. The…
Photo by Caterina sanders on Unsplash “You know what’s weird? Day by day, nothing seems to change, but pretty soon…everything’s different.” – Bill Watterson Note : if you need the upgrade steps for version 15 to 16, you can find them here , and if you need the steps for 14 to 15, you can find them here . Upgrade steps These steps assume you have installed PostgreSQL…
The standard way of updating all fields on Windows is to select all and press F9. The advice I found for Mac was the same, but didn’t work for me. Turns out there’s an easy way - if you change the print options in preferences to tick “Update fields” and “Update links”, everything will update when you open the print dialog. So you can just press ⌘ + P to open it,…
Rather than checking the expiration of the certificate on disk, we’ll connect to the server and get the live certificate instead. If the live certificate expires earlier than the one on disk, you’ll likely need to reload (not restart) the PostgreSQL server. We’ll be using the openssl binary, since PostgreSQL already requires it, so you don’t need to install dependencies to…
During a PostgreSQL backend failover, you might find that PgPool-II becomes unresponsive, and that a process listing shows one or more PgPool-II processes as being <defunct> : postgres 3683365 0.0 0.0 0 0 ? Z Jun11 0:00 [pgpool] <defunct> postgres 3683366 0.0 0.0 0 0 ? Z Jun11 0:00 [pgpool] <defunct> postgres 3683367 0.0 0.0 0 0 ? Z Jun11 0:00 [pgpool] <defunct> postgres 3683368 0.0 0.0 0 0 ? Z…
Normally Ansible doesn’t allow for the following: --- webservers: hosts: web-01 web-02 Instead of using the hyphen in the YAML host key, you use the inventory name as an alias, and then have the actual hostname in the ansible_host field for SSH purposes: --- webservers: hosts: web01: ansible_host: web-01 web02: ansible_host: web-02 You can still access ansible_host from your hostvars in your…
If it has worked up until this point, there’s no need for re-learning remote settings (either on the TV or the Apple TV). The fix is obscure but simple: Hold the TV and volume down buttons on the remote simultaneously for ten seconds: When you release the buttons after ten seconds, the Apple TV will pop up a notification indicating that the remote has reconnected. With that done, you can…
Let’s assume you have a username user_a , with a database name database_a . If you were to enter the user credentials and click on the Choose Database option, you’d get a message stating: Failure -FATAL: database 'user_a' does not exist With the option to not choose the database now, it might appear that you cannot proceed any further, but it turns out you can use the Hostname setting…
Version 2.17 of Ansible was released on the 20th of May 2024. This version deprecated support for Python 3.6 1 , which is the default version of Python that ships with RHEL 8. If you upgrade to Ansible 2.17 on your machine and try to execute a playbook on a RHEL 8 target, you’ll see the following error, among the full stack trace: SyntaxError: future feature annotations is not defined The…
These are the apps I install on every new Mac, and this post serves as my personal reference list (as with many other posts on this blog). It’s likely that Rectangle will be replaced by the built-in window tiling functionality in the upcoming Sequoia release, but for now it remains indispensable. All of these apps are open source. Most screenshots are from the original sources. Karabiner…
“How did it get late so soon?” Photo by Murray Campbell on Unsplash Performance I recently had a query from a colleague regarding a slow DELETE query on PostgreSQL. On the face of it, it was simple enough. It had no CASCADE , and they were only deleting a few records at a time using a subquery (in the absence of a LIMIT for DELETE ). This small batch approach was working, but it was…
Photo by Jandira Sonnendeck on Unsplash If you find yourself in the position where you need a full vacuum, you’re probably already looking at the number of dead tuples to have reached that conclusion. The trouble is that bloated tables and (nearly) full disks tend to go hand in hand. In this case, you might be wondering: how much disk space do I need to complete a full vacuum? Let’s…
If you’re successfully authenticating with PgPool-II, but receive the following message: Unable to get session context It means that you’ve likely not specified the correct connection database. Double check the host-based access control configuration, and make sure that the user is authorised to connect to the database you’re specifying. If you haven’t specified a database,…
Peeking into the janitor’s closet Photo by Richard Jacobs on Unsplash Tuning the PostgreSQL autovacuum concerns a delicate balance between the kind of workloads running and the performance characteristics of the system. In short, it boils down to making sure that the autovacuum triggers when it is supposed to, and is able to complete its work, without interrupting the workload imposed by the…
If you find that, for some reason, an INSERT with a sequence value fails with a duplicate key error, you need to resynchronise the sequence value with the contents of the table. For a given table table1 , with an identity column called identity_id (with a corresponding sequence), you can run the following to update the sequence to match the highest value already existing in the column + 1. SELECT…
On the 8th of April, I requested a transfer of this domain from Gandi.net to EuroDNS, following the recent-ish changes Gandi made to mailbox services, and wanting to avoid future issues arising from the takeover of Gandi.net. The transfer succeeded, but the EuroDNS dashboard showed that a DNS update was pending. I thought this was concerning as the transfer was already registered and I received a…
Die lirieke is nêrens elders korrek ingelees nie, dus skryf ek dit hier op. sit weg my kitaar en sluit die kroeg jaag die mense weg ek’s moeg gespeel ek het lank gewag vir dit wat verlore is ek moet nou huis toe laai die kar en sluit die boot sit vir Fokof aan daai bitter soet dis net als te veel om alleen te voel ek moet nou huis toe dalk kom ek terug na daai bries laat op Ryneveld jou…
“No one is ever satisfied where he is.” – Antoine de Saint-Exupéry The classic issue with an unreachable Ansible node is that SSH authorisation is either not configured or configured incorrectly. In such a case you’ll see the following: TASK [Gathering Facts] ********************************... fatal: [<machine>]: UNREACHABLE... Make sure that you can connect as the correct user,…
Timeouts? What timeouts? Photo by YoonJae Baik on Unsplash I was recently called into a situation where the same query was running on three different environments, but one environment was running considerably slower than the other two. I requested an extended EXPLAIN of the query on all three environments, along with the output of pg_locks and pg_stat_activity on the troublesome environment, for…
“There’s never enough time to do all the nothing you want.” ― Bill Watterson While vMotion migrations are not explicitly logged on Linux VMWare guests, there is a log message which correlates with these events. The message is logged to /var/log/vmware-vmsvc-root.log , and looks as follows: ToolsDaemonTcloReceiveVixCommand: command 62, additionalError = 17 It is worth noting that…
PgPool raises the following error when attempting to run <a href="https://www.pgpool.net/docs/latest/en/html/pcp-detach-node.html">pcp_detach_node</a> : ERROR: degenerate backend request for node_id: 0 from pid [5307] is canceled because failover is disallowed on the node This occurs if you have DISALLOW_TO_FAILOVER set as the backend flag. Set the flag to ALLOW_TO_FAILOVER instead, and…
“It’s still magic even if you know how it’s done.” – Terry Pratchett There’s a litany of shortcuts when it comes to technical work. Stack Overflow, Google Quick Answers (the answer boxes and Q&As on search result pages), various LLM-based services and others promise that you no longer need to read lengthy pieces of documentation. You can just enter a question, and…
On perpetrating protocol mimicry It's surprisingly tricky to decide where to put a moustache on an elephant Introduction Today we’ll have a look at the PostgreSQL message flow, and implement a minimum workable server in Python. The aim for part one is to implement the handshake successfully to the extent that psql sees us as a PostgreSQL server, and have a look at what else would be needed…
To most developers, interacting with an API endpoint via HTTP(s) is something they’ve always done via libraries written by other people. Sometimes they get a little bit more exposure by having a look at the requests and headers in their browser’s developer tools, or when they submit a POST using curl. Are you one of those developers? Let’s have a look under the hood this time.…
The flags of Namibia and Norway, respectively These two countries have inherited a curse. Namibia is affected more than Norway, but that might change with time, as systems get more clever. Their curse is one of misguided data processing. The ISO 3166-1 alpha-2 standard contains two-letter country codes. For the United States, it is US , and for South Africa, it is ZA , for example. These codes…
“Begin at the beginning," the King said, very gravely, “and go on till you come to the end: then stop.” If your logs contain the following message: HikariPool-1 - Connection marked as broken because of SQLSTATE(08006) You have an invalid connection to the PostgreSQL server. It may have been closed due to a network interruption, or PostgreSQL (or an intermediary like PgBouncer or PgPool) may…
Changes made to the schema definition on the primary will not automatically reflect in the secondary. This results in messages like these in the PostgreSQL log: LOG: 1BAD/7B63ABC0 has been already streamed, forwarding to 1BAD/7B695078 You can read the explanation for this in the source code , briefly: /* * It might seem like we should error out in this case, but it's * pretty common for a client…
Querying the primary We can query pg_stat_replication , and map the documented strings to numeric values – Prometheus uses numeric metrics, we’ll map them back to strings in Grafana: SELECT slot_name, application_name, client_addr, CASE WHEN state = 'startup' THEN 1 WHEN state = 'catchup' THEN 2 WHEN state = 'streaming' THEN 3 WHEN state = 'backup' THEN 4 WHEN state = 'stopping' THEN 5 WHEN…
After a recent NFS issue I saw the following warnings in my Telegraf logs, and the disk metrics stopped being collected: W! [inputs.disk] Collection took longer than expected; not complete after interval of 10s The usual advice is to just increase the collection interval to give it more time to complete. This is generally not good advice, since there’s no reason why such a collection should…