Skip to content

Instantly share code, notes, and snippets.

@parkerlreed
parkerlreed / image_switch.sh
Created February 22, 2026 17:18
UNO Q IODD
#!/bin/bash
set -euo pipefail
. /home/arduino/.venv/bin/activate
python3 /home/arduino/uno.py "Unmounted -----"
MEDIA_DIR="/home/arduino/msd_media"
STATE_FILE="/home/arduino/.msd_cycle_last" # stores last served full path
EXTS=("iso" "img") # cycle these extensions
G=/sys/kernel/config/usb_gadget/msd
System Information:
OS Version:
Linux Distribution: Steam Runtime 2 (soldier)
Kernel Version: 6.11.11-valve27-1-neptune-611-g60ef8556a811 #1 SMP PREEMPT_DYNAMIC Thu, 08 Jan 2026 10:09:09 +0000
Hardware Info:
Machine Type To Be Filled By O.E.M. B450M/ac R2.0 To Be Filled By O.E.M.
CPU Type AuthenticAMD x86_64
CPU Info AMD Ryzen 7 1800X Eight-Core Processor
CPU Speed 3600 MHz
#!/usr/bin/env python3
import struct
import sys
import serial
PORT_DEFAULT = "/dev/ttyUSB0"
BAUD = 115200
ROTATE_ID = 0x28 # fixed/reused
ROTATE_OPCODE = 0x08
parker@parker-framework:~/Downloads/brush-app-x86_64-unknown-linux-gnu$ ./brush_app
radv/amdgpu: Not enough memory for command submission.
thread 'main' panicked at /home/runner/.cargo/git/checkouts/wgpu-50febe783b343bfe/bdf430c/wgpu/src/backend/wgpu_core.rs:3591:38:
Error in Surface::present: Validation Error
Caused by:
Parent device is lost
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@parkerlreed
parkerlreed / gist:278cfe26a365408ce5250c72036baa53
Created October 16, 2025 19:04
NOMVDIC X300 Projector UART
UART_115200
AC_ON
BIST0-OK
BIST1-OK
#_eMMC_RPMB_Check_Program_Key
*NOTICE: BL3-1: v1.1(debug):0014a44
09-11 16:11:34.549 2675 2675 I {OngoingActivityDataHelper}: setBaseActivityComponentName:ComponentInfo{com.sec.android.app.launcher/com.sec.android.app.launcher.Launcher}
09-11 16:11:34.549 2675 2675 D InterruptionStateProvider: no Heads up : edgelighting enabled app. 0|org.proninyaroslav.libretorrent|-1|null|10496
09-11 16:11:34.551 1468 1551 I SurfaceFlinger: Capture layer list: Wallpaper BBQ wrapper 7_systemlock#116(seamlessTransition:0)
09-11 16:11:34.552 1468 1551 I SurfaceFlinger: Capture layer list: com.sec.android.app.launcher/com.sec.android.app.launcher.Launcher$_8448#290439(seamlessTransition:0)
09-11 16:11:34.556 8448 8448 I HoneySpace.FloatingAnimator: [Player:A(33.905)] container x: 98.76117, y: 311.0, scale : 0.13611111
09-11 16:11:34.557 8448 8579 I VRI[Launcher]@af0b33a: mWNT: t=0xb400007821e466d0 mBlastBufferQueue=0xb400007881e125d0 fn= 82 HdrRenderState mRenderHdrSdrRatio=1.0 caller= com.android.systemui.shared.launcher.ViewRootImplCompat.mergeWithNextTransaction:4 com.hone
W/SocketClient( 1178): write error (Broken pipe)
W/SocketClient( 1178): write error (Broken pipe)
W/SocketClient( 1178): write error (Broken pipe)
W/SocketClient( 1178): write error (Broken pipe)
W/SocketClient( 1178): write error (Broken pipe)
D/dalvikvm(16629): GC_CONCURRENT freed 4260K, 53% free 5343K/11284K, paused 2ms+1ms, total 8ms
D/dalvikvm(16629): GC_FOR_ALLOC freed 58K, 51% free 5535K/11284K, paused 1ms, total 1ms
I/dalvikvm-heap(16629): Grow heap (frag case) to 7.945MB for 2536932-byte allocation
D/dalvikvm(16629): GC_CONCURRENT freed <1K, 29% free 8012K/11284K, paused 0ms+0ms, total 3ms
D/dalvikvm(16629): WAIT_FOR_CONCURRENT_GC blocked 3ms
@parkerlreed
parkerlreed / ctp500_print.py
Last active September 25, 2025 21:04
Print to the CTP500 thermal printer from Linux using Bluetooth
import sys
import bluetooth
from PIL import Image
import numpy as np
def convert_image_to_escpos_raster(filepath, width=384, dither=False):
# Load RGBA image and separate alpha mask
img_rgba = Image.open(filepath).convert("RGBA")
alpha = img_rgba.getchannel("A")
import sys
import bluetooth
from PIL import Image, ImageOps
import numpy as np
import os
def convert_image_to_bitpacked(filepath, width=384, height=390):
# Load the image with RGBA mode to preserve alpha
img = Image.open(filepath).convert("RGBA")