dt.iki.fi

61 posts are tagged "linux"

Getting email off my web server with msmtp (and PHP)

My server is not a mail server, and I never learned to make use of UNIX' internal mailing system. But 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 my email addres.....

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.....

Creating Udev Rules

Scenario: Ignore a permanently connected backup drive Also see this related article. I have a WD USB drive - it's some cheapo variant, never get one of these! It's in an enclosure but can't be taken out and connected directly, like they used to, and suffers a lack of configurability as hdparm show.....