Skip to content

Instantly share code, notes, and snippets.

View alexrudd's full-sized avatar

Alex Rudd alexrudd

  • CCP Games
  • Glasgow
  • 16:30 (UTC)
View GitHub Profile
@alexrudd
alexrudd / aws_cred_chain.go
Last active February 17, 2017 19:04
Default AWS credentials chain
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws/defaults"
)
func main() {
creds := defaults.CredChain(defaults.Config(), defaults.Handlers())
// Validate credentials

Keybase proof

I hereby claim:

  • I am alexrudd on github.
  • I am arudd (https://keybase.io/arudd) on keybase.
  • I have a public key whose fingerprint is 6A1B D505 F783 B273 4DAB 1A6C 4EB6 4D85 B50D 6A39

To claim this, I am signing this object:

@alexrudd
alexrudd / domain.go
Last active May 8, 2021 16:42
EventStoreDB: storing proto messages in events
package domain // domain layer
import "google.golang.org/protobuf/proto"
// Event represents a domain event that has been retreived from the event store.
type Event interface {
ID() string
Revision() uint64
Data() proto.Message
}
@alexrudd
alexrudd / README.md
Last active November 17, 2023 07:44
OCSP Request in Go

OCSP Request in Go

This came out of debugging the error net/http: TLS handshake timeout which seemed to only be happening for certain endpoints. The thing that these endpoints all had in common was that they used Let's Encrypt as their CA. Some googling lead me to think it might have something to do with OCSP, so I wrote a small application that could make an OCSP request for a specified certificate.

The issue ended up being that the server experience the TLS handshake timeout had port 80 blocked. Port 80 was required to make the OCSP HTTP request to check that the certificate wasn't revoked.

go run ocsp.go ./cert.cer
@alexrudd
alexrudd / main.go
Created April 21, 2022 19:38
HoneyComb delete old columns
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"