Skip to content

Instantly share code, notes, and snippets.

@alicebob
alicebob / hetzner_nixos_luks.md
Last active June 22, 2024 20:07
nixos 24.05 with full disk encryption on Hetzner cloud

Setup full disk encryption on a Hetzner cloud CX42 machine. No fancy SSH unlock: you have to go to their web based terminal to enter the disk password on boot.

Notes:

  • Their web based terminal is /weird/. You can paste things, but it looks like it's set up for a german keyboard, and many characters change ("http://" into "http;//"), sometimes it converts everything to lowercase after a while, sometimes it enters some capslocks mode. I ended up typing as much as possible by hand, and only use alphanumeric passphrases so there are no surprises when copy-pasting those.
  • The (qemu) virtual machine doesn't use EFI, but Legacy Boot. Most setup instructions I found are for EFI systems.

there we go

  • In the Hetzner UI click the server in the list, go to tab [ISO Images], search for "nix", and mount "NixOS 24.05 (x86_64/minimal)"
  • Reboot, and open the terminal. (the's a button on the top with [>_], which is a shortcut for the terminal)
package main
import (
"fmt"
)
type KVOp string
const (
KVSet KVOp = "set"
@alicebob
alicebob / gist:ed1ac1c1f192481cb819
Created March 28, 2016 15:45
basic Aerospike client
package main
import (
"fmt"
"sync"
as "github.com/aerospike/aerospike-client-go"
)
func main() {
@alicebob
alicebob / aeint.go
Created November 27, 2015 10:33
int64 in Aerospike
package main
import (
"fmt"
"time"
as "github.com/aerospike/aerospike-client-go"
)
const lua = `
package main
import (
"log"
"net"
"net/http"
"time"
)
func main() {
@alicebob
alicebob / yml.go
Created February 16, 2015 15:08
reformat yml files
package main
import (
"io/ioutil"
"os"
"gopkg.in/yaml.v2"
)
func main() {