Skip to content

Instantly share code, notes, and snippets.

View paxswill's full-sized avatar

Will Ross paxswill

View GitHub Profile
@paxswill
paxswill / README.md
Last active September 10, 2021 15:48
Setting up Prometheus node_exporter on TrueNAS Core

Just a quick note as I need to do this every time there's a TrueNAS update.

  1. Enable the FreeBSD pkg repo (as root)

    sed -i '' -e 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf
  2. Disable the local package repo:

sed -i '' -e 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf

@paxswill
paxswill / README.md
Last active April 18, 2021 16:33
RUSTUP_HOME and CARGO_HOME for Visual Studio Code (and others)

The VS Code Rust plugin assumes RUSTUP_HOME and CARGO_HOME are their default values, which presented a problem for me as I had them installed under /opt. To get around this I added a quick shim script that defines those variables before execing the real executables. Then I created symlinks with the name of each tool pointing to my shim in an location in PATH. In other words, /usr/local/bin looks like this:

/usr/local/bin/
├── cargo -> rustup-shim
├── cargo-clippy -> rustup-shim
├── cargo-fmt -> rustup-shim
├── cargo-miri -> rustup-shim
├── clippy-driver -> rustup-shim
├── rls -> rustup-shim
├── rustc -> rustup-shim
@paxswill
paxswill / whitelisted_ports.md
Last active October 16, 2020 19:29
A list of ports I sometimes whitelist on my firewalls

I typically set up an untrusted network for use with IoT devices. Hosts from this network are allowed to access the outside internet, but are blocked from accessing hosts on other networks (i.e. the trusted or guest networks). Some ports are then explicitly allowed for specific services (ideally these ports are also restricted to just the hosts that need them as well).

Port Number Description
319 Precision Time Protocol, used in Airplay it seems
320 Also Precision Time Protocol
@paxswill
paxswill / autocircadian_living_room.yaml
Last active October 1, 2020 14:49
A collection of Home Assistant w/ circadian_lighting configs
# Overview:
# Define two circadian_lighting switches, one controlling just brightness and the
# other just color. Add the real lights to these two switches, then define a
# template light that basically passes through any commands to the real lights,
# but also modifies a toggle that enables/disables circadian_lighting's brightness
# control.
input_boolean:
living_room_brightness_override:
name: "Living Room Brightness Override"
@paxswill
paxswill / ipmi-updater.py
Created August 1, 2019 22:06 — forked from mcdamo/ipmi-updater.py
Supermicro IPMI certificate updater
#!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# This file is part of Supermicro IPMI certificate updater.
# Supermicro IPMI certificate updater is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
@paxswill
paxswill / pfsense_cert_to_keystore.sh
Created September 27, 2017 17:41
Simple script to copy certificates from pfSense's certificate manager (which in my case were being updated with Let's Encrypt) to a Java keystore (in my case the one being used by Ubiquiti's Unifi Controller).
#!/bin/sh
set -eu
XMLLINT=/usr/local/bin/xmllint
BASE64_DECODE='/usr/local/bin/python2 -m base64 -d'
OPENSSL="/usr/bin/openssl"
KEYTOOL="/usr/local/bin/keytool"
PFSENSE_CONF=/cf/conf/config.xml

Keybase proof

I hereby claim:

  • I am paxswill on github.
  • I am paxswill (https://keybase.io/paxswill) on keybase.
  • I have a public key ASAmfFbr6lUyRhhJGiTIBmY1X-thZ2kfURIb6fjA7u2iPQo

To claim this, I am signing this object:

import datetime
import ssl
import sys
import warnings
from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_
from requests.packages.urllib3.exceptions import (
from evesrp.killmail import ZKillmail
import gdata.spreadsheets.client
from decimal import Decimal
# patch the spreadsheet's client to use the public feeds
gdata.spreadsheets.client.PRIVATE_WORKSHEETS_URL = \
gdata.spreadsheets.client.WORKSHEETS_URL
gdata.spreadsheets.client.WORKSHEETS_URL = ('https://spreadsheets.google.com/'
'feeds/worksheets/%s/public/full')
from evesrp.killmail import CRESTMail
class SubmittedCRESTZKillmail(CRESTMail):
"""Accepts and validates CREST killmail links, but submits them to
ZKillboard and substitutes the zKB link in as the canonical link
"""
def __init__(self, url, **kwargs):
# Let CRESTMail validate the CREST link