Skip to content

Instantly share code, notes, and snippets.

@ekristen
ekristen / gist:8696240
Created January 29, 2014 20:25
useful docker cleanup commands
docker ps -a | grep "Exit" | awk '{print $1}' | xargs -I{} docker stop {}
docker ps -a | grep "Exit" | awk '{print $1}' | xargs -I{} docker kill {}
docker ps -a | grep "Exit" | awk '{print $1}' | xargs -I{} docker rm {}
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi
encryption:
password: some_random_long_string
dev_name: /dev/sda1
vg_name: data
mountpoint: data
@ekristen
ekristen / instanceluks.pillar
Last active August 29, 2015 14:02
Example State and Pillar Data for Automatic Encryption of EC2 Instance (Ephemeral) Storage for SaltStack
instanceluks:
password: global_password
passwords:
data0: password1
data1: password2
data2: password3
#!/bin/bash
#
# esdiagdump
#
# Usage: esdiagdump [-h <hostname/IP>:<port>] [-o <output filename>]
# hostname defaults to localhost
# output file defaults to current directory/esdiagdump.out.<timestamp>
#
# TODO:
# - Support for collecting marvel indices for export
sudo pip install pygit2==0.20.3
Downloading/unpacking pygit2==0.20.3
Downloading pygit2-0.20.3.tar.gz (146kB): 146kB downloaded
Running setup.py (path:/tmp/pip_build_root/pygit2/setup.py) egg_info for package pygit2
Installing collected packages: pygit2
Running setup.py install for pygit2
building '_pygit2' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -Iinclude -I/usr/include/python2.7 -c src/tree.c -o build/temp.linux-x86_64-2.7/src/tree.o
In file included from src/utils.h:34:0,
@ekristen
ekristen / blackbox.patch
Last active August 29, 2015 14:15
Patch to make blackbox installable via homebrew
diff --git a/bin/blackbox_addadmin b/bin/blackbox_addadmin
index 782d815..a26472f 100755
--- a/bin/blackbox_addadmin
+++ b/bin/blackbox_addadmin
@@ -9,7 +9,7 @@
#
set -e
-blackbox_home=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+blackbox_home=$(brew --prefix)/Cellar/blackbox/1.20150203/include
@ekristen
ekristen / Dockerfile
Created December 8, 2013 17:17
Testing overwriting resolv.conf
FROM ubuntu:12.04
ADD resolv.conf /etc/resolv.conf
ENTRYPOINT ["/bin/bash"]
@ekristen
ekristen / generate_ec_keypair.js
Created March 29, 2016 13:50
Generate a secp521r1 EC keypair
var child_process = require('child_process')
function generateKeyPair(callback) {
var keypair = {
privKey: '',
pubKey: ''
}
var priv_openssl = child_process.spawn('openssl', ['ecparam', '-name', 'secp521r1', '-genkey', '-noout'])
FROM ubuntu
RUN apt-get update
RUN apt-get install -y wget sudo supervisor
RUN apt-get install -y python-software-properties
RUN apt-get update
RUN apt-get install -y openssh-server
EXPOSE 4505 4506
@ekristen
ekristen / Dockerfile
Last active August 29, 2016 22:35
Example of how to *not* construct your RUN instructions (for Medium)
FROM ubuntu
RUN apt-get update
RUN apt-get install -y wget sudo supervisor
RUN apt-get install -y python-software-properties
RUN apt-get update
RUN apt-get install -y openssh-server
EXPOSE 4505 4506