Skip to content

Instantly share code, notes, and snippets.

View setup postgres.sql
CREATE USER iam_admin;
GRANT rds_iam TO iam_admin;
grant rds_superuser to iam_admin;
CREATE USER iam_readonly;
GRANT rds_iam TO iam_readonly;
GRANT pg_read_all_data to iam_readonly;
REVOKE CREATE ON SCHEMA public FROM iam_readonly;
flaviut / Setting up Emporia Vue 2 with
Last active Sep 30, 2022
Setting up Emporia Vue 2 with ESPHome
View Setting up Emporia Vue 2 with

Setting up Emporia Vue 2 whole-home power monitor with ESPHome

  • 2022-07-30: add home assistant instructions & MQTT FAQ.
  • 2022-07-16: mention using UART adaptor's RTS pin, thanks to @PanicRide
  • 2022-07-02: mention mqtt is now supported
  • 2022-04-30: bump software version number to 2022.4.0
  • 2022-05-04: mention 64-bit ARM issues in FAQ
import sys
import datetime
Dumps the data from a bluetooth-connected PC-60FW fingertip oximeter to a CSV
on stdout.
# Getting started
Make sure you have CMake, gcc, and python 3.7+ installed.
View Interrupts in standard

Interrupts in standard C++

Jul 23, 2018

by Mikael Rosbacke


flaviut / console.log
Created Sep 15, 2021
uses of settings.get in octoprint plugins
View console.log
$ comby -ripgrep '-g*.py' -match-only ':[~_?]settings:[~[()]*].get:[~_?([iI]nt|[fF]loat|[bB]oolean)?](:[_])' ''
View gist:fc30f2697cb3ed94ecf6d593d634f432
Sep 27 14:34:07 tight-seat kernel: Fixing recursive fault but reboot is needed!
Sep 27 14:34:07 tight-seat kernel: CR2: 00007f98264ad0a0 CR3: 00000007f340a000 CR4: 00000000003406e0
Sep 27 14:34:07 tight-seat kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Sep 27 14:34:07 tight-seat kernel: FS: 00007f9825772400(0000) GS:ffffa0947efc0000(0000) knlGS:0000000000000000
Sep 27 14:34:07 tight-seat kernel: R13: 0000000000000024 R14: 00000000ffffffff R15: ffffa0947b807640
Sep 27 14:34:07 tight-seat kernel: R10: 0000000000000018 R11: 0000000000000018 R12: 651927072fe29674
Sep 27 14:34:07 tight-seat kernel: RBP: 0000000000000dc0 R08: ffffa0947b807640 R09: ffffa08eaed0cd3c
Sep 27 14:34:07 tight-seat kernel: RDX: 0000000054211e0f RSI: 0000000054211e0f RDI: 00000000000310a0
Sep 27 14:34:07 tight-seat kernel: RAX: 651927072fe29694 RBX: 0000000000000000 RCX: 00000000000310a0
Sep 27 14:34:07 tight-seat kernel: RSP: 0018:ffffb4fe0c4bbbb8 EFLAGS: 00010202
View sockJsWebsocket.ts
// generates a websocket for a sockjs endpoint, as defined in
// This websocket works just like a regular websocket, and is compatible with
// stompjs.
// `onmessage` and `send()` are modified to transparently handle converting to and
// from sockjs messages
// (c) 2020, Flaviu Tamas
export CHROOT_DIR=/home/user/tmp/armhf-linux
mkdir -p "$CHROOT_DIR/usr/bin"
sudo cp /usr/bin/qemu-arm-static "$CHROOT_DIR/usr/bin"
sudo debootstrap --arch=armhf stable "$CHROOT_DIR"
sudo mount --bind /dev "$CHROOT_DIR/dev"
sudo mount --bind /sys "$CHROOT_DIR/sys"
sudo mount --bind /proc "$CHROOT_DIR/proc"
sudo chroot "$CHROOT_DIR"
export HOME=/root LC_ALL=C LANG=C.UTF-8 TERM=xterm-256color
View hid description
$ sudo usbhid-dump -s1:17 | grep -v : | xxd -r -p | hidrd-convert -o spec
Usage Page (FF00h), ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
Report ID (16),
Report Count (6),
Report Size (8),
Logical Minimum (0),
Logical Maximum (255),
Usage (01h),
import random
from pystrich.datamatrix import DataMatrixEncoder
"used", "every", "large", "popular", "able", "basic", "known", "various",
"several", "united", "hot", "useful", "mental", "scared", "old", "similar",
"healthy", "medical", "federal", "entire", "strong", "actual", "poor",
"happy", "cute", "helpful", "recent", "willing", "nice", "serious", "huge",
"rare", "typical", "aware", "global", "legal", "capable", "foreign",