Skip to content

Instantly share code, notes, and snippets.

View joemiller's full-sized avatar

joe miller joemiller

View GitHub Profile
@joemiller
joemiller / remove-slice.sh
Created April 22, 2016 13:57
fuck you systemd
sed --follow-symlinks -i -e '/Slice=/d' /etc/systemd/system/mysql*service /etc/systemd/system/replica*service /etc/systemd/system/pt*service
## maybe just drop these altogether?
if "audit" in [tags] and [LONG_TERM_STORAGE] != "1" {
drop { }
}
## drop solr logs (this doesn't catch all solr logs but should get most)
if [unit] == "tomcat.service" {
if [message] =~ /org.apache.solr.core.SolrCore/ { drop { } }
if [message] =~ /webapp=[\/]+solr/ { drop { } }
}
@joemiller
joemiller / k8s-secrets.rb
Last active April 12, 2016 03:22
helper for making kubernetes secrets yaml files. Supports key/val strings and file contents
#!/usr/bin/env ruby
#
# helper for making kubernetes secrets yaml files. Supports key/val strings and file contents
#
# Example:
# --------
#
# $ echo 'top secret stuff right here' >secret.txt
# $ ./k8s-secrets.rb secret-volume @secret.txt foo=bar biz=bop
#
@joemiller
joemiller / he-dns-update.sh
Last active September 4, 2024 18:46
script for updating dynamic DNS records on he.net (hurricane electric)
#!/bin/bash
#
# Script for updating DNS records on Hurricane Electirc's DNS system (https://dns.he.net).
#
# The record will be updated with the IP address that originates the request.
#
# Usage
# -----
#
# Create config file `/etc/he-dns-update.conf`:

Keybase proof

I hereby claim:

  • I am joemiller on github.
  • I am joemiller (https://keybase.io/joemiller) on keybase.
  • I have a public key ASB2rUAf7TBITz--9TUrhgfkvA_rfCn7IalrXwMvs5KtSwo

To claim this, I am signing this object:

macbook-joe git/coreos/coreos-xhyve ‹master› » docker-machine create -d xhyve xhyve-test
Running pre-create checks...
Creating machine...
(xhyve-test) Copying /Users/joe/.docker/machine/cache/boot2docker.iso to /Users/joe/.docker/machine/machines/xhyve-test/boot2docker.iso...
(xhyve-test) Creating VM...
(xhyve-test) Extracting vmlinuz64 and initrd.img from boot2docker.iso...
(xhyve-test) /dev/disk3 /Users/joe/.docker/machine/machines/xhyve-test/b2d-image
(xhyve-test) "disk3" unmounted.
(xhyve-test) "disk3" ejected.
(xhyve-test) Generating 20000MB disk image...
@joemiller
joemiller / fix-systemd-symlinks.sh
Last active January 26, 2016 02:50
search for systemd units in .wants or .requires dirs that are regular files and convert them back to symlinks
@joemiller
joemiller / mysql-blob-test.sh
Last active January 20, 2016 19:40
test writing different sized blobs to a mysql instance
#!/bin/sh
set -ex
mysql_cmd="btool mysql"
tmpdir=$(mktemp -d /tmp/mysql-blob-test.XXXXXXXX)
chmod 755 "$tmpdir"
function cleanup {
@joemiller
joemiller / mk-test-certs.sh
Created December 29, 2015 22:32
helper script for making a new CA and signing client (leaf) certs, including making java keystore (JKS) files. useful in creating test fixtures
#!/bin/sh
# helper script for making a new CA and signing client (leaf) certs, including making java keystore (JKS) files. useful in creating test fixtures
#
# Example:
# ./mk-test-certs.sh
# ==> Creating new CA: certs/ca.key, certs/ca.crt
# Generating a 2048 bit RSA private key
# ....................................................+++
# ...............................+++
# writing new private key to 'certs/ca.key'
@joemiller
joemiller / backup.sh
Created December 23, 2015 22:21
backup / restore docker images
#!/bin/sh
images=$(docker images | grep -v REPOSITORY | awk '{print $1}')
for i in $images; do
tarname=$(echo $i | sed -e 's@/@_@g').tar
docker save -o $tarname $i
done