Skip to content

Instantly share code, notes, and snippets.

@softminus
softminus / bench.sh
Last active December 22, 2021 01:24
#!/bin/bash
echo "listunspent 200k-send"
./qa/zcash/performance-measurements.sh time listunspent 200k-send | sed 1d | jq '.[]|.runningtime' | tee listunspent_200k-send
echo -n "listunspent 200k-send average is "
awk '{sum+=sprintf("%f",$1)}END{printf "%.6f\n",sum/NR}' listunspent_200k-send
echo
@softminus
softminus / min_duty_cycle_settei.sh
Created February 6, 2020 01:58
Set minimum fan speed on Fujitsu/Kontron motherboards with Teutates BMC
#!/bin/bash
# Copyright (C) 2020 Kia
# Licensed under Zero Clause BSD License
if [[ $# -ne 3 ]]; then
echo "usage: $0 (BMC I2C BUS NUMBER) (FAN PAGE) (DUTY CYCLE FLOOR)"
echo ""
echo "BMC I2C BUS NUMBER can be found as follows"
@softminus
softminus / demouse.diff
Created August 24, 2016 08:24
Disable mouse reporting in urxvt properly
diff --git a/src/rxvt.h b/src/rxvt.h
index 5c7cf66..2751ba3 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -646,7 +646,7 @@ enum {
#define PrivMode_ExtMouseRight (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales
#define PrivMode_BlinkingCursor (1UL<<25)
-#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent)
+#define PrivMode_mouse_report 0 /* (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) */
@softminus
softminus / gist:36b81b275c1cbb07dd88
Created August 17, 2014 05:02
mplayer crash on file with sha256 e2e67e9ec1447ad2fad8978b4fad484ce9f7d04d2c0de7daf2c5f929c510bdb2
Program received signal SIGSEGV, Segmentation fault.
0x00007f472fd636e4 in memset () from /usr/lib/libc.so.6
(gdb) bt
#0 0x00007f472fd636e4 in memset () from /usr/lib/libc.so.6
#1 0x00007f47354c1100 in ?? () from /usr/lib/libass.so.5
#2 0x00007f47354bdc55 in ?? () from /usr/lib/libass.so.5
#3 0x00007f47354bfe0a in ass_render_frame () from /usr/lib/libass.so.5
#4 0x0000000000548bd7 in get_bitmaps (sh=<optimized out>,
osd=0x1f09de0, res=0x7fff6c2a1730) at sub/sd_ass.c:144
#5 0x0000000000528ef3 in sub_get_bitmaps (osd=0x1f09de0,
@softminus
softminus / gist:8979c1f4543115a965ca
Created June 15, 2014 23:10
250.mus uncompressed
run dd if=250.mus bs=1 skip=17 of=foo
and ./a.out foo | xxd
0000000: 0201 0003 1520 4845 4156 454e 4c59 2056 ..... HEAVENLY V
0000010: 4953 494f 4e2c 2032 3530 e100 0f54 696d ISION, 250...Tim
0000020: 6573 204e 6577 2052 6f6d 616e 0001 0018 es New Roman....
0000030: 0000 0000 0000 0100 0000 0000 0000 0015 ................
0000040: 0d0d 4a61 636f 6220 4672 656e 6368 2c20 ..Jacob French,
0000050: 3137 3836 2ee1 000f 5469 6d65 7320 4e65 1786....Times Ne
0000060: 7720 526f 6d61 6e00 0100 1000 0000 0000 w Roman.........
0000070: 00ff 0000 0064 0000 0064 020d 0de2 0005 .....d...d......