Skip to content

Instantly share code, notes, and snippets.

View smarthall's full-sized avatar

Daniel Hall smarthall

View GitHub Profile
@smarthall
smarthall / podsecurityaudit.sh
Last active April 10, 2024 02:36
This script will tell you the most restrictive policy to apply to each namespace in your cluster based on curently running pods.
#!/bin/bash
set -euo pipefail
function checknspolicy() {
ns=$1
policy=$2
out=$(kubectl label --dry-run=server --overwrite ns $ns pod-security.kubernetes.io/enforce=${policy} 2>&1 > /dev/null)
@smarthall
smarthall / amzn-txn-export-csv.user.js
Last active December 3, 2023 21:11
TamperMonker UserScript to Export Amazon Transactions
// ==UserScript==
// @name Amazon Transaction Export to CSV
// @namespace http://www.danielhall.me/
// @version 0.4
// @description Adds a link to Amazon to export transactions as a CSV for import into YNAB
// @updateURL https://gist.github.com/smarthall/5b01a396ff30921625b1ac7175842d10/raw/amzn-txn-export-csv.user.js
// @downloadURL https://gist.github.com/smarthall/5b01a396ff30921625b1ac7175842d10/raw/amzn-txn-export-csv.user.js
// @author Daniel Hall <userscripts@danielhall.me>
// @match https://www.amazon.com.au/cpe/yourpayments/transactions
// @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com.au
#!/bin/bash
set -uo pipefail
version=""
CEPH_HEALTH_TIMEOUT="15m"
NODE_HEALTH_TIMEOUT="15m"
NODE_UPGRADE_TIMEOUT="15m"

Keybase proof

I hereby claim:

  • I am smarthall on github.
  • I am smarthall (https://keybase.io/smarthall) on keybase.
  • I have a public key ASBwv-LmwQhwYFEcoZU7EJus8dpu7abfW1kyRzD3lq2j4Ao

To claim this, I am signing this object:

@smarthall
smarthall / gist:1618800
Created January 16, 2012 02:56
Hacked Tone Library example for LeoStick
// A fun sketch to demonstrate the use of the Tone library.
// To mix the output of the signals to output to a small speaker (i.e. 8 Ohms or higher),
// simply use 1K Ohm resistors from each output pin and tie them together at the speaker.
// Don't forget to connect the other side of the speaker to ground!
// You can get more RTTTL (RingTone Text Transfer Language) songs from
// http://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation
/*************************************************
@smarthall
smarthall / fetchlistfromdict.py
Last active February 16, 2018 08:43
Getting lists from dictionaries in Ansible
# In Ansible lots of things take lists (or comma seperated
# strings), however lots of things return dicts. One
# example of this is the hostvars and groups variable.
#
# groups returns a list of machines in a group, and
# hostvars is a dict containing all the hosts. So if you
# need a list of ip addresses of those hosts for the
# route53 module you cant. This filter makes this possible.
def fetchlistfromdict(d, l):
http://filamentgroup.com/lab/responsive_design_approach_for_complex_multicolumn_data_tables/
@smarthall
smarthall / gist:7867898
Created December 9, 2013 05:56
Easy function for switching/making Python Virtualenvs. Put in your ~/.bashrc
function pve {
VENVFILE="$HOME/usr/venv/$1/bin/activate"
if [ -f $VENVFILE ]; then
source $VENVFILE
else
virtualenv $HOME/usr/venv/$1
source $VENVFILE
fi
}
@smarthall
smarthall / display.sh
Last active December 18, 2015 22:59
Beaglebone to OpenSegment code for REA Hack Day 2013
#!/bin/bash
# To use:
# Plug the left display into pin 24 on connector P9
# Plug the right display into pin 21 on connector P9
if [ -f /sys/devices/bone_capemgr*/slots ]; then
# Create and setup the UART devices if needed
if [ -f /dev/ttyO1 ]; then
echo BB-UART1 >/sys/devices/bone_capemgr*/slots
@smarthall
smarthall / gist:4095271
Created November 17, 2012 11:58
Fridge Data logger
// This file has moved into the glassfridge project.
// Find it here: https://github.com/smarthall/glassfridge
#include <SoftwareSerial.h>
// software serial #1: TX = digital pin 2, RX = digital pin 3
SoftwareSerial xbee(2, 3);
unsigned long nextreport;
#define REPORTINT 10000UL