Skip to content

Instantly share code, notes, and snippets.

@bkw777
bkw777 / gist:8d988031fd20756dc46aa6f26ac0a76f
Last active February 3, 2025 16:47
Sony Xperia 1 VI rooted firmware update
Xperia 1 VI - XQ-EC72 HK
firmware update notes
https://xdaforums.com/t/tool-xperifirm-xperia-firmware-downloader-v5-7-0.2834142/
https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/
https://xdaforums.com/t/tool-unsin-sin-v3-v4-v5-unpacker-v2-0.3128106/
-------------------------------------------
xperia boot modes:
@bkw777
bkw777 / gist:ebb80ec191e5eb102f42252645bdab6a
Created December 30, 2024 08:07
Brother p-touch shrink tube hack
Use shrink tube in printer models that don't officially support them.
https://hackaday.io/project/190126-brother-label-tape-hack
@bkw777
bkw777 / Quartus_13_on_Ubuntu_23.md
Last active January 24, 2025 21:02
Quartus 13.0 & ModelSim on Ubuntu 24
@bkw777
bkw777 / bashcat.sh
Last active March 3, 2024 01:55
cat without cat
# minimal example just for reference, not pointful by itself
# binary-safe read/write file without cp/cat/dd etc, pure bash, no subshell
while LANG=C IFS= read -d '' -r -n 1 x ;do printf '%c' "$x" ;done <bin1 >bin2
@bkw777
bkw777 / BYA_BYxxxx_hot_plate.txt
Last active December 29, 2023 21:53
BYA BY1010 BY1515 BY2020 BY2030 BY3030 BY4030 hot plate directions
Directions for BYA hot plate
BY1010 BY1515 BY2020 BY2030 BY3030 BY4030
https://www.amazon.com/dp/B0932X6JB8
https://www.amazon.com/dp/B0CN19C4DC
https://www.amazon.com/dp/B0CC62TP4L
https://www.aliexpress.us/item/3256805843992076.html
https://www.aliexpress.us/item/3256805212626461.html
https://www.aliexpress.us/item/3256804646990894.html
@bkw777
bkw777 / downpour_merge.sh
Last active January 2, 2025 11:04
Merge downpour.com m4b files
#!/bin/bash
# Merges downpour.com m4b files into a single m4b file per book.
# Directions:
# download m4b files from downpour.com
# cd into the directory with "Book Title ...[File # of #].m4b
# run with no arguments
# Multiple books may all be downloaded into the same directory.
# Previously combined books may still exist in the same directory.
@bkw777
bkw777 / show_signals.sh
Created March 12, 2023 02:20
Trap & display all possible signals in bash
# with bash-isms
for s in {1..64}; do trap "echo trap $s" $s; done
# without bash-isms
s=1; while [ $s -le 64 ]; do trap "echo trap $s" $s; s=$((s+1)); done
@bkw777
bkw777 / DIP_PCB_LEGS.md
Last active August 24, 2024 17:20
DIP PCB LEGS

It's common these days to need to replace obsolete DIP chip parts in vintage electronics with small PCBs that fit where the DIP chips used to go. For instance the infamous SID and PLA chips in Commodore computers.

However the most common types of pin headers available to make the legs are actually too thick and they damage DIP sockets. This includes common machined round pins, which are thinner than the square pins, and ok for use in round sockets, but still technically a bit too thick for leaf sockets. They can compress the wipers and make the socket no longer make a good connection with a real DIP chip any more. Also those pins always have a quite large insulator & shoulder, and in some cases there is not much room where a DIP chip came out of for that much vertical thickness of the pin header shoulders and insulators plus the pcb plus the components soldered to the pcb.

Here are 3 different ways to make DIP legs on PCBs, where the legs are thin enough not to stretch out leaf/wiper style DIP sockets, and

@bkw777
bkw777 / bash_uname.sh
Last active August 7, 2021 00:15
Platform detection in bash without external executables (no /bin/uname)
#!/usr/bin/env bash
# Example to detect OS in bash using bash built-in variable $OSTYPE instead of `uname`
# platform differences
stty_f="-F" SERIAL_TTY_PREFIX=ttyUSB # Default (Linux)
case "${OSTYPE,,}" in
*bsd*) stty_f="-f" SERIAL_TTY_PREFIX=ttyU ;; # FreeBSD/NetBSD/OpenBSD/etc
darwin*) stty_f="-f" SERIAL_TTY_PREFIX=cu.usbserial- ;; # Mac OSX
esac
@bkw777
bkw777 / bin_to_hex_to_bin.sh
Last active July 7, 2022 05:04
binary-safe file-to-ram, ram-to-file, in pure bash
#!/usr/bin/env bash
# file-to-ram, ram-to-file, in pure bash
# binary-safe including nulls, no external tools, no sub-shells
# Brian K. White [email protected]
# read file binary to h[] hex pairs
ftoh () {
local -i i= ;local x= LANG=C ;h=()
while IFS= read -d '' -r -n 1 x ;do printf -v h[i++] '%02X' "'$x" ;done <$1
}