Skip to content

Instantly share code, notes, and snippets.

@garthk
garthk / kibana-front-end.conf
Created March 25, 2013 04:34
Lighttpd config to front-end a Kibana site.
server.modules += ( "mod_auth" )
server.modules += ( "mod_proxy" )
accesslog.filename = "/var/log/lighttpd/logs-access.log"
# server.bind = "0.0.0.0"
$SERVER["socket"] == ":80" {
$HTTP["remoteip"] =~ "^10\.10\.10\." {
# hosts in the 10.10.10.10 range can access :80/api/ subroot
$HTTP["url"] !~ "^/api/" {
@garthk
garthk / object-stream-throughput.js
Last active December 17, 2015 02:48
Attempt to benchmark Node.js object streams. See nodejs/node-v0.x-archive#5429 for discussion.
// benchmark/object-stream-throughput.js
//
// Shows performance of pipe()ing new streams in object mode
// through Transform streams.
var OBJECTS_PER_B = 12 / 1024; // I get 12 of my objects per KB of input XML
var SOURCE_WRITE_SIZE = 64*1024;
var common = require('./common');
var net = require('net');
@garthk
garthk / .gitignore
Last active December 18, 2015 03:29
rendering failure with hyperstream 0.2.0 and markdown-directory 0.1.0 under node 0.10.8..10
node_modules
@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
@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 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 / 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 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
#!/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
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/