Skip to content

Instantly share code, notes, and snippets.

View janw's full-sized avatar

Jan Willhaus janw

View GitHub Profile
@janw
janw / 15-confirm-plex.sh
Last active October 28, 2023 13:24
A simple molly-guard compatible script to request confirmation for rebooting a machine with active Plex sessions
#!/bin/sh
#
# 15-confirm-plex.sh - molly-guard script to request confirmation for rebooting
# a machine with active Plex sessions.
#
# To use it place the script in /etc/molly-guard/run.d/ and make it executable.
# Requires molly-guard, curl, jq:
#
# sudo apt install molly-guard curl jq
#
@janw
janw / Dockerfile
Created February 19, 2023 12:23
copy from external
FROM upstream/image:v1.23.0 as img
FROM another/external-tool:latest as externaltool
FROM alpine:3
RUN important things
COPY --from img /img/bin/tool /bin/tool
COPY --from externaltool /bin/externaltool /bin/externaltool
@janw
janw / disable_forced_subs.sh
Created December 5, 2022 19:54
Disable forced subtitles in MKV files
#!/usr/bin/env bash
set -euo pipefail
files=("$@")
function disable_subs() {
local file=$1
local forced_track_id
forced_track_id="$(mkvmerge -J "$file" |
@janw
janw / fontawesome.py
Last active October 6, 2020 10:08
Font Awesome role for sphinx documentation
# Place in docs/_ext
#
# Add to conf.py:
# sys.path.append(os.path.abspath("./_ext")
# extensions = [
# # ...
# 'fontawesome',
# ]
#