Skip to content

Instantly share code, notes, and snippets.

View Roxxers's full-sized avatar
🏳️‍⚧️

Roxie Gibson Roxxers

🏳️‍⚧️
  • UK
  • 20:40 (UTC +01:00)
View GitHub Profile
@walkermalling
walkermalling / luks-encrypted-root-on-nixos.org
Last active April 7, 2024 22:29
Nix Setup with LUKS encrypted root

Setting up NixOs with LUKS encrypted root

Here are my working notes on getting a system up and running.

WARNING: You can run into a hidden problem that will prevent a correct partition setup and /etc/nixos/configuration.nix from working: if you are setting up a UEFI system, then you need to make sure you boot into the NixOS installation from the UEFI partition of the bootable media. You may have to enter your BIOS boot selection menu to verify this. For example, if you setup a NixOS installer image on a flash drive, your BIOS menu may display several boot options from that flash drive: choose the one explicitly labeled with “UEFI”.

References

I used these resources:

@smashnet
smashnet / docker-compose.yml
Last active December 7, 2023 05:50
Docker-Compose: Mastodon v3.5.3 with Traefik v2.9
version: "3.5"
# Variables to fill in:
# Line 23: <LETSENCRYPT_MAIL_ADDRESS> - your mail address for contact with Let's Encrypt
# Line 36: <TRAEFIK_DASHBOARD_ADMIN_PASSWORD> - MD5 hash of your password (use http://www.htaccesstools.com/htpasswd-generator/)
# Line 54: <POSTGRES_PASSWORD> - the password for the postgres db. Use the same during mastodon:setup!
# Lines 31, 86, 111: <DOMAIN> - e.g. social.yourdomain.com (Must have an A record pointing to your box' IP) (AAAA for IPv6 ;)
services:
traefik:
@agbaraka
agbaraka / docker_remote.go
Created September 14, 2019 08:21
Access remote docker daemon via ssh using Golang Docker SDK
package main
import (
"context"
"fmt"
"github.com/docker/cli/cli/connhelper"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
"net/http"
"os"
@bradtraversy
bradtraversy / vscode_shortcuts.md
Last active May 3, 2024 12:59
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

If you have any other helpful shortcuts, feel free to add in the comments of this gist :)

Official List of all commands

@trajing
trajing / 01-writeup.md
Last active April 14, 2019 01:21
Python switch/case Using Dynamic except

switch/case in Python

A manner of replicating the functionality of switch and case in other languages using variable type arguments to Python's except keyword.

Dynamic except

Python's except keyword takes as an argument either a type or tuple of types specifying what exceptions to capture (you can also bind the exception object to a variable, but we don't care about that right now.) it functions like so:

try:
@fwenzel
fwenzel / b2.md
Last active July 31, 2023 04:40
Mastodon --> Backblaze B2

Using Mastodon with Backblaze B2

Mastodon can store its assets in Amazon S3 (it speaks the S3 protocol). But it does not, by default, speak to Backblaze B2.

There are a couple of reasons why you might want that:

  • you already know and trust B2
  • it's cheaper
  • you do not want to make your instance dependent on AWS
  • etc.
@mrcrilly
mrcrilly / gin_jwt_middleware.go
Last active February 23, 2024 01:13
Gin JWT Middleware (Example)
package main
import (
"errors"
"net/http"
"strconv"
"strings"
"time"
"github.com/dgrijalva/jwt-go"
@ladinu
ladinu / encryptedNixos.md
Last active March 1, 2024 07:19
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device

Installing on Linode

There are now official docs, so follow those as they'll be up-to-date and easier to follow.

Click here to view the old directions

Installing on Linode