Skip to content

Instantly share code, notes, and snippets.

function (user, context, callback) {
var request = require('request');
var github_org_whitelist = ['ministryofjustice'];
// Apply to 'github' connections only
if(context.connection === 'github'){
var github_identity = _.find(user.identities, { connection: 'github' });
// Only allow members of whitelisted Github orgs
@kerin
kerin / bumpme
Last active January 5, 2018 14:21
Fri Jan 5 14:21:41 UTC 2018
#!/usr/bin/env python
import json
import urllib
import argparse
import boto3
import requests
LOGIN_URL = 'https://dev-analytics-moj.eu.auth0.com/'
kops cluster spec:
spec:
kubeAPIServer:
oidcClientID: OIDC_CLIENT_ID
oidcIssuerURL: https://dev-analytics-moj.eu.auth0.com/
oidcUsernameClaim: sub
kerin-foo-namespace-admin-rolebinding.yml:
@kerin
kerin / omg.py
Created November 23, 2017 10:53
def sync_service_catalog(s3, artifact):
""" Pseudo logic as follows
1. Extract S3 Zip file
2. Iterate through all the sub-folders in the portfolio directory
3. Read mapping.yaml in each such folder. Refer Readme for more details on syntax
4. If portfolio name matches, update the products by creating a new version
5. If portfolio name does not matches, create a new one.
6. Share the portfolio with list of accounts mentioned in the mapping.yaml
7. Give access to the principals mentioned in the mapping.yaml
8. Tag Portfolio as mentioned in mapping.yaml
[email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
$ curl -H "Authorization: token TOKEN_A" https://api.github.com/user/orgs -v
> GET /user/orgs HTTP/1.1
< HTTP/1.1 200 OK
< Server: GitHub.com
< X-OAuth-Scopes: read:org, read:user, user:email
< X-Accepted-OAuth-Scopes: admin:org, read:org, repo, user, write:org
[
{
- name: example metrics cluster
endpoint: https://curator:[email protected]:9243
indices:
- prefix: s3logs-
days: 30
- prefix: logstash-dev-
days: 30
- prefix: logstash-apps-dev-
days: 30
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
creationTimestamp: 2017-06-08T12:42:53Z
generation: 1
labels:
app: node-metrics-node-exporter
chart: node-exporter-0.1.0
name: node-metrics-node-exporter
namespace: kube-system
base
boot
class
cluster
codetools
compiler
datasets
foreign
graphics
grDevices