Skip to content

Instantly share code, notes, and snippets.

@jmatth
jmatth / venmo2ynab
Last active August 29, 2015 14:21
Convert venmo csv exports to a format YNAB 4 can read.
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
import sys
import csv
from datetime import datetime
VENMO_DATE_FORMAT = '%a %b %d %H:%M:%S %Y'
@jmatth
jmatth / merge_spell_data.py
Created March 14, 2015 06:49
Merged D&D 5e spell info from json and a csv for use with rpg-cards.
#!/usr/bin/env python
# encoding: utf-8
import sys
import csv
import json
from collections import OrderedDict
LVLS_MAP = {
'0': 'cantrip',
@jmatth
jmatth / tmux.plugin.zsh
Created July 10, 2014 03:30
Extended oh-my-zsh tmux plugin
#
# Aliases
#
alias ta='tmux attach -t'
alias ts='tmux new-session -s'
alias tl='tmux list-sessions'
# Only run if tmux is actually installed
if which tmux &> /dev/null
@jmatth
jmatth / keep_salt_keys
Last active August 29, 2015 13:58
Keep salt keys during a cobbler reinstall. Place this snippet in %pre.
#raw
# Nifty trick to restore keys without using a nochroot %post
echo "Saving salt keys..." > /dev/ttyS0
SEARCHDIR=/etc/salt/pki
WATCHDIR=/etc
TEMPDIR=salt
PATTERN=''
@jmatth
jmatth / callbacks.js
Last active August 29, 2015 13:58
js stuff
callbacks = [];
for (var i = 0; i < 2; i++) {
callbacks.push(function() {console.log(i);});
}
for (var j = 0; j < 2; j++) {
callbacks[j]();
}
@jmatth
jmatth / archstrap.sh
Last active August 29, 2015 13:57
Bootstrap script for installing archlinux stuff.
#!/bin/bash
BUILDCMD='makepkg -s -i --noconfirm --asroot'
aurbuild () {
pushd /tmp
wget https://aur.archlinux.org/packages/${1:0:2}/$1/$1.tar.gz
tar xzvf $1.tar.gz
cd $1
$BUILDCMD
popd
@jmatth
jmatth / logger.js
Created January 3, 2014 21:08
Slight tweaks to the dev logger for node so it doesn't suck with a solarized terminal.
var bytes = require('bytes');
exports.dev = function(tokens, req, res){
var status = res.statusCode
, method = req.method
, len = parseInt(res.getHeader('Content-Length'), 10)
, status_color = 32
, method_color = 33;
if (status >= 500) status_color = 31
@jmatth
jmatth / id_rsa.pub
Created February 2, 2013 20:30
One of my public keys.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkPRFelYiKXCFI3S7vO6sgTc7I02dibrX+TxcIDQeAQr3aJblnPSUFhB32UouQyungiFfm4RV7Pv5KZPHTO8qi9PssFXMOabqbsnnvAPx7i84EjdR/235n1JKenxUI9yQKqD/uv4mmtEbvtzooKIe/Fa+ZrkZ0wZNCt+gNkOmhOFj5+mmoojlkwiYPJbp5kd8mQYPhvV8fv5vB3x8ImlRNwdpGLdEW5bag/G3jEQsRSLl09YuvlYReivRbfyeoWYMgLBiAgyPUFpHSqi0ue2g3oFqsLAW2lcKH27oYvRUkAVlKBsFb2UEeB9rB/MKSnb9xV4rM/WtVQU5fchitKZFl josh@cronos
@jmatth
jmatth / RUWireless_Secure
Created January 31, 2013 21:46
RUWireless_Secure wicd template
name = RUWireless_Secure
author = Josh Matthews
version = 1
require identity *NetID password *Password ca_cert *Path_to_CA_Cert
protected password *Password
-----
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="$_ESSID"
scan_ssid="$_SCAN"
@jmatth
jmatth / eduroam
Created January 31, 2013 21:20
eduroam wicd profile from the AUR
name = eduroam
author = Ander Martinez
version = 2
require identity *Identity password *Password
protected password *Password
-----
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="$_ESSID"
scan_ssid="$_SCAN"