Skip to content

Instantly share code, notes, and snippets.

View GitterDoneScott's full-sized avatar

GitterDoneScott

View GitHub Profile
@GitterDoneScott
GitterDoneScott / gist:f41c97b46fe72769a26ce0b9cfda02b6
Last active December 11, 2024 22:32
containerized yt-dlp command to download and clean Youtube transcripts and output the results to stdout. The purpose of this gist is to use the resulting output for text generation AI processes.
docker run --rm ghcr.io/jauderho/yt-dlp:latest --quiet --no-warnings --ignore-config --skip-download --write-subs --write-auto-subs --sub-lang en --sub-format ttml --convert-subs srt --exec before_dl:"echo %(title)q" --exec before_dl:"cat %(requested_subtitles.:.filepath)#q | sed '/^[0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9] --> [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]$/d' | sed '/^[[:digit:]]\{1,3\}$/d' | sed 's/<[^>]*>//g' | sed '/^[[:space:]]*$/d' " <YouTube video URL>
@GitterDoneScott
GitterDoneScott / gist:88805cd6397e6204557bebe902c3dccb
Created January 20, 2022 13:36
Remove location/gps metadata from images
exiftool -overwrite_original -gps:all= *.jpg
@GitterDoneScott
GitterDoneScott / gist:812f93f158ad10cabe1d8035eab380c8
Created April 24, 2021 23:45
wget scrape of a Confluence Wiki - This isn't perfect becuase it gets some duplicate pages
wget \
--header="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36" \
--header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" \
--header="Accept-Language: en-us,en;q=0.5" \
--header="Accept-Encoding: gzip, deflate" \
--header="Cookie: JSESSIONID=<Paste your session ID here>" \
--cipher 'DEFAULT:!DH' \
--no-check-certificate \
--page-requisites \
--html-extension \
@GitterDoneScott
GitterDoneScott / gist:9dcab4e33600d2860890258b7b397267
Created March 1, 2021 18:16
Repairing/restoring a plex database using a SQLite3 docker image
# Ensure permissions on /opt/plex_config_local are correct
docker run --rm -it --entrypoint /bin/sh --mount src=/opt/plex_config_local,target=/opt/plex_config_local,type=bind keinos/sqlite3:latest
cd /opt/plex_config_local/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/
# Follow these steps https://support.plex.tv/articles/201100678-repair-a-corrupt-database/
# If the database is corrupt, change the last line of the export (dump.SQL) to 'COMMIT;'
import pudb; pudb.set_trace()
@GitterDoneScott
GitterDoneScott / docker-compose.override.yml
Created January 29, 2020 16:50
Bitwarden behind self-hosted containerized jwilder/nginx-proxy
version: '3'
services:
nginx:
environment:
- "VIRTUAL_PORT=8080"
- "VIRTUAL_HOST=bitwarden.example.com"
- "LETSENCRYPT_HOST=bitwarden.example.com"
- "LETSENCRYPT_EMAIL=lte@example.com"
networks:
- reverse-proxy
@GitterDoneScott
GitterDoneScott / docker-compose.override.yml
Created January 29, 2020 16:49
Bitwarden behind self-hosted containerized jwilder/nginx-proxy
version: '3'
services:
nginx:
environment:
- "VIRTUAL_PORT=8080"
- "VIRTUAL_HOST=bitwarden.example.com"
- "LETSENCRYPT_HOST=bitwarden.example.com"
- "LETSENCRYPT_EMAIL=lte@example.com"
networks:
- reverse-proxy
@GitterDoneScott
GitterDoneScott / export_inbox.py
Created October 4, 2019 17:14
Save (export) all messages in Outlook inbox as .msg files
from win32com.client import Dispatch
import re
outlook = Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder("6")
all_inbox = inbox.Items
for message in all_inbox:
try:
name = str(message.subject)
@GitterDoneScott
GitterDoneScott / gist:eacf9aea3a9185c0cfa41150138e133f
Created September 1, 2019 21:05
create and scp/ssh a gzipped tarball with no intermediary steps or files
tar zcvf - MyBackups | ssh user@server "cat > /path/to/backup/foo.tgz"
@GitterDoneScott
GitterDoneScott / gist:c5527aa8b38ece16197c4d272c7a63e4
Created September 1, 2019 20:08
Backup and restore commands for a Docker mysql database.
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE