Skip to content

Instantly share code, notes, and snippets.

@brimur
brimur / preCachePlexEpisode.py
Last active April 3, 2024 05:31
Python script to cache the next episode of a TV show playing in Plex using rclone
#######################################
# This python script should be run
# as a cron job every 15 minutes to
# cache the next episode of a currently
# playing TV show.
########################################
import requests
import os
import psutil
@brimur
brimur / preCachePlexOnDeckEpiosodes.py
Last active May 29, 2023 18:37
Cache unwatched On Deck items in Plex using rclone
#######################################
# This python script should be run
# as a cron job every 6 hours to
# cache On Deck episodes.
########################################
import os
import psutil
from subprocess import check_call
from itertools import chain
@brimur
brimur / MsSkuToFriendlyName.ps1
Last active August 24, 2022 20:14
Dynamic map of Microsoft SKU to friendly name
##################################################################
#
# Requires Windows PowerShell v2 - v5
# Will not work in PS 7+ due to lack of ParsedHtml functionality
#
##################################################################
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$skuPage = Invoke-WebRequest "https://docs.microsoft.com/en-us/azure/active-directory/enterprise-users/licensing-service-plan-reference"
@brimur
brimur / checkDisk.sh
Last active October 25, 2021 07:01
Cron script to control
# Name: checkDisk.sh
# Created by: Brimur
# Created: Nov 26th 2019
# This script is used to control Transmission jobs based on available disk space.
#
# This should be run as a cronjob (every minute) on the server/computer running Transmission
#
# If you use a download manager tell it to add jobs as PAUSED
#
# - If disk is nearly full (limit) then stop all jobs