Skip to content

Instantly share code, notes, and snippets.

View LeoDJ's full-sized avatar

LeoDJ

View GitHub Profile
@jackm
jackm / can-packages-and-tools.md
Last active December 3, 2024 20:47
Collection of CAN bus packages and tools

Collection of CAN bus packages and tools

This document assumes the use of Linux as the chosen development platform. Items in bold are highly recommended.

It is recommended to use SocketCAN when working with CAN bus on Linux. It is supported by the Linux kernel mainline and follows the Linux interface model, allowing you to use other network tools such as Wireshark. This also allows the creation of virtual CAN interfaces where no physical hardware is required to simulate or replay CAN messages.

@darkxst
darkxst / rules.txt
Last active November 27, 2024 17:56 — forked from denniskupec/rules.txt
KiCad DRC rules for JLCPCB, 2 & 4-layer PCB
(version 1)
#Kicad 7
# 2-layer, 1oz copper
(rule "Minimum Trace Width (outer layer)"
(constraint track_width (min 5mil))
(layer outer)
(condition "A.Type == 'track'"))
(rule "Minimum Trace Spacing (outer layer)"
@totti2
totti2 / SSRPARI_Snapserver_Snapclient_RPi3.md
Last active July 29, 2024 02:12
Synchronous multi-room sound casting of Bluetooth, Airplay, Line-In and Spotitfy

Synchronous multi-room sound casting of Bluetooth, Airplay, Line-In and Spotitfy

ALL CREDITS TO @badaix AND @BaReinhard

This will setup a raspberry-pi-3 as a snapcast-server and snapcast-client.
Possible music sources for the snapserver-component: Bluetooth, Airplay, Spotify, Line-In (more to come eg. RTP)
Music sinks (snapclients): usb soundcard connected to my stereo, another Pi

To Do:

  • Energy saving by disabling onboard bluetooth, wifi and soundcard
@bbx10
bbx10 / ESPWebSock.ino
Last active June 5, 2024 20:16
ESP8266 Web server with Web Socket to control an LED
/*
* ESP8266 Web server with Web Socket to control an LED.
*
* The web server keeps all clients' LED status up to date and any client may
* turn the LED on or off.
*
* For example, clientA connects and turns the LED on. This changes the word
* "LED" on the web page to the color red. When clientB connects, the word
* "LED" will be red since the server knows the LED is on. When clientB turns
* the LED off, the word LED changes color to black on clientA and clientB web
@patagonaa
patagonaa / parse_gear360.py
Last active February 6, 2024 14:30
Extract Gyro / Accelerometer Data from Samsung Gear 360 2017 (SM-R210) MP4 files
#!/usr/bin/env python3
import io
import logging
import os
import struct
import sys
import csv
from typing import BinaryIO
import matplotlib.pyplot as plt
@jblang
jblang / tpm2.md
Last active January 25, 2024 17:00
TPM2 Protocol Description

TPM2 Protocol Implementation

Introduction

Frame data is transferred inside packets (similar to DMX, for example). A frame is an image representing a matrix or a light scene.

The packets start and end with one-byte characters. In between are a few control bytes followed by the payload. There is no set size for a payload; it is transmitted with each packet. This makes the protocol quite flexible. There are enough bytes in a single packet for an RGB matrix with 21,845 pixels, but if you just want to control an RGBW lamp, that only requires 9 bytes. The variable frame size means there is no overhead, allowing for maximum transfer speed.

TPM2 Packet Structure

@BenWoodford
BenWoodford / lh2.md
Last active October 17, 2023 02:33
Lighthouse 2.0 GATT Information

All control characteristics are under Service 00001523-1212-EFDE-1523-785FEABCD124

Characteristics

Mode = 00001524-1212-EFDE-1523-785FEABCD124 (READ, WRITE, NOTIFY)

Identify = 00008421-1212-EFDE-1523-785FEABCD124 (WRITE)

Power State = 00001525-1212-EFDE-1523-785FEABCD124 (WRITE, newer firmware also had READ and NOTIFY)

@CatoLynx
CatoLynx / wg_aliases.sh
Last active June 30, 2023 14:09
Bash script to append aliases to peer IDs in Wireguard output
#!/bin/bash
# To the extent possible under law, I hereby waive all copyright
# and related or neighboring rights to this program.
# Determine the path of this script, to read the aliases file relative to that
parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
# Check if the unbuffer command is available.
# It is used to retain colored output from wg show