Skip to content

Instantly share code, notes, and snippets.

View GitterDoneScott's full-sized avatar

GitterDoneScott

View GitHub Profile
@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
@GitterDoneScott
GitterDoneScott / gist:fa062c7d2286d45a195f6c1010004260
Created August 20, 2019 16:34
Docker syntax to include TLS/SSL proxy certificates into ca-certificates and java keystore
# Compile and install certificates for the Java trust keystore
COPY certs/ /usr/local/share/ca-certificates/
RUN update-ca-certificates && \
ls -1 /usr/local/share/ca-certificates | while read cert; do \
openssl x509 -outform der -in /usr/local/share/ca-certificates/$cert -out $cert.der; \
"$JAVA_HOME/bin/keytool" -import -alias $cert -keystore "$JAVA_HOME/jre/lib/security/cacerts" -trustcacerts -file $cert.der -storepass changeit -noprompt; \
rm $cert.der; \
done