Skip to content

Instantly share code, notes, and snippets.

@pirogoeth
pirogoeth / test.env
Created September 17, 2024 04:38
maas test setup
MAAS_SETUP_DISABLE_POSTGRESQL=1
MAAS_SETUP_EXTERNAL_DATABASE_HOST=maas-postgres
MAAS_SETUP_EXTERNAL_DATABASE_PORT=5432
MAAS_SETUP_EXTERNAL_DATABASE_NAME=maas
MAAS_SETUP_EXTERNAL_DATABASE_USER=maas
MAAS_SETUP_EXTERNAL_DATABASE_PASSWORD=maas
MAAS_SETUP_MAAS_URL=http://10.100.1.222:5240/MAAS
MAAS_SETUP_ADMIN_USERNAME=admin
MAAS_SETUP_ADMIN_EMAIL=admin@example.org
@pirogoeth
pirogoeth / limit.go
Created May 31, 2024 22:16
things i implemented before i realized go stdlib had it
package goro
import (
"context"
"errors"
"sync"
)
type LimitGroup struct {
sema *SlottedSemaphore
@pirogoeth
pirogoeth / loki-chunks.json
Last active January 13, 2024 05:09 — forked from chancez/loki-chunks.json
Loki dashboards that work with monolithic mode or microservices mode
{
"annotations": {
"list": [ ]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"links": [ ],
"refresh": "10s",
@pirogoeth
pirogoeth / meta.yml
Last active November 30, 2023 03:53
[blog] Smartifying a dumb LED strip
---
categories:
- Hardware
- LED
- Lighting
- ESP32
title: Smartifying a dumb LED strip
slug: smartifying-dumb-led-strip
coverImage: ~
published: false
@pirogoeth
pirogoeth / README.md
Created July 14, 2023 15:59
coder w/ tailscale tunneling

assumptions:

  • your Docker setup isn't using 172.20/16 already
    • update the network at networks.tailnet.ipam.config.0 to be an unused network if already in use
    • also set a TS_ROUTES=your-network/24 environment variable to change the routing for the Tailscale network
  • you're not running rootless Docker/Podman
  • traefik is configured in your stack. specifically:
    • is attached to a Docker network called "servicenet", which is the network all "publically exposed" services listen on
    • consumes docker container labels to build the service catalog
  • has a TLS cert resolver called "default-le" (set TRAEFIK_TLS_RESOLVER=, otherwise)
@pirogoeth
pirogoeth / docker-compose.yml
Created May 12, 2023 01:54
coder provisioner server w/ tailscale router
version: "3.9"
networks:
backend: {}
outbound: {}
tailnet:
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import enum
import itertools
import smtplib
import time
import threading
import textwrap
# This file contains common pin mappings for the FlashForge-Creator-Pro
# To use this config, the firmware should be compiled for
# the Atmel atmega2560.
# Use the following command to flash the board:
# avrdude -c stk500v2 -p m2560 -P /dev/serial/by-id/usb-MakerBot_Industries_The_Replicator_557373136313514061A2-if00 -b 57600 -D -U out/klipper.elf.hex
# See docs/Config_Reference.md for a description of parameters.
[include mainsail.cfg]
@pirogoeth
pirogoeth / multitail.py
Last active May 25, 2022 22:37
Tail a file across many hosts
# -*- coding: utf-8 -*-
# from __future__ import annotations
import io
import logging
import os
import sys
from tempfile import mkstemp
from typing import List