This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Files and paths | |
timestamp_file="/tmp/plex_busy_db_timestamp" | |
log_file="/tmp/plex_events.log" | |
lock_file="/tmp/plex_script.lock" | |
restart_grace_file="/tmp/plex_restart_grace" | |
# Apprise URL for Telegram notifications | |
APPRIZE_URL="tgram://bot_token/A,B/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Timestamp file to keep track of last "busy db" message | |
timestamp_file="/tmp/plex_busy_db_timestamp" | |
# Function to check the health of the plex container | |
check_plex_health() { | |
# Get the last 10 lines of log output from the plex container | |
plex_logs=$(docker logs --tail 10 plex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x # Enable debug mode | |
# Function to check the health of the plex container | |
check_plex_health() { | |
# Directly print the logs to the terminal for debugging | |
docker logs --tail 10 plex | |
# Get the last 10 lines of log output from the container named plex | |
plex_logs=$(docker logs --tail 10 plex) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import time | |
import sys | |
import select | |
def rename_defective_file(filepath): | |
"""Rename the defective file by appending '_(i_frame_defect)' before the file extension.""" | |
root, ext = os.path.splitext(filepath) | |
new_name = f"{root}_(i_frame_defect){ext}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import time | |
import sys | |
import select | |
# Detailed introductory message | |
print("DESCRIPTION:") | |
print("------------") | |
print("This script will recursively search the current directory and its subdirectories for video files with extensions .mp4, .mkv, and .avi.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Plex busy DB workaround | |
# Set the maximum number of allowed occurrences of the Sqlite3: Sleeping for 200ms to retry busy DB string | |
# about 3 times usually indicates an instance that can't recover by itself | |
# if your instance restarts your docker logs should reset, or "cover up" the busy DB lines, afaik | |
MAX_OCCURRENCES=3 | |
# this part "docker logs --tail 10 plex" "--tail 10" means the last ten lines of the container logs | |
# of the container named "plex", change the name according to your setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker compose pull | |
docker compose up -d | |
docker exec -it tdarr bash -c "wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/6.0-1/jellyfin-ffmpeg6_6.0-1-focal_amd64.deb && \ | |
apt install -y ./jellyfin-ffmpeg6_6.0-1-focal_amd64.deb && \ | |
rm -rf ./jellyfin-ffmpeg6_6.0-1-focal_amd64.deb && \ | |
ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg && \ | |
ln -sf /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/tdarr-ffmpeg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file contains pin mappings and other defaults for the Weefun/Weedo | |
# Tina2s based on the GD32F103. It won't work with the ATMega-bsed | |
# Tina/Tina wifi/monoprice cadet. | |
# The biggest issue with this printer is that the USB-serial CH340G's DTR pin | |
# is tied to reset with a 1k resistor - not a capacitor circuit like most. | |
# restart_method of 'tina2s' was added to make sure DTR is held high during | |
# normal operation | |
# Pins were found in https://github.com/weedo3d/TINA2Sfirmware and confirmed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cartwheel FFmpeg | |
mkdir ~/git && cd ~/git | |
git clone https://github.com/intel-media-ci/cartwheel-ffmpeg --recursive | |
cd cartwheel-ffmpeg | |
git submodule update --init --recursive | |
cd ffmpeg | |
git am ../patches/*.patch | |
PKG_CONFIG_PATH=/opt/intel/mediasdk/lib/pkgconfig ./configure \ | |
--prefix=/home/yourname/.local \ ####change to preferred install path | |
--extra-cflags="-I/opt/intel/mediasdk/include" \ ###location may depend on your env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# based on: https://gist.github.com/feedsbrain/0191516b5625b577c2b14241cff4fe30#!/bin/bash | |
# | |
# update environment | |
sudo apt update | |
sudo apt dist-upgrade | |
# install dependencies for compiling | |
sudo apt install -y cmake make autoconf automake libtool g++ bison \ |