Skip to content

Instantly share code, notes, and snippets.

View dezren39's full-sized avatar
🕵️‍♂️
Processing..

Drewry Pope dezren39

🕵️‍♂️
Processing..
View GitHub Profile
@alexaandru
alexaandru / chi.go
Created February 14, 2024 16:40
Chi-like syntactic sugar layer on top of stdlib http.ServeMux
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux.
package main
import (
"net/http"
"slices"
)
type (
middleware func(http.Handler) http.Handler
@pete3n
pete3n / README.md
Last active March 18, 2025 02:18
NixOS Offline Options

NixOS in Offline and Restrictive Networks

This gist was created to explore options for working with NixOS in a completely offline environment or inside a network with restricted internet access (such as a corporate LAN with a Proxy).

Offline Installation

Netboot/Pixieboot

@miXwui
miXwui / framework-13-amd-upgrade.md
Last active March 2, 2025 02:52
Framework 13 AMD 7080U Upgrade (From i7-1165G7, Fedora 38)

Note: this is an ongoing process which I'm documenting here. Semi-experimental, but this is my daily driver machine since September 2021 (work included), so I'm aiming for stability (hence why I'm not using the recommended Fedora 39 Beta).

Upgraded from an Intel i7-1165G7 to AMD 7080U mainboard:

  • 64GB (2x32GB) G.Skill F5-5600S4040A32GX2-RS
    • Have an SK Hynix 16GB (2x8GB) 4800MHz (HMCG66MEBSA095N BA) kit that I'll test just to see power draw difference.
  • SK hynix Gold P31 2TB PCIe NVMe Gen3 M.2 2280

These notes are for Fedora 38 6.5.8-200.fc38.x86_64 with SwayWM.

Booted into Fedora with BIOS 3.02 and seemed fine. First thing I did was upgrade to 3.03.

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt update && sudo apt install charm
# this file goes in $HOME/.config/systemd/user
[Unit]
Description=beepy backlight controller
[Service]
Type=simple
# adjust this path to where you wrote the script out
ExecStart=/home/rj/bin/noarch/beepy-bl.sh
Restart=on-failure
import RPi.GPIO as GPIO
import datetime
import os
import time
BUTTON_PIN = 17
SHORT_PRESS_TIME = 0.5 # Less than 0.5 seconds
REPEAT_TIMEOUT = 0.5 # Repeat short presses should be within 1s
MEDIUM_PRESS_TIME = 2 # Less than 2.0 seconds
# this file goes in $HOME/.config/systemd/user
[Unit]
Description=beepy backlight controller
[Service]
Type=simple
# adjust this path to where you wrote the script out
ExecStart=/home/rj/bin/noarch/beepy-bl.sh
Restart=on-failure
@ThePlenkov
ThePlenkov / boot.sh
Last active April 19, 2025 09:29
Resolve WSL DNS automatically
#!/bin/bash
# Remove existing "nameserver" lines from /etc/resolv.conf
sed -i '/nameserver/d' /etc/resolv.conf
# Run the PowerShell command to generate "nameserver" lines and append to /etc/resolv.conf
# we use full path here to support boot command with root user
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -Command '(Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | ForEach-Object { "nameserver $_" }' | tr -d '\r'| tee -a /etc/resolv.conf > /dev/null
@dezren39
dezren39 / contributor-license-agreement.md
Last active April 18, 2023 23:12
Contributor License Agreement

Thank you for your interest in contributing to developing.today LLC ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us.

How to use this Contributor Agreement

If You are an employee and have created the Contribution as part of your employment, You need to have Your employer approve this Agreement or sign a copy of this document on behalf of the Entity. If You do not own the Copyright in the entire work of authorship, any other author of the Contribution should also sign this – in any event, please contact Us at [email protected]

1. Definitions

@jxsl13
jxsl13 / koanf.go
Last active April 19, 2025 20:38
Koanf and Cobra integration
package config
import (
"errors"
"fmt"
"os"
"reflect"
"strconv"
"strings"