Skip to content

Instantly share code, notes, and snippets.

View pythoninthegrass's full-sized avatar

pythoninthegrass

View GitHub Profile
@pythoninthegrass
pythoninthegrass / font.yml
Last active September 15, 2023 03:43 — forked from mkubenka/sparsecheckout.yml
Install hack nerd-font via ansible shell out to git sparse-checkout
# code: language=ansible
---
- hosts: localhost
connection: local
gather_facts: true
any_errors_fatal: true
vars:
base_dir: "{{ home_dir }}/git/nerd-fonts"
repo_url: https://github.com/ryanoasis/nerd-fonts.git
@pythoninthegrass
pythoninthegrass / imperial_credit.py
Last active June 20, 2024 17:24
Convert Imperial Credits to US Dollars and vice versa
#!/usr/bin/env python3.11
import sys
"""
Convert Imperial Credits to US Dollars and vice versa.
Based on the exchange rate of 4.50 Imperial Credits to 1 US Dollar.
cf:
@pythoninthegrass
pythoninthegrass / README.md
Last active October 19, 2023 05:44
Decompress/compress all directories ineither a given or current directory.

archive (all)

Usage

# clone
cd ~/Downloads
git clone https://gist.github.com/d76520b1bfa66713a5e27ead5e2c4e93.git archive

# create local bin directory
mkdir -p ~/.local/bin
@pythoninthegrass
pythoninthegrass / compile_python.sh
Last active October 14, 2023 22:28
Compile and install a specific version of Python from source
#!/usr/bin/env bash
# shellcheck disable=SC2046,SC2086,SC2164
cat << 'DESCRIPTION' >/dev/null
compile_python.sh compiles and installs a specific version of Python from source.
USAGE
./compile_python.sh "<version>"
@pythoninthegrass
pythoninthegrass / m3uparser.py
Last active October 24, 2023 02:31
Reconcile Amazon Music (csv) + MP3 library (m3u) to recreate a local playlist(s) with matching library files.
#!/usr/bin/env python3
# SOURCE: https://github.com/pythoninthegrass/m3u_prsr
import sys
class track():
def __init__(self, length, title, path):
self.length = length
@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
@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 / 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 / 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 / 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