Skip to content

Instantly share code, notes, and snippets.

@dylanmei
dylanmei / gist:50ef2f5e282287104986
Created April 5, 2015 05:45
Problem with logspout custom build
logspout-kafka|master ⇒ docker build -t gettyimages/logspout -f Dockerfile.example .
Sending build context to Docker daemon 71.68 kB
Sending build context to Docker daemon
Step 0 : FROM gliderlabs/logspout:master
# Executing 2 build triggers
Trigger 0, COPY ./modules.go /src/modules.go
Step 0 : COPY ./modules.go /src/modules.go
---> Using cache
Trigger 1, RUN cd /src && ./build.sh "$(cat VERSION)-custom"
Step 0 : RUN cd /src && ./build.sh "$(cat VERSION)-custom"
@dylanmei
dylanmei / gist:3316360a4e550c8e2ab7
Created March 15, 2015 22:39
packer / winrm / powershell elevated command
{
"builders": [{
"type": "virtualbox-windows-ovf",
"source_path": "ovf/windows_2008_r2.bare.ova",
"headless": false,
"boot_wait": "1m",
"winrm_username": "packer",
"winrm_password": "packer",
"winrm_wait_timeout": "10m",
"guest_additions_mode": "disable",
@dylanmei
dylanmei / winrm.config
Created January 3, 2015 18:08
Win-2012 R2 winrm config
Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 1800000
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
<powershell>
write-output "Running User Data Script"
write-host "(host) Running User Data Script"
# Set TZ
#cmd.exe /c tzutil /s \"Pacific Standard Time\"
cmd.exe /c net user /add packer packer
cmd.exe /c net localgroup administrators packer /add
cmd.exe /c wmic useraccount where "name='packer'" set PasswordExpires=FALSE
@dylanmei
dylanmei / Haproxy logstash to StatsD
Last active July 25, 2017 21:27
Haproxy logstash to StatsD
input {
tcp {
port => 5140
type => "haproxy"
}
}
filter {
grok {
# break the input "message" into two parts: a priority structure,
@dylanmei
dylanmei / coalescing
Last active August 29, 2015 14:02
Go - coalescing messages
http://play.golang.org/p/ORXhGHM5xV
package main
import "fmt"
import "time"
type msg string
func main() {
@dylanmei
dylanmei / vimrc
Created April 1, 2014 22:32
vimrc
execute pathogen#infect()
Helptags
set background=dark
set encoding=utf-8
set backupdir=~/tmp
" http://vim.wikia.com/wiki/Mac_OS_X_clipboard_sharing
set clipboard=unnamed
@dylanmei
dylanmei / csv-to-json
Created March 25, 2014 13:50
CSV to JSON in Groovy
import groovy.json.*
if (args.size() == 0) {
println("missing argument")
System.exit(1)
}
def f = new File(args[0])
if (!f.exists()) {
println("file doesn't exist")
@dylanmei
dylanmei / gist:7914583
Created December 11, 2013 17:18
packer-windows - sshd_config - circa november
# $OpenBSD: sshd_config,v 1.89 2013/02/06 00:20:42 dtucker Exp
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/bin:/usr/sbin:/sbin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
@dylanmei
dylanmei / WinRM in Go
Created November 17, 2013 17:15
WinRM's equivalent of Hello World in Go, from the XML sample in on the front page of MSDN's WS-Management documentation.
package main
import (
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/http"
)