Homelab

Purging "PMEDIA" spam from my music library with Beets and Mutagen

I have been cleaning up my music collection, which I have ripped from CDs over the years, finally getting around to tagging them properly. I used MusicBrainz Picard to tag my music, but what I didn’t know is that it was adding a bunch of tags which contain ‘PMEDIA’ (even in places like the composer field, which makes no sense).

Seeing this as annoying, I needed a way to clean up my tags to remove this unwanted metadata. Since I have imported the music via beets.io, I was able to use that to help fix up the metadata. However, I ran into several albums in my library where the “PMEDIA” watermark kept reappearing, even after Beets reported that the fields had been successfully cleaned and synced.

Automating storage backups with Kyverno sidecars

In my homelab, I’ve been using Longhorn as my primary Kubernetes storage solution. It’s fantastic for high-availability block storage, but I still wanted a way to keep my data synchronized with my central NAS for long-term backups and to make it easier to recover from total cluster failures.

Initially, I was manually adding a pair of initContainers as sidecars to every single service YAML. This worked, but it was a maintenance nightmare—I had nearly 1,500 lines of redundant boilerplate across my repository.

Getting metrics out of longhorn without prometheus

Recently, I migrated all my homelab Kubernetes storage to Longhorn. While Longhorn provides excellent features, monitoring its performance is crucial for identifying potential issues and optimizing resource utilization.

Longhorn offers Prometheus as the recommended monitoring solution. However, since I use InfluxDB for my time-series data needs, I needed to find a way to integrate Longhorn metrics with my existing setup.

Longhorn exposes metrics on each of its longhorn-manager pods. However, there’s no dedicated service to access these metrics directly. Furthermore, the names of these pods can change dynamically, making it impossible to create a static endpoint for InfluxDB.