Skip to content

Instantly share code, notes, and snippets.

View tgulacsi's full-sized avatar

Tamás Gulácsi tgulacsi

View GitHub Profile
@tgulacsi
tgulacsi / lockfree.go
Last active April 9, 2021 00:15 — forked from vessenes/lockfree.go
simple Go map - not lockfree, but GC-friendly
package main
import (
"bytes"
"errors"
"flag"
"log"
"os"
"runtime"
"strconv"
Verifying I am +tgulacsi on my passcard. https://onename.com/tgulacsi
@tgulacsi
tgulacsi / keybase.md
Last active September 22, 2015 19:32

Keybase proof

I hereby claim:

  • I am tgulacsi on github.
  • I am tgulacsi (https://keybase.io/tgulacsi) on keybase.
  • I have a public key whose fingerprint is 2799 AB1A F982 C4FD FF02 1693 7661 4AF3 9ECD 9AD1

To claim this, I am signing this object:

@tgulacsi
tgulacsi / runit-caddy.md
Last active April 8, 2023 05:29
Using runit as a supervisor for Caddy

Supervisors

A supervisor's main task, is to start a specified process (in a specified environment), watch it running, and do something when it ends - usually based on the exit code.

From my experience, the environment setup can be a complex task (consult some config management for the required ports, actualize the config file from the central config management...), and this is where the most featureful supervisor (systemd, AFAIK) falls short:

  • it can setup & manage the listening sockets, and pass it to your app (if it can accept it - not hard, just have to be ready for it),
package main
import (
"fmt"
"log"
jwt "github.com/dgrijalva/jwt-go"
)
func main() {