Skip to content

Instantly share code, notes, and snippets.

View jmarhee's full-sized avatar

jdm jmarhee

View GitHub Profile
from plexapi.myplex import MyPlexAccount
import os
plex_auth_info = {
"username" : os.environ['PLEX_USERNAME'],
"password" : os.environ['PLEX_PASSWORD'],
"server" : os.environ['PLEX_SERVER_NAME']
}
account = MyPlexAccount(plex_auth_info['username'], plex_auth_info['password'])
@jmarhee
jmarhee / resetRemoteManagement.sh
Created July 30, 2021 01:16
When Remote Desktop'd to a Mac, after switching Remote Management to only your user, you will be disconnected. Run this script to restore RDP access to your account.
#!/bin/bash
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users $1 -privs -all -restart -agent -menu
@jmarhee
jmarhee / container_prune.py
Created February 15, 2021 01:19
Terminates containers running longer than an float-value number of hours.
from datetime import datetime
import os
import docker
import dateparser
STARTING_TIME = str(datetime.now()).split(" ")[0]+ "T" + str(datetime.now()).split(" ")[1] + "Z"
if os.environ.get('LIMIT_HOURS') is None:
LIMIT_HOURS = 2.0
else: