Skip to content

Instantly share code, notes, and snippets.

@piratecarrot
piratecarrot / spinner.go
Last active March 17, 2026 23:48
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)
@piratecarrot
piratecarrot / install-wildfly.txt
Created March 17, 2022 04:18
Install WildFly on Debian 11
# Guide takend from
# https://computingforgeeks.com/how-to-install-wildfly-jboss-on-debian-linux/
sudo apt update
sudo apt install openjdk-17-jdk
export WILDFLY_RELEASE="26.0.1"
wget https://github.com/wildfly/wildfly/releases/download/${WILDFLY_RELEASE}.Final/wildfly-${WILDFLY_RELEASE}.Final.tar.gz
sudo tar xvf wildfly-${WILDFLY_RELEASE}.Final.tar.gz -C /opt
sudo mv /opt/wildfly-${WILDFLY_RELEASE}.Final /opt/wildfly
sudo groupadd --system wildfly
@piratecarrot
piratecarrot / gist:74331b06a7303404a0793533de38672f
Created February 7, 2022 11:58
Updating MMC device with file loaded over TFTP all within u-boot - STM32MP157F-DK2
STM32MP> mmc part
Partition Map for MMC device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00000022 0x00000221 "fsbl1"
attrs: 0x0000000000000000
@piratecarrot
piratecarrot / gist:5b51fbb979988d79f2b062b8f85b0549
Last active August 12, 2025 05:31
Flashing STM32MP1 eMMC for Seeed Odyssey board
# Put contents of $BUILDROOT/output/images onto Debian SD in /home/debian
# Run from /home/debian
cat<<__EOF__ | sudo sfdisk -f /dev/mmcblk1
label: gpt
label-id: 8180153F-48CF-4520-BB44-AF0F881C8679
device: /dev/sdc
unit: sectors
first-lba: 34
/dev/mmcblk1p1 : start= 34, size= 412, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=7AB96C94-9AAA-4736-A97F-4950BC078562, name="fsbl1"
@piratecarrot
piratecarrot / add-google-workspace-dns.sh
Created November 17, 2021 01:15
Add Google Workspace DNS records
#!/bin/bash
resourceGroup="my-resource-group"
sites=("test.com" "test.net" "test.org")
mailExchanges=("aspmx4.googlemail.com" "alt2.aspmx.l.google.com" "aspmx2.googlemail.com" "aspmx3.googlemail.com" "aspmx.l.google.com" "alt1.aspmx.l.google.com" "aspmx5.googlemail.com")
preferences=( 30 20 30 30 10 20 30 )
for site in ${sites[@]}; do
for i in ${!mailExchanges[@]}; do
az network dns record-set mx add-record \
export BASE=/var/lib/build
cd $BASE
mkdir -p $BASE/bbb/build
cd $BASE
git clone -b dunfell git://git.yoctoproject.org/poky.git poky-dunfell
cd poky-dunfell
git clone -b dunfell git://git.openembedded.org/meta-openembedded
git clone -b dunfell https://github.com/meta-qt5/meta-qt5.git
git clone -b dunfell git://git.yoctoproject.org/meta-security.git
git clone -b dunfell https://github.com/jumpnow/meta-jumpnow.git
#!/bin/bash
DIR=~/workspaces/kicad
REPOS=('symbols' 'footprints' '3dmodels')
for i in "${REPOS[@]}"
do
echo git -C $DIR/$i "$@"
git -C $DIR/$i "$@"
@piratecarrot
piratecarrot / keepassxc-setup.sh
Last active October 2, 2023 10:45
Setting up KeePassXC with Google Drive synchronisation and SSH Agent
# This is intended to be copied and pasted to a console, not executed as a script... for now.
# Install some stuff, I use yay, you may use something else
sudo pacman -S keepassxc rclone curl
mkdir -p ~/.local/bin
mkdir -p ~/.local/lib/private
chmod 0700 ~/.local/lib/private
# CREATE YOUR KEEPASSXC BASE IN ~/.local/lib/private/
@piratecarrot
piratecarrot / metasploit.sh
Last active September 28, 2021 12:04
Metasploit installation on Arch with PostgreSQL Docker
# I use yay package manager on Arch
# This also assumes you have a Docker environment already setup
yay -S metasploit ruby-irb rubygems ruby-bundler
docker run --name postgres-metasploit -d -p 5432:5432 -e POSTGRES_PASSWORD=mysuperpassword postgres:alpine
msfdb --connection-string=postgresql://postgres:mysuperpassword@localhost:5432/postgres reinit --component database