Daily Shaarli

All links of one day in a single page.

January 6, 2025

Seamless PostgreSQL Upgrade: Migrating from Version 12 to 16 in Docker

Shows a step-by-step procedure to upgrad PG behind a docker container.
Can be adapted for other version differences.

Needed a few tweaks on my side, especially if using a different username/password/role, discussed here.

Successfully migrated my nextcloud database on-premises using the following:

 export USNAME=<my-db-username>
 export PAWOO=<my-db-password>
mkdir -p pg16
docker run --rm -v $(pwd)/nextcloud_db/_data:/var/lib/postgresql/12/data -v $(pwd)/pg16:/var/lib/postgresql/16/data -e POSTGRES_USER=$USNAME -e POSTGRES_PASSWORD=$PAWOO -e PGUSER=$USNAME -e POSTGRES_INITDB_ARGS="-U $USNAME" tianon/postgres-upgrade:12-to-16

Which then leaves me to move the resulting pg16 dir either into the other volume, overwriting existing data or just switching it around.

Take care that the pg16 directory that you are writing into exists but is completely empty otherwise there will be errors.

Code Smells Catalog

A long list of 'smells' (i.e. often viewed as indicating bad practice) when programming. Take it as ibspiration and indication, not gospel.

GitHub - yo8192/fcron: fcron is an advanced cron for Linux/Unix systems

A much more advanced cron daemon which seeks to have many opions and rivals systemd timers in some of its functionality.

Can have uptime-based and periodical timers in addition to the usual date and time based ones. Can take machine downtime into account. Can provide randomness and jitter. Can be invoked from scripts and only run when e.g. an internet connection exists. And more.

GitHub - chimera-linux/turnstile: Independent session/login tracker

Can provide per-user service managers with the required functionality.

Somewhat hard to explain but essentially you can take any service manager (currently, especially dinit and runit are given as examples but s66 and similar should work) and have it work in a user-space mode, not just system wide.
Fundamentally does so by seeking to be an alternative to logind.

Can also take care of XDG_RUNTIME_DIR management which is nice for example for voidlinux.

GitHub - ptchinster/dcron: dillon's lightweight cron daemon

A crond which seeks to stay light and easy while having some (anachron-like) niceties.