Skip to content

Instantly share code, notes, and snippets.

View hfuller's full-sized avatar
😎
Cool

Hunter Fuller hfuller

😎
Cool
View GitHub Profile
@hfuller
hfuller / ShittyStallionServerStatus.user.js
Created August 28, 2022 06:24
ShittyStallionServerStatus.user.js
// ==UserScript==
// @name ShittyStallionServerStatus
// @namespace http://github.com/hfuller
// @version 1
// @description dont even worry about it bro
// @author Hunter Fuller
// @match https://manage.buyvm.net/
// @icon https://www.google.com/s2/favicons?sz=64&domain=buyvm.net
// @grant none
// ==/UserScript==
@hfuller
hfuller / whitelist.py
Created February 24, 2021 18:52
whitelist.py - Extremely insecure tool to allow users to add themselves to the minecraft whitelist
#!/usr/bin/env python3
from flask import Flask, request
import requests
import json
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'get out'
@hfuller
hfuller / watchdog.sh
Created September 14, 2020 02:57
OpenWRT iPhone Watchdog with "ping passthrough"
#!/bin/sh
# A small script to make life with iPhone tethering less cumbersome on OpenWrt
# Petr Vyskocil, Apr 2020
# Modified by Hunter Fuller, Sep 2020
# Public domain
# After you successfully allow iPhone tethering, copy files with name like
# /var/lib/lockdown/12345678-9ABCDEF012345678.plist to /etc/lockdown/locks.
# That way, you won't have to set up trust again after router reboots.
if [ -e /etc/lockdown/locks ]; then
@hfuller
hfuller / routing filter print
Last active February 26, 2020 22:23
DN42 routing filters
0 ;;; Accept DN42 prefixes (next 2 lines)
chain=dn42-in prefix=172.20.0.0/14 prefix-length=14-32 invert-match=no action=accept set-bgp-prepend-path=""
1 chain=dn42-in prefix=fd00::/8 prefix-length=32-128 invert-match=no action=accept set-bgp-prepend-path=""
2 ;;; Keep ChaosVPN in RIB not FIB (next 2 lines)
chain=dn42-in prefix=172.31.0.0/16 prefix-length=16-32 invert-match=no action=reject set-bgp-prepend-path=""
3 chain=dn42-in prefix=10.0.0.0/8 prefix-length=8-32 invert-match=no action=reject set-bgp-prepend-path=""
@hfuller
hfuller / extralife-donation-poll.py
Created November 2, 2019 01:02
Poll for Extra Life donation record-holders and write the data to files (to use in OBS)
import urllib.request
import json
import time
team_id = 48709
url = "https://www.extra-life.org/api/teams/" + str(team_id) + "/donations"
def get_name(donation_data):
try:
return donation_data['displayName']
@hfuller
hfuller / gist:fa9dfcc14bc4a478ebf39564e398ae70
Created December 24, 2018 01:53
Using a RS232 pin as a binary sensor
PIN="Clear To Send"
while true; do
statserial /dev/ttyUSB0 -n | grep -qE "0\s+$PIN"
echo $? | sed -e 's/0/false/' -e 's/1/true/'
sleep 0.5
done
@hfuller
hfuller / gist:e6d87fb9d2c2b495fdd0185abe4acfc7
Created December 23, 2018 06:40
Make fan appear as light (Home Assistant)
light:
- platform: template
lights:
living_room_fans:
friendly_name: "Living room fans"
value_template: "{{ states('fan.living_room_fans') }}"
level_template: >
{% if (state_attr('fan.living_room_fans', 'speed') == "low" %}
85
{% elif (state_attr('fan.living_room_fans', 'speed') == "high" %}
@hfuller
hfuller / snap-to-mqtt.sh
Created November 16, 2018 04:43
Quick and dirty SNAP network to MQTT adapter
#!/bin/sh
set -e
snap -o json network listen | jq -jc ' "-t \"snap/cafe/", .src, "/", .func, "\" -m '"'"'", .args, "'"'"'\n" '
Below is an example showing an excessive amount of prepending for prefix
185.135.134.0/23 at 2017-09-18 20:20:05 UTC.
as_path_count: 501
as_path: 38726 9957 17604 7922 6830 197451 197451 197451 207239 207239
207239 207239 207239 207239 207239 207239 207239 207239 207239 207239
207239 207239 207239 207239 207239 207239 207239 207239 207239 207239
207239 207239 207239 207239 207239 207239 207239 207239 207239 207239
207239 207239 207239 207239 207239 207239 207239 207239 207239 207239
207239 207239 207239 207239 207239 207239 207239 207239 207239 207239
wget -O- "https://www.google.com/async/eob_en_v?async=v:o,tz:America%2FChicago,isf:2,_id:eob-enav,_pms:s&vet=10ahUKEwj4xpaduprQAhXDQSYKHTQ4As8Qyt4BCCYwAA..i&ei=w3IiWLjZFsODmQG08Ij4DA&yv=2" | grep -oE 'Trump has ([0-9]*)|Clinton has ([0-9]*)'