Skip to content

Instantly share code, notes, and snippets.

View jameinel's full-sized avatar

John Arbash Meinel jameinel

View GitHub Profile
@jameinel
jameinel / foo_test.go
Created February 11, 2022 15:47
Benchmark copy vs append
package foo
import "testing"
func createSource(b *testing.B) []int {
source := make([]int, b.N)
for i := range source {
source[i] = i
}
b.ResetTimer()
@jameinel
jameinel / nrpe_mysql.py
Created April 5, 2021 14:01
NRPE MySQL Client
import logging
import ops.charm
import ops.framework
class MySQLNRPEClient(os.framework.Object):
_stored = ops.framework.StoredState()
def __init__(self, charm, relation_name: str):
"options":
"extra_packages":
"description": >
Space separated list of extra deb packages to install.
"type": "string"
"default": ""
"package_status":
"default": "install"
"type": "string"
"description": >
@jameinel
jameinel / restorebackup.md
Last active August 6, 2022 02:51
Manual Steps for Restoring a Juju Controller from an HA backup

Setting up the initial HA controller

  1. Bootstrap
  $ juju bootstrap --no-gui lxd lxd-original --bootstrap-series=xenial \
    --debug --model-default "logging-config=<root>=INFO"

You can run this with: go build -flags chaos and go build

And then run it (./chaostest)