Skip to content

Instantly share code, notes, and snippets.

@slmaxk
slmaxk / convert-raw-to-vmdk.sh
Created April 30, 2021 19:06 — forked from abn/convert-raw-to-vmdk.sh
Convert all xz compressed raw images in current directory to vmdk and xz compress them.
find ./ -type f -name "*.raw.xz" \
-exec echo "Uncompressing {} ..." \; \
-exec unxz --keep {} \; \
-exec bash -c \
'for file do
INPUT_IMG=${file/.xz/}
OUTPUT_IMG=${file/raw.xz/vmdk}
echo "Converting to vmdk: ${INPUT_IMG}";
qemu-img convert -f raw -O vmdk ${INPUT_IMG} ${OUTPUT_IMG};
echo "Compressing ...";
@slmaxk
slmaxk / gist:3a52ba44532d45cdf2e4dbe3533ad682
Created May 13, 2019 09:41 — forked from alphazo/gist:3303282
Clone MiFare cards using chinesse UUID writable cards

libnfc supports UUID writable cards and even has some dedicated tools for them.

However it doesn't work with some of the cards found on eBay that are even simpler to use. Sector 0 is unlocked and can be written without any additional commands. libnfc requires a small patch to get it working.

Following has been tested under ArchLinux with modified libnfc 1.5.1, mfoc 0.10.2 and a SCL3711 dongle.

Patch & recompile libnfc

The patch is fairly simple, open libnfc-1.5.1/utils/nfc-mfclassic.c and comment 2 lines (it was lines 384 and 385 for me):

// Try to write the trailer