Skip to content

Instantly share code, notes, and snippets.

View shoenig's full-sized avatar
🪁
lets Go

Seth Hoenig shoenig

🪁
lets Go
View GitHub Profile
@shoenig
shoenig / opaque.go
Created March 10, 2023 20:45
Better Go opaque map comparison
// net yet used because
// 1. very slow (like 10x worse than DeepEqual)
// 2. terrifying - i mean what even is this
var (
cmpOptIgnorePrivate = ignoreUnexportedAlways()
cmpOptNilIsEmpty = cmpopts.EquateEmpty()
)
// ignoreUnexportedAlways is a derivative of go-cmp.IgnoreUnexported, but this one
@shoenig
shoenig / cgroups.txt
Created February 27, 2023 19:06
nomad raw_exec cores example
fs/cgroup/nomad.slice
➜ cat 416baca9-bc05-d4c4-29f0-d0feec4e355c.task*.scope/cpuset.cpus
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 416baca9-bc05-d4c4-29f0-d0feec4e355c.task1.scope/cpuset.cpus
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 0-2,8-23
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 416baca9-bc05-d4c4-29f0-d0feec4e355c.task2.scope/cpuset.cpus
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@shoenig
shoenig / pebble.nomad.hcl
Created February 23, 2023 21:12
hack demo feb 2023
job "pebble" {
type = "service"
group "pebble" {
network {
mode = "host"
port "acme" {
static = 6666
}
port "mgmt" {
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
"strings"
)
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
"github.com/hashicorp/go-set"
// NOTE: pre-transpose matrix, split instructions into second file
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
"github.com/hashicorp/go-set"
package main
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/hashicorp/go-set"
)
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
const (