Skip to content

Instantly share code, notes, and snippets.

@alicebob
alicebob / hetzner_nixos_luks.md
Last active April 11, 2025 19:12
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)
@jmatsushita
jmatsushita / README
Last active May 2, 2025 14:36
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@smira
smira / README.md
Last active November 13, 2024 10:27
Talos on Firecracker

Talos on Firecracker

  1. Build Firecracker from source (it's fast and easy, builds in docker): https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md#building-from-source

  2. Adjust /dev/kvm permissions: https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md#prerequisites

  3. Build Talos, you will need build/vmlinux & build/initramfs.xz.

  4. Prepare configs for Talos: osctl config generate fire https://172.16.0.2:6443. Make following changes to the config: add resolvers to the machine.network config: nameservers: ["8.8.8.8", "1.1.1.1"] (IP config will come from kernel args), update install location: install: disk: /dev/vda (default is sda).

@aszlig
aszlig / module.nix
Last active April 12, 2024 19:45
Passing secrets to NixOS containers without exposing them world-readable
{ pkgs, lib, config, ... }:
let
inherit (lib) mkOption types;
secretsModule = {
options.path = mkOption {
type = types.path;
example = lib.literalExample "pkgs.hello";
description = ''
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@rupakg
rupakg / serverless-application-for-long-running-process-fargate-lambda.md
Last active August 31, 2021 21:41
Post: How to use AWS Fargate and Lambda for long-running processes in a Serverless app

How to use AWS Fargate and Lambda for long-running processes in a Serverless app

Build an ETL job service by fetching data from a public API endpoint and dumping it into an AWS Redshift database.

Published on Jan. 11th, 2018 at https://serverless.com/blog/serverless-application-for-long-running-process-fargate-lambda/

thumbnail

AWS dropped so many serverless announcements at re:Invent, the community is still scrambling to make sense of them all. This post is all about AWS Fargate.

In this article, I will show you how to create an end-to-end serverless application that extracts thumbnails from video files. But, oh no, processing video files is a long-running process! Whatever will we do?

@smeijer
smeijer / parse-es6-template.js
Last active October 26, 2024 03:15
ES6 template string parser
function get(path, obj, fb = `$\{${path}}`) {
return path.split('.').reduce((res, key) => res[key] || fb, obj);
}
function parseTpl(template, map, fallback) {
return template.replace(/\$\{.+?}/g, (match) => {
const path = match.substr(2, match.length - 3).trim();
return get(path, map, fallback);
});
}
@nolanlawson
nolanlawson / why_we_dropped_lerna_from_pouchdb.md
Last active December 13, 2023 10:56
Why we dropped Lerna from PouchDB

Why we dropped Lerna from PouchDB

We dropped Lerna from our monorepo architecture in PouchDB 6.0.0. I got a question about this from @reconbot, so I thought I'd explain our reasoning.

First off, I don't want this post to be read as "Lerna sucks, don't use Lerna." We started out using Lerna, but eventually outgrew it because we wrote our own custom thing. Lerna is still a great idea if you're getting started with monorepos (monorepi?).

Backstory:

{
"tilejson":"2.0.0",
"tiles":["http://services.arcgisonline.com/arcgis/rest/services/Demographics/USA_Population_Density/MapServer/WMTS/?Layer=0&Style=default&TileMatrixSet=EPSG:3857&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TileMatrix={z}&TileCol={x}&TileRow={y}"]
}