Skip to content

Instantly share code, notes, and snippets.

View packerdl's full-sized avatar

Devin Packer packerdl

  • Hamilton, Ontario
View GitHub Profile
@packerdl
packerdl / verifyflac.sh
Created March 26, 2022 13:28
Recursively search for and verify flac files
#! /usr/bin/env bash
# Recursively searches for flac files in the supplied
# directory and checks them for errors.
shopt -s globstar
error_log="$(pwd)/errors.log"
green='\033[0;32m'
red='\033[0;31m'
@packerdl
packerdl / flac_audio_stream_hash.sh
Created January 1, 2022 15:50
Calculate hash of FLAC audio stream with FFMPEG
#! /usr/bin/env bash
# This converts each flac file in a given folder into a raw PCM bit stream.
# The raw bit stream can be used to perform a metadata-agnostic comparison
# with other audio streams.
for file in *.flac; do
# -ar = sampling rate
# -ac = number of audio channels
# -f = sample format (s16le = 16bit, little-endian)
ffmpeg -i "$file" -loglevel error -ar 44100 -ac 2 -f s16le "$file.pcm"
md5sum "$file.pcm"
@packerdl
packerdl / wg_add_peer.sh
Last active January 31, 2021 15:57
Painlessly setup a new peer on your wireguard server
#! /usr/bin/env sh
# Painlessly setup a new peer on your wireguard server
#
# Peer config will be rendered as a QR code that can be
# scanned by a mobile device. The peer public key and
# IP will be appended to the server's wireguard interface
# config.
#
# Requires qrencode to be installed on the system.
set -e
@packerdl
packerdl / top-ad-domains.txt
Created November 29, 2020 14:05
PiHole: Top Ad Domains
# Most common ad servers via /r/privacy post:
# https://www.reddit.com/r/privacy/comments/3tz3ph/blocking_most_advertising_servers_via_factory
# Chances are your PiHole is already blocking most of these, but it's nice to be sure.
adsense.com
adblade.com
207.net
247realmedia.com
2mdn.net
2o7.net
33across.com
@packerdl
packerdl / lxc_bind_mount_cifs.md
Created October 12, 2020 23:48
Bind mount a CIFS share on a Proxmox host to an LXC container.

Bind Mount CIFS Volume to LXC Container

This example mounts a read-only Media share to the Promox hosts and bind mounts the volume to an LXC container running a Plex Media Server.

  1. Open a shell on the Proxmox node
  2. In the /root create a file called cifs_credentials.
  3. Inside the file place the username and password for the share in the following format:
username=USERNAME
@packerdl
packerdl / lxc_plex_intel_quicksync.md
Last active April 28, 2024 13:43
Intel QuickSync passthrough to an unprivileged LXC container running plex.

Running Plex in an Unprivileged LXC with Intel QuickSync Passthrough

First setup an unprivileged Ubuntu container with Plex Media Server installed. Inside the container take note of the id of the plex group.

# Your Plex group's ID may be different
$ getent group plex | cut -d : -f3
998