Skip to content

Instantly share code, notes, and snippets.

View patagonaa's full-sized avatar
🏳️‍🌈

Patrick patagonaa

🏳️‍🌈
View GitHub Profile
@patagonaa
patagonaa / orno-01.yml
Last active January 6, 2025 01:38
ESPHome config for reading YongTaiLong DTS353F-2/3 power meters (also sold as Orno OR-WE-516/517, B+G E-Tech DRT428M-2/3)
uart:
id: modbus_uart
rx_pin: GPIO16
tx_pin: GPIO17
# required for this meter type
baud_rate: 9600
parity: EVEN
stop_bits: 1
modbus:
@patagonaa
patagonaa / z0r-hotkeys.js
Created March 6, 2023 23:11
z0r.de UserScript key shortcuts for navigation
// ==UserScript==
// @name z0r key shortcuts
// @namespace http://www.example.com/gmscripts
// @description key shortcuts for z0r
// @include http://z0r.de/*
// @include https://z0r.de/*
// @version 0.3
// ==/UserScript==
function addJQuery(callback) {
@patagonaa
patagonaa / parse_gear360.py
Last active March 13, 2025 23:36
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
@patagonaa
patagonaa / get-id-from-filename.sh
Last active April 3, 2022 21:42
re-download / add metadata to files downloaded via youtube-dl
find . -maxdepth 1 -type f | sed -nE 's/^.*-([A-Za-z0-9_-]{11})\..*$/\1/gp' | xargs -I '{}' youtube-dl 'https://youtube.com/watch?v={}'
@patagonaa
patagonaa / prometheus_mellanox_temp.sh
Last active December 3, 2024 23:52
Prometheus textfile collector script for Mellanox Connect-X temperature (for getting temperature of Mellanox SFP+ Ethernet cards)
#!/bin/bash
echo '# HELP node_mlx_temperature Mellanox networking card temperature.'
echo '# TYPE node_mlx_temperature gauge'
temperature=`mget_temp -d $1 | tr -d '[[:space:]]'`
echo "node_mlx_temperature{device=\"$1\"} $temperature"