Skip to content

Instantly share code, notes, and snippets.

View chriswgerber's full-sized avatar

Chris W. Gerber chriswgerber

  • Minnesota
View GitHub Profile
@chriswgerber
chriswgerber / git-config
Created April 27, 2014 20:25
Git Conf - Add to git deployments with memory limits.
## Lower memory option for commiting. Allows me to workaround "Out of memory" issues on commit and push.
[pack]
threads = 1
@chriswgerber
chriswgerber / functions-region.php
Created August 26, 2014 17:03
Functions for adding custom taxonomy into The Events Calendar
<?php
/**
* Custom Region Taxonomy
*/
if ( ! function_exists( 'epg_event_regions' ) ) {
// Register Custom Taxonomy
function epg_event_regions() {
$labels = array(
@chriswgerber
chriswgerber / keybase.md
Last active October 4, 2017 20:10
keybase

Keybase proof

I hereby claim:

  • I am thatgerber on github.
  • I am chriswgerber (https://keybase.io/chriswgerber) on keybase.
  • I have a public key ASBt9vcQq2pSlnBqpCokb9mUxOcYtEQgmBDjkms5aNHyugo

To claim this, I am signing this object:

@chriswgerber
chriswgerber / config
Last active February 13, 2018 13:36
SSH Config
Host bitbucket.org
ControlMaster no
Host *
Compression yes
ControlMaster auto
ControlPath /tmp/ssh-conn-%r@%h:%p.con
ControlPersist 30
ForwardAgent yes
ServerAliveInterval 100
IdentityFile ~/.ssh/id_rsa
@chriswgerber
chriswgerber / Makefile
Last active August 10, 2017 18:10
Terraform Makefile
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS = -e
CLEAN_TARGETS =
TF = terraform
TF_DIR = .terraform
STATE_FILE = ${TF_DIR}/terraform.tfstate
@chriswgerber
chriswgerber / install-homebrew.sh
Created September 6, 2017 15:12
Single-User Homebrew Install
export HOMEBREW_INSTALL_BADGE="🦍"
export HOMEBREW_PREFIX="$HOME"
export HOMEBREW_REPOSITORY="$HOME/Library/Homebrew"
test -d $HOMEBREW_REPOSITORY || git clone git@github.com:Homebrew/brew.git $HOMEBREW_REPOSITORY
# install homebrew for single user
# add the new homebrew bin directory to the path
if [ -z `echo $PATH | grep "$HOMEBREW_REPOSITORY"` ]; then
if [[ "$SHELL" == *"bash"* ]]; then
@chriswgerber
chriswgerber / troposphere-errors-example.py
Created May 14, 2018 17:38
Python file demonstrating errors with Troposphere Template Generator
#!/usr/bin/env python3
import json
from troposphere.template_generator import TemplateGenerator
JSON_DATA = """\
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Example nested outputs template",
@chriswgerber
chriswgerber / pushbullet_send.py
Created May 30, 2018 21:06
Send notification with Pushbullet
#!/usr/bin/env python3
import json
import logging
import os
import sys
import urllib.error
import urllib.parse
import urllib.request
[...]
return TemplateGenerator(yaml_template)
File "[...]/lib/python3.6/site-packages/troposphere/template_generator.py", line 63, in __init__
self._get_resource_type_cls(v)
File "[...]/lib/python3.6/site-packages/troposphere/template_generator.py", line 162, in _convert_definition
return self._create_instance(expected_type, args, ref)
File "[...]/lib/python3.6/site-packages/troposphere/template_generator.py", line 265, in _create_instance
expected_type, kwargs[prop_name], prop_name)
File "[...]/lib/python3.6/site-packages/troposphere/template_generator.py", line 206, in _create_instance
return [self._create_instance(cls[0], v) for v in args]
@chriswgerber
chriswgerber / pi_monitor
Last active September 1, 2023 19:50
Pi Monitor
"""Forked from https://raw.githubusercontent.com/Bunn/pi_monitor/master/pi-monitor.py"""
from dataclasses import dataclass, asdict
from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import re
import sys
import subprocess