Skip to content

Instantly share code, notes, and snippets.

@stackcoder
stackcoder / Dockerfile
Created February 2, 2024 16:37
Build WinAFL in Docker Windows Container
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["powershell", "-NoProfile", "-Command", "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; $VerbosePreference='Continue'; "]
RUN $hash = 'a6058d7c4c16bfa5bcd6fde051a92de8c68535fd7ebade55fc0ab1c41be3c8d5' \
; Invoke-WebRequest -OutFile 'git_setup.exe' 'https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe' \
; if (Compare-Object $hash $(Get-FileHash 'git_setup.exe').Hash) { Write-Error 'CHECKSUM VERIFICATION FAILED!' -ErrorAction Stop } \
; Start-Process -Wait 'git_setup.exe' -ArgumentList '/verysilent' \
; Remove-Item -Force 'git_setup.exe'
@stackcoder
stackcoder / erase-tapes.sh
Created February 19, 2024 17:30
Bash script to batch erase tapes
#!/bin/bash
set -euo pipefail
# Redirect everything to stdout and logfile
exec > >(tee -a erase_tape.log) 2>&1
# {{ ansible_managed }}
TAPE="{{ tape_backup__tape_drive }}"
if [[ ! -c "${TAPE}" ]]; then
@stackcoder
stackcoder / wipe-free.sh
Created December 8, 2024 19:17
Wipe free space on Android devices
#!/bin/bash
set -euxo pipefail
{
for path in "/system" "/data" "/cache" "/sdcard"; do
dst="$path/xxx-wipe"
echo "Fill $dst"
dd if=/dev/urandom of="$dst" bs=1048576 conv=sync || true
cat /dev/urandom > "$dst.1" || true
sync