Skip to content

Instantly share code, notes, and snippets.

View pirate's full-sized avatar
🗃️
Archiving all the things!

Nick Sweeting pirate

🗃️
Archiving all the things!
View GitHub Profile
@pirate
pirate / usernames.txt
Last active April 12, 2024 20:50
Untaken 3-letter Usernames on Github
None of these 3 letter-only usernames below are available anymore as of 2021.
However, if you use numbers and symbols, or accept 4 letters, you can definitely find a free one.
Check responsibly. Don't spam the github API/support, it's not a race, there are plenty free if you have imagination.
agq, ahq, aqf, aqg, aqp, aqt, aqf, aqy, atq, auh, ayp, azj, azq, bey, bgt, bgx, bhq, bkk, bkq, bmq,
bpp, bpq, bqa, bqc, bqg, bqi, bqj, bql, bqn, bqo, bqp, bqr, bqt, bqy, buo, buq, bwz, bxe, bxo, bxw,
bzn, bzp, cfl, ckg, ckq, cnq, cpq, cpz, cqa, cqe, cqf, cqg, cqk, cqo, cqp, cqf, cqx, cqz, cud, cuh,
cuk, cuo, cfl, cxe, czo, dkq, dnq, dqg, dqi, dqk, dqo, dqs, dsr, dtq, dxe, eaj, eaq, ebq, ecl, ecy,
eer, efq, efy, egq, egx, ehh, ehz, eiu, eiw, eiy, ejx, eoq, eou, epj, eqa, eqb, eqf, eqg, eqj, eqk,
eqs, eqf, eqw, eqz, erq, etq, eub, euf, euj, euq, euf, efq, efy, ewy, ewz, exn, eyh, eyj, eyn, eyq,
@pirate
pirate / imgur_backup.sh
Created May 4, 2023 05:26
Backup all Imgur URLs found in a given set of files using ripgrep + wget. Searches all text and binary files for any imgur URLs and downloads them locally.
#!/usr/bin/env bash
# imgur_backup.sh
# Backup all Imgur URLs found in a given directory using ripgrep + wget. Searches all text files, binary files, PDFs, database dumps, etc. for any imgur URLs and downloads them into a local directory.
#
# Note: make sure you apt/brew install ripgrep first, and replace grep with ggrep (brew install grep) on macOS
# Usage:
#
# $ mkdir db_dumps
# $ docker-compose exec postgres env PGPASSWORD=somepassword pg_dump -U someuser somedb > ./db_dumps/db_dump.sql
# $ bash imgur_backup.sh db_dumps
@pirate
pirate / docker-compose-backup.sh
Last active March 31, 2024 00:51
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@pirate
pirate / add_debug_entitlement.sh
Created March 28, 2024 09:02 — forked from talaviram/add_debug_entitlement.sh
Simple Utility Script for allowing debug of hardened macOS apps.
#! /bin/bash
# Simple Utility Script for allowing debug of hardened macOS apps.
# This is useful mostly for plug-in developer that would like keep developing without turning SIP off.
# Credit for idea goes to (McMartin): https://forum.juce.com/t/apple-gatekeeper-notarised-distributables/29952/57?u=ttg
# Update 2022-03-10: Based on Fabian's feedback, add capability to inject DYLD for sanitizers.
#
# Please note:
# - Modern Logic (on M1s) uses `AUHostingService` which resides within the system thus not patchable and REQUIRES to turn-off SIP.
# - Some hosts uses separate plug-in scanning or sandboxing.
# if that's the case, it's required to patch those (if needed) and attach debugger to them instead.
@pirate
pirate / music_in_screenshots.py
Created January 12, 2024 14:43
Automatically detect song/video title/artist/album/metadata captured in screenshots using GPT-4-vision via the OpenAI API.
#!/usr/bin/env python3
# Script to extract song/video title, artist, album, etc. metadata from screenshots w/ GPT-4.
### Example Usage: ###############################################################################
#
# ➜ ~/Desktop # python3 music_in_screnshots.py --prompt=prompt.txt --attach=spotify_screenshot.PNG
# {
# "found_prominent_media": true,
# "all_strings": [
const fs = require('fs');
const path = require('path');
const pathTo2captchaExtension = path.join(__dirname, '2captcha-solver');
const pathToPuppeteerStreamExtension = path.join(__dirname, 'puppeteer-stream-ext');
const { Cluster } = require('puppeteer-cluster');
const puppeteer = require("puppeteer-extra");
// add recaptcha plugin to solve captchas automatically
@pirate
pirate / dump_pocket.py
Last active February 26, 2024 04:05
Archive pocket data to local folder
#!/usr/bin/env python3
# Nick Sweeting 2017 | MIT License
# Usage:
# 1. Download pocket export from https://getpocket.com/export to ril_export.html
# 2. Run ./dump_pocket.py ril_export.html
# 4. Archive is saved in "pocket" folder
# Dependencies (chrome, python3, wget):
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
@pirate
pirate / strip_bad_filename_characters.sh
Last active February 23, 2024 21:36
Bash script to remove accents and special characters from filenames recursively.
#!/usr/bin/env bash
# Recursively remove all special characters from filenames by renaming them to their ASCII normalized forms.
#
# By default it does a dry run, to actually move the files uncomment the `mv -vi ...` line.
#
# This is useful for cleaning up network shares that will be shared via SMB/NFS between Unix/macOS/Windows
# where non-ASCII filenames can sometimes cause "file does not exist" errors when trying to access the files.
#
# This script removes leading/trailing whitespace in filenames and replaces accents and non-english
# characters with their ASCII equivalent, if no ASCII equivalent exists, it removes the character e.g.:
@pirate
pirate / django_auto_tz.py
Created March 23, 2021 15:52
Automatic timezone detection based on the user's browser for Django
# Inspiration from here: https://tutti.me/post/5453/
# Or you can use a library like:
# - https://github.com/adamcharnock/django-tz-detect (last updated 2019)
# - https://github.com/Miserlou/django-easy-timezones (last updated 2016)
# - https://github.com/jamesmfriedman/django-easytz (last updated 2015)
# Or guess TZ using visitors IP GEOIP: https://codereview.stackexchange.com/questions/161261/set-time-zone-from-cookie
# settings.py
TEMPLATES = [{
@pirate
pirate / docker_netcat_tunnel.sh
Last active January 29, 2024 08:07
Remote control a Docker container from another container in the same network using netcat, ssh, or pure python
# Three ways to control a docker container remotely from another docker container or host: Python, SSH, or ncat/nc/socat.
#
# Useful if you have two containers in a Docker Compose project and you want
# container1 to be able to run commands in container2 without having to share /var/run/docker.sock
#
# Further Reading: https://www.revshells.com/#bind
### 1. Using pure Python, the cleanest option
# supports dbus/x11/etc as it doesnt spawn a new login shell, correctly handles exiting after finished commands without hacky workarounds