Skip to content

Instantly share code, notes, and snippets.

View doismellburning's full-sized avatar
🔥

Kristian Glass doismellburning

🔥
View GitHub Profile

I'm really interested in how y'all are doing Continuous Integration/Deployment of your Infrastructure-as-Code (particularly CloudFormation), especially without disruption to users!

Specifically, I'm trying to automate a "manual CloudFormation setup". Right now that's "templates in git with humans periodically run update-stack"; ideally it would become "PR merged? Rolling out the change".

(Part of me feels like I have "too many questions" and really just need to see a working setup, but hey)

@doismellburning
doismellburning / create_superuser.py
Created June 14, 2016 08:21
Non-interactively create/set a Django superuser
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth import get_user_model
from django.conf import settings
from django.db import transaction
class Command(BaseCommand):
# Excerpt
INT=$(iwconfig 2> /dev/null | grep -v "^ " | awk '{print $1}' | head -1 | egrep "^[a-z]")
if [ $? -eq 0 ]
then
echo "Removing Existing interface ${INT}"
ifconfig ${INT} down
iw dev ${INT} del
fi
sleep 1
@doismellburning
doismellburning / userstories.md
Last active October 30, 2017 16:25
Conference User Stories
commit d2a403c85ef68c4119de9208c15e9c4dc5df9b9b
Author: Kristian Glass <git@doismellburning.co.uk>
Date: Fri Oct 31 00:36:56 2014 +0000
Magic anchor links
With thanks to http://ben.balter.com/2014/03/13/pages-anchor-links/
diff --git a/_config.yml b/_config.yml
index 1b00c31..ad61734 100644
from django.contrib.auth import get_user_model
from django.test import LiveServerTestCase
from selenium.webdriver.phantomjs.webdriver import WebDriver
class LiveTests(LiveServerTestCase):
@classmethod
def setUpClass(cls):
super(LiveTests, cls).setUpClass()
#!/usr/bin/python
from __future__ import absolute_import, division, print_function, unicode_literals
import csv
import subprocess
import sys
FILENAME = 'redirection.csv'
@doismellburning
doismellburning / Private-pypi-howto
Last active August 29, 2015 14:27 — forked from Jaza/Private-pypi-howto
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@doismellburning
doismellburning / hypothesis_example.py
Created July 28, 2015 13:38
Trivial hypothesis example
import hypothesis
def reverse(s):
return s[::-1]
@hypothesis.given(hypothesis.strategies.text())
def test_reverse_involution(s):
r = reverse(reverse(s))
assert r == s, "%s did not equal %s" % (r, s)