Skip to content

Instantly share code, notes, and snippets.

@timothyham
timothyham / ipv6guide.md
Last active October 23, 2025 20:41
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

{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,
@daspn-dock
daspn-dock / generate_ulid.sql
Created June 15, 2022 20:30
PostgreSQL function to generate an unique ID of type ULID
CREATE EXTENSION IF NOT EXISTS pgcrypto;
CREATE OR REPLACE FUNCTION generate_ulid() RETURNS uuid
AS $$
SELECT (lpad(to_hex(floor(extract(epoch FROM clock_timestamp()) * 1000)::bigint), 12, '0') || encode(gen_random_bytes(10), 'hex'))::uuid;
$$ LANGUAGE SQL;
@enobufs
enobufs / before_after_each_test.go
Created May 7, 2022 23:07
beforeEach and afterEach with go-test
package main
import (
"fmt"
"os"
"runtime"
"testing"
)
func TestMain(m *testing.M) {
@ipedrazas
ipedrazas / flask-signal.py
Created August 22, 2020 04:47
Processing SIGTERM in python
import signal
import time
class GracefulKiller:
kill_now = False
def __init__(self):
signal.signal(signal.SIGINT, self.exit_gracefully)
signal.signal(signal.SIGTERM, self.exit_gracefully)
def exit_gracefully(self,signum, frame):
@markwhitfeld
markwhitfeld / project.code-snippets.json
Last active November 23, 2023 16:27
VsCode Snippet for converting Camel/Pascal Case to kebab-case
{
"Camel as Kebab": {
"prefix": "x-kebab",
"body": [
"${1} -> ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/downcase}${2:+-}${3:/downcase}${4:/downcase}/g}"
],
"description": "dash separators"
},
"lowerFirstLetter": {
"prefix": "x-lower-first",
@lisawolderiksen
lisawolderiksen / git-commit-template.md
Last active November 1, 2025 01:01
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@vatshat
vatshat / cwl_insights_parse_regex.sh
Created January 29, 2019 18:25
An example of how to use regex in the parse statement of a CloudWatch Insights query
#!/usr/bin/env bash
query_string=$(cat << EndOfMessage
fields @timestamp, @logStream, headers.X-Amzn-Trace-Id, @transId, @message
| parse @message /(transactionId:[ ]?)(?<@transId>[a-zA-Z0-9]+)/
| filter @transId = a4c475516be5445a87fbb81bb7a4b365
EndOfMessage
) \
&& \
query_id=`aws logs start-query --log-group-name /aws/lambda/console_log \
@troyharvey
troyharvey / deployment.yml
Last active September 26, 2025 06:29
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@cham11ng
cham11ng / git-ssh-configuration.md
Last active September 25, 2025 04:37
Configuring SSH for Git

Git Installation and SSH Configuration

By: Sagar Chamling

Installation

For Linux (Debian/Ubuntu):

sudo apt install git