Skip to content

Instantly share code, notes, and snippets.

node_modules
*.zip
@garthk
garthk / keybase.md
Created March 8, 2014 21:20
Claiming my part of the namespace.

Keybase proof

I hereby claim:

  • I am garthk on github.
  • I am garthk (https://keybase.io/garthk) on keybase.
  • I have a public key whose fingerprint is ACA0 364F 77B9 53D7 3D39 5F3B 3DE9 A3FD 46DE AB61

To claim this, I am signing this object:

var stream = require('stream');
function streamify(text) {
var s = new stream.Readable();
s.push(text);
s.push(null);
return s;
}
streamify('foo\n').pipe(process.stdout);
FROM stackbrew/ubuntu:precise
MAINTAINER Garth Kidd <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
RUN dpkg-divert --local --rename /usr/bin/ischroot && ln -sf /bin/true /usr/bin/ischroot
RUN apt-get update
RUN apt-get install -y openjdk-6-jdk curl
RUN cd /opt && curl -OL https://download.elasticsearch.org/logstash/logstash/logstash-1.3.3-flatjar.jar
ADD logstash-noconfig /usr/local/bin/
#!/bin/bash
set -e # exit on errors
if [ $(uname) = Darwin ]; then
cat <<EOF0
This script cannot work on OS X because your OS X paths don't exist in the
'boot2docker' virtual machine.
EOF0
exit 1
fi
@garthk
garthk / Dockerfile
Created January 22, 2014 09:20
Nesting Docker in Docker didn't work as expected.
# Matryoshka Docker
FROM stackbrew/ubuntu:12.04
MAINTAINER Garth Kidd <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A88D21E9
RUN echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list
RUN echo 'deb http://security.ubuntu.com/ubuntu precise-security main restricted' >> /etc/apt/sources.list
RUN apt-get update && apt-get upgrade -y && apt-get install -y apt-transport-https curl
@garthk
garthk / Dockerfile
Last active January 4, 2016 02:19
Do docker's environment variables for container linking make as much sense as we'd like?
# Politely listens on the nominated TCP ports.
FROM stackbrew/ubuntu
ADD multi-listen /usr/local/bin/multi-listen
RUN chmod a+x /usr/local/bin/multi-listen
ENTRYPOINT ["/usr/local/bin/multi-listen"]
CMD ["80"]
@garthk
garthk / Dockerfile
Created January 22, 2014 02:19
Dockerfile for building OpenTSDB 2.0.0 from git
# OpenTSDB build container
# Usage:
# docker build -t=opentsdb-build .
# docker run -name=opentsdb-building opentsdb-build ./build.sh debian
# docker commit opentsdb-building opentsdb-rebuild
# docker run -rm -v=$(pwd):/tmp/results opentsdb-rebuild cp /opt/opentsdb/build/opentsdb-2.0.0/opentsdb-2.0.0_all.deb /tmp/results
FROM stackbrew/ubuntu:precise
MAINTAINER Garth Kidd <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_US.UTF-8
@garthk
garthk / hapi-restify.js
Last active January 3, 2016 23:09
hapi plugin to add routes directly from the composer manifest
'use strict';
exports.register = function (plugin, options, next) {
function addRoutes(server) {
var serverPluginSettings = server.settings.plugins || {},
serverSpecificSettings = serverPluginSettings.routify || {},
routes = serverSpecificSettings.routes || options.routes;
if (routes) {
server.route(routes);
@garthk
garthk / Dockerfile
Created January 19, 2014 23:44
Avoiding Java certificate problems with `stackbrew/ubuntu` under Docker
FROM stackbrew/ubuntu:precise
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8