Skip to content

Instantly share code, notes, and snippets.

View soyflourbread's full-sized avatar
🍓
storby

Clementine Bread soyflourbread

🍓
storby
View GitHub Profile
@soyflourbread
soyflourbread / fp310_quirk.py
Created May 14, 2026 16:04
Aqara Presence Sensor FP310 (lumi.sensor_occupy.acn1) ZHA quirk
"""Quirk for Aqara Presence Sensor FP310 (lumi.sensor_occupy.acn1)."""
from __future__ import annotations
from typing import Final
from zhaquirks.xiaomi import XiaomiAqaraE1Cluster
from zigpy import types as t
from zigpy.quirks.v2 import QuirkBuilder, ReportingConfig
from zigpy.quirks.v2.homeassistant import (
@soyflourbread
soyflourbread / presence.yaml
Created January 19, 2025 14:21
XIAO ESP32C6 ESPHome with 24GHz mmWave for XIAO
esphome:
name: presence
friendly_name: "Presence Sensor"
platformio_options:
platform: https://github.com/platformio/platform-espressif32/archive/refs/tags/v6.9.0.zip
board_build.f_cpu: 160000000L
board_build.f_flash: 80000000L
board_build.flash_size: 4MB
build_flags: "-DBOARD_HAS_PSRAM"
board_build.arduino.memory_type: qio_opi
dd if=/dev/zero of=alpine-rootfs.ext4 bs=1M count=100
mkfs.ext4 alpine-rootfs.ext4
mkdir /tmp/alpine-rootfs
mount alpine-rootfs.ext4 /tmp/alpine-rootfs
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run -it --name armv7alpine --net=host -v /tmp/alpine-rootfs:/extrootfs arm32v7/alpine
# In docker container
apk update
apk add openrc
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='local')
tf.tpu.experimental.initialize_tpu_system(cluster_resolver)
strategy = tf.distribute.TPUStrategy(cluster_resolver)
def parse_imagenet_example(example, image_size):
# Read example
@soyflourbread
soyflourbread / convert-oracle.md
Last active February 3, 2024 17:44
Convert Oracle A1 to Arch Linux
sudo systemctl disable --now snapd
wget https://ca.us.mirror.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
mount -t tmpfs -o size=1500M none /mnt
cd /mnt
tar -xf ~/ArchLinuxARM-aarch64-latest.tar.gz
cp /etc/resolv.conf etc
@soyflourbread
soyflourbread / panopto.sh
Last active April 3, 2023 09:05
Downloading videos from Gauchocast, UCSB/Panopto
#!/bin/bash
# Copyright 2020 encombhat<bhat@encom.eu.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION