Skip to content

Instantly share code, notes, and snippets.

View PyroAVR's full-sized avatar

Andy PyroAVR

View GitHub Profile
@PyroAVR
PyroAVR / select_interactive.py
Created December 4, 2021 19:12
Interactive fuzzy select feat. FZF
from __future__ import annotations
from subprocess import Popen, PIPE
import sys
def select_i(choices: List[str], multi:bool=False) -> (List[int], List[str]):
"""
Interactively select from a list of choices, returning the selections
and their indices in the original list of choices.
"""
stdin_data = '\n'.join(choices).encode('utf-8')
@PyroAVR
PyroAVR / libwdi-parent_id-v1.5.0.patch
Last active November 2, 2023 19:41
libwdi parent_id patch
diff --git a/libwdi/libwdi.c b/libwdi/libwdi.c
index 0bd1296..2c2b072 100644
--- a/libwdi/libwdi.c
+++ b/libwdi/libwdi.c
@@ -25,6 +25,7 @@
#include <crtdbg.h>
#endif
+#include <initguid.h>
#include <windows.h>
@PyroAVR
PyroAVR / socat-relay.sh
Last active March 31, 2025 17:48
Mirror a serial port with socat
socat /dev/ttyUSB2,rawer system:'tee in.log | socat stdio "pty,rawer,link=/tmp/relay" | tee out.log'
# this doesn't seem to work with all applications, but it's a start. Redirect your application to talk to /tmp/relay instead of /dev/ttyUSB2, in this example.
# IOCTLs are not transferred, so you may need to set the port speed manually with stty -F <port> <speed> <settings>