Skip to content

Instantly share code, notes, and snippets.

View bloodearnest's full-sized avatar

Simon Davy bloodearnest

  • Bennett Institute for Appllied Data Science, Oxford University
  • Leeds, UK
  • X @bloodearnest
View GitHub Profile
@bloodearnest
bloodearnest / gist:6699509
Created September 25, 2013 13:22
Theoretical juju pynamite
juju bootstrap -e ec2 # or local or openstack or azure
juju deploy pynamite --config some-load-test.yaml -n 10 # number units
juju add-unit pynamite # add one more
juju set pynamite endpoint="http://"
juju set pynamite start=True # or timestamp of scheduled test
# not sure about how to collect results...
@bloodearnest
bloodearnest / gist:6779561
Created October 1, 2013 14:41
musing on a charm-tester charm that's configurable in what it relation-set's
$ juju deploy charm-tester test
$ juju deploy charm-under-test charm
$
$ juju set test relation-config="
joined:
port: 8080
sitename: test.local
"
$ # 1. start test
@bloodearnest
bloodearnest / keybase.md
Created March 7, 2014 10:26
keybase.md

Keybase proof

I hereby claim:

  • I am bloodearnest on github.
  • I am bloodearnest (https://keybase.io/bloodearnest) on keybase.
  • I have a public key whose fingerprint is 8B91 F3C0 BE8F 7977 F9DF 6EC2 44A2 9F57 B63A 5F44

To claim this, I am signing this object:

@bloodearnest
bloodearnest / gist:554fa5552a0dea8b5605
Created June 24, 2014 13:17
Building off a base image for dev/prod images
GOAL: Use docker to build some images:
- a base image
- a dev image, from base, with extra dev deps, and the source code mounted as a host volume
- a prod image, from base, with src explicitly ADDed into the image as a stand alone executable
SUBGOALS:
- make use of docker's cache for faster building
A base image:
$ cat base.docker
wavy@shredder:~/canonical/dev/sso$ cat ~/bin/juju-sync-charm
#!/bin/bash
if [ -z "$1" ]
then
echo "You must provide a unit name" >&2
exit 1
fi
UNIT=$1
DIR=${2:-.}
@bloodearnest
bloodearnest / md5_check.py
Created August 4, 2014 16:32
md5_check.py
import os
import hashlib
class FilterModule(object):
def filters(self):
return {
'md5_check': self.md5_check,
}
vars:
an_int: 3
some_dict:
other: "{{ an_int }}"
# this means that some_dict.other is now a string.
# using {{ an_int|int }} doesn't work, of course
# am I missing something?
@bloodearnest
bloodearnest / selfsigned.py
Last active March 17, 2024 02:06
Create a self-signed x509 certificate with python cryptography library
# Copyright 2018 Simon Davy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
...
tests_requires = [
'flake8>=2.4.1',
'pytest>=2.9.1',
'freezegun>=0.3.6',
'coverage>=4.0',
]
devel_requires = test_requires + ['detox']
docs_requires = [
'Sphinx==1.4',
.ONESHELL:
python: private SHELL=python
python:
for i in range(10):
print('OMG!')
def f(x):
print(x)
f('this is awesome')