View a_code_blob.py
def __get_gh_repos(teamname):
'''
looks up team ID from the organization then returns a list of repos
for which that team are collaborators
'''
params = ''
base_url = 'https://api.github.com/'
headers = { 'Accept' :'application/vnd.github.v3+json', "Content-type" : "application/json", \
'User-Agent' : 'dmangot@librato.com', 'Authorization': 'token ' + app.config['GH_API_TOKEN'] }
req = requests.get(base_url + 'orgs/librato/teams', auth=(app.config['GH_API_TOKEN'], 'x-oauth-basic')).text
View Simplistic Librato Agent Cost Calculator
#!/bin/bash
NET=$1
MOUNT=$2
PRICE[5]='.30'
PRICE[10]='.25'
PRICE[15]='.20'
PRICE[30]='.15'
PRICE[60]='.10'
PRICE[300]='.5'
View docker_issues
[ { "url": "https://api.github.com/repos/docker/docker/issues/18048", "labels_url": "https://api.github.com/repos/docker/docker/issues/18048/labels{/name}", "comments_url": "https://api.github.com/repos/docker/docker/issues/18048/comments", "events_url": "https://api.github.com/repos/docker/docker/issues/18048/events", "html_url": "https://github.com/docker/docker/issues/18048", "id": 117446711, "number": 18048, "title": "docker daemon crash when starting container after: RequestAddress(LocalDefault/172.17.0.0/16, <nil>, map[])", "user": { "login": "bschiffthaler", "id": 8308279, "avatar_url": "https://avatars.githubusercontent.com/u/8308279?v=3", "gravatar_id": "", "url": "https://api.github.com/users/bschiffthaler", "html_url": "https://github.com/bschiffthaler", "followers_url": "https://api.github.com/users/bschiffthaler/followers", "following_url": "https://api.github.com/users/bschiffthaler/following{/other_user}", "gists_url": "https://api.github.com/users/bschiffthaler/gists{/gist_id}", "starred_url":
View run-parts-wrapper
#!/bin/bash
RP='/bin/run-parts-orig' #where's the original run-parts?
SHELLBRATO='/opt/shellbrato/shellbrato.sh' #where's shellbrato?
LBCREDS='/home/dave/librato_creds' #where are the librato creds?
PARENT=$(ps -ocommand= -p $PPID | awk -F/ '{print $NF}' | awk '{print $1}')
START=$(date -d 'now' +%s)
OUT=$(${RP} ${@})
EXIT=${?}
View gist:8306440
#!/bin/sh
#use nest.py to gather interesting metrics, and push them to librato
NP="/home/dave/tmp/nest.py show --user dave --password XXX" # the nest.py command
source ${SBHOME}/shellbrato.sh #the librato shell library
${NP} | egrep -w 'current_humidity|current_temperature|hvac_heater_state|target_temperature' | sed -e 's/\.\+: /:/'| while read METRIC
do
read NAME VALUE <<< $(echo ${METRIC} | tr ':' ' ')
[ "${VALUE}" == "True" ] && VALUE=1