Skip to content

Instantly share code, notes, and snippets.

@zenofile
zenofile / opustrackno.sh
Created October 14, 2020 19:44
Write opus track metadata extracted from filename
#!/usr/bin/env bash
trim() {
local var="$*"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
printf '%s' "$var"
}
@chungy
chungy / README.adoc
Last active July 31, 2023 19:18
minecraft systemd service

Use these files for managing a Minecraft server with systemd.

Place minecraft.service in /etc/systemd/system, and run systemctl daemon-reload. minecraft should go into /etc/conf.d or an equivalent directory (change the path in the service too). /etc/conf.d/minecraft should not have world permissions. chown root:root and chmod 600 the file.

The user and group minecraft should exist. The minecraft user should only be a member of the minecraft group, for system security.