Skip to content

Instantly share code, notes, and snippets.

Philip Potter philandstuff

  • Government Digital Service
Block or report user

Report or block philandstuff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@philandstuff
philandstuff / metrics.yaml
Created Aug 9, 2019
configure istio to collect custom metrics
View metrics.yaml
---
apiVersion: config.istio.io/v1alpha2
kind: metric
metadata:
labels:
app: canary
owner: canary-hack
name: requestcountbypath
namespace: sandbox-main
spec:
View foo.go
package main
import (
"fmt"
"log"
"github.com/ugorji/go/codec"
)
func main() {
@philandstuff
philandstuff / clug-2019-01-31.org
Created Jan 31, 2019
london concourse user group jan 2019
View clug-2019-01-31.org

Pipelines done right

  • Diego Lemos @dlresende, Derik Evangelista @kirederik
  • this talk is about pipelines and how you can use best practices to write better pipelines
  • who here works with concourse? [lots of hands]

introduction

CI / CD

@philandstuff
philandstuff / new-targets-config.yml
Last active Sep 24, 2018
Prototype for how we might do prometheus targets from the service broker in a better way
View new-targets-config.yml
scrape_configs:
- job_name: 'paas'
scheme: https
static_configs:
- targets: ['guid:0','guid:1']
labels:
job: foo
space: my-space
@philandstuff
philandstuff / lead-dev-2018.org
Last active Aug 23, 2018
Lead Developer London 2018
View lead-dev-2018.org

Lead dev 2018

Welcome - Meri Williams

  • @TheLeadDev #LeadDevLondon
  • white coat captioning - @whitecoatcapxg
    • wvnts.co/lduk2018

The Container Operator’s Manual - Alice Goldfuss

  • happy pride! it’s like the world cup for people with fashion sense
  • who am I?
View transfer.rb
require 'octokit'
client = Octokit::Client.new(access_token: "<TOKEN>")
repos = client.repos('gds-attic')
repos.take(10).each do |repo|
puts "archiving #{repo.url}..."
client.post(
"#{repo.url}/transfer",
View scale-summit-18.org

scalable build pipelines

A

  • jenkins as a build tool
  • microservices
  • how do we standdardize unit testing in our pipeline?
  • is a failure because we broke the pipeline, or because the code is bad?
  • we’ve recently been trying jenkins declarative pipelines
  • bash scripts
@philandstuff
philandstuff / devopsdays.org
Last active Oct 12, 2017
Devopsdays london 2017
View devopsdays.org

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 Mar 2, 2017
consuming-consistency-proofs
View consistency.org

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 Feb 7, 2017
build regexes for matching all vowels
View vowel-regex.py
#!/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 = []
You can’t perform that action at this time.