Skip to content

Instantly share code, notes, and snippets.

View tstellanova's full-sized avatar
💭
growing excited

Todd Stellanova tstellanova

💭
growing excited
View GitHub Profile
@tstellanova
tstellanova / uconsole_cm4_setup.md
Last active March 3, 2024 21:50
New uConsole setup

Assembly

  • When assembling the uConsole, at step "E. Mount the Core", the CM4 module tends to unplug/disengage from the two connectors that hold it on the main board. Carefully use glue or another method to secure the CM4 to the core board.
  • When placing the heat transfer putty on the CM4, between the CM4 and the case, spread the putty so that it will make approximately flat contact with the case. The Broadcom chip is a bit thicker than the adjacent chips. If needed you can scribe some shallow hash marks into the putty to make it spread more easily.

Software Configuration

  • Use the external antenna rather than the CM4 internal antenna
@tstellanova
tstellanova / gui1_liners.sh
Last active March 2, 2024 05:24
one liners for wmctrl and xrandr on ubuntu 22 with wayland
# wmctrl one-liners
# DISPLAY is needed if you're running from eg an ssh shell
# list all windows
DISPLAY=:0 wmctrl -lG
# Resize the "active" window
# dimensions are: X,Y,width,height
DISPLAY=:0 wmctrl -r :ACTIVE: -e 0,40,40,1000,500
@tstellanova
tstellanova / x11grab_ffmpeg.sh
Created January 28, 2024 21:04
ffmpeg one liners to capture a portion of the screen and save to video file using x11grab
# x11grab from the default device at offset x=70, y=65
ffmpeg -video_size 1280x720 -framerate 30 -f x11grab -i :0.0+70,65 -c:v libx264rgb -crf 0 -preset ultrafast -color_range 2 out6.mkv
# use x265 output encoding instead
ffmpeg -video_size 1280x720 -framerate 30 -f x11grab -i :0.0+70,65 -c:v libx265 out7.mp4
@tstellanova
tstellanova / convert_image_to_raw.sh
Created January 14, 2024 00:26
Create 1bpp raw data file from any image with imagemagick, for eg embedded rust custom mono fonts
# first, install imagemagick, eg on debian:
# sudo apt install libpng-dev libjpeg-dev libtiff-dev imagemagick
convert input_image.png -depth 1 gray:output.raw
@tstellanova
tstellanova / dump_frame.sh
Last active December 27, 2023 17:55
Grab a single frame from a video using ffmpeg
# Input a video ID (this is used to build an input filename) and frame to dump
video_id=$1
guess_frame=$2
# modern video formats prefer timestamps over framerates, so YMMV
frame=$(( ${guess_frame} ))
printf "video_id: %s frame: %d \r\n" ${video_id} ${frame}
# this is a heuristic guess as to how frequently (every 250 frames) we see a keyframe
keyframe=$(( ${frame} / 250 ))
@tstellanova
tstellanova / micropython_for_ch32v0x.md
Last active November 12, 2023 00:32
Building micropython for WCH CH32v07

Simple grab n build

git clone https://github.com/r4d10n/micropython-wch-ch32v307.git
cd micropython-wch-ch32v307
make -C mpy-cross
@tstellanova
tstellanova / esp32_s2_rgb_led_micropython.md
Last active January 2, 2023 16:48
Notes on driving onboard RGB LEDs on various ESP32 S2 dev boards with micropython or circuitpython
@tstellanova
tstellanova / rok64_audio_setup.md
Created January 22, 2022 18:08
rock64 audio setup

Edit the following:

sudo vi /etc/asound.conf
defaults.ctl.card 1
defaults.pcm.card 1
defaults.pcm.device 0
@tstellanova
tstellanova / ether_echo.cpp
Created January 4, 2022 23:52
Simple Particle BSOM example that uses the Ethernet capability of the M.2 SOM Eval Board (EVB)
/*
* Project etherecho
* Description:
* Author:
* Date:
* Can use eg `telnet 10.0.1.47 80` to connect to this echo server
* Ensure your EVB has ETH_* jumpers connected.
*/
#include "Particle.h"
@tstellanova
tstellanova / adsbex_armbian.md
Last active October 16, 2021 04:07
Setup an Armbian-based adbsexchange feeder with both 1090 and 978 MHz support

1090 Support

Install prerequisites:

sudo apt-get install rtl-sdr lighttpd
sudo apt-get install build-essential debhelper librtlsdr-dev pkg-config dh-systemd libncurses5-dev libbladerf-dev
sudo apt install libhackrf-dev liblimesuite-dev libbladerf-dev