xpam.pl

Category: Script magic

  • ZFS on Debian: load-key keyboard issues

    I have a systemd service which decrypts my ZFS dataset on boot. It essentially runs /usr/sbin/zfs load-key -a but randomly on some boots, my password is “incorrect” and by experimenting I figured out that if I type everything slowly it works almost every time, but if I type it fast it regularly fails. I suspect…

  • Setting env variables with hyphen and running a program

    Docker compose allows you very unrestrictive naming of your environment variables. It allows you to use hyphen and other “special” characters in variables names. When you need to use these variables in regular shell you are out of luck, bash and many other shells do not allow hyphens in variable names. But this is merely…

  • Creating a new torrent and seeding with Transmission

    You have setup a Transmission server on your Linux box together with Transmisison Web or something along those lines and now you are wondering.. how can I actually seed a NEW file? I couldn’t find a straightforward answer on the web so here is the short tutorial: Upload your file to your transmission download directory…

  • Xrandr framebuffer and per-display scaling

    Ubuntu 18.04 LTS came out recently with Gnome desktop as default. Unfortunately even in 2018, it won’t remember the external monitor positioning after reboot and has no support in display settings to set per-display scaling. Year of the Linux desktop, anyone? Xrandr is a powerful Linux tool to manipulate displays. Unfortunately, the man page is…

  • Running multiple PHP versions and compiling from source

    We had a peculiar situation where both PHP5 and PHP7 were needed at the same time on a FreeBSD server. It was also prohibitive to get root or sudo access on the managing account. The solution was to compile PHP from source with fpm, run fpm on a UNIX socket and wire the specific domain…

  • Centos Docker unable to unmount on stop/start

    Error looks something like Error response from daemon: driver “overlay” failed to remove root filesystem for 805c245dad451542b44bb1b58c60887fa98a64a61f2f0b8de32fa5b13ccc8ce4: remove /var/lib/docker/overlay/8f666b802f418f4a3dc4a6cafbefa79afc81491a5cb23da8084dd14e33afbea0/merged: device or resource busy It usually appears when stopping and starting a container. It results in Docker container not being able to start or starts in a weird dead/removed state. Issue is presumably fixed in Centos…

  • Lib packaging for your own repo

    This is a note to self about the release procedure and distro packaging of a development library. This instructions expect aptly and createrepo to be preinstalled on your repo server together with a valid GPG key. Packaging a .deb 1. Checkout the release tag and build the deb according to README. Each build should be…

  • Bashmagic collection vol1

    Keep only last X lines of a file (shrink). echo "$(tail -n 10000 huge.log)" > huge.log Deploy maven artefact to a specific repo without specifying it in pom.xml (format repoId:default:repoUrl). Repo should be specified in your .m2 settings.xml with any necessary credentials. mvn deploy -DaltDeploymentRepository=repo.mydomain.com.my.releases::default::https://repo.mydomain.com/repository/maven-my-releases/ One liner to set password for default PostgreSQL user after…

  • Periodically pause and resume Transmission torrents on TrueNAS

    Unless you have great internet bandwidth you probably don’t want to leech and seed your 100 torrents during the day. You usually want them to seed during the night and then pause in the morning. Let’s do this on our TrueNAS box.  Open up your jails, select transmission and fire up the shell. If you…