Skip to content

Instantly share code, notes, and snippets.

View JayH5's full-sized avatar

Jamie Hewland JayH5

  • Yelp
  • London, UK
View GitHub Profile

Keybase proof

I hereby claim:

  • I am JayH5 on github.
  • I am jamiehewland (https://keybase.io/jamiehewland) on keybase.
  • I have a public key whose fingerprint is 5205 28B8 191F 409B 7739 36AC 79AB 6C71 BA35 5010

To claim this, I am signing this object:

@JayH5
JayH5 / fake_marathon.py
Created April 28, 2016 14:19
Fake Marathon
class FakeMarathon(object):
def __init__(self):
self.event_subscriptions = []
self.apps = {}
self.tasks = {}
self.app_tasks = {}
def _get_event_subscriptions(self):
@JayH5
JayH5 / registry-cleanup.py
Last active June 22, 2016 15:09
Delete non-latest digests in Docker Registry
from __future__ import print_function
import datetime
import sys
import re
import requests
BASE_URL = 'https://localhost:5000'
SSL_VERIFY = False
/ # pip wheel -v uwsgi
Collecting uwsgi
1 location(s) to search for versions of uwsgi:
* https://pypi.python.org/simple/uwsgi/
Getting page https://pypi.python.org/simple/uwsgi/
Looking up "https://pypi.python.org/simple/uwsgi/" in the cache
Current age based on date: 173
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
The response is "fresh", returning cached response
#! /usr/bin/python
# Sanity check that consul-template is writing the services in Consul to the
# nginx config file.
import requests
HOST = '10.1.1.13'
CONSUL_PORT = 8500
NGINX_CONFIG_PATH = '/etc/nginx/sites-enabled/consul_template.conf'
@JayH5
JayH5 / challenge.diff
Created October 27, 2016 09:48
txacme assert challenge type
diff --git a/src/txacme/test/test_client.py b/src/txacme/test/test_client.py
index 5ea4435..97a7628 100644
--- a/src/txacme/test/test_client.py
+++ b/src/txacme/test/test_client.py
@@ -12,9 +12,9 @@ from hypothesis import strategies as s
from hypothesis import assume, example, given
from testtools import ExpectedException, TestCase
from testtools.matchers import (
- AfterPreprocessing, Always, ContainsDict, Equals, HasLength, Is,
- IsInstance, MatchesAll, MatchesListwise, MatchesPredicate,
@JayH5
JayH5 / reference_regex.py
Created January 10, 2017 13:48
Docker reference regex in Python
import re
"""
A straight Python port of the Docker reference regexes.
https://github.com/docker/distribution/blob/9a43b8f6961d975f5d29587b3b89972bf18ea8dc/reference/regexp.go
"""
match = re.compile
diff --git a/xenapi/__init__.py b/xenapi/__init__.py
index faa592d..546d6ce 100644
--- a/xenapi/__init__.py
+++ b/xenapi/__init__.py
@@ -1,20 +1,30 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
+# Copyright (c) Citrix Systems, Inc.
{
"volumes": null,
"id": "/marathon-lb",
"cmd": null,
"args": [
"sse",
"-m", "http://master.mesos:8080",
"--health-check",
"--group", "external",
"--ssl-certs", "/marathon-acme/certs,/marathon-acme/default.pem",
{
"id": "/marathon-acme",
"cmd": null,
"cpus": 0.01,
"mem": 128,
"disk": 0,
"instances": 1,
"container": {
"type": "DOCKER",
"volumes": [],