Ubuntu

Stop SUDO nag

sudo visudo

{username} ALL=(ALL) NOPASSWD: ALL

Change modified time: find . -exec touch -d "12 hours ago" {} +

Find all of certian type: find . -type f -name "*.mp4"

Delete all of type recursively: find . -name "*.whatever" -type f -delete

Plex

sudo service plexmediaserver stop/start/restart

/var/lib/plexmediaserver/Library/Application Support/Plex Media Server

cd ~/NVE/plexdata && sudo tar -h --exclude Logs/* --exclude Application\ Support/Plex\ Media\ Server/Metadata/* --exclude Application\ Support/Plex\ Media\ Server/Media/* --exclude Application\ Support/Plex\ Media\ Server/Logs/* --exclude Application\ Support/Plex\ Media\ Server/Crash\ Reports/* --exclude Application\ Support/Plex\ Media\ Server/Cache/* -zcvf "Library-`date +%b-%d-%y`.tar.gz" ~/NVE/plexdata/Library/

Rclone

 

/etc/systemd/system/rclonemount.service


[Unit]
Description=Rclone Mount
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount google:Media /home/johnpowell/rclonemount --allow-other --dir-cache-time 1000h --poll-interval 15s --umask 002 --rc --rc-addr :5572 --rc-no-auth --cache-dir=/rccache --vfs-cache-mode full --vfs-cache-max-size 300G --vfs-cache-max-age 336h --bwlimit-file 16M
ExecStop=/bin/fusermount -uz /home/johnpowell/rclonemount
ExecStartPost=/usr/bin/rclone rc vfs/refresh recursive=true --rc-addr 127.0.0.1:5572 _async=true
Restart=on-failure
User=johnpowell
Group=johnpowell

[Install]
WantedBy=multi-user.target


	

Bandwith Limit: --bwlimit=10M

Limit # of Transfers: --transfers=1


FFMPEG & HandbrakeCLI

find . -type f -mmin +180 -name '*.mpg' | while read f; do comcut "$f" "${f%.mpg}.mp4"; rm "$f"; done


Squid

 Install: sudo apt-get install squid
 
Conf Location: sudo nano /etc/squid/squid.conf
Add ACL: Should be around line 1187 acl client src IP.IP.IP.IP # Home IP http_access allow client

Plex with Cloudflare using socat

		
[Unit]
Description=Proxy 8443 to 32400 internally but not externally
After=syslog.target local-fs.target network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/socat tcp-listen:8443,reuseaddr,fork tcp:localhost:32400
ExecStop=
Restart=always
RestartSec=5
[Install]
WantedBy=default.target
		
	

Fix lang

		
tv

cd ..

rclone move -P google:Media/TVpartial TEST --include *.mp4 --max-transfer 500G

bash test.bash

rclone move -P TEST google:Media/TVpartial --bwlimit=80M --delete-empty-src-dirs

find TEST -mindepth 1 -type f -name "*.mp4" -printf x | wc -c		
	

filebot -rename -r /home/main/pdmount/Media/ID --db thetvdb -non-strict --format "/home/main/pdmount/Media/ID/{n}/{'Season '+s}/{n}.{s00e00}.{vf}.{vc}.{ac}"

sed 's/.*alt=" //' netyear.txt | sed 's/ on IMDb\" \/><\/a><\/span>//' > netyear1.txt
# Replace spaces in file names with "-"
for f in *\ *; do mv "$f" "${f// /-}"; done
545