Skip to content

Instantly share code, notes, and snippets.

View philandstuff's full-sized avatar

Philip Potter philandstuff

View GitHub Profile
@philandstuff
philandstuff / devopsdays.org
Last active October 12, 2017 21:05
Devopsdays london 2017

Devopsdays London 2017

initial session, bob walker (@rjw1)

  • welcome everyone!
  • we have a code of conduct
  • thanks to organisers, sponsors, etc

Humane Teams at home and around the world

@philandstuff
philandstuff / consistency.org
Created March 2, 2017 16:39
consuming-consistency-proofs

trying to implement consistency checking on my prison RSF poller

I wrote a thing to keep the prison index service prototype up-to-date. It works by polling the RSF for updates, and only downloads new entries.

However, the prison register is in discovery and I’m told it will be deleted and reloaded (possibly a number of times). This means that if I only download entries from the last entry number I saw, I’ll miss the entries which have been completely rewritten.

@philandstuff
philandstuff / vowel-regex.py
Created February 7, 2017 18:16
build regexes for matching all vowels
#!/usr/bin/env python3
def regex_for(required_letters):
# special cases for 1 and 2 letters, to keep things a bit tidier
if len(required_letters) == 1:
return required_letters[0]
if len(required_letters) == 2:
x,y = required_letters
return "%s.*%s|%s.*%s" % (x,y,y,x)
subregexes = []
========================================================================== FAILURES ===========================================================================
______________________________________________________ test_audit_proofs_are_valid_with_alternative_impl ______________________________________________________
@given(st.lists(st.binary(), max_size=99), st.integers(min_value=0, max_value=99))
> def test_audit_proofs_are_valid_with_alternative_impl(data, leafIndex):
tests/test_verifiable_log.py:146:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/s5f9zba6xbrjqxmmnjikwndqg9wk2xvr-python3.5-hypothesis-3.5.2/lib/python3.5/site-packages/hypothesis/core.py:524: in wrapped_test
print_example=True, is_final=True
@philandstuff
philandstuff / README.md
Last active October 5, 2016 14:09
Example external representations

possible ideas for serialisation formats

This gist has some possible formats:

jsonl with inline items

This is the format from the first spike.

jsonl with items encoded as strings

csv,conf,v2

Ben Foxall, Serving CSV from the browser

  • @benjaminbenben @pusher

why do I love CSV?

  • accessibility - don’t need specialized programs
  • it’s the start of something, not the end
@philandstuff
philandstuff / cfgmgmtcamp2016.org
Last active August 27, 2018 09:11
configuration management camp 2016 notes
@philandstuff
philandstuff / foo.sh
Last active January 10, 2016 22:12
building docker images from nix packages
nix-build -E '<nix-expr>'
@philandstuff
philandstuff / minimal-ct-nix.md
Last active December 14, 2015 11:05
Deploying certificate-transparency to a docker container using nix

Deploying certificate-transparency to a docker container using nix

On the nixos/nix docker container

Fisrt, download and run the nixos/nix image:

docker run -ti nixos/nix /bin/sh

Subscribe to the nixos channel (eventually, certificate-transparency will be available on the nixpkgs channel too but as of 2015-12-14 it's not):

@philandstuff
philandstuff / codemesh2015.org
Last active November 16, 2015 19:37
Code mesh 2015 notes

Kush, an introduction to schedulers

about me

  • I work for GDS
  • Cabinet Office
  • we started by building GOV.UK
    • replaced older sites like direct gov, business link
  • we’re not just fixing websites
    • we also build and run digital services
    • working with depts across the country
    • eg: register to vote