Skip to content

Instantly share code, notes, and snippets.

Working from home

Mike Fiedler miketheman

Working from home
View GitHub Profile
miketheman /
Created Jul 22, 2013
Adding nodes to a ZooKeeper ensemble

Adding 2 nodes to an existing 3-node ZooKeeper ensemble without losing the Quorum

Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.

In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.

YMMV. Caveat usufructuarius.

Step 1: Have a healthy 3-node ensemble

miketheman /
Created May 7, 2012
AWS EC2 Unused Security Group cleanup
#!/usr/bin/env python
import sys
import boto
import pprint
del_flag = ''
if len(sys.argv) > 1:
del_flag = sys.argv[1]
miketheman /
Last active Mar 20, 2021 — forked from benkehoe/
Single sourcing a python package version using importlib.metadata.version()
# importlib.metadata is present in Python 3.8 and later
import importlib.metadata as importlib_metadata
except ImportError:
# use the shim package importlib-metadata pre-3.8
import importlib_metadata as importlib_metadata
__version__ = importlib_metadata.version(__package__ or __name__)
except importlib_metadata.PackageNotFoundError:
miketheman / Makefile
Created Sep 1, 2016
Django + docker-compose Makefile
View Makefile
CURRENT_DIRECTORY := $(shell pwd)
TESTFLAGS = --with-timer --timer-top-n 10 --keepdb
@echo "Docker Compose Help"
@echo "-----------------------"
@echo ""
@echo "Run tests to ensure current state is good:"
View hypermail.rb
class Hypermail < Formula
desc "Hypermail is a free (GPL) program to convert email from Unix mbox format to html."
homepage ""
url ""
sha256 "f97995b9bb1ece888968467cdad05e3daa7662ff3e3a5739e378b4f3adeb26c6"
license "GPL-2.0"
depends_on "bison" => :build
depends_on "gcc"
View main.dart
flip(inputInt) {
return inputInt = 1 - inputInt;
void main() {
miketheman /
Created Feb 14, 2020
A simple script to enable GitHub's Data Services & Vulnerability Scanning on a given Organization's Repositories
from github import Github
org = gh.get_organization('SET_ORG_NAME_HERE')
repos = org.get_repos()
for repo in repos:
if repo.archived:
miketheman /
Last active Jun 4, 2020
Mike's Super Janky Manual GitHub Vuln Alert Query

How To


  • GitHub account with admin-level rights to repos, possibly even org-level admin.
  • Command Line familiarity
  • jq tool

Note: Commands have been written assuming a macOS machine, they may work on other platforms, but I haven't tested those.

miketheman / installer.log
Last active Feb 22, 2020
chefdk-0.7.0-rc.2-1.dmg failure log
View installer.log
Jul 11 10:16:27 wing Installer[99257]: LSExceptions [0x7f857ac0cbb0] loaded
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Install PROJECT:Install-1000
Jul 11 10:16:27 wing Installer[99257]: @(#)PROGRAM:Installer PROJECT:Installer-852
Jul 11 10:16:27 wing Installer[99257]: Hardware: MacBookAir6,1 @ 1.70 GHz (x 4), 8192 MB RAM
Jul 11 10:16:27 wing Installer[99257]: Running OS Build: Mac OS X 10.11 (15A215h)
Jul 11 10:16:27 wing Installer[99257]: Env: __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
Jul 11 10:16:27 wing Installer[99257]: Env: TMPDIR=/var/folders/78/3jyqdny925n348fpr6wh23bc0000gn/T/
Jul 11 10:16:27 wing Installer[99257]: Env: HOME=/Users/miketheman
Jul 11 10:16:27 wing Installer[99257]: Env: SHELL=/bin/bash
Jul 11 10:16:27 wing Installer[99257]: Env: SSH_AUTH_SOCK=/private/tmp/
miketheman /
Created Dec 31, 2015
Datadog Agent Linux Entropy Available
from checks import AgentCheck
class LinuxEntropyCheck(AgentCheck):
def check(self, instance):
with open('/proc/sys/kernel/random/entropy_avail', 'r') as procfile:
data =
self.gauge('system.kernel.entropy_available', int(data))