Skip to content

Instantly share code, notes, and snippets.

-- vim: tabstop=2 shiftwidth=2 expandtab
-- We almost always start by importing the wezterm module
local wezterm = require 'wezterm'
-- Define a lua table to hold _our_ module's functions
local module = {}
-- Returns a bool based on whether the host operating system's
-- appearance is light or dark.
function module.is_dark()
@timothyham
timothyham / ipv6guide.md
Last active September 19, 2024 14:53
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@kconner
kconner / macOS Internals.md
Last active September 23, 2024 15:19
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@nautalice
nautalice / gist:5db09aebcf892b57f342b695ffebc867
Last active June 11, 2024 11:21
Fuck off Twitter Chirp
1. Install uBlock Origin: https://github.com/gorhill/uBlock
2. Click the gears icon on the plugin dropdown (lower right-hand corner)
3. Select the My Filters tab
4. Enter the following (one filter per line):
https://abs.twimg.com/fonts/chirp-bold-web.woff
https://abs.twimg.com/fonts/chirp-heavy-web.woff
https://abs.twimg.com/fonts/chirp-regular-web.woff
https://abs.twimg.com/fonts/chirp-medium-web.woff
https://abs.twimg.com/fonts/v2/chirp-bold-web.woff
https://abs.twimg.com/fonts/v2/chirp-regular-web.woff
@cyber-murmel
cyber-murmel / NixOS_on_Hetzner_Cloud.md
Last active May 6, 2024 08:00
NixOS on Hetzner Cloud

This is the gist of how to setup a NixOS server on a Hetzner Cloud instance with an admin user, ssh access and configuration management via git.

  1. Create a Hetzner Cloud instance and click to enter it.
  2. Stop the instance (top right corner icon).
  3. Go to ISO Images.
  4. Search for "nixos" and click mount. ISO Images tab of a Hetzner Cloud instance with the NixOS image already mounted
  5. Start the instance again (top right corner icon).
  6. Open the console (top right corner icon).
  7. Get the IP address by executing ip --brief --color address. The address can also be optained from the Hetzner Cloud web interface.
@lg
lg / adding-tailscale-to-edgerouter.md
Last active September 17, 2024 12:12
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already
@lizthegrey
lizthegrey / attributes.rb
Last active August 25, 2024 11:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
package jwtex
import (
"encoding/base64"
"encoding/json"
"fmt"
"strings"
"testing"
)
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active September 23, 2024 09:08
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@htp
htp / curl-websocket.sh
Last active August 20, 2024 09:06
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/