Skip to content

Instantly share code, notes, and snippets.

STOP: docker stop $(docker ps -aq)
START (no Watchtower): docker start $(comm -13 <(docker ps -a -q --filter="name=watchtower" | sort) <(docker ps -a -q | sort))
STOP & DISABLE unionfs_cleaner.service
STOP & DISABLE unionfs.service
STOP plexdrive & rclonemount services
sudo cp ~/service.bak/plexdrive.service /etc/systemd/system/
cp /opt/plexdrive/plexdrive-latest /opt/plexdrive/plexdrive
@hthighway
hthighway / plex-update-mtime.py
Created August 21, 2018 18:32 — forked from tadly/plex-update-mtime.py
Retroactively update plex's updated_at, created_at and added_at dates by the files mtime
#!/usr/bin/env python3
#
# Most importantly:
# 1. Use at your own risk!
# 2. You may consider creating a backup because this script doesn't
# 3. Only tested on linux
#
# What does this script do?
# Whenever you scan for new items, plex will set the respective dates to
# the CURRENT time rather than the files mtime.
@hthighway
hthighway / plexcrypt.service
Last active October 12, 2018 21:49
PlexDrive + Rclone Crypt + UnionFS Mount
[Unit]
Description=RClone Mount (crypt)
AssertPathIsDirectory=/mnt/decrypt
After=plexdrive.service
Requires=plexdrive.service
PartOf=plexdrive.service
[Service]
Type=simple
User=username
Repair (dump and import):
1. cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original
2. sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
3. sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"
4. sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
5. rm com.plexapp.plugins.library.db
6. sqlite3 com.plexapp.plugins.library.db < dump.sql
#*/30 * * * * /home/user/scripts/cleanhidden.sh
#1 6 * * * /home/user/scripts/gcloud-start.cron
wget x86.ca/bench.sh -O - -o /dev/null|bash
http://www.speedtest.net/result/6507176914.png
wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip
@hthighway
hthighway / plexdrive.service
Last active March 16, 2021 20:30
SYSTEMD files for plexdrive. Ceates a plexdrive mount and then a UnionFS of local and remote content (SEE updated version here: https://github.com/hthighway/scripts/tree/master/plexdrive )
[Unit]
Description=Plexdrive
AssertPathIsDirectory=/mnt/plexdrive
After=network-online.target
[Service]
Type=simple
#
# uid & gid values are for the user that you want to run plexdrive, $id will give you the values for the logged in user
#
@hthighway
hthighway / Plex Routing thru SSH Tunnel
Last active August 24, 2022 10:05 — forked from MarMed/README.md
Routing plex traffic through an SSH tunnel
#Routing plex traffic through an SSH tunnel
This guide creates a reverse SSH tunnel to route all Plex server traffic through it.
Step 2 is done on the tunnel, all other steps are done on the plex server.
#1. Setup SSH keys (if you already have key based authenthication setup skip to step 2)
On plex server:
@hthighway
hthighway / gist:d687a9fc07b2af55756e5a8aac94df12
Created August 21, 2018 18:47
Change file path for Plex Media
1 Shutdown plex server
2 Backup your data https://support.plex.tv/hc/en-us/articles/201539237
3 Copy your content to the new location
4 Edit your database. Find the location here: https://support.plex.tv/hc/en-us/articles/201100678-Repair-a-Corrupt-Database
5 There are 4 edits you'll need to make (change pathing to appropriate values):
UPDATE section_locations
SET root_path= replace(root_path, '/Users/jelwell/Shared', '/Volumes/Movies')
where root_path like '%/Users/jelwell/Shared%'