Skip to content

Instantly share code, notes, and snippets.

@seia-soto
seia-soto / arm64e-linux.sh
Created July 5, 2020 11:21
Installs sbinger's arm64e toolchain to allow arm64e compilation on Linux
curl -LO https://github.com/sbingner/llvm-project/releases/download/v10.0.0-1/linux-ios-arm64e-clang-toolchain.tar.lzma
TMP=$(mktemp -d)
tar --lzma -xvf linux-ios-arm64e-clang-toolchain.tar.lzma -C $TMP
pushd $TMP/ios-arm64e-clang-toolchain/bin
find * ! -name clang-10 -and ! -name ldid -and ! -name ld64 -exec mv {} arm64-apple-darwin14-{} \;
find * -xtype l -exec sh -c "readlink {} | xargs -I{LINK} ln -f -s arm64-apple-darwin14-{LINK} {}" \;
popd
mkdir -p $THEOS/toolchain/linux/iphone
mv $TMP/ios-arm64e-clang-toolchain/* $THEOS/toolchain/linux/iphone/
rm -rf $TMP linux-ios-arm64e-clang-toolchain.tar.lzma
@tmcolby
tmcolby / shell commands
Last active December 1, 2025 11:52
socat tricks - relaying serial ports, sniffing/monitoring/data logging traffic
This first example assumes two usb serial port adapters are connected to the host machine. They enumerate as ttyUSB0 and ttyUSB1.
We want data coming into ttyUSB0 to be piped right back out of ttyUSB1 (so our host sits as a man in the middle).
We want an application running on the host to be able to connect to a com port and monitor the traffic.
# create the fifo
sudo mkfifo -m 777 /tmp/fifo
# stream serial data on /dev/ttyUSB0 to the fifo AND a virtual com port /tmp/relay
sudo socat /dev/ttyUSB0,raw,echo=0 system:'sudo tee /tmp/fifo | sudo socat - "pty,raw,echo=0,link=/tmp/relay"' &
@warewolf
warewolf / README.md
Last active December 29, 2025 23:10
Phison drive mode configuration

Phison PS2251-xx USB flash drive controller mode configuration

Overview

Phison based flash drives have various modes that dictate how they operate;

  1. as a regular flash drive (mode 3)
  2. as a dual-volume flash drive (mode 7)
  3. as a single volume flash drive + cdrom (mode 21)