Skip to content

Instantly share code, notes, and snippets.

@nicman23
nicman23 / hd-idle-zfs.zsh
Created December 8, 2023 16:21
zfs hdd spindown script
#!/bin/zsh
pool=zdata
devices=$(zpool status -P $pool | grep /dev/ | awk '{print $1}')
intervalinsec=120
while true; do
zpool iostat -HyL zdata $intervalinsec 1 |
grep -q '0 0 0 0' ; res=$?
@nicman23
nicman23 / main.py
Last active April 16, 2024 16:36
a modchip for w6d
import machine
import time
uart = machine.UART(1, baudrate=115200, tx=machine.Pin(4), rx=machine.Pin(5), timeout=20)
while True:
if uart.any():
res = uart.readline().decode('utf-8')
if 'U-Boot Boot Menu' in res:
print('yes')
uart.write('')