Skip to content
Snippets Groups Projects
Commit 1b8c9bca authored by nimrod's avatar nimrod
Browse files

- Use the json.tool module instead of writing my own one-liner.

parent 1ffc4ddb
No related branches found
No related tags found
No related merge requests found
...@@ -76,6 +76,7 @@ alias sudo="sudo " ...@@ -76,6 +76,7 @@ alias sudo="sudo "
alias presentation='docker run -itv "$PWD:/project" adarnimrod/presentation' alias presentation='docker run -itv "$PWD:/project" adarnimrod/presentation'
alias prune_prerun='find "$HOME" -maxdepth 1 -name ".prerun.*" -print0 | grep -zv "$(pgrep -u "$(id -u)" bash)" | xargs -0r rm ' alias prune_prerun='find "$HOME" -maxdepth 1 -name ".prerun.*" -print0 | grep -zv "$(pgrep -u "$(id -u)" bash)" | xargs -0r rm '
alias netdata='docker run --detach --name netdata --cap-add SYS_PTRACE --volume /proc:/host/proc:ro --volume /sys:/host/sys:ro --volume /var/run/docker.sock:/var/run/docker.sock --publish 19999:19999 firehol/netdata' alias netdata='docker run --detach --name netdata --cap-add SYS_PTRACE --volume /proc:/host/proc:ro --volume /sys:/host/sys:ro --volume /var/run/docker.sock:/var/run/docker.sock --publish 19999:19999 firehol/netdata'
alias json-tool='python3 -m json.tool'
deduce_aws_region () { deduce_aws_region () {
AWS_DEFAULT_REGION="$(python << EOF AWS_DEFAULT_REGION="$(python << EOF
......
#!/usr/bin/env python3
'''Get JSON from stdin, output pretty JSON to stdout.'''
import json
import sys
if __name__ == '__main__':
print(json.dumps(json.load(sys.stdin), indent=4, sort_keys=True))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment