Skip to content

Instantly share code, notes, and snippets.

Debugging Python Boot Issues

Date: 2024-12-19

Problem

When MicroPython firmware fails during boot (e.g., due to import errors in frozen modules), the board may appear dead with no visible error output. Debug builds have REPL enabled, but if the main script crashes on import, you won't see the stacktrace unless you manually trigger the import.

Solution: Iterative Debug Workflow

@k9ert
k9ert / bmad-beads-integration-research.md
Created December 7, 2025 09:51
BMad + Beads Integration Research - Exploring complementary AI development frameworks

BMad + Beads Integration Research

Research Date: December 7, 2025 Researcher: BMad Orchestrator Agent Purpose: Investigate potential integration between BMad-METHOD and Steve Yegge's Beads


Executive Summary

@k9ert
k9ert / gist:3edcf1205a283030786109394eaacc1a
Last active March 5, 2024 12:28
Dynamically loading functions from files in a directory and exposing them via a variable
import {readdirSync} from 'fs'
import path from 'path'
export const logAPICall = async <T>(
apiFunction: () => Promise<T>,
functionName: string,
): Promise<T> => {
try {
const result = await apiFunction()
logger.error(
@k9ert
k9ert / websockets.py
Created July 4, 2022 14:43
websockets with server-side code sending msgs out to clients
#!/usr/bin/env python3
import asyncio
import os
import subprocess
import sys
import time
import websockets
from websockets import connect
@k9ert
k9ert / chaincode_test.py
Created July 2, 2022 12:04
chaincode_test
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""An example functional test
getting node 1 to mine another block, send it to node 2, and check that node 2 received it.
"""
from collections import defaultdict
@k9ert
k9ert / gist:7890be48fe00abf5e3f2fde928d80e1c
Last active May 24, 2022 07:57
Scanning the utcoset in specter
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 2ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
[ DEBUG] in rpc: call repeated 1 times
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 2ms) payload:[{'method': 'listtransactions', 'params': ['*', 1000, 0, True], 'jsonrpc': '2.0', 'id': 0}]
[ DEBUG] in rpc: call(wallet/specter/ghostmachine )( 1ms) payload:[]
(.env) kim@nucii➜ pytho3.10 cp ~/src/specter-desktop/requirements.in .
(.env) kim@nucii➜ pytho3.10 pip-compile --generate-hashes requirements.in
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes requirements.in
#
aniso8601==9.0.1 \
--hash=sha256:1d2b7ef82963909e93c4f24ce48d4de9e66009a21bf1c1e1c85bdd0812fe412f \
@k9ert
k9ert / robbyrussell.zsh-theme
Last active April 24, 2022 12:16
robbyrussell.zsh-theme
PROMPT="$USER@%M"
PROMPT+="%(?:%{$fg_bold[green]%}➜ : %{$fg_bold[red]%}➜ )"
PROMPT+=' %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"