Skip to content

Instantly share code, notes, and snippets.

stuart-warren / tomcat7.spec
Created February 7, 2014 09:56
Tomcat 7.0.50 RPM spec file (used with OpenShift on CentOS 6.5)
View tomcat7.spec
# To Build:
# sudo yum -y install rpmdevtools && rpmdev-setuptree
# wget -O ~/rpmbuild/SPECS/tomcat7.spec
# wget -O ~/rpmbuild/SOURCES/tomcat7.init
# wget -O ~/rpmbuild/SOURCES/tomcat7.sysconfig
# wget -O ~/rpmbuild/SOURCES/tomcat7.logrotate
# wget -O ~/rpmbuild/SOURCES/apache-tomcat-7.0.50.tar.gz
# rpmbuild -bb ~/rpmbuild/SPECS/tomcat7.spec
stuart-warren / registry.service
Last active August 29, 2015 13:56
Attempt to get Docker registry to start on CoreOS
View registry.service
Description=Docker Registry
ExecStart=/usr/bin/docker run -p 5000:5000 registry
stuart@LAPTOP:~/Workspace/git/tcollector$ PYTHONPATH=`pwd` python collectors/0/
stuart-warren / docker-stdout
Created September 26, 2014 14:02
Docker log to stdout
View docker-stdout
Sometimes you want your container to log to stdout, but the process can only write to a file.
e.g. nginx
Simply create a symlink from the logfile you are writing to, to /proc/self/fd/1 or write directly to it.
user www-data;
worker_processes 4;
pid /run/;
stuart-warren /
Created September 26, 2014 11:13
Output date with bash for use with Logstash
# Wanted to output date for use with Logstash
# Using gnu date:
date -u +"%Y-%m-%dT%H:%M:%S.%3N%:z"
# Outputs: 2014-09-26T11:07:05.393+00:00
stuart-warren / Dockerfile
Created October 24, 2014 17:40
Build go apps without installing go (needs more testing)
View Dockerfile
FROM ubuntu:latest
## Run with:
# docker build -t golang .
# export GOPATH=/home/
# alias go='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} golang'
# alias gofmt='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} --entrypoint=/go/bin/gofmt golang'
# alias godoc='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} --entrypoint=/go/bin/godoc golang'
# cd /project/within/GOPATH
# go get
stuart-warren / Dockerfile
Created October 24, 2014 10:56
Build haproxy with ssl
View Dockerfile
FROM ubuntu:14.04.1
# docker build -t haproxybuild .
# git clone
# cd haproxy-1.5
# docker run -ti -v $(pwd):/src haproxybuild
RUN apt-get update && apt-get install -y build-essential libpcre3-dev libssl-dev
stuart-warren /
Last active August 29, 2015 14:09
Access recent (and tail new) logs from your Log4j Java app over a TLS connection using ncat
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
stuart-warren / mesos-on-coreos.txt
Last active August 29, 2015 14:10
CoreOS Mesos notes
View mesos-on-coreos.txt
# May need to use a better zookeeper container capable of clustering
# ?
docker run -d -p 2181:2181 -p 2888:2888 -p 3888:3888 jplock/zookeeper
# See this for other config values
docker run -d \
stuart-warren / es-thrift.go
Created December 7, 2014 22:41
Example golang code to access Elasticsearch using Thrift
View es-thrift.go
package main
* Example golang code to access Elasticsearch using Thrift
* gen-go directory generated with:
* ``thrift -gen go elasticsearch.thrift``
import (
"" // generated code