Skip to content

Instantly share code, notes, and snippets.

View kpatdev's full-sized avatar

Kishan Patel kpatdev

View GitHub Profile
@kpatdev
kpatdev / plex_empty_trash.py
Last active October 23, 2024 16:41
Empty Trash on Plex but check if NFS mounts are active before doing so (
import os
from plexapi.server import PlexServer
# Replace with your actual Plex server details
PLEX_URL = 'http://<plex_server_ip>:32400'
PLEX_TOKEN = '<plex_x_token>'
MOUNT_PATH = '/mnt/nfs'
FOLDERS = ['movies', 'tvshows', 'homevideos', 'youtube']
def check_folders():
@Om-Kamath
Om-Kamath / gemini.py
Created June 1, 2024 17:50
Gemini for CSV
import google.generativeai as genai
import pandas as pd
import json
import typing_extensions
import streamlit as st
#Gemini
genai.configure(api_key='API_KEY')
@JonnyWong16
JonnyWong16 / select_tmdb_poster.py
Last active October 20, 2025 22:55
Selects the default TMDB poster and art for items in a Plex library if no poster/art is selected or the current poster/art is from Gracenote.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Description: Selects the default TMDB poster and art for items in a Plex library
if no poster/art is selected or the current poster/art is from Gracenote.
Author: /u/SwiftPanda16
Requires: plexapi
Usage:
* Change the posters for an entire library:
@sussycatgirl
sussycatgirl / Caddyfile
Last active August 9, 2025 15:08
Authentik Forward Auth with Caddy
# Put this somewhere near the top of your Caddyfile (at the root, not in a site directive).
# Replace `http://127.0.0.1:9000` with your *internal* Authentik outpost's hostname and port
(authentik_forwardauth) {
reverse_proxy /outpost.goauthentik.io/* http://127.0.0.1:9000
forward_auth {args.0} http://127.0.0.1:9000 {
uri /outpost.goauthentik.io/auth/caddy
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version
trusted_proxies private_ranges
}
}
@lucanello
lucanello / rclone_backup.py
Last active October 22, 2025 19:02
Python Rclone Script with Telegram and InfluxDB Reporting
# Python Rclone Script with Telegram and InfluxDB Reporting
# - This Script backups your data to any rclone location (see rclone.org)
# - You can execute scripts, commands and database dumps before running a single rclone command
# - It sends automatic error reports and summaries
# - It saves all statistics and operations to an Influx database
# - The data can be used for visualizations in e.g. Grafana
# - You can automate it by using cron
# Created by: Luca Koroll - https://github.com/lucanello
# Last update: 2021-07-04
@rssnyder
rssnyder / oracle-cloud-free-tier-guide.md
Last active November 11, 2025 05:33
oracle-cloud-free-tier-guide

how to leverage oracle's temping offers

free tier limits

The limits of the free tier say that you can create up to 4 instances.

  • x2 x86 instances (2core/1g)
  • x2 ampere instances (with 4core/24g spread between them)
  • 200GB total boot volume space across all intances (minimum of 50G per instance)

create your account

@thehesiod
thehesiod / 1pass_dups.py
Last active December 21, 2024 15:18
1password duplicate remover (alpha, only run in debugger with breakpoints everywhere *g*)
#!/usr/bin/env python3
import json
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
import html
import dictdiffer
import iso8601
@fryfrog
fryfrog / radarr_cleanup_packed_torrent.sh
Last active March 29, 2023 17:21
A Radarr post processing script to remove the video file from packed torrents, modified version of subzero79/87a347a07964390884c9
#!/bin/bash
# Examples for testing
# radarr_moviefile_sourcefolder="/data/torrent/movies/Justice.League.2017.1080p.HDRip.X264.AAC-m2g" radarr_moviefile_sourcepath="/data/torrent/movies/Justice.League.2017.1080p.HDRip.X264.AAC-m2g/Justice.League.2017.1080p.HDRip.X264.AAC-m2g.mkv"
# Instructions
# Put this script somewhere on your file system like /usr/local/bin and make it executable.
#
# In Radarr, Settings -> Connect add a Custom Script
# On Grab: No
@fryfrog
fryfrog / sonarr_cleanup_packed_torrent.sh
Last active April 13, 2024 11:06
A Sonarr post processing script to remove the video file from packed torrents, modified version of subzero79/87a347a07964390884c9
#!/bin/bash
# Examples for testing
# sonarr_episodefile_sourcefolder="/data/torrent/tv/Penny.Dreadful.S01E01.720p.HDTV.x264-2HD" sonarr_episodefile_sourcepath="/data/torrent/tv/Penny.Dreadful.S01E01.720p.HDTV.x264-2HD/penny.dreadful.s01e01.720p.hdtv.x264-2hd.mkv"
# Instructions
# Put this script somewhere on your file system like /usr/local/bin and make it executable.
#
# In Sonarr, Settings -> Connect add a Custom Script
# On Grab: No
@sscotth
sscotth / keystroke the clipboard extended.workflow
Last active September 7, 2025 09:08
Paste as keystrokes (macOS)
# Why?
# To paste text into windows that normally don't allow it or have access to the clipboard.
# Examples: Virtual machines that do not yet have tools installed, websites that hijack paste
#
# Extended vs Simple?
# * Includes an initial delay to allow you to change active windows
# * Adds small delay between keypresses for slower responding windows like SSH sessions
# * Better handling of numbers
# * VMWare bug fix
#