Skip to content

Instantly share code, notes, and snippets.

@jamescun
jamescun / masterless-puppet.sh
Created December 14, 2012 22:05
Sync puppet manifests and modules with a remote HTTP server and execute puppet apply
#!/bin/sh
# Masterless Puppet Script
# Copyright (C) 2012 James Cunningham <j@goscale.com>
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@jamescun
jamescun / indyref.md
Last active August 29, 2015 14:06
My opinion of Scottish Independence

I've tried to keep out of the Scottish Independence debate, for virtue of that I haven't lived in Scotland for four years, however it is a topic which evokes strong emotions in me through the possibility of further losing ties to my homeland.

I do not get a vote in this referendum, nor should I, but this has not stopped me from forming an opinion.

I have seen a lot of wishy thinking and hollow policies from the Yes campaign, and a lot of fear mongering and back-handed tricks from the No campaign. I have seen passionate and convincing debate from both sides, and have found myself supporting either side at one time or another.

However what seems to be getting lost among the lively debate is the true purpose of this referendum: self determination. Should Scotland receive total governance from Holyrood, or continue the path of devolution with Westminster at the political forefront. Politicians linger on, bickering about currency, EU admittance, oil revenues and the like; but these are short term issues which c

package main
import (
"net/http"
)
type Handler struct{}
func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("hello world"))
@jamescun
jamescun / letter.md
Created November 4, 2015 22:48
Letter to Emily Thornberry regarding the Draft Investigatory Powers Bill

Dear Emily Thornberry,

I write to you with a simple hypothetical. Imagine the ISP TalkTalk were required by law to retain 12 months worth of internet access history, now imagine the result of their recent security breach given this. Every TalkTalk customer would potentially have their entire private online world exposed to the public: from the popular teenager, terrified of the views of his family and friends, researching LGBTQ issues; to the jovial receptionist frequenting suicide support forums. None of it legally sensitive, but personally devastating.

TalkTalk are not alone: BT, Virgin and Sky have all had data breaches go public. As long as data security continues to be overlooked at these companies and many others, data breaches will continue to happen. The only way to safe guard the above information from attack, is to not have it at all.

If the proposed Draft Investigatory Powers Bill were to pass, the above would become an all too common reality. Nobody argues against the need for our security serv

Keybase proof

I hereby claim:

  • I am jamescun on github.
  • I am jamescun (https://keybase.io/jamescun) on keybase.
  • I have a public key whose fingerprint is 587C 198F C503 2D2D C810 5D47 AAD7 4B93 8D56 6702

To claim this, I am signing this object:

@jamescun
jamescun / cert.txt
Created February 18, 2020 10:42
how Go handles multiple x509/ssl certificate common names
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
61:02:d2:d6:00:00:00:00:00:15
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=Washington, L=Redmond, O=Microsoft Corporation, CN=Microsoft Product Secure Server CA/emailAddress=pki@microsoft.com
Validity
Not Before: Aug 13 21:20:05 2010 GMT
Not After : Nov 13 21:20:05 2011 GMT