Skip to content

Instantly share code, notes, and snippets.

View zambonin's full-sized avatar

Gustavo Zambonin zambonin

View GitHub Profile
@zambonin
zambonin / git-estimate.sh
Last active November 18, 2020 05:01
Estimates how much time a project has taken according to the commit timeline.
#!/usr/bin/env sh
# shellcheck disable=SC2214
#
# A POSIX-compliant shell script that estimates the number of hours taken to
# create the contents of a Git repository. The heuristic is based on grouping
# bundles of commits according to a certain period limit, accumulating time
# differences between pairs of commits in each bundle, and compensating for its
# first commit with another parametrized quantity. Timestamps are taken from
# the author of the commit.
#
@zambonin
zambonin / git-size-history.sh
Created November 18, 2020 04:29
File size vs time as given by a Git repository. Inspired by http://phdcomics.com/comics/archive.php?comicid=1915.
#!/usr/bin/env bash
# shellcheck disable=SC2214
#
# A shell script that shows the size of a file in each commit that modifies it,
# alongside the timestamp taken from the author of the commit. This is useful
# to visualize the size evolution of a file.
#
# It accepts a single option to customize its behavior, described as
# follows. The last argument must be a valid file tracked by its respective
# repository, with the first file obtained from git-ls-files(1) as default.
@zambonin
zambonin / sendkeys.awk
Last active November 29, 2024 23:38
AWK script to send multiple `sendkey` commands to a QEMU virtual machine.
#!/usr/bin/env awk -f
#
# AWK script to send multiple `sendkey` commands to a QEMU virtual machine.
# It writes at a rate of roughly 40 keys per second, due to lower delays
# resulting in garbage output.
#
# It makes use of a TCP client created by an external utility, such as OpenBSD
# Netcat, to interact with QEMU's monitor and send a stream of `sendkey`
# commands. This is a practical way to transfer a small file or to script
# interactions with a terminal user interface.
@zambonin
zambonin / README
Last active April 21, 2020 20:38
Script that reconstructs the order of unlocked secrets for the save game file of The Binding of Isaac.
Script that reconstructs the order of unlocked secrets in the `so.sol`
auxiliary save game file for The Binding of Isaac (2011 roguelite game).
The main save file for Isaac is called `serial.txt`, located inside the game
folder. It is the only file backed up by Steam Cloud [1], and its secrets field
does not hold the order in which these were unlocked. If the secondary file
`so.sol` is missing, it will be recreated without this information.
The idea is to use Steam achievement timestamps to recreate the unlocking order
of Isaac secrets. If a secret has no corresponding achievements, it is randomly