This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is a verbatim excerpt from the Jinja2 library that I'm preserving in a Gist for posterity | |
# https://github.com/pallets/jinja/blob/5b498453b5898257b2287f14ef6c363799f1405a/jinja2/debug.py | |
# -*- coding: utf-8 -*- | |
""" | |
jinja2.debug | |
~~~~~~~~~~~~ | |
Implements the debug interface for Jinja. This module does some pretty | |
ugly stuff with the Python traceback system in order to achieve tracebacks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of a pluginized architecture breaking up a large app | |
with complex behavior (ArchiveBox), into a series of steps | |
that plugins can hook into. | |
(read from the bottom to top to get a quick overview) | |
""" | |
import re | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# asymptotic_progress_bar.py | |
# MIT License © 2021 | |
# | |
# A pretty non-blocking python progress bar timer that fills up asymptotically until you stop it. | |
# Good for when you don't know how long a task is going to take (up to some max timeout), | |
# but you want it to feel fast and accurate / not stuck the whole time. | |
# ████████████████████ 0.9% (1/60sec) | |
# useful for animating e.g. file copy progress, download progress, package install progress, etc. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load tz %} | |
<html> | |
<head> | |
<script> | |
{% get_current_timezone as TIME_ZONE %} | |
window.TIME_ZONE = '{{TIME_ZONE}}' // timezone server thinks we're in | |
function setCookie(name, value, days) { | |
let expires = "" | |
if (days) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 = [{ |
NewerOlder