RSSAmplifier

Blog

Mark's blog

High-performance Linux optimization and development.

markandruth.co.ukRSS feed ↗10 posts

Latest posts

Getting OpenTelemetry Logging working in Python

I ve just spent a few hours tracking through the source code of OpenTelemetry and Python s logging packages to try to get a better understanding of how this works in order to implement OpenTelemetry logging in python. As it s not trivial I thought I d document the process for others (and my future self) to better understand. Continue reading Getting OpenTelemetry Logging working in Python

Running musescore from within a docker container

For a project, I m wanting to run the excellent musescore from the CLI to bulk convert .mscz files into MusicXML, PDF renders and even instrumental MP3s in bulk. However because the user content is from modern versions of musescore, and the server is very old, I m having to use docker to run a modernish version Continue reading Running musescore from within a docker container

Adding a primary key to a partitioned table in postgres with zero downtime or locks

In postgres (14), we have a table pubsub_node_option which looks like: The 64 partitions are named like pubsub_node_option_p0 to _p63. It has a few hundred Gb of data and we want to add a primary key to it with no downtime or locks (perhaps 1s is acceptable). The standard ADD PRIMARY KEY etc commands will Continue reading Adding a primary key to a partitioned table in postgres with zero downtime…

Easily running unison on different Ubuntu versions

Unison is a great file-synchronization tool, but it s highly dependent on both the unison version and the OCAML version being the same between client and server to enable syncing. I ve wasted much time over the years trying to backport versions to ubuntu as I upgrade a laptop but not the server it backs up to Continue reading Easily running unison on different Ubuntu versions

Easily dumping all AWS SSM details

We have a lot of credentials and config mixed up in AWS SSM/Parameter Store over many different regions and profiles. We want to export all of these to a spreadsheet to allow some more junior team members to convert the non-secret ones into standard parameters which can be stored in our kubernetes git config (on Continue reading Easily dumping all AWS SSM details

Using Postgres NOTIFY with placeholders

When writing SQL you always want to use placeholders rather than trying to escape text yourself and risk an SQL injection attack. Postgres provides great functionality for this such as: Today I was trying to send arbitrary text to a channel via the very powerful NOTIFY command. However every time I tried to use placeholders Continue reading Using Postgres NOTIFY with placeholders

Hacking ElasticSearch python client to work with AWS OpenSearch

Because of various disagreements between AWS and ElasticSearch, AWS released a fork called OpenSearch but and Elastic updated their clients to throw errors if you try to use them with this product. This is obviously really annoying if you are using 3rd party software which uses the Elastic libraries, but trying to run them against Continue reading Hacking ElasticSearch python client to work with…

Screen corruption on KDE with Ubuntu 20.04

At some point in the past couple of weeks I guess my laptop updated libraries or something, because when I had to reboot my laptop yesterday I started seeing massive screen corruption in some applications. It manifested itself in horizontal white/black lines remaining especially when selecting text. This was especially visible in konsole. I couldn t Continue reading Screen corruption on KDE with…

Best wordle starter words

I recently, like pretty much everyone else got into Wordle. One of the most important things in getting the correct answer is to find the best first word or two to start with which will help guide you to the correct answer. The ideal first word(s) should use one each of the most common letters Continue reading Best wordle starter words

Simple mitigation for the new DNS cache poisoning attack

As reported in many places, a new attack has been presented which can allow an attacker to poison caching and forwarding DNS server entries. The PDF is an interesting read and contains many different ideas which chained together can lead to this attack. I believe the following firewall rule should defend against the attack on Continue reading Simple mitigation for the new DNS cache poisoning…