Journal of my recent activities

Update pip packages

(venv) $ pip list --outdated
(venv) $ pip list --outdated --format=freeze \
               | grep -v '^\-e' | cut -d = -f 1  \
               | xargs -n1 pip install -U

How to upgrade all Python packages with pip #python #soft

$ systemctl list-timers
$ systemctl enable --now ibm_backend.timer

in user space use --user parameter, and put your timers into ~/.config/systemd/user/

Use systemd timers instead of cronjobs

certbot timer


Photomultiplier tubes are extremely sensitive detectors of light

1 photon > cathode> 1 electron >> ... > n*electron >> ... > anode


Repairing LibrreOffice conversion odt to pdf in parallel PHP script, as it sometimes hangs.

$cmd = 'export HOME=/tmp && cd /tmp  && libreoffice --headless --convert-to pdf  ~/16c6801746f3e924b254abb0089f0a0f.odt ';
exec($cmd, $output, $retCode);

The problem is in access to /tmp/.config and /tmp/.cache for the same user (apache) from different processes. The solution was to generate a temporary subdir for every conversion and pass it to HOME parameter.


$ podman network create nextcloud-net
$ podman network ls
$ podman network inspect nextcloud-net

$ podman volume create nextcloud-app
$ podman volume ls
$ podman volume inspect nextcloud-app

Installing Nextcloud 20 on Fedora Linux with Podman

Add new disk in OVH public cloud server

Storage > Block Storage > Create new instance

Attach it to the instance using context menu [...]

$ lsblk
$ sudo fdisk /dev/vdb
# n -> default answers , w
$ sudo mkfs.ext4 /dev/vdb1
$ sudo mkdir /mnt/bazy
$ sudo mount /dev/vdb1 /mnt/bazy
# fstab
$ sudo blkid
$ sudo vim /etc/fstab #linux #soft

Podman (docker) cheatsheet

podman logs postgres12

Postgresql from container

$ podman pull postgres
$ mkdir ~/podman/volumes/postgres
$ podman run --rm --name pg-docker -e POSTGRES_PASSWORD=docker  
   -d -p 5432:5432 \r
   -v $HOME/podman/volumes/postgres:/var/lib/postgresql/data:z postgres
$ podman ps
$ psql -h localhost -W -U postgres
$ podman stop pg-docker

The :z suffix solves the permission denied problem for the volume.

#podman #docker

Don't write command-line interfaces (generate them)

Instead of writing a command line menu use hug or typer - it is like implementing REST interface for your command line program.