Skip to content

Instantly share code, notes, and snippets.

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' : '[email protected]', '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
@pcn
pcn / BUILD
Created December 4, 2017 18:33 — forked from jayeye/BUILD
stamping with build information. Obviously, replace _slash_ in the filenames with an actual slash!
package(default_visibility = ["//visibility:public"])
genrule(
name = "genpybuildinfo",
outs = [
"buildinfo.py",
],
stamp = 1,
cmd = "./$(location tools/mkpybuildinfo.sh) > \"$@\"",
tools = [
@pcn
pcn / complex_salt_orchestrate.sls
Created March 12, 2018 15:23 — forked from whiteinge/complex_salt_orchestrate.sls
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}
@pcn
pcn / install_pyenv.sh
Last active April 26, 2019 20:33 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/bash
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
@pcn
pcn / twittermute.txt
Created January 29, 2020 15:33 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet