Skip to content

Instantly share code, notes, and snippets.

@jeffehobbs
jeffehobbs / vibration_sensor_ESP32_HA_how_to.txt
Last active June 5, 2024 15:53
Vibration Sensor for ESPHome/Home Assistant
GOAL: Send a push notification after the (vibrations from the) dryer cycle has completely stopped.
USING:
* Inexpensive hardware (see below)
* ESPhome (http://esphome.io) for chip firmware
* Home Assistant (http://hass.io) for sensor state machine and push notification.
---
SHOPPING LIST:
@arteymix
arteymix / git-archive-all
Last active March 15, 2024 10:55
Archive HEAD and its submodules recursively
#!/usr/bin/env sh
if [ -z $1 ]; then
echo "You must specify a super-archive name."
exit 1
fi
git archive --prefix "$1/" -o "$1.tar" HEAD
git submodule foreach --recursive "git archive --prefix=$1/\$path/ --output=\$sha1.tar HEAD && tar --concatenate --file=$(pwd)/$1.tar \$sha1.tar && rm \$sha1.tar"