Skip to content

Instantly share code, notes, and snippets.

View micahhausler's full-sized avatar

Micah Hausler micahhausler

View GitHub Profile
@micahhausler
micahhausler / build.sh
Created May 19, 2016 19:12
Build Mesos & Marathon with SSL
#!/bin/bash
cat <<EOF > /home/core/Dockerfile
FROM debian:jessie
MAINTAINER Micah Hausler, <[email protected]>
RUN echo "deb http://httpredir.debian.org/debian jessie-backports main" | \
tee -a /etc/apt/sources.list \
&& apt-get -y update \
&& apt-get -y install \
@micahhausler
micahhausler / marathon-lb.json
Last active May 6, 2016 20:17
marathon-lb.json
{
"id": "/marathon-lb",
"cmd": null,
"cpus": 1,
"mem": 256,
"disk": 0,
"instances": 2,
"constraints": [
[
"hostname",
@micahhausler
micahhausler / cache.go
Last active December 31, 2015 19:43
Go map Data Race
package cache
import (
"sync"
)
// UserCache stores a concurrent-safe cache of authenticated users
type UserCache struct {
mu sync.RWMutex // guards Cache
Cache map[string]string
@micahhausler
micahhausler / 0_reuse_code.js
Created December 10, 2015 21:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@micahhausler
micahhausler / uwsgi.sh
Created November 16, 2015 23:13
uwsgi command parameters
newrelic-admin run-program /usr/local/bin/uwsgi \
--stats=/path/to/socket/socket.sock \
--close-on-exec \
--enable-threads \
--master \
--max-requests=100 \
--module=project.wsgi \
--harakiri=60 \
--env=DJANGO_SETTINGS_MODULE=project.settings \
--py-tracebacker=/path/to/traceback/socket \
@micahhausler
micahhausler / master.sh
Last active January 23, 2016 08:42
Docker Orca (0.4.0) Quickstart instructions
#!/bin/bash
#
# Requires docker-toolbox >= 1.9.0d
# https://github.com/docker/toolbox/releases
MACHINE_NAME="orcamaster"
docker-machine create -d virtualbox $MACHINE_NAME
eval $(docker-machine env $MACHINE_NAME)
@micahhausler
micahhausler / keybase.md
Created October 26, 2015 20:17
keybase.md

Keybase proof

I hereby claim:

  • I am micahhausler on github.
  • I am micahhausler (https://keybase.io/micahhausler) on keybase.
  • I have a public key whose fingerprint is 7151 8EA6 23DA 1ABE 1D54 F693 D5EC 627D 9DCE 5FEB

To claim this, I am signing this object:

@micahhausler
micahhausler / .bashrc
Created October 1, 2015 16:25
docker-clean
docker-clean(){
EXITED=$(docker ps -f status=exited -q)
if [ -n "$EXITED" ]; then
docker rm $EXITED
fi
DANGLING=$(docker images -f dangling=true -q)
if [ -n "$DANGLING" ]; then
docker rmi $DANGLING
fi
}
@micahhausler
micahhausler / version.sh
Last active September 11, 2015 17:44
Docker 1.8.2 Go version
$ brew update && brew install docker docker-machine
...
$ docker-machine --version
docker-machine version 0.4.1 (HEAD)
$ docker-machine upgrade dev
Stopping machine to do the upgrade...
Upgrading machine dev...
Downloading https://github.com/boot2docker/boot2docker/releases/download/v1.8.2/boot2docker.iso to /Users/micahhausler/.docker/machine/cache/boot2docker.iso...
Starting machine back up...
@micahhausler
micahhausler / server.conf
Created July 9, 2015 15:35
Graylog Server Default Config 1.1.4
# If you are running more than one instances of graylog2-server you have to select one of these
# instances as master. The master will perform some periodical tasks that non-masters won't perform.
is_master = true
# The auto-generated node ID will be stored in this file and read after restarts. It is a good idea
# to use an absolute file path here if you are starting graylog2-server from init scripts or similar.
node_id_file = /etc/graylog/server/node-id
# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
# Generate one by using for example: pwgen -N 1 -s 96