Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / .gitignore
Last active December 28, 2023 00:16
Remove repos from CircleCI via API
repos.txt
@pythoninthegrass
pythoninthegrass / set_hostname.sh
Last active December 19, 2023 21:59
Set hostname on macOS
#!/usr/bin/env bash
# shellcheck disable=SC2086
IFS="$(printf '\n\t')"
trap 'unset IFS' INT HUP QUIT
help() {
cat <<- DESCRIPTION >&2
@pythoninthegrass
pythoninthegrass / dl-gh
Last active July 22, 2025 08:05
Download latest GitHub releases by user, repo, and extension
#!/usr/bin/env bash
# shellcheck disable=SC2207
base_url="https://github.com/$user_name/$repo_name/releases"
pkg_path=$(pwd)
distro=$(uname) # Linux / Darwin
arch=$(uname -m) # x86_64 / aarch64 / arm64
help() {
@pythoninthegrass
pythoninthegrass / bfg
Last active December 14, 2023 00:17
Shim for bfg repo cleaner
#!/usr/bin/env bash
# * Download latest bfg bin from https://rtyley.github.io/bfg-repo-cleaner/
# * Copy somewhere in path (e.g., ~/.local/bin)
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
java -jar "${SCRIPT_DIR}/bfg-1.14.0.jar" "$@"
@pythoninthegrass
pythoninthegrass / data_drives.sh
Created November 22, 2023 19:39
Make filesystem then add drives to fstab
# create dirs
mkdir -p /data/{0..2}
# mkfs xfs
mkfs.xfs /dev/nvme0n1
mkfs.xfs /dev/nvme1n1
mkfs.xfs /dev/nvme2n1
# mount partition manually (optional)
# mount /dev/nvme0n1 /data/0
@pythoninthegrass
pythoninthegrass / gen_passwd.sh
Last active November 21, 2023 17:58
Generate a hash from a random salt and password from stdinput.
#!/usr/bin/env bash
# shellcheck disable=all
# pass a password to this script and it will return the hash
if [ -z "$1" ]; then
echo "Usage: $0 <password> <salt>"
exit 1
fi
@pythoninthegrass
pythoninthegrass / omnivore_export.py
Last active December 23, 2023 16:38
MVP for exporting 3000+ articles from Omnivore in one go via the GraphQL library.
#!/usr/bin/env python3
import json
from decouple import config
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.exceptions import TransportServerError, TransportQueryError
api_key = config('OMNIVORE_API_KEY')
@pythoninthegrass
pythoninthegrass / run-ios-sim.sh
Last active August 26, 2025 16:04
Run iOS simulator from the command line.
#!/usr/bin/env bash
# shellcheck disable=SC2143,SC2317
# TODO: debug ctrl-d
# trap ctrl-c, ctrl-d, and ctrl-z
trap_card() {
echo -e "\nGoodbye!"; exit 0
}
trap trap_card SIGINT SIGQUIT SIGTSTP
@pythoninthegrass
pythoninthegrass / solution.py
Created October 28, 2023 00:57
Snyk Fetch the Flag: sparky
#!/usr/bin/env python3
import argparse
import base64
import datetime
import requests
from colorama import Fore
"""
SOURCE
@pythoninthegrass
pythoninthegrass / SOLUTION.md
Created October 27, 2023 19:53
Snyk Fetch the Flag: unhackableandy

Unhackable Andy

  • Navigate to mistaken git commit of .env file here
  • Log into docker instance of admin dashboard (e.g., http://challenge.ctf.games:30715/dashboard)
  • Enter creds
  • Find the flag and output contents instead of resetting the server
    find / -maxdepth 10 -iname "flag.txt" -exec cat {} \; 2>/dev/null