Skip to content

Instantly share code, notes, and snippets.

View gromgit's full-sized avatar
💭
🤔 🤣

Adrian Ho gromgit

💭
🤔 🤣
  • Singapore
View GitHub Profile
@gromgit
gromgit / kore_mavericks.diff
Created August 5, 2016 04:05
Kore compatibility patch for macOS <= Mavericks
*** kore-2.0.0/src/pool.c.orig Fri Aug 5 10:21:29 2016
--- kore-2.0.0/src/pool.c Fri Aug 5 11:04:37 2016
***************
*** 21,26 ****
--- 21,35 ----
#include "kore.h"
+ // FIX: macOS <= Mavericks doesn't define MAP_ANONYMOUS
+ #ifndef MAP_ANONYMOUS
@gromgit
gromgit / test-keyspace.c
Last active November 14, 2017 03:06
AES-256 keyspace collision threshold calculator
// OBJECTIVE: Find the smallest ASCII-only password length guaranteed to
// trigger KDF collisions for AES-256
// TEST 1 (binary ASCII): Find the smallest N for which:
// 2^7 + 2^14 + 2^21 + ... + 2^(7*N) > 2^256
// TEST 2 (printable ASCII): Find the smallest N for which:
// 95^1 + 95^2 + 95^3 + ... + 95^N > 2^256
// TEST 3 (alphanumeric ASCII): Find the smallest N for which:
// 62^1 + 62^2 + 62^3 + ... + 62^N > 2^256
// COMPILE:
// gcc -o test-keyspace test-keyspace.c -lgmp
@gromgit
gromgit / pa_serial_test.c
Created November 27, 2017 13:43
PackedArray serialization test
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "PackedArray.h"
/*
PackedArray serialization test
BUILD:
1. Grab PackedArray.[ch] from https://github.com/gpakosz/PackedArray, drop them in this dir
@gromgit
gromgit / dump_bcrypt_hash.c
Created May 30, 2018 05:51
Dump salt and digest of bcrypt hash
// Original src: https://github.com/pyca/bcrypt/blob/master/src/_csrc/bcrypt.c
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
// Maps to character set "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
static const u_int8_t index_64[128] = {
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
#!/usr/bin/env bash
tapdir=$HOMEBREW_REPOSITORY/Library/Taps
tmpd=$(mktemp -d)
trap 'rm -fr "$tmpd" "${tapdir}"/test/homebrew-tap[0-9]*' EXIT
# Set up taps for testing
# Tap with Formula
[[ -d "${tapdir}"/gromgit/homebrew-dev ]] || brew tap gromgit/dev
# Tap with HomebrewFormula
[[ -d "${tapdir}"/mikosa/homebrew-awsp ]] || brew tap mikosa/awsp https://github.com/mikosa/aws-permission
@gromgit
gromgit / # yaws - 2021-05-24_10-05-03.txt
Created May 24, 2021 10:05
yaws on Ubuntu 18.04.5 LTS - Homebrew build logs
Homebrew build logs for yaws on Ubuntu 18.04.5 LTS
Build date: 2021-05-24 10:05:03
@gromgit
gromgit / # sc-im - 2021-05-27_14-37-02.txt
Created May 27, 2021 14:37
sc-im on Ubuntu 18.04.5 LTS - Homebrew build logs
Homebrew build logs for sc-im on Ubuntu 18.04.5 LTS
Build date: 2021-05-27 14:37:02
@gromgit
gromgit / # bzt - 2022-01-24_23-37-20.txt
Created January 24, 2022 15:37
bzt on macOS 12 - Homebrew build logs
Homebrew build logs for bzt on macOS 12
Build date: 2022-01-24 23:37:20
@gromgit
gromgit / dotnet-sdk-api-install.log
Created February 1, 2023 00:52
HOMEBREW_INSTALL_FROM_API causes wrong path to be derived
$ brew install --debug --cask dotnet-sdk
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 12.6.1\)\ curl/7.79.1 --header Accept-Language:\ en --max-time 5 --retry 3 --fail https://formulae.brew.sh/api/cask-source/dotnet-sdk.rb
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 12.6.1\)\ curl/7.79.1 --header Accept-Language:\ en --fail --progress-bar --silent --max-time 5 --retry 3 --location --remote-time --output /Users/aho/Library/Caches/Homebrew/api/cask.json --time-cond /Users/aho/Library/Caches/Homebrew/api/cask.json --compressed --silent https://formulae.brew.sh/api/cask.json
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 1
@gromgit
gromgit / dotnet-sdk-api-install.log
Created February 4, 2023 03:35
HOMEBREW_INSTALL_FROM_API causes wrong path to be derived
$ brew install --debug --cask dotnet-sdk
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 12.6.1\)\ curl/7.79.1 --header Accept-Language:\ en --max-time 5 --retry 3 --fail https://formulae.brew.sh/api/cask-source/dotnet-sdk.rb
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 12.6.1\)\ curl/7.79.1 --header Accept-Language:\ en --fail --progress-bar --silent --max-time 5 --retry 3 --location --remote-time --output /Users/aho/Library/Caches/Homebrew/api/cask.json --time-cond /Users/aho/Library/Caches/Homebrew/api/cask.json --compressed --silent https://formulae.brew.sh/api/cask.json
/opt/homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --show-error --user-agent Homebrew/3.6.20-167-g7a5f614\ \(Macintosh\;\ arm64\ Mac\ OS\ X\ 1