Skip to content

Instantly share code, notes, and snippets.

@mclarkson
mclarkson / yaml2json.py
Created May 15, 2017 09:23 — forked from noahcoad/yaml2json.py
Python to Convert yaml to json
# convert yaml to json
# pip3 install pyyaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml
# gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73
import yaml, json, sys
sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys=True, indent=2))
#!/bin/bash
# by http://github.com/jehiah
# this prints out some branch status (similar to the '... ahead' info you get from git status)
# example:
# $ git branch-status
# dns_check (ahead 1) | (behind 112) origin/master
# master (ahead 2) | (behind 0) origin/master
git for-each-ref --format="%(refname:short) %(upstream:short)" refs/heads | \