Skip to content

Instantly share code, notes, and snippets.

View llamafilm's full-sized avatar

Elliott Balsley llamafilm

View GitHub Profile
@llamafilm
llamafilm / parallels_nat_repro.ps1
Created November 10, 2026 01:22
Repro Parallels NAT issue
<#
Minimal repro for Parallels NAT throttling issue. Measures the time to make new TCP connections to a target host.
Usage: powershell -NoProfile -ExecutionPolicy Bypass -File parallels-nat-repro.ps1 <lan-host> [port]
Any host on the Mac's network that accepts TCP connections will do (a router web UI, a NAS, another machine).
#>
param(
[Parameter(Position = 0)][string]$Target,
[Parameter(Position = 1)][int]$Port = 443
)
@llamafilm
llamafilm / sleep_exporter.py
Created May 15, 2025 22:59
Prometheus exporter that just sleeps a specified duration and returns that number as a metric
#!/usr/bin/env python3
import argparse
import logging
import os
from urllib.parse import parse_qs
import time
import wsgiref.simple_server
import wsgiref.util
from wsgiref.simple_server import ServerHandler
@llamafilm
llamafilm / lightware_mx2_exporter.py
Last active April 3, 2025 17:30
Lightware MX2 prometheus exporter
import logging
import os
import urllib
import socket
import sys
import wsgiref
import prometheus_client
from prometheus_client.core import GaugeMetricFamily, InfoMetricFamily
@llamafilm
llamafilm / python-execd.conf
Last active February 9, 2025 20:48
Telegraf execd config
[[inputs.execd]]
command = ["python", "-u", "./python-execd.py", "localhost"]
data_format = "influx"
signal = "STDIN"
[[outputs.file]]
files = ["stdout"]
use_batch_format = false
data_format = "influx"
-- Qsys Text Controller to print a log message every time an AES67 or Atmos receiver input changes
Components=Component.GetComponents()
for _,v in pairs(Components) do
if v.Type == 'input_box' then
local rx = Component.New(v.Name)
rx['sdp.lan.a'].EventHandler = function(ctl)
print(v.Name .. ' SDP LAN A changed to ' .. ctl.String)
Log.Message(v.Name .. ' SDP LAN A changed to ' .. ctl.String)
lyngdorf_info,audio_input="HDMI",audio_type="Dolby ATMOS 0.0.0",device="MP-60",interface="IP",room_perfect_position="Bypass",room_perfect_voicing="Neutral",active_source="HDMI 1",video_type="2160p60 YCbCr 4:2:0",zone_b_source="Follow Main",zone_b_stream_type="None",zone_b_audio_input="HDMI",stream_type="None",video_input="HDMI 1",hdmi_main_output="HDMI Out 1" value=1
lyngdorf_mute_status zone_b=1,main=0
lyngdorf_power_status zone_b=0,main=1
lyngdorf_lipsync value=0
lyngdorf_loudness status=0
lyngdorf_volume max_vol=0,trim_bass=0,trim_center=0,trim_height=0,trim_lfe=0,trim_surrs=0,trim_treble=0,zone_b_volume=-55,volume=0
@llamafilm
llamafilm / debug.recipe.yaml
Created July 17, 2024 01:28
Autopkg recipe that fails when you run it a second time
Identifier: debug
Input:
NAME: telegraf
Process:
- Processor: URLDownloader
Arguments:
url: https://dl.influxdata.com/telegraf/releases/telegraf-1.31.1_darwin_arm64.dmg
- Processor: PkgRootCreator
Arguments:
pkgroot: '%RECIPE_CACHE_DIR%/payload'
@llamafilm
llamafilm / barco_projector_test.md
Created April 8, 2024 15:16
Telegraf config for Barco projector

This is the base SNMP config for Barco projector, with string fields recorded as tags.

[agent]
  omit_hostname = true
  snmp_translator = "gosmi"
  quiet = true

[[inputs.snmp]]
  alias = "5913"
@llamafilm
llamafilm / Dockerfile
Last active March 26, 2024 01:32
LG WebSocket connection
FROM ubuntu:latest
RUN apt update && apt install -y \
git \
lua5.3 \
liblua5.3-dev \
luarocks \
libssl-dev \
nano
RUN luarocks install http
@llamafilm
llamafilm / sunset_appreciation.gs
Created December 18, 2023 05:47
Create google calendar event for sunset appreciation each day
/**
* Creates an event in the user's default calendar.
* @see https://developers.google.com/calendar/api/v3/reference/events/insert
*/
function createEvent(start) {
const calendarId = 'primary';
// make end time 15 minutes after start
var m = 15; // minutes
var end = new Date();