Skip to content

Instantly share code, notes, and snippets.

View rothwerx's full-sized avatar

Jeremiah Roth rothwerx

View GitHub Profile
@rothwerx
rothwerx / gist:3392745ab7bef150a73a
Created December 9, 2014 16:48
ISC DHCP configuration that updates Windows DDNS
isc-dhcpd-4.1.1-P1
authoritative;
option domain-name "int.domain.com";
option domain-search "int.domain.com";
option domain-name-servers 10.50.10.74, 10.50.10.75, 10.50.10.20, 10.50.10.21;
ddns-updates on;
ddns-update-style interim;
update-static-leases on;
@rothwerx
rothwerx / gist:700f275d078b3483509f
Created January 4, 2015 21:05
8x8 bit matrix characters
// These were written specifically for the Adafruit 8x8 LED matrix,
// https://www.adafruit.com/product/870 but they could be used anywhere you need
// 64 bit character representations. I wasn't happy with any of the characters I
// found, so I created these. They're nice and bold, not silly line letters.
B00110000,B01111000,B11001100,B11001100,B11111100,B11001100,B11001100,B00000000,25, // A
B11111100,B01100110,B01100110,B01111100,B01100110,B01100110,B11111100,B00000000,25, // B
B00111100,B01100110,B11000000,B11000000,B11000000,B01100110,B00111100,B00000000,25, // C
B11111000,B01101100,B01100110,B01100110,B01100110,B01101100,B11111000,B00000000,25, // D
B11111110,B01100010,B01101000,B01111000,B01101000,B01100010,B11111110,B00000000,25, // E
@rothwerx
rothwerx / gist:7bdc7946402f6746468f412e678a72a7
Created June 15, 2022 04:10
Makefile: auto-incrementing
IMAGE_NAME := whatever/whatever
.PHONY: docker-build version-increment bc-check
docker-build: version-increment
DOCKER_BUILDKIT=1 docker buildx build -t $(IMAGE_NAME):v$(shell cat version.txt) .
version-increment: bc-check
bc <<< "1 + $(shell cat version.txt)" > version.txt
bc-check:
[alias]
co = checkout
st = status
ls = log --stat
cp = cherry-pick
lsshort = log --stat --abbrev-commit
lsnm = log --stat --no-merges
lslast = "!f() { \
git ls-tree --name-only HEAD $1 | while read filename; do echo \"$(git log -1 --date=iso --pretty=format:'%ad' -- $filename) $filename\"; done \
}; f"
@rothwerx
rothwerx / lighter-graphite-rpi.sh
Last active October 16, 2020 07:54
Bash: Graphite for Raspbian
#!/bin/bash
# A lighter graphite for raspberry pi/raspbian wheezy.
# For when you don't need memcache/rabbitmq/full uWSGI server/etc
# Not fully tested on a clean install. This is just what it *should* take.
# Installing supervisor because upstart conflicts with sysvinit
aptitude update && aptitude install gcc python-dev python-pip python-cairo python-pysqlite2 supervisor libffi-dev
pip install django==1.4.3

Keybase proof

I hereby claim:

  • I am rothwerx on github.
  • I am rothwerx (https://keybase.io/rothwerx) on keybase.
  • I have a public key ASBy7WRKEIU2UJRhUTIcRrHbXliZjB8p5pDriDHcUa6mywo

To claim this, I am signing this object:

@rothwerx
rothwerx / gist:5809932
Created June 18, 2013 22:11
Python: Query given WMI class on Windows host from Linux and output to easy-to-read JSON
#!/usr/bin/env python
from optparse import OptionParser
from subprocess import Popen, PIPE
# Requires wmic from Samba project, or here:
# http://dev.zenoss.org/trac/browser/tags/zenoss-3.2.1/inst/externallibs
wmic = '/vagrant/wmic'
parser = OptionParser()
set nocompatible
if has("syntax")
syntax on
endif
if has("autocmd")
" Automatically reload vimrc after saving
autocmd bufwritepost .vimrc source $MYVIMRC
" Remember last position in file
# set -g default-terminal "screen-256color"
# fix pbpaste and pbcopy commands on OSX https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
# set-option -g default-command "reattach-to-user-namespace -l $SHELL"
# Report support for 256 colors
set -g default-terminal "screen-256color"
# remap prefix to C-a
set -g prefix C-a
@rothwerx
rothwerx / gist:ebef10660b42ae4e3235f47b0236b518
Created December 4, 2017 21:55
Shell: Installing iPython in Python 2.7
# iPython 6 dropped support for Python 2.7
sudo pip install "pathlib2==2.1.0"
sudo pip install "ipython<6.0"