Skip to content

Instantly share code, notes, and snippets.

@0xack13
0xack13 / 1-setup.md
Created February 22, 2025 16:16 — forked from troyfontaine/1-setup.md
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@0xack13
0xack13 / ngrams.py
Created February 17, 2025 16:52 — forked from benhoyt/ngrams.py
Print most frequent N-grams in given file
"""Print most frequent N-grams in given file.
Usage: python ngrams.py filename
Problem description: Build a tool which receives a corpus of text,
analyses it and reports the top 10 most frequent bigrams, trigrams,
four-grams (i.e. most frequently occurring two, three and four word
consecutive combinations).
NOTES
@0xack13
0xack13 / github-actions-notes.md
Created January 16, 2025 04:56 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions
@0xack13
0xack13 / flink-quickstart-scala.sh
Created July 13, 2024 19:49 — forked from cesarcneto/flink-quickstart-scala.sh
Create an apache-flink scala project using the provided quickstart archetype
@0xack13
0xack13 / ca.md
Created February 11, 2024 02:26 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@0xack13
0xack13 / nix-shell-shebang.md
Created January 26, 2024 00:45 — forked from travisbhartwell/nix-shell-shebang.md
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

@0xack13
0xack13 / bash_flock.sh
Created January 25, 2024 05:07 — forked from jpclipffel/bash_flock.sh
Bash flock example
#!/bin/bash
#
# Bash `flock` example.
# Works on: Linux, BSD
# Doesn't work on: MacOS
# The file which represent the lock.
LOCKFILE="`basename $0`.lock"
# Timeout in seconds.
@0xack13
0xack13 / nix_inputs.md
Created January 20, 2024 21:36 — forked from CMCDragonkai/nix_inputs.md
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.

@0xack13
0xack13 / vagrant-vmware-tech-preview-apple-m1-pro.md
Created January 20, 2024 18:15 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

UPDATE November 20, 2022: VMWare Fusion 13

VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.

Summary

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated

@0xack13
0xack13 / urandom_music.sh
Created January 14, 2024 04:21 — forked from aweijnitz/urandom_music.sh
Music from /dev/urandom on Mac OSX
# I really enjoyed "Bash One Liner - Compose Music From Entropy in /dev/urandom"
# From http://blog.robertelder.org/bash-one-liner-compose-music/
#
# This is a collection of one liners that work on Mac OSX
# You need sox
brew install sox
# Major scale
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | sox -v 0.25 -traw -r16000 -b32 -e signed-integer - -tcoreaudio