Skip to content

Instantly share code, notes, and snippets.

View zaxbux's full-sized avatar
👨‍💻

Zach Schneider zaxbux

👨‍💻
View GitHub Profile
@zaxbux
zaxbux / clean_downloads.sh
Created March 28, 2024 00:11
Delete user downloads that are older than 28 days (macOS)
#!/bin/bash
sudo -u $(stat -f "%Su" /dev/console) /bin/bash <<'END'
# Move files to user's trash
function trash() {
if [[ $# ]]; then
a=()
for f in "$@"; do a+=("$(realpath "$f")"); done
f=$(printf "\",POSIX file \"%s" "${a[@]}")\"
@zaxbux
zaxbux / README.md
Created October 5, 2023 07:45
ESP32-C6-DevKitC-1

Addressable RGB LED

light:
  - platform: esp32_rmt_led_strip
    id: led_gpio8
    name: "${friendly_name} Light"
    pin: GPIO8
    num_leds: 1
 rmt_channel: 0
@zaxbux
zaxbux / tubezb-cc2652p2-ethusb-2023.yaml
Created September 12, 2023 02:29
TubeZB CC2652P2 Ethernet/USB Coordinator ESPHome BLE Proxy
substitutions:
name: tubezb-cc2652p2-ethusb-2023
friendly_name: TubesZB and Bluetooth Proxy
esphome:
name: ${name}
friendly_name: ${friendly_name}
esp32:
board: esp32doit-devkit-v1
@zaxbux
zaxbux / gdocs.xml
Last active September 10, 2023 03:09
File Types
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/vnd.google-apps.document">
<comment>Google Docs</comment>
<glob pattern="*.gdoc" />
</mime-type>
<mime-type type="application/vnd.google-apps.drawing">
<comment>Google Drawings</comment>
<glob pattern="*.gdraw" />
</mime-type>
@zaxbux
zaxbux / README.md
Last active September 10, 2023 10:20
OpenSprinkler, Rust, Raspberry Pi
@zaxbux
zaxbux / README.md
Last active February 12, 2023 20:41
Raspberry Pi cmdline.txt options
@zaxbux
zaxbux / readme.md
Created January 27, 2023 00:15
CSP Policies
@zaxbux
zaxbux / readme.md
Last active July 10, 2022 05:49
Raspberry Pi 4B One Button Startup/Shutdown (OBSS) without disrupting I2C

I am working on a project that requires GPIO3 be used for I2C. Unfortunately, this is also the pin that can be used for one button startup/shutdown.

Goals

  • Wake Pi after shutdown, halt, or poweroff
  • Shutdown Pi safely to avoid corruption
  • Does not rely on GPIO3 (pin 5; I2C1 SCL)

Background

@zaxbux
zaxbux / readme.md
Last active April 17, 2022 23:19
TELUS Communications VoWiFi (Voice-over-WiFi) / WiFi Calling

Canada Mobile Country Code (MCC): 302

TELUS Mobile Network Code (MNC): 220

Operator ePDG FQDN: epdg.epc.mnc220.mcc302.pub.3gppnetwork.org

Telus uses IKE for authentication (UDP port 500), and IPsec NAT traversal (UDP port 4500).

Sample packet capture:

@zaxbux
zaxbux / cryptodev-linux.md
Created April 12, 2022 07:01
Pine A64 Miscellaneous
  1. Install Linux Headers
  2. wget https://github.com/cryptodev-linux/cryptodev-linux/archive/refs/tags/cryptodev-linux-1.12.tar.gz
    tar -xzf cryptodev-linux-1.12.tar.gz
    cd cryptodev-linux-cryptodev-linux-1.12
    make
    make install