Skip to content

Instantly share code, notes, and snippets.

@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 / 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,
<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 / 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
@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 / 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"

Keybase proof

I hereby claim:

  • I am dylanmei on github.
  • I am dylanmei (https://keybase.io/dylanmei) on keybase.
  • I have a public key whose fingerprint is B068 6A5C 1FBE 9127 25A4 DF31 7D8E 57A7 3DDA 9FC0

To claim this, I am signing this object:

@dylanmei
dylanmei / gist:1c94c11276ad53cd856a
Created May 16, 2015 18:45
Watch alias for OSX
watch_for_osx() {
while :
output=`eval "$@"`
do clear;
echo $output
sleep 5
done
}
alias watch=watch_for_osx
@dylanmei
dylanmei / gist:1759c5b47a5e7a0b8681
Last active December 21, 2015 22:27
eclim install
# http://eclim.org/install.html
# http://qiita.com/youhei/items/09756fba4f969b075486
# http://wiki.eclipse.org/Eclipse/Installation#Download_Eclipse
brew install caskroom/cask/brew-cask
#brew cask install java
brew cask install eclipse-java
@dylanmei
dylanmei / rsc-ss-upload.go
Last active August 29, 2015 14:25
RSC SS Upload Example
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/rightscale/rsc/rsapi"
"github.com/rightscale/rsc/ss/ssd"
)