Skip to content

Instantly share code, notes, and snippets.

@piratecarrot
piratecarrot / README.md
Last active September 12, 2024 00:43
Windows 10 Enterprise

These steps have to be done on Windows unfortunately

Get media creation tool https://go.microsoft.com/fwlink/?LinkId=691209

At a command prompt MediaCreationTool_22H2.exe /Eula Accept /Retail /MediaArch x64 /MediaLangCode en-GB /MediaEdition Enterprise

Product Key Windows 10 Enterprise NPPR9-FWDCX-D2C8J-H872K-2YT43

@piratecarrot
piratecarrot / README.md
Last active September 11, 2024 23:32
Freescale/NXP eTPU
@piratecarrot
piratecarrot / README.md
Created August 26, 2024 11:55
Libvirt XML SLIC Windows

libvirt SLIC insert

This assumes you are using libvirt, I have not tested on anything else.

Add the below ACPI section with the table entry to your libvirt XML file.

@piratecarrot
piratecarrot / arch-nuttx
Last active July 30, 2024 14:19
NuttX environment setup on Arch
sudo pacman -S bison\
flex \
picocom \
arm-none-eabi-binutils \
arm-none-eabi-gcc \
arm-none-eabi-gdb \
arm-none-eabi-newlib
yay -S --noconfirm \
kconfig-frontends \
# Disabled flag, used to check and enable or disable login provider.
# 1 = Disabled credential provider
# 0 = Enabled credential provider
$DisbaleFlag = "1"
# Registry keys for removing Password and Pin login.
$registryKeys =
@(
[pscustomobject]@{Name="PasswordProvider";Location="HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{60b78e88-ead8-445c-9cfd-0b87f74ea6cd}";Key="Disabled";Value="1"},
# [pscustomobject]@{Name="PINLogonProvider";Location="HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\Credential Providers\{cb82ea12-9f71-446d-89e1-8d0924e1256e}";Key="Disabled";Value="1"},
@piratecarrot
piratecarrot / kicad-tag-replacer.py
Created February 29, 2024 23:30
Replace tags in KiCAD files
#!/usr/bin/env python
import glob, os
import tomllib
data = {}
for file in glob.glob("build/env.d/*.env"):
with open(file, "rb") as f:
for k, v in tomllib.load(f).items():
@piratecarrot
piratecarrot / 10-keyboard-leds.rules
Created February 17, 2024 10:51
clevo_wmi (tuxedo-keyboard) keyboard LED udev rule and script on Arch Linux but probably works with others
# /etc/udev/rules.d/10-keyboard-leds.rules
ACTION=="add", SUBSYSTEM=="leds", DEVPATH=="/devices/platform/tuxedo_keyboard/leds/rgb:kbd_backlight_2", RUN+="/usr/local/bin/keyboard-leds.sh"
set interfaces openvpn vtun0 mode client
set interfaces openvpn vtun0 remote-host <remote-host>
set interfaces openvpn vtun0 remote-port <remote-port>
set interfaces openvpn vtun0 persistent-tunnel
set interfaces openvpn vtun0 authentication username <username>
set interfaces openvpn vtun0 authentication password <password>
set interfaces openvpn vtun0 encryption aes256
set interfaces openvpn vtun0 hash sha512
@piratecarrot
piratecarrot / spinner.go
Last active December 14, 2023 16:21
GoLang Fyne spinner widget
package uisim
import (
"fmt"
"image/color"
"reflect"
"strconv"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
@piratecarrot
piratecarrot / main.py
Created November 10, 2022 13:30
Python SPIDEV controlling Maxim MAX14915 on STM32MP1
import gpiod
import spidev
from maxim import Type, Output, RegisterAddress, FastStatus, GlobalError, Config1, Config2, Mask, Interrupt, cmd
import time
#if __name__ == '__main__':
chip_b = gpiod.chip(1)
chip_c = gpiod.chip(2)
chip_h = gpiod.chip(7)