Skip to content

Instantly share code, notes, and snippets.

View halmartin's full-sized avatar
💭
I void warranties and ask companies for their GPL source code.

Hal Martin halmartin

💭
I void warranties and ask companies for their GPL source code.
View GitHub Profile
@halmartin
halmartin / th_wemos-5a0385.py
Last active June 3, 2018 13:27
MicroPython for Wemos D1 mini to read temperature/humidity and report to InfluxDB
import urequests
from time import sleep
from machine import Pin, reset
p2 = Pin(2, Pin.OUT)
HOST="wemos-5a0385"
LENGTH=60
def TempSensReport():
from sht30 import SHT30
@halmartin
halmartin / temperature_S1200BTL.sh
Last active January 22, 2018 11:11
FreeBSD: collectd metrics for Intel S1200BTL CPU, BMC, and PSU
#!/bin/sh
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}"
INTERVAL="${COLLECTD_INTERVAL:-30}"
while sleep "$INTERVAL"; do
/sbin/sysctl -a | awk -F'[. ]' '/dev\.cpu\.[0-9]\.temperature/ {printf "%s %s\n",$3,$5}'|while read c t
do
echo "PUTVAL \"$HOSTNAME/temperature/temperature-cpu${c}\" interval=$INTERVAL N:${t%%.*}"
done
@halmartin
halmartin / temperature.sh
Created January 10, 2018 20:50
FreeBSD: collectd temperature Dell R210 II CPU & BMC
#!/bin/sh
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}"
INTERVAL="${COLLECTD_INTERVAL:-30}"
while sleep "$INTERVAL"; do
/sbin/sysctl -a | awk -F'[. ]' '/dev\.cpu\.[0-9]\.temperature/ {printf "%s %s\n",$3,$5}'|while read c t
do
echo "PUTVAL \"$HOSTNAME/temperature/temperature-cpu${c}\" interval=$INTERVAL N:${t%%.*}"
done
@halmartin
halmartin / uP_0.txt
Created January 8, 2018 18:58
WT61P805 partial firmware from WD Yosemite
00000000 02 5d a9 02 10 00 12 63 8e 22 32 02 6d 35 0d 0a |.].....c."2.m5..|
00000010 00 ff ff 02 6d d7 ff ff ff ff ff 02 56 c7 ff ff |....m.......V...|
00000020 ff ff ff 02 59 49 7f 01 12 00 46 7f 02 7e 00 12 |....YI....F..~..|
00000030 6b e0 22 02 6f ac ff ff ff ff ff 02 6d f4 ff ff |k.".o.......m...|
00000040 ff ff ff 02 00 0a 90 12 cd ef f0 e4 ff 12 6a ce |..............j.|
00000050 e4 ff 12 6b 06 7f 01 12 6b 3e 12 0f f8 12 0f f8 |...k....k>......|
00000060 90 12 cd e0 ff 12 6f 90 12 0f f8 12 0f f8 e4 ff |......o.........|
00000070 12 6b 3e 12 0f f8 12 0f f8 22 ff 02 10 00 90 11 |.k>......"......|
00000080 bb e0 70 05 90 11 ea 04 f0 e5 42 64 01 70 46 fe |..p.......Bd.pF.|
00000090 7f 11 fd 7b 01 7a 11 79 d3 12 4d b4 e4 90 12 c2 |...{.z.y..M.....|
@halmartin
halmartin / mcu_upgrade_strace_write.txt
Created January 8, 2018 17:49
Western Digital Yosemite mcu_upgrade strace write calls
write(3, "\17WT61P8\377", 8) = 8
write(3, "\17\2 \2\2\2\377", 7) = 7
write(3, "\17\16\2\214\214\214\377", 7) = 7
write(3, "\17\16\0\270\270\270\377", 7) = 7
write(3, "\17\r\0\0\0\0\377", 7) = 7
write(3, "\17\r\10\0\0\0\377", 7) = 7
write(3, "\17\r\20\0\0\0\377", 7) = 7
write(3, "\17\r\30\0\0\0\377", 7) = 7
write(3, "\17\r \0\0\0\377", 7) = 7
write(3, "\17\r(\0\0\0\377", 7) = 7
@halmartin
halmartin / mcu_upgrade_Yosemite_strings.txt
Created January 8, 2018 17:45
Western Digital Yosemite mcu_upgrade binary strings
/lib/ld-linux.so.3
librs232.so
RS232_Send
_fini
RS232_Read
RS232_Open
__gmon_start__
RS232_SetParam
RS232_Close
_Jv_RegisterClasses
@halmartin
halmartin / upload_firmware_Yosemite_strings.txt
Created January 8, 2018 17:40
Western Digital Yosemite upload_firmware binary strings
/lib/ld-linux.so.3
libshare.so
xmldbc_get_wb
_fini
LIB_Get_Dev_SCSI_Map
xml_get_int
__gmon_start__
LIB_Get_Disk_Size
LIB_Check_Mounts_OK
_Jv_RegisterClasses
@halmartin
halmartin / WD_MyCloud_NAS_Codenames.txt
Created January 8, 2018 17:25
Western Digital My Cloud codenames
Single bay:
Glacier: WD My Cloud
Dual bay:
BryceCanyon: WD My Cloud PR2100
KC/Zion: WD My Cloud EX2
RP/GT (GrandTeton): WD My Cloud EX2 Ultra
Yosemite: WD My Cloud EX2100
Quad bay:
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
87:8d:c5:e9:d8:81:a7:37
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=CN, ST=Beijing, L=Beijing, O=WindRiver-Beijing, OU=PFG, CN=IDP-OWNER/emailAddress=owner@windriver.com
Validity
Not Before: Apr 17 03:43:07 2014 GMT
Not After : Apr 14 03:43:07 2024 GMT
--- a/work/efi/ia32/loader/linux.c 2017-01-24 22:11:35.266806622 +0000
+++ b/work/efi/ia32/loader/linux.c 2017-01-24 22:14:19.473474756 +0000
@@ -401,21 +401,9 @@
goto fail1;
}
- if (grub_quark_secure)
- {
- if (! grub_quark_fetch_sbh (GRUB_QUARK_ASSET_KERNEL_CSBH, kernel, &quark_sbh))
- {