Skip to content

Instantly share code, notes, and snippets.

@HappyCodingRobot
HappyCodingRobot / stm32_gpio_reg.md
Created January 27, 2023 15:53 — forked from iwalpola/stm32_gpio_reg.md
STM32 GPIO registers cheatsheet
@HappyCodingRobot
HappyCodingRobot / my_ys1_notes.md
Created December 21, 2022 10:43 — forked from JamesHagerman/my_ys1_notes.md
Some useful YARD Stick One notes

Some useful YARD Stick One notes

This thing is a bit of a beast. People don't give it NEARLY the credit, or the documentation it deserves.

Two ways of using this thing: rfcat directly, or write a python script for it.

Basically, writing a python script is easier. Using rfcat directly is great but often, there are just too many silly settings to configure

@HappyCodingRobot
HappyCodingRobot / rpi.py
Created May 14, 2015 12:10
Simple XBMC/Kodi controller via http POST request and JSONRPC
#!/usr/bin/python
'''
Very simple XBMC/Kodi controller via http POST request and JSONRPC
(testing the principle..)
'''
import httplib
import sys, argparse
import json
PI = '192.168.162.33'

Stop all containers

$ docker stop $(docker ps -q)

Build docker image

$ cd /path/to/Dockerfile
@HappyCodingRobot
HappyCodingRobot / 61-hp-mic-mute-hotkey.hwdb
Created January 8, 2019 14:22
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
# see also: /lib/udev/hwdb.d/60-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*EliteBook*:pvr*
KEYBOARD_KEY_81=f20 # Fn+F8 on Elitebook, map to F20
# KEYBOARD_KEY_81=fn_esc # org entry
@HappyCodingRobot
HappyCodingRobot / xanes_xi_protocol_rev_eng.md
Created February 7, 2018 13:17
XANES X1 Programmable LED light badge protocoll reverse engineering

XANES X1 Programmable LED light badge protocoll reverse engineering

General informations

  • VID:PID - 0416:5020
  • Product ID: LS32 Custm HID
  • uses HID Protocoll
  • 2 endpoints, uses endpoint 1 for data, all with report 0
  • 64 byte paket size

The Protocol

@HappyCodingRobot
HappyCodingRobot / esphome_neopixel_clock_effect.yaml
Created October 6, 2020 09:52 — forked from markusressel/esphome_neopixel_clock_effect.yaml
ESPHome configuration example to create an animated clock using the Neopixel 60 LED ring
esphome:
# [...]
on_boot:
priority: -10
then:
# enable clock effect after boot
- light.turn_on:
id: light_ring
brightness: 100%
effect: Clock
@HappyCodingRobot
HappyCodingRobot / README.md
Created April 14, 2020 14:31 — forked from rot42/README.md
Gnuk Token on ST Dongle with STM32F103CBU6

Gnuk Token on ST Dongle with STM32F103CBU6

Based on Daniel Kucera's implementation of the confirmation button, adapted for a different ST Dongle using an STM32F103CBU6 microcontroller.

STM32F103CBU6 microcontroller ST-LINK/V2 clone dongle

Order of the 4 SWD interface holes from left to right:

@HappyCodingRobot
HappyCodingRobot / serialplot2
Created June 10, 2020 16:55 — forked from turbinenreiter/serialplot2
plotting data from serial port with matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import serial
fig, ax = plt.subplots()
line, = ax.plot(np.random.rand(10))
ax.set_ylim(-5000, 5000)
xdata, ydata = [0]*100, [0]*100
raw = serial.Serial("/dev/ttyUSB1",9600)
@HappyCodingRobot
HappyCodingRobot / Local PR test and merge.md
Created December 19, 2019 22:15 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37