Some scripts I use, most of them have --help
if you run them for more options.
For now, it's a gem, but unpublished. To build and install locally:
- Clone the repo
gem build margs-util.gemspec
gem install margs-util-*.gem
Extract input (usually from a log file) into a CSV-like output. Supports grabbing fields by index, or by key in the form key=value
. Great for parsing logs!
$ m-extract --index 1 --key key <<EOS
col0 col1 key=yay bar=nope
woo0 woo1 key=woo
EOS
index_1,key
col1,yay
woo1,woo
Overlays text at the bottom of a GIF. convert
is just too much to remember on its own, so I wrote this to help myself out.
gif-overlay --text "THIS IS AWESOME" input.gif output.gif
(requires ImageMagick to be installed)
Pretty-prints JSON
$ pretty-json '{"woo":true}'
{
"woo": true
}
Pretty-prints the query part of a URL
$ rack-query 'https://example.com/foo/bar/baz?x=y&z[]=1&z[]=2#wooo'
https://example.com/foo/bar/baz
{"x"=>"y", "z"=>["1", "2"]}
Opens a pane in tmux with the given argument entered, also sets synchronize-panes
$ tmux-args a b c d