Skip to content

Instantly share code, notes, and snippets.

@jtai
jtai / stemcell-completion.bash
Created December 13, 2013 18:50
Bash completion for stemcell
_stemcell_role()
{
COMPREPLY=( $( compgen -W '$(ls -1 roles | sed "s/\.rb$//")' -- "$cur" ) )
}
_stemcell()
{
local cur prev words cword
COMPREPLY=()
_get_comp_words_by_ref cur prev words cword
@jtai
jtai / compile.log
Created November 5, 2014 17:51
nokogiri-1.6.4 compile log
$ cat /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.4/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/compile.log
make all-recursive
make[1]: Entering directory `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.4/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2'
Making all in include
make[2]: Entering directory `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.4/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include'
Making all in libxml
make[3]: Entering directory `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.4/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include/libxml'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.4/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include/libxml'
make[3]: Entering directory `/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/nokogiri-1.6.
@jtai
jtai / statsd_dissector.lua
Last active May 24, 2021 15:52
Wireshark dissector to decode statsd protocol
-- Usage: tshark -X lua_script:statsd_dissector.lua -r capture.pcap
-- Usage: tshark -X lua_script:statsd_dissector.lua -T fields -e statsd.metric_name -e statsd.value -e statsd.metric_type -r capture.pcap
local statsd = Proto("statsd","Statsd Protocol")
local pf_metric_name = ProtoField.new("Metric Name", "statsd.metric_name", ftypes.STRING)
local pf_value = ProtoField.new("Value", "statsd.value", ftypes.STRING)
local pf_metric_type = ProtoField.new("Metric Type", "statsd.metric_type", ftypes.STRING)
statsd.fields = { pf_metric_name, pf_value, pf_metric_type }