Create restricted user on Linux, home directory on encrypted partition
Premise Create a user that has the sole task to run some daemon that also needs to store files on disk. Starting and stopping daemon, as well as accessing these files, needs to be possible via ssh. Otherwise it should be locked down as far as possible. Let's call the user sandy from now on. There al...
Getting email off my web server with msmtp (and PHP)
Sometimes I want to get a message from my server, e.g. diagnostic stuff from services (SMART daemon, fail2ban), or if someone tries to contact me on my website, and I want it sent to one of my email addresses which is not maintained on that server. I used to use sSMTP for this, but it seems to stop ...
Time not synced
I noticed that my server's (Debian stable) datetime was way off. Years. Strange, because I was sure I had enabled systemd-timesyncd (but apparently never gave it a second thought after that). Looking at systemctl status systemd-timesyncd I found this cryptic message: ● systemd-timesyncd.service - Ne...
Encrypt any block device
Goal A hard drive or a USB stick set up in this way is recognised by common filemanagers (e.g. Thunar, PCManFM) - it shows up as an encrypted device in the side bar, a password dialog pops up, and the twofold decrypt/mount process happens in one click. Device encryption, performance considerations W...
Disable the Linux kernel watchdog
journalctl -b | grep watchdog; sudo dmesg | grep watchdog Both commands return something like NMI watchdog: Enabled. Permanently consumes one hw-PMU counter. I have no use for this watchdog on a desktop computer. This link already contains all the information required to disable it, but here's the m...
Record system audio output with ALSA
This was written & tested on an Archlinux system, but I believe it applies to most Linux/ALSA systems. ALSA loopback device We assume a single run-of-the-mill Intel sound card, mapped as card 0. We will create a virtual loopback card 1. #> modprobe snd-aloop aplay -l The loopback device works...
Disable a USB port and the connected hard drive
And enable it when required. Also see this related article. Premise & problem I have a USB hard drive used only for weekly automated backups. It is always connected to the same port and never gets removed. At all other times I want this drive to be unmounted, off, invisible, powered down. I wa...
Openbox: change keybind action depending on active window
The situation under Xorg: I have an application with keybinds that cannot be changed, namely Signal for Linux desktop. One of these keybinds has been my probably most used keybind for a long time, namely Shift-Return to open an application launcher. Solution: Openbox allows me to execute different a...