Skip to content

Instantly share code, notes, and snippets.

View aconz2's full-sized avatar

Andrew Consroe aconz2

View GitHub Profile
@aconz2
aconz2 / inspecttar.py
Created October 25, 2024 20:10
little script to print out tar file info and also for oci image manifest per layer
#!/usr/bin/env python
import tarfile
import json
from pathlib import Path
import argparse
types = {}
for k in 'REGTYPE AREGTYPE LNKTYPE SYMTYPE DIRTYPE FIFOTYPE CONTTYPE CHRTYPE BLKTYPE GNUTYPE_SPARSE'.split():
types[getattr(tarfile, k)] = k
@aconz2
aconz2 / report.md
Created January 21, 2025 17:46
how I flashed an artillery sidewinder x2 firmware

okay this should probably go in a bug report or get reported upstream but that is hard sometimes because it takes a lot of work to report and is sometimes murky who to report to and I feel like a bother when there are 8 million issues already. hoping this ends up in search results

I wanted to flash new marlin firmware 2.1.2.5 to get linear advance on an artillery sidewinder x2. I'm on linux fedora 40. I downloaded vs code with the auto build marlin extension and platformio version 6.1.16.

Build was successful but then hit an error when trying to flash/upload. using lsub I observe the stm32 device vendor id : product id (vid:pid) 0483:5740 and later when in bootloader mode 0483:df11.

Bus 001 Device 017: ID 0483:5740 STMicroelectronics Virtual COM Port <- example when not in bootloader mode

The error from platformio which uses openocd (tool-openocd @ 3.1200.0 (12.0)) was

@aconz2
aconz2 / pe.toml
Created July 15, 2025 22:03
program explorer test gist
image = "index.docker.io/library/busybox@sha256:086417a48026173aaadca4ce43a1e4b385e8e62cc738ba79fc6637049674cac0"
cmd = "sh /run/pe/input/test.sh"
@aconz2
aconz2 / a.txt
Last active July 16, 2025 21:42
gist test with a non-truncated file and two truncated files
hello world
@aconz2
aconz2 / traversal.js
Created July 29, 2025 21:21
cheap way to compute a pretty good traversal to visit 2d points
// public domain or Unlicense or MIT licensed
// operates in place
function sortPoints(points) {
let bb = bbox(points);
let bands = numberOfBands(points, bb);
sortYbandsX(points, bb, bands);
}
function sortYbandsX(points, bbox, bands) {