Skip to content

Instantly share code, notes, and snippets.

@parkerlreed
parkerlreed / betteradbcopy
Last active January 25, 2025 13:24
betteradbcopy - Multi-threaded SCP to/from Android device over USB/WiFi with Termux
#!/bin/bash
# Make sure to have OpenSSH setup in Termux as well as setting a password with `passwd`
# Requires https://github.com/upa/mscp and adb platform tools on your local machine
init_sshd() {
adb shell -t "run-as com.termux files/usr/bin/bash -lic 'export PATH=/data/data/com.termux/files/usr/bin:$PATH; export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so; sshd'"
adb forward tcp:8022 tcp:8022;
}
stop_sshd() {
adb shell -t "run-as com.termux files/usr/bin/bash -lic 'export PATH=/data/data/com.termux/files/usr/bin:$PATH; export LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so; killall sshd'"
@ktkd
ktkd / thinkpad.x13s.note.txt
Last active February 27, 2024 12:39
Thinkpad X13s (or any other with whitelist and WWAN m.2 port) second nvme drive
Main idea, we modify NVME pci id's to look like a white-list allowed device (i.e. modem/wifi/etc)
First we should find white-listed VID/PID/SSVID/SSPID, for thinkpad x13s i just read a bios firmware and found this part
of data, well it looks like id's and repeated like a list of them
0000000001000000 5B10 C1E0 CB17 0C01
0000000001000000 5B10 C2E0 CB17 0C01
0000000001000000 5B10 C3E0 CB17 0C01
mirror them»»»»
0000000001000000 105B E0C1 17CB 010C
0000000001000000 105B E0C2 17CB 010C
@benhess02
benhess02 / all_6502.json
Last active November 13, 2024 21:22
All MOS 6502 Instructions in JSON Format (including illegal instructions)
[
{
"opcode": 0,
"mnemonics": [
"BRK"
],
"addressingMode": "implied",
"cycles": 7,
"pageBoundaryCycle": false,
"illegal": false
@imbushuo
imbushuo / HalInterrupt.md
Last active November 17, 2020 10:13
Third party Windows interrupt controller support if you are brave enough

Extracted from Windows public symbol, with a bit guessing. Function prototypes are not fully understood yet.

You still need your own way to hook your things into HAL.dll, as interrupt controller extension is never exposed.

typedef struct _SOC_INITIALIZATION_HEADER {
    ULONG TableVersion;
    ULONG TableSize;
} SOC_INITIALIZATION_HEADER, *PSOC_INITIALIZATION_HEADER;
@Alex4386
Alex4386 / crossover-howtocompile.md
Last active December 21, 2024 08:40
CodeWeavers CrossOver - How to compile from source! for macOS

[STOP] This gist is deprecated.

TL;DR

WAY MORE UP-TO-DATE GIST (and includes some setup stuff that I forgot to document): https://gist.github.com/sarimarton/471e9ff8046cc746f6ecb8340f942647
Current Development for Building Libre-version of CrossOver: https://github.com/GabLeRoux/macos-crossover-cloud-build.
For Latest Discussions: https://github.com/GabLeRoux/macos-crossover-cloud-build/issues.

Long Description

This version of gist is outdated since it was written while I was compiling CrossOver v19. and seems to be there are some breaking changes in v19.1+ and 20. Also, I think I missed some required libraries/stub files that was required in build (that I previously installed beforehand). Oops.

@mortie
mortie / chrono-cheat-sheet.md
Last active March 7, 2025 19:54
std::chrono cheat sheet for the every-day programmer

Chrono cheat sheet

For the every-day programmer who needs to get shit done instead of fighting type errors.

If your application deals with times in any meaningful way, you should probably want to actually store time_points and durations and what-not; chrono has a pretty rich vocabulary for talking about time-related concepts using the type system. However, sometimes you just need to do something simple, like timing how long something takes, which is where chrono becomes overly complex, hence this cheat sheet.

All examples will assume #include <chrono>.

I just want to time something, then print the result

@averne
averne / Makefile
Created April 19, 2019 08:15
VSCode Linux project
TARGET = $(notdir $(CURDIR))
EXTENSION = elf
OUT = out
RELEASE = release
DEBUG = debug
SOURCES = src
INCLUDES =
LIBS =
ARCH = -march=native -fpie
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@SciresM
SciresM / nx_bootloader_uncompress.c
Last active December 27, 2019 10:43
Quick and dirty NX bootloader uncompression code for 6.2.0+
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
typedef uint32_t u32;
typedef uint8_t u8;
###############################################
# TX SX OS unpacker - by hexkyz and naehrwert #
###############################################
from Crypto.Cipher import AES
from Crypto.Util import Counter
import os
import struct
"""