Skip to content

Instantly share code, notes, and snippets.

View madslundt's full-sized avatar

Mads Engel Lundt madslundt

View GitHub Profile
@blacktwin
blacktwin / create_wait_kill_trans.py
Last active October 17, 2019 04:13
Receive session_key from PlexPy when paused. Use session_id to create sub-script to wait for X time then check if transcoding still paused. If so, kill.
'''
kill_transcode function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
[X] Notify on pause
PlexPy > Settings > Notification Agents > Scripts > Gear icon:
Playback Pause: create_wait_kill_trans.py
PlexPy > Settings > Notifications > Script > Script Arguments:
{session_key}
@tim-elvidge
tim-elvidge / Concrete Controller
Last active January 8, 2021 10:07
Generic Mediator Pattern for Data Handling
public partial class AuctionUsersController : WebCommon.Controllers.DapperGridController<Domain.AuctionModels.UserDto>
{
public AuctionUsersController(IDbInterface mediatorInjection)
{
base.DbMediator = mediatorInjection;
}
public virtual ActionResult Index()
{
return View();
}
@bfg100k
bfg100k / snapRAID_helper.sh
Last active May 22, 2024 13:49
Bash helper script to help with the automation of routine snapRAID tasks. Add it as a cron job to automate the routine tasks of running sync and scrub. Script will optionally send you email of status and issues encountered during the run.
#!/bin/bash
#######################################################################
# This is a helper script that keeps snapraid parity info in sync with
# your data and optionally verifies the parity info. Here's how it works:
# 1) It first calls diff to figure out if the parity info is out of sync.
# 2) If parity info is out of sync, AND the number of deleted files exceed
# X (configurable), it triggers an alert email and stops. (In case of
# accidental deletions, you have the opportunity to recover them from
# the existing parity info)
# 3) If partiy info is out of sync, AND the number of deleted files exceed X