Skip to content

Instantly share code, notes, and snippets.

@atripes
atripes / nginx.conf
Last active February 28, 2018 16:32
nginx logging depending on upstream server
upstream {
server 10.0.0.200;
server 10.0.0.300;
}
map $upstream_addr $should_log {
"10.0.0.200:80" 1;
default 0;
}
@atripes
atripes / .vimrc
Created May 19, 2017 16:35
URL encode/decode vim selection.
" URL encode/decode selection
vnoremap <leader>en :!python -c 'import sys,urllib;print urllib.quote(sys.stdin.read().strip())'<cr>
vnoremap <leader>de :!python -c 'import sys,urllib;print urllib.unquote(sys.stdin.read().strip())'<cr>