Skip to content

Instantly share code, notes, and snippets.

@cleanhands
cleanhands / install-mkinitcpio-firmware.sh
Last active May 23, 2024 17:44
Fix "Possibly missing firmware for module XXXX" by installing mkinitcpio-firmware and dependencies from AUR
#!/usr/bin/env bash
set -euo pipefail
t="$(mktemp -d)"
if [[ ! -e ${t} ]]; then
>&2 echo "Failed to create temp directory"
exit 1
fi
trap 'rm -rf "${t}"' EXIT
<advancedsettings>
<cache>
<buffermode>4</buffermode>
<memorysize>314572800</memorysize>
<readfactor>40</readfactor>
<chunksize>1048576</chunksize>
</cache>
<videolibrary>
<cleanonupdate>true</cleanonupdate>
</videolibrary>
@cleanhands
cleanhands / mediasources.sh
Last active October 2, 2025 20:17
Generate mediasources.xml for Kodi using https://github.com/AquilaIrreale/urlencode
#!/bin/bash
IFS= read -rp 'Server name: ' server_name < /dev/tty
IFS= read -rp 'Username: ' username < /dev/tty
IFS= read -rsp 'Password: ' password < /dev/tty
echo 1>&2
password_encoded=$(urlencode -bc $' "#$%&\'*+,/:;<=>?@[\\]^`{|}~' <<< "$password")
tee "$HOME/.kodi/userdata/mediasources.xml" <<EOF
<mediasources>
@cleanhands
cleanhands / dufs@.service
Created January 28, 2025 18:31
systemd service for https://github.com/sigoden/dufs behind nginx reverse proxy
[Unit]
Description=Dufs daemon (%i instance)
Wants=network-online.target
After=network-online.target
AssertPathExists=/srv/%i
StartLimitIntervalSec=30
StartLimitBurst=2
[Service]
User=%i
@cleanhands
cleanhands / aaget.sh
Created February 14, 2025 00:41
Bash script for downloading books from Anna's Archive using CLI (requires: xq aria2c)
#!/usr/bin/env bash
set -euo pipefail
url="${1}"
prot="${url%%:*}"
link="${url#$prot://}"
domain="${link%%/*}"
link="${link#$domain}"
tmpdir="$(mktemp -d)"
@cleanhands
cleanhands / README.md
Last active February 20, 2025 05:59
PlutoTV on NextPVR in docker using maddox/pluto-for-channels with streamlink