Skip to content

Instantly share code, notes, and snippets.

@tetele
tetele / README.md
Last active April 17, 2024 16:05
ESPHome config - Raspiaudio Muse Luxe as a voice assistant satellite in Home Assistant

Introduction

The purpose of this ESPHome config is to be able to use the Raspiaudio Muse Luxe as a voice assistant satellite in Home Assistant.

Features

  • wake word, push to talk and continuous conversation support
  • response playback
  • service exposed in HA to start and stop the voice assistant from another device/trigger
  • visual feedback of the recording/success/error status via the Luxe's onboard LED
@coltonbh
coltonbh / docker-swarm-gpu.md
Last active April 15, 2024 04:33
Docker Swarm GPU Support

GPU Support For Docker Swarm

Docker compose has nice support for GPUs, K8s has moved their cluster-wide GPU scheduler from experimental to stable status. Docker swarm has yet to support the device option used in docker compose so the mechanisms for supporting GPUs on swarm are a bit more open-ended.

Basic documentation

@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active April 24, 2024 22:18
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
@mschwaig
mschwaig / sway.nix
Last active March 17, 2024 16:45
Configure sway as the window manager for NixOS with gdm as the display manager
{ config, pkgs, lib, ... }:
{
# This sway config is mostly based on https://nixos.wiki/wiki/Sway
# which integrates sway with systemd in the style described here
# https://github.com/swaywm/sway/wiki/Systemd-integration
# and the replies in https://github.com/NixOS/nixpkgs/issues/57602
# with some individual packages added/removed and using sddm as the display manager.
#
# Take care to start the correct target as described by the sway proejct wiki.
@sahilsk
sahilsk / sts-decode.py
Created June 7, 2020 08:18
aws sts decode-authorization-message
import boto3
import json
import sys
encodedMessageStr = sys.argv[1]
client = boto3.client('sts')
response = client.decode_authorization_message(
EncodedMessage=encodedMessageStr
)
@insdavm
insdavm / WireGuard-site-to-site.md
Last active April 21, 2024 19:53
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@frozenice
frozenice / hddperftest
Last active September 29, 2023 22:06
quick perf test for the new Hetzner cloud volumes
# nbg1-dc3, CX11, Ubuntu 20.04, 10 GB EXT4 Volume
# local SSD
root@voltest:~# hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads: 14624 MB in 1.99 seconds = 7341.48 MB/sec
@seanhandley
seanhandley / docker-compose.yml
Last active April 9, 2024 04:05
How To Set Up Docker For Mac (Mojave) with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@BretFisher
BretFisher / swarm-upgrade.md
Last active March 19, 2024 09:37
docker swarm upgrade

Replace your Swarm Manager and Workers with updated versions of docker

  • it's best to replace nodes, don't do apt/yum upgrades.
  • both would work, but VM replacment forces me to think of it as immutable and prevents making pets
  • if you don't want to update join scripts for manager IP's, then do something like Elastic IP's so manager IP's won't change.

Lets assume you have 3 managers and 3 workers on 17.06 and you want to update to 17.12

  • managers: m1, m2, m3
@jamesbar2
jamesbar2 / postal-codes.json
Last active April 17, 2024 17:40 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",