Skip to content

Instantly share code, notes, and snippets.

View smarthall's full-sized avatar

Daniel Hall smarthall

View GitHub Profile
http://filamentgroup.com/lab/responsive_design_approach_for_complex_multicolumn_data_tables/
@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):
@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
/*************************************************

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:

#!/bin/bash
set -uo pipefail
version=""
CEPH_HEALTH_TIMEOUT="15m"
NODE_HEALTH_TIMEOUT="15m"
NODE_UPGRADE_TIMEOUT="15m"
@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
@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)