This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3api create-bucket --bucket kubernetes-example-co-uk-state-store-2 --region eu-central-1 --create-bucket-configuration LocationConstraint=eu-central-1 --profile kops | |
aws s3api put-bucket-versioning --bucket kubernetes-example-co-uk-state-store-2 --versioning-configuration Status=Enabled --profile kops | |
kops create cluster \ | |
--zones "eu-central-1a,eu-central-1b,eu-central-1c" \ | |
--master-zones "eu-central-1a,eu-central-1b,eu-central-1c" \ | |
--master-count 3 \ | |
--node-count 4 \ | |
--topology private \ | |
--networking kopeio-vxlan \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json | |
import urllib2 | |
from M2Crypto import X509 | |
from base64 import b64decode | |
from M2Crypto.Err import M2CryptoError | |
SNS_MESSAGE_TYPE_SUB_NOTIFICATION = "SubscriptionConfirmation" | |
SNS_MESSAGE_TYPE_NOTIFICATION = "Notification" | |
SNS_MESSAGE_TYPE_UNSUB_NOTIFICATION = "UnsubscribeConfirmation" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am joonathan on github. | |
* I am joonathan (https://keybase.io/joonathan) on keybase. | |
* I have a public key whose fingerprint is A482 1228 CA37 A480 2CEE E813 92CE 40DB 0714 9D83 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A really stupid python template language inspired by coffeekup, markaby. | |
Do not use this code, it will ruin your day. A byproduct of insomnia. | |
TL;DR | |
----- | |
This module defines a template language that allows us to do: | |
d = Doc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
# requires cf_customorigin branch | |
# https://github.com/boto/boto/tree/cf_customorigin | |
origin_domain = 'www.example.org' | |
cdn_cname = ['media.example.org'] | |
caller_reference = 'exmaple Distribution' | |
c = boto.connect_cloudfront() | |
d = c.create_custom_distribution( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models.signals import post_init | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. | |
>>> @track_data('name') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A script to query the Amazon Web Services usage reports programmatically. | |
Ideally this wouldn't exist, and Amazon would provide an API we can use | |
instead, but hey - that's life. | |
Basically takes your AWS account username and password, logs into the | |
website as you, and grabs the data out. Always gets the 'All Usage Types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Save the supervisord.initscript script as /etc/init.d/supervisord | |
Run /usr/sbin/update-rc.d -f supervisord defaults |