Skip to content

Instantly share code, notes, and snippets.

@scbunn
scbunn / vimrc saltdev
Last active March 12, 2017 19:10
vim function to run testinfra tests in tmux pane
" Salt Development bindings
function! TestInfra (target)
let tests = a:target
execute 'silent !tmux send-keys -t 3 "python -m pytest --spec -vv -m ' . tests . ' tests/" C-m'
:redraw!
endfunction
nnoremap <Leader>t :call TestInfra("unit") <CR>
nnoremap <Leader>T :call TestInfra("integration") <CR>
@scbunn
scbunn / saltdev.zsh
Created March 12, 2017 16:53
Function to launch a new TMUX session ready for salt formula development
function saltdev () {
if [[ $TMUX ]]; then
tmux new-window -n "SaltDev $1"
tmux split-window -v
tmux split-window -v
tmux select-pane -t 0
tmux resize-pane -y 10
tmux select-pane -t 2
tmux resize-pane -y 15
tmux select-pane -t 1

Keybase proof

I hereby claim:

  • I am scbunn on github.
  • I am scbunn (https://keybase.io/scbunn) on keybase.
  • I have a public key ASD25kglUDjEbCIZ7Mawn7EvfklWv-_nIBQ41pC738yQhgo

To claim this, I am signing this object:

@scbunn
scbunn / gist:618ac5fd392ec7cd7c5a
Created August 27, 2015 19:45
string I need escaped
$template logstash, "{%timestamp:::date-rfc3339,jsonf:@timestamp%,%source:::jsonf:source_host%,\"source\":\"syslog://%fromhost-ip:::json%\",\"message\":\"%msg:::json%\",\"fields\":{%syslogfacility-text:::jsonf:facility%,%syslogseverity-text:::jsonf:severity%,%programname:::jsonf:program%,%procid:::jsonf:pid%,%timegenerated:::jsonf:timegenerated%,%timereported:::jsonf:timereported%,%syslogtag:::jsonf:syslogtag%},\"rsyslog_tags\":\"processed\"}"