Skip to content

Instantly share code, notes, and snippets.

View paul-chambers's full-sized avatar
💭
Open to new opportunities

Paul Chambers paul-chambers

💭
Open to new opportunities
View GitHub Profile
@paul-chambers
paul-chambers / traefik.service
Created February 25, 2019 04:14
If you're not running traefik using docker, you might want a systemd service file for it.
#
# assumes you have a user called 'traefik', with the home directory '/var/lib/traefik',
# containing the 'traefik' executable and a 'trafik.toml' configuration file.
## adduser --system --shell /sbin/nologin --home /var/lib/traefik traefik
#
[Unit]
Description=Traefik
Documentation=https://docs.traefik.io
After=network-online.target
@paul-chambers
paul-chambers / keybase.md
Created March 2, 2019 07:11
Keybase authentication

Keybase proof

I hereby claim:

  • I am paul-chambers on github.
  • I am paulchambers (https://keybase.io/paulchambers) on keybase.
  • I have a public key ASCurpxOID6GqlcTvchnLxQDIIfVcFWcAdKsLtiFuoqKZwo

To claim this, I am signing this object:

@paul-chambers
paul-chambers / miniupnp-repo-split
Created October 28, 2019 02:48
Short script to split the miniupnp/miniupnp repo into three - miniupnpc, miniupnpd, and minissdpd
#!/bin/bash
set -x
USER=miniupnp
PROJECT=miniupnp
repo=https://github.com/${USER}/${PROJECT}.git
if [ -d "${PROJECT}" ]; then
rm -rf "${PROJECT}"
fi
@paul-chambers
paul-chambers / cleanup.sh
Created January 3, 2020 00:36
Cleans up cruft that accumulates in some of my media folders
#!/bin/bash
set -x
dir="${1:-./}"
if [ ! -z "${dir}" ]
then
find "${dir}" -regex '.*[\.-_][Ss]ample[\.-_].*' -delete
find "${dir}" -regex '.*proof.*\.jpg' -delete
find "${dir}" -regex '.*\/screen[0-9]+\.png' -delete
find "${dir}" -regex '.*\.\(exe\|idx\|nfo\|lnk\|nzb\|sfv\|srr\|srs\|srt\|sub\|sup\|txt\|url\)' -delete
@paul-chambers
paul-chambers / passthru-nvidia-to-lxc.sh
Last active February 23, 2020 06:54
nvidia GPU passthru to an LXC container (for Debian)
#!/bin/bash
# In both host and container, add the nVidia repros (see https://nvidia.github.io/nvidia-container-runtime/)
set -x
which curl > /dev/null || apt install curl
# add the repo key:
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
# add the 'nvidia container runtime' repo to apt's sources
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
@paul-chambers
paul-chambers / MakeMKV auto config
Last active September 6, 2020 05:37
Automation of my preferred selection of streams
+sel:all,-sel:(audio|subtitle)&!(favlang|nolang|single),=100:all,-10:favlang
@paul-chambers
paul-chambers / dhclient-enter-hooks.d
Last active January 12, 2023 05:45
/etc/dhcp/dhclient-enter-hooks.d
Some custom Scripts to update things that depend on the WAN IP address
@paul-chambers
paul-chambers / update-country-ipsets.sh
Created August 5, 2023 07:50
Script to pull country-specific IP ranges from ipdeny.com and create/update country-specific ipsets from them
#!/bin/bash
#
# Powered by <a href="http://www.ipdeny.com">IPDENY.COM</a> IP database.
#
# Pull the agregated zone lists from denyip.com, and create country-specific ipsets from them
#
# This approach doesn't require an additional 'geoip' kernel module or the Maxmind database.
#
# When updating, the new ipset replaces the existing one with a 'swap', so there isn't any
# time period when the set is empty.
@paul-chambers
paul-chambers / README.md
Last active August 7, 2023 12:29
My Control-D & dnsmasq config

These two config files work together to integrate Control-D for public DNS queries and dnsmasq for intranet ones (including those assigned by DHCP).

When these chages are made, the ctrld daemon is 'in front' and receives all queries first on listener.0, irrespective of origin. Listener.0 then diverts any that are for *.local or my intranet to the dnsmasq instance, which has been moved to port 531, to avoid conflicts. If dnsmasq doesn't resolve the request itself internally (i.e. dhcp allocations, /etc/hosts, static dhcp-host configs, etc.), it 'forwards' it back to ctrld on port 532, where listener.1 sends it upstream unconditionally (i.e. listener.1 has no rules to redirect intranet requests to dnsmasq, like there

@paul-chambers
paul-chambers / iptv-org-setup.sh
Last active September 4, 2023 01:08
iptv-org sparse checkout
#!/bin/bash
set -x
git clone --no-checkout --depth 1 https://github.com/iptv-org/iptv.git && cd iptv
git config core.sparsecheckout true
cd iptv/streams && git sparse-checkout set us*.m3u ca*.m3u uk*.m3u