Skip to content

Instantly share code, notes, and snippets.

View jspiro's full-sized avatar
:shipit:
const application:Application = Application(Application.application); // Sigh.

Jono Spiro jspiro

:shipit:
const application:Application = Application(Application.application); // Sigh.
View GitHub Profile
@jspiro
jspiro / README.md
Last active September 12, 2025 06:03
DNS Nameserver Comparison Tool - Validates DNS record equivalency during migrations

nscompare - DNS Nameserver Comparison Tool

A tool for validating DNS record equivalency when migrating between DNS providers. It compares live DNS responses from two nameservers to ensure functional equivalency during migrations.

The zone file is used ONLY to determine which hostnames and record types to query. The actual values in the zone file are ignored - all comparisons are based on live DNS responses from the specified nameservers.

Installation

# Download the script

iPod Music Extraction Tools

CLI tools for extracting music from iPod nano (5th generation) on macOS.

Quick Start

  1. Connect iPod via USB
  2. Run ./lock_ipod.sh to prevent auto-unmounting
  3. Use the Python extractor in ipod-music-extractor/
@jspiro
jspiro / README.md
Last active October 29, 2023 23:37
How I do my bitcoin taxes

TurboTax has no crypto support, it also doesn't support importing CSVs of transactions, and CreditKarma has no ability to import from financial institutions at all (so e.g. wealthfront is an instant dealbreaker for trying it). Square sends out terrible CSVs of transactions and does very little to help you report for the few bucks you made.

  1. Import transactions to https://app.koinly.io/transactions
  2. Set tax basis to LIFO, print https://app.koinly.io/reports/2019 to PDF
  3. Load https://app.koinly.io/transactions?page=1 and find the transactions JSON transfer in the Network tab, Copy as cURL
  4. In the terminal, paste this, and either remove the gzip line or pipe through gzip, do this for each page, e.g.:
curl 'https://api.koinly.io/api/transactions?page=1&per_page=20' \
    -XGET \
    -H 'Accept: application/json, text/plain, */*' \
@jspiro
jspiro / git-magic-trick.md
Last active July 23, 2020 09:13
Migrate repo AND select branches/PRs into a monorepo WITHOUT retaining history

Preparation

  • Source repo should have as many branches and PRs closed or merged as possible
  • Rest of PRs should be merged with master just before migration begins

Prepare the initial commit of the migrated repo (master)

  1. Archive source repo
  2. Go to target directory in monorepo
  3. Clone source repo into correctly named folder in monorepo
  4. cd to repo and make all necessary changes for migration to monorepo (e.g. renaming)
  5. Commit all changes INSIDE the cloned repo on local master (commit name doesn't matter, DO NOT PUSH)
@jspiro
jspiro / gist:729e64e451d05ba3ce655a34cfb43d2a
Last active June 16, 2020 22:32
horrific but working way to summarize file sizes in a directory for evaluating what's tracked by git lfs
$ find . -type f -name '*.*' |
sed 's/.*\.//' |
sort -u |
while read ext; do
(
gfind . -name "*$ext" -printf "%s\n" |
sed 's/$/+/' |
tr -d '\n'
echo 0
) | bc | tr -d '\n'
@jspiro
jspiro / dedupe.sh
Created May 18, 2020 09:34 — forked from tvwerkhoven/dedupe.sh
De-duplicate using APFS clonefile(2) and jdupes in zsh
#!/usr/bin/env zsh
#
# # About
# Since APFS supports de-duplication on block-level, it can be useful to
# manually de-duplicate your files if you've migrated/upgrade to APFS not
# using a fresh install.
#
# I've written this simple script with the aim to:
# - Be simple, easy to read and understand (for users to check)
# - Use native cp -c for de-duplication
@jspiro
jspiro / login-to-artifactory.sh
Last active May 13, 2020 06:22
CLI tool to log in to Artifactory NPM
#!/bin/sh
scope=company-name
any_scoped_package_name=secret_package
url=artifactory.company.com
repo=npm
cd "$(dirname "$0")" || exit
echo Please enter your email address:
read -r email
#!/bin/sh
sudo nvram StartupMute=%00
#!/bin/sh
grep pam_tid /etc/pam.d/sudo >/dev/null || echo auth sufficient pam_tid.so | cat - /etc/pam.d/sudo | sudo tee /etc/pam.d/sudo > /dev/null
@jspiro
jspiro / coffeelint.css
Created March 5, 2019 23:05
coffeelint.org snapshot 9/19
* {
padding:0;
margin:0;
}
html {
width:100%;
}
body {