flatten json to paths

the following will take the output from a json object and flatten it into a key-value path. this is particularly handy when you’re looking to parse out the supported paths in a given device. note: you need to remove the \s from this output and put the entire jq string on the same line. jq '[leaf_paths as $path \ | {"key": $path | join("/"), "value": getpath($path)}] \ | from_entries' foo.json alias to make life happy....

December 16, 2019 · sulrich

pyenv reminder

you can have multiple pythons enabled at the same time so that those applications which you run which make assumptions about python2 being available work. (i’m looking at you gsutil and gcloud) elmo(~)% pyenv global 3.7.1 2.7.15 elmo(~)% pyenv versions system * 2.7.15 (set by /Users/sulrich/.pyenv/version) 2.7.15/envs/foo 2.7.5 * 3.7.1 (set by /Users/sulrich/.pyenv/version) 3.7.2 foo elmo(~)% which python2 /Users/sulrich/.pyenv/shims/python2 elmo(~)% which python3 /Users/sulrich/.pyenv/shims/python3 elmo(~)% which python /Users/sulrich/.pyenv/shims/python elmo(~)% python --version Python 3....

April 15, 2019 · sulrich