random musings from 改造
Using AWS KMS RSA keys with Golang!
Getting golang to talk to AWS/KMS RSA Keys In short, there’s a few things to get done. To start with we need the Amazon C++ SDK to be able to provide the first layer. Then, we need a pkcs11 provider to talk to that SDK. After that, we need a golang library to be able to talk to that pkcs11 provider. 😀
Amazon Linux Because I’m a sadist, I decided on using AWS Linux to make things as complicated as possible.…
Read more ⟶
Squeezing the last drops out of FTTP connections using OpenBSD
Packet Queuing with OpenBSD’s pf.
Two immediate links for you, one to Solene’s fantastic explanation of queueing, and another to the pf.conf manpage.
I’m on fibre now at home, which is rather fantastic. In the UK you pay for packages which are sometimes described as 100, 200, 250, 500 etc which indicates the download speed, but annoyingly, they still insist on asymmetric traffic flows, meaning your uplink is limited. As a result, in order to get the maximum download speeds you’ll find yet again, you need to do some traffic shaping.…
Read more ⟶
OpenBSD - veb's, vport's and vlan's
openbsd - veb’s, vport’s and vlan’s Inspired by a question on reddit from someone who wanted to create another wireless network for guests to the house, here’s a short how-to on how I’ve got things set up at home.
My main router/firewall is an OpenBSD box, with multiple nics. A few of those nics’ connect to some Wireless AP’s, running OpenWRT. The OpenWRT AP’s run a few different SSID’s for things, for example I’ve got one for guests to the house, one for the AV kit, one for the IoT devices……
Read more ⟶
.dotfiles
.dotfiles On the old site I used to keep some of my .dotfiles for configuration of stuff, so I could easily grab them and reuse them on every new box I touched, and also so others can find some reference material. Here’s the modern equivalents of what I’ve got.
.tmux.conf Of all the things I can’t live without, tmux is one of the top ones. This config broadly remaps the ctrl+b behavior to react to ctrl+a and changes the theme to my favourite one….…
Read more ⟶
AWS and SMS
Code to get stuff done quickly using the AWS golang SDK is often surprisingly easy.
For example, sending an SMS is as easy as the following….
package main import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sns" ) func main() { sess := session.Must(session.NewSession()) svc := sns.New(sess) params := &sns.PublishInput{ Message: aws.String("Some Message Here"), PhoneNumber: aws.String("+44000000000"), } _, _ = svc.Publish(params) } …
Read more ⟶
Custom Freebsd Images (13.1) on Oracle Cloud ARM64
This is a rather terse guide to doing this. I’m assuming you already know what you’re doing with FreeBSD and are comfortable building your own systems from source. If not, go do that now and comeback here….
Download the diff from here.
If that file is not found, it’s probably been updated. You can find the current version on this page.
Apply the diff in /usr/src with
git apply -p0 D34746.…
Read more ⟶
Cloudfront and index.html files
CloudFront is not a Web Server. It’s easy to think of Cloudfront as a web server - indeed once it’s set up it pretty much works as one, but behind the scenes it’s really just another interface to an S3 bucket, which itself you think looks like a filesystem, because it kinda pretends it is…
The problem comes, after you’re used to hitting /some-location/ and the webserver automagically knows to server you index.…
Read more ⟶
Golang Highlighting
Playing with hugo. This should be some pretty formatted gocode ….
package main import ( "crypto/rand" "log" "math/big" "net" "time" ) type foo struct { name string } func main() { var i int time.Sleep(5 * time.Millisecond) } …
Read more ⟶
Moving to AWS
Well, Moved actually… History. Many many years ago, kaizo.org was hosted the ony way you could host your own stuff, on physical hardware in a datacentre.
Specifically, c0ke.kaizo.org was a physical Sun Microsystems SparcStation 10 which was hosted up at the excellent Legend Internet in Leeds. This was circa 2000 when all this was in place, and it served well until virtual machines bacame the next big thing. We retired c0ke because frankly, it was an absolute pain in the arse - if something when wrong it required a car journey from London or Oxford, all the way to leeds, to give it some love.…
Read more ⟶