Skip to content

Instantly share code, notes, and snippets.

@HappyCodingRobot
HappyCodingRobot / rpi.py
Created May 14, 2015
Simple XBMC/Kodi controller via http POST request and JSONRPC
View rpi.py
#!/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'
View docker-cheat-sheet.md

Stop all containers

$ docker stop $(docker ps -q)

Build docker image

$ cd /path/to/Dockerfile
@HappyCodingRobot
HappyCodingRobot / 61-hp-mic-mute-hotkey.hwdb
Created Jan 8, 2019
Activate mic mute function key, ubuntu 18.04, HP Elitebook 820
View 61-hp-mic-mute-hotkey.hwdb
# 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 Feb 7, 2018
XANES X1 Programmable LED light badge protocoll reverse engineering
View xanes_xi_protocol_rev_eng.md

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 Oct 6, 2020 — forked from markusressel/esphome_neopixel_clock_effect.yaml
ESPHome configuration example to create an animated clock using the Neopixel 60 LED ring
View esphome_neopixel_clock_effect.yaml
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 Apr 14, 2020 — forked from rot42/README.md
Gnuk Token on ST Dongle with STM32F103CBU6
View README.md

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 Jun 10, 2020 — forked from turbinenreiter/serialplot2
plotting data from serial port with matplotlib
View serialplot2
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 Dec 19, 2019 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU
View Local PR test and merge.md

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
@HappyCodingRobot
HappyCodingRobot / Scheduler_Example.c
Last active Aug 22, 2019
Very basic Round Robin scheduler for AVR
View Scheduler_Example.c
#include <avr/io.h>
#include <avr/interrupt.h>
#include <inttypes.h>
#include "scheduler.h"
// Task definitions
#define nTask1 1
#define nTask2 2
@HappyCodingRobot
HappyCodingRobot / VerticalScrolledFrame.py
Created May 31, 2019 — forked from novel-yet-trivial/VerticalScrolledFrame.py
A vertical scrolled frame for python tkinter that behaves like a normal Frame. Tested with python 2 and 3, windows and linux.
View VerticalScrolledFrame.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
class VerticalScrolledFrame:
"""