Skip to content

Instantly share code, notes, and snippets.

View maruno's full-sized avatar

Maruno Ulfdrengr maruno

View GitHub Profile
@maruno
maruno / charset.py
Created December 16, 2023 15:22
IV-17 charset creation
def create_char(segments):
char_1 = 0
char_2 = 0
for segment in segments:
if 3 <= segment <= 9:
char_1 |= (1 << (segment - 3))
elif segment == 13:
char_1 |= (1 << 7)
if 14 <= segment <= 21:
@maruno
maruno / sensors.yaml
Last active January 14, 2022 20:42
Luchtmeetnet HA sensor configuration (example station NL01492)
- platform: rest
name: Luchtmeetnet NL01492 PM2.5
resource: https://api.luchtmeetnet.nl/open_api/stations/NL01492/measurements?formula=PM25
device_class: pm25
unit_of_measurement: µg/m³
value_template: '{{ value_json.data[0].value }}'
- platform: rest
name: Luchtmeetnet NL01492 PM10
resource: https://api.luchtmeetnet.nl/open_api/stations/NL01492/measurements?formula=PM10
device_class: pm10
@maruno
maruno / list_usb.py
Created September 16, 2018 12:29
Read USB through ioreg plist
import asyncio
import plistlib
from typing import Iterable
def devices_from_bus(bus_entries: Iterable[dict]):
devices = []
for bus_entry in bus_entries:
if 'IORegistryEntryChildren' in bus_entry:
devices.extend(
@maruno
maruno / gunicorn_venv
Created February 9, 2017 10:04
Gunicorn serve script with venv
#!/usr/home/michel/daemons/bynder-web/env/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'gunicorn==19.4.5','console_scripts','gunicorn'
__requires__ = 'gunicorn==19.4.5'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
@maruno
maruno / application.mk
Created February 8, 2017 22:50
RTL8701
# Initialize tool chain
# -------------------------------------------------------------------
ARM_GCC_TOOLCHAIN = /usr/local/gcc-arm-embedded-6_2-2016q4-20161216/
AMEBA_TOOLDIR = ../../../component/soc/realtek/8195a/misc/iar_utility/common/tools/
FLASH_TOOLDIR = ../../../component/soc/realtek/8195a/misc/gcc_utility/
CROSS_COMPILE = $(ARM_GCC_TOOLCHAIN)bin/arm-none-eabi-
# Compilation tools
@maruno
maruno / .tmux.conf
Created November 7, 2016 10:00
Tmux conf with Vim mode and 256 colours
set -g terminal-overrides "xterm-256color"
set -g default-terminal "screen-256color"
set -sg escape-time 0
set-window-option -g mode-keys vi
set-window-option -g aggressive-resize on
bind-key -t vi-copy 'v' begin-selection
bind-key -t vi-copy 'y' copy-selection
@maruno
maruno / build.log
Last active May 18, 2016 20:31
Crosstool-NG xtensa-1.22.x GCC 5.2 compile
This file has been truncated, but you can view the full file.
[INFO ] Performing some trivial sanity checks
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] Testing '! ( -n )'
[DEBUG] ==> Executing: 'mkdir' '-p' '/storage/tooling/crosstool-NG/bin/.build'
[DEBUG] ==> Executing: 'rm' '-f' '/storage/tooling/crosstool-NG/bin/.build/backtrace'
[DEBUG] ==> Executing: 'touch' '/storage/tooling/crosstool-NG/bin/.build/foo'
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 30916, room 16
tail 4
chksum 0x2b
load 0x3ffe8000, len 2168, room 4
tail 4
chksum 0x84
load 0x3ffe8880, len 4940, room 4
tail 8
pp_task_hdl : 3fff2158, prio:14, stack:512
pm_task_hdl : 3fff2b28, prio:1, stack:176
frc2_timer_task_hdl:3fff55e0, prio:12, stack:200
ESP-Open-SDK ver: 0.0.1 compiled @ Jan 31 2016 14:40:28
phy ver: 273, pp ver: 8.3
Connecting to network...
mode : sta(5c:cf:7f:12:13:75)
add if0
@maruno
maruno / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console