Skip to content

Instantly share code, notes, and snippets.

@brwyatt
brwyatt / git_puppet_count.sh
Created December 29, 2018 23:29
Script to count the lines of Puppet code for each commit in a Git repo
#!/bin/bash
file="/tmp/count.csv"
echo "datetime,commit,lines" > "${file}"
for i in $(git log --pretty='%ct:%H'); do
d=$(echo "${i}"|cut -f1 -d':')
c=$(echo "${i}"|cut -f2 -d':')
@brwyatt
brwyatt / ui_stock_check.sh
Last active January 28, 2023 01:05
Ubiquiti Store stock checker
#!/bin/bash
models=(
"switch-enterprise-8-poe"
"usw-enterprise-24-poe"
"usw-enterprise-48-poe"
"usp-rps"
)
do_check () {
#!/bin/bash
ip=""
ping="NO"
dns=()
timeout=1
while [[ $# -gt 0 ]]; do
case $1 in
-p|--ping)

Installing HAProxy with Certbot

Largely taken from this tutorial, which was hilariously out of date

Install HA Proxy

sudo apt install haproxy

Install Certbot

Workaround for missing default route on Proxmox boot

Have an issue where Proxmox, on boot, fails to set the default route. It is set in the config (file and UI), and changing the gateway and applying will set the default route, so something's getting mixed up here. So hopefully this fixes it.

Replace 172.17.25.1 with your gateway, and vlan25 with the correct interface.

Script

file: /usr/local/bin/fix-default-route.sh

@brwyatt
brwyatt / Create_Render_LXC.md
Created April 23, 2025 03:01
Create Render LXC in Proxmox

Create a Render LXC in Proxmox

Instructions to setup a dedicated rendering LXC for Jellyfin. Useful for running Jellyfin in a VM and without passing through the whole iGPU, instead passing off to LXCs, allowing using more than one Proxmox host in the cluster for rendering.

Sources

Hardware

  • Minisforum MS-01