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
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
aaronfeng / mount_socket_to_host.sh
Created Apr 3, 2015
Mount unix socket from boot2docker to host
View mount_socket_to_host.sh
# 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@192.168.59.103 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
Host: 172.17.0.36:9200
User-Agent: Go 1.1 package http
Content-Length: 97
Accept: application/json
Accept-Encoding: gzip
{"index":{"_index":"2015.03.31","_type":"7d98073d388e"}}
{"bar":"boo","log":"awesome"}
HTTP/1.1 400 Bad Request
@aaronfeng
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
end
View foo-hekad.toml
[foo_decoder]
type = "SandboxDecoder"
filename = "/etc/heka/foo_decoder.lua"
[Logs]
type = "LogstreamerInput"
log_directory = "/var/log"
file_match = 'foo/(?P<Logger>[0-9a-z]+)-json\.log'
priority = ["^Logger"]
differentiator = ["Logger"]
@aaronfeng
aaronfeng / gist:9489158e8e06d751e1b1
Created Mar 30, 2015
heka es output checkpoint.txt
View gist:9489158e8e06d751e1b1
„I{"index":{"_index":"31559528a22df380c968a77866c9ba4fa30ded7a7bae0ae52a1c9ee34b266c80-2015.03.30","_type":"logfile-31559528a22d"}}
nil{"index":{"_index":"31559528a22df380c968a77866c9ba4fa30ded7a7bae0ae52a1c9ee34b266c80-2015.03.30","_type":"logfile-31559528a22d"}}
nil{"index":{"_index":"31559528a22df380c968a77866c9ba4fa30ded7a7bae0ae52a1c9ee34b266c80-2015.03.30","_type":"logfile-31559528a22d"}}
nil{"index":{"_index":"31559528a22df380c968a77866c9ba4fa30ded7a7bae0ae52a1c9ee34b266c80-2015.03.30","_type":"logfile-31559528a22d"}}
nil{"index":{"_index":"31559528a22df380c968a77866c9ba4fa30ded7a7bae0ae52a1c9ee34b266c80-2015.03.30","_type":"logfile-31559528a22d"}}
@aaronfeng
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
[user]
name = Aaron Feng
email = aaron@forty9ten.com
[diff]
tool = vimdiff
[color]
ui = auto
status = auto
@aaronfeng
aaronfeng / docker-machine.zsh
Created Feb 4, 2015
zsh helper to work with docker-machine
View docker-machine.zsh
docker-machine-wrapper() {
CONFIG_NAME="$1"
shift
docker $(docker-machine config "$CONFIG_NAME") $@
}
alias dm="docker-machine-wrapper"
You can’t perform that action at this time.