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 / lifx.c
Created August 12, 2015 12:11
LIFX Packet Sending Example
#include "lifx.h"
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@smarthall
smarthall / gist:39d9db9392de8dbff1f8
Created October 21, 2014 05:15
Keybase Verification
### Keybase proof
I hereby claim:
* I am smarthall on github.
* I am smarthall (https://keybase.io/smarthall) on keybase.
* I have a public key whose fingerprint is A7FC 317E A9D0 5A34 45E7 2BCD 8AD9 D99E 2E0A 44E2
To claim this, I am signing this object:
@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 / 0_reuse_code.js
Created June 21, 2014 12:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
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
}