Skip to content

Instantly share code, notes, and snippets.

View tuxpowered's full-sized avatar

TuxPowered tuxpowered

View GitHub Profile
@spali
spali / 10-wancarp
Last active November 11, 2025 17:07
Disable WAN Interface on CARP Backup
#!/usr/local/bin/php
<?php
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
$subsystem = !empty($argv[1]) ? $argv[1] : '';
$type = !empty($argv[2]) ? $argv[2] : '';
@tomdaley92
tomdaley92 / README.md
Last active December 5, 2025 20:15
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@NameOfTheDragon
NameOfTheDragon / Useful Klipper Macros
Created April 22, 2021 02:23
Klipper gcode macros that I use with my Creality Ender 3
# These macros are required for Fluidd to correctly function.
# You can copy these entries into your printer.cfg.
#
# Alternatively, import this file by adding
# this line into your printer.cfg;
#
# [include client_macros.cfg]
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
@ddutt
ddutt / ssh_timeit.py
Created September 8, 2020 04:49
Benchmarking various Python SSH libraries for communicating with network devices
#!/usr/bin/env python3
import sys
import socket
from timeit import Timer
import asyncssh
import asyncio
import paramiko
@sinbad
sinbad / backup_gitea.sh
Created August 9, 2020 14:58
My Gitea Backup & Restore Scripts
#!/bin/bash
# `gitea dump` doesn't currently back up LFS data as well, only git repos
# It primarily backs up the SQL DB, and also the config / logs
# We'll backup like this:
# * "gitea dump" to backup the DB and config etc
# * tar / bzip all the repos since they will be skipped
# * Not rotated because git data is immutable (normally) so has all data
# * rsync LFS data directly from /volume/docker/gitea/git/lfs
# * No need for rotation since all files are immutable
@nkhitrov
nkhitrov / logger.py
Last active August 29, 2025 00:11
Configure uvicorn logs with loguru for FastAPI
"""
WARNING: dont use loguru, use structlog
https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f
Configure handlers and formats for application loggers.
"""
import logging
import sys
from pprint import pformat
@thoaster
thoaster / reset.sh
Last active December 3, 2025 07:19
Transmit 5 Trial Reset
#!/bin/sh
# Reset Transmit 5 Trial
# curl -fsSL https://gist.githubusercontent.com/thoaster/ca5b4fdb653b9cdb3930897045b78558/raw/reset.sh | bash
set +e
set -x
sudo rm -rf ~/Library/Caches/com.panic.Transmit
sudo rm -rf ~/Library/Application\ Support/com.panic.Transmit
sudo rm ~/Library/Preferences/com.panic.Transmit.plist
@SimonShapiro
SimonShapiro / Latest status.md
Last active February 16, 2022 05:02
This gist is a python (anvil) snapshot of the auth flow against NSS. It contains the auth process up to the redirect to NSS and the callback code.

pop_token

{'iss': '04f576620a243986e7b11674d435063f', 
'aud': 'https://anvil1.inrupt.net',
 'exp': 1564403772,
 'iat': 1563194173, 
'id_token': 'eyJhbGciOiJSUzI1NiIsImtpZCI6InZaaUNkZGVIbHQ0In0.eyJpc3MiOiJodHRwczovL2lucnVwdC5uZXQiLCJzdWIiOiJodHRwczovL2FudmlsMS5pbnJ1cHQubmV0L3Byb2ZpbGUvY2FyZCNtZSIsImF1ZCI6IjA0ZjU3NjYyMGEyNDM5ODZlN2IxMTY3NGQ0MzUwNjNmIiwiZXhwIjoxNTY0NDAzNzcyLCJpYXQiOjE1NjMxOTQxNzIsImp0aSI6ImY3NGRlMWUxOTQ0ZjExY2YiLCJub25jZSI6ImYxN2NhOGVlOWUwNzQ3ZWQ4NDZkNzhhZGYzYzNhYjRiIiwiYXpwIjoiMDRmNTc2NjIwYTI0Mzk4NmU3YjExNjc0ZDQzNTA2M2YiLCJhdF9oYXNoIjoiazZNakJjV3BhQnR1Q0NMdVgzdHlLQSJ9.SWEdPYVP-QWxgJjeDJ8CkQ6jvVpBrzlo3OUjDQFfXE0C5C4h9RG9QKJ1YUDUrZYFDbDQMcaSskkGL9Hud0iYARoWQNQg3CF4R47Oi4hin3vf39tbFdXSYQjVtWIiSyeHaB_scfVHRu8LnO2-g9PqLKhW5H-397DSP6nyWzlyYzPy_I8NDmwfVU56JdpXC0eRBA9LCHtAxnlGDSSXNYwiHAqTB2tm_lJ8RctKF3K_9RoKWgq4LnsLMK7W81Lguf7XemvfFPysyXJKYk_pUpFnHeOgQqXuSTRM7RlSpmilF9n9quMUPFFOWGmjAkrszULxbd5Tzy0LPmCMsr7OWHkelQ',
 'token_type': 'pop'}

I'm getting status 401 Unauthorized. The header has an err

from fastapi import FastAPI, Depends, Query
from starlette.requests import Request
from starlette.responses import JSONResponse
import starlette.status
from pydantic import BaseModel, validator
import datetime
from typing import List
from dataclasses import dataclass, field

Run mdadm - this command is used to manage and monitor software RAID devices in linux.

mdadm --detail /dev/md0 or md<N>

mount -t ext4 /dev/md0 /share/MD0_DATA

Check disks

mdadm --examine /dev/sdd3