I hereby claim:
- I am jamesmcdonald on github.
- I am jamesmcdonald (https://keybase.io/jamesmcdonald) on keybase.
- I have a public key ASCKs__uF7nQGcY936n3Vctl38hk13tHmwdovM9vabhUVgo
To claim this, I am signing this object:
- name: my play that does stuff | |
hosts: all | |
vars_prompt: | |
username: "enter a username" | |
or | |
vars_prompt: | |
- username: "enter a username" | |
default: someone |
#!/usr/bin/perl -w | |
# ynabimport.pl | |
# James McDonald <james@jamesmcdonald.com> | |
# Cook data from skandiabanken for import into YNAB. Entirely based on | |
# guesswork and reverse-engineering from failures, so ymmv. | |
# To use this, follow these steps: |
#!/bin/bash | |
# post-receive hook to trigger r10k over ssh on updates to puppet control repo | |
# Set SSHTARGET in ~/.config/puppet-update to eg: | |
# root@puppet.example.com | |
# The ssh target should have an authorized_key with eg: | |
# command="/usr/local/sbin/puppet-update.sh" | |
# That script need simply call: | |
# /path/to/r10k deploy environment $SSH_ORIGINAL_COMMAND |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
/* 101 bytes - the 102nd is the \n */ | |
#define BYTES "This line of text has been engineered by " \ | |
"only the very finest, wisest squirrels to contain 102 bytes." | |
void usage(char *progname) | |
{ |
// Overcomplicated "healthy" metric generator | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"net/http" | |
"os" | |
"strconv" | |
"time" |
#!/usr/bin/env python | |
""" | |
Wrap i3status to add things to your i3bar | |
You need to have dbus-python installed. | |
Right now this will prepend | |
* Spotify status that looks like "Artist > Song". | |
The > will be replaced with an _ if Spotify is paused. |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
"""Read a stream of one-per-line json events and print them in a more human-readable format""" | |
import json | |
import sys | |
import string | |
import argparse | |
class SkipFormatter(string.Formatter): | |
"""A string.Formatter that returns '-' for missing fields""" |
# This should go in /etc/udev/rules.d | |
KERNEL=="card0", SUBSYSTEM=="drm", ACTION=="change", RUN+="/usr/local/bin/monitorswitch.sh" |
function kn() { | |
local context=$1 | |
shift | |
local namespace=$1 | |
shift | |
if [[ -z "$context" ]]; then | |
echo "usage: kn <context> [namespace]" >&2 | |
return 1 | |
fi | |
if ! kubectl config get-contexts $context >/dev/null 2>&1; then |