Skip to content

Instantly share code, notes, and snippets.

Aaron Feng aaronfeng

Block or report user

Report or block aaronfeng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aaronfeng / ADD
Last active Aug 29, 2015
Examples of Docker ADD
View ADD
## ├── Dockerfile
## ├── backend
## │   ├── service
## │   └── service.config
## ├── backend.tar.gz
## └── frontend
## ├── app
## └── app.config
FROM debian:8.0
aaronfeng /
Created Apr 3, 2015
Mount unix socket from boot2docker to host
# Requires socat on host and boot2docker
# OSX - brew install socat
# boot2docker - tce-load -wi socat
# change your ssh key path
sudo socat "UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork" EXEC:'ssh -i /Users/aaron.feng/.ssh/id_boot2docker docker@ socat STDIO UNIX-CONNECT\:/var/run/docker.sock'
# own the unix socket on host
sudo chown aaron.feng /var/run/docker.sock
View gist:a8736ad319e2050efbb4
POST /_bulk HTTP/1.1
User-Agent: Go 1.1 package http
Content-Length: 97
Accept: application/json
Accept-Encoding: gzip
HTTP/1.1 400 Bad Request
aaronfeng / foo-json.log
Created Mar 31, 2015
heka foo log file
View foo-json.log
{"log": "awesome1"}
{"log": "awesome2"}
{"log": "awesome3"}
{"log": "awesome4"}
{"log": "awesome5"}
{"log": "awesome6"}
{"log": "awesome7"}
{"log": "awesome8"}
{"log": "awesome9"}
{"log": "awesome10"}
View foo_decoder.lua
local cjson = require("cjson")
function process_message()
local payload_str = read_message("Payload")
local ok, payload = pcall(cjson.decode, payload_str)
if not ok then
return -1
View foo-hekad.toml
type = "SandboxDecoder"
filename = "/etc/heka/foo_decoder.lua"
type = "LogstreamerInput"
log_directory = "/var/log"
file_match = 'foo/(?P<Logger>[0-9a-z]+)-json\.log'
priority = ["^Logger"]
differentiator = ["Logger"]
aaronfeng / gist:9489158e8e06d751e1b1
Created Mar 30, 2015
heka es output checkpoint.txt
View gist:9489158e8e06d751e1b1
aaronfeng / gist:d27c1099bba1821bb590
Last active Aug 29, 2015
heka docker base image log
View gist:d27c1099bba1821bb590
[ 20%] Completed 'lua-5_1_5'
[ 20%] Built target lua-5_1_5
Makefile:147: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/lua_sandbox.dir/build.make:110: recipe for target 'ep_base/Stamp/lua_sandbox/lua_sandbox-build' failed
make[2]: *** [ep_base/Stamp/lua_sandbox/lua_sandbox-build] Error 2
CMakeFiles/Makefile2:1707: recipe for target 'CMakeFiles/lua_sandbox.dir/all' failed
make[1]: *** [CMakeFiles/lua_sandbox.dir/all] Error 2
Makefile:147: recipe for target 'all' failed
make: *** [all] Error 2
View gist:965e3f267934634bc8d9
name = Aaron Feng
email =
tool = vimdiff
ui = auto
status = auto
aaronfeng / docker-machine.zsh
Created Feb 4, 2015
zsh helper to work with docker-machine
View docker-machine.zsh
docker-machine-wrapper() {
docker $(docker-machine config "$CONFIG_NAME") $@
alias dm="docker-machine-wrapper"
You can’t perform that action at this time.