Skip to content

Instantly share code, notes, and snippets.

@AXKuhta
AXKuhta / .config
Created December 26, 2022 15:45
NuttX RP2040 QuickJS config
#
# Automatically generated file; DO NOT EDIT.
# NuttX/x86_64 Configuration
#
#
# License Setup
#
# CONFIG_ALLOW_BSD_COMPONENTS is not set
# CONFIG_ALLOW_GPL_COMPONENTS is not set
@AXKuhta
AXKuhta / http.py
Created November 24, 2022 14:29
Nucleo F746ZG Micropython HTTP
import network
import socket
x = network.LAN()
x.active(True)
print(x.ifconfig())
ListenPort = 80
Host = ''
@AXKuhta
AXKuhta / fetch.jsx
Last active November 17, 2022 14:19
React fetch note
import React from "https://cdn.skypack.dev/[email protected]";
import ReactDOM from "https://cdn.skypack.dev/[email protected]";
function Demo ({inpv}) {
return (<pre><code>{inpv}</code></pre>);
}
function App () {
const [text, setText] = React.useState("Waiting...");
@AXKuhta
AXKuhta / install.reg
Created February 21, 2022 10:07
MSYS2 Start Here -- It's extremely frustrating that they won't add this as an option to their installer
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\msys2]
@="MSYS2 Bash Here"
"Icon"="\"C:\\msys64\\msys2.ico\""
[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\msys2\command]
@="C:\\msys64\\msys2.exe env CHERE_INVOKING=1 bash -li"
@AXKuhta
AXKuhta / .config
Last active June 3, 2021 10:18
BQ 2400L dot config
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 4.4.83 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_MIGHT_HAVE_PCI=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_STACKTRACE_SUPPORT=y
@AXKuhta
AXKuhta / stereo_stream.bat
Created August 30, 2020 04:41
Very low latency Raspberry Pi camera streaming
nc64 -L -p 5002 | mpv - --no-cache --untimed --no-demuxer-thread --video-sync=audio --vd-lavc-threads=1 --fps=50 --lavfi-complex="[vid1] split [s0][s1]; [s0][s1] hstack [vo]"
REM Requires netcat -- google for "nc64.exe"
REM run this on RPi: raspivid -t 0 -b 2000000 --hflip --vflip -o - -w 1296 -h 972 -fps 42 | nc 192.168.1.101 5002
@AXKuhta
AXKuhta / test.bmx
Created July 1, 2020 12:59
Misusing bbThreadSetData() and bbThreadGetData() in BlitzMax NG
' This code works on x64 windows, but fails on arm64
' That occurs because the upper 4 bytes of the pointer get cut off and arm relies on them
' I.e. 0x0000007f88799fc0 turns into 0xffffffff88799fc0 on arm
' On x64 it doesn't crash because the upper 4 bytes are just so happen to be unused
' I.e. 0000000003139FC0 still remains 0000000003139FC0
' You _can_ make it work on arm if you manually replace the higher 0xffffffff back to 0x0000007f
'
' This code is only for documenting purposes
Framework BRL.StandardIO
@AXKuhta
AXKuhta / CameraFunctions.bmx
Last active March 7, 2023 05:54
OpenB3D and Newton Dynamics
Import OpenB3DMax.B3DGLGraphics
' TODO: Tweakable keybindings and speeds
Function MouseLook(pivot:TMesh, camera:TCamera, time:Long )
Local elapsed:Long
Repeat
elapsed=MilliSecs()-time
Until elapsed>0
@AXKuhta
AXKuhta / web.log
Created September 25, 2019 02:31
tuya-convert new-api branch with the python change
pi@raspberrypi:~/convert2.1/tuya-convert/scripts $ tail -f smarthack-web.log
tornado.ioloop.IOLoop.current().start()
File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", lin e 148, in start
self.asyncio_loop.run_forever()
File "/usr/lib/python3.7/asyncio/base_events.py", line 539, in run_forever
self._run_once()
File "/usr/lib/python3.7/asyncio/base_events.py", line 1739, in _run_once
event_list = self._selector.select(timeout)
File "/usr/lib/python3.7/selectors.py", line 468, in select
fd_event_list = self._selector.poll(timeout, max_ev)
@AXKuhta
AXKuhta / mqtt.log
Last active September 24, 2019 13:55
These are terminal dumps. First I tried the "newer" tuya-convert (~/convert2/tuya-convert) from the https://github.com/kueblc/tuya-convert/tree/new-api, then the "older" one (~/tuya-convert) from https://github.com/M4dmartig4n/tuya-convert, while running tail -f on their logs. You can make sense of what is where by doing ctrl+f for "tail -f".
pi@raspberrypi:~/convert2/tuya-convert/scripts $ tail -f smarthack-mqtt.log
1569302251: mosquitto version 1.5.7 starting
1569302251: Using default config.
1569302251: Opening ipv4 listen socket on port 1883.
1569302251: Opening ipv6 listen socket on port 1883.
^C1569302467: mosquitto version 1.5.7 terminating
1569302533: mosquitto version 1.5.7 starting
1569302533: Using default config.
1569302533: Opening ipv4 listen socket on port 1883.
1569302533: Opening ipv6 listen socket on port 1883.