Skip to content

Instantly share code, notes, and snippets.

View brettpetch's full-sized avatar
🌥️
Call me Cloudflare because I'm Always Online™

Brett Petch brettpetch

🌥️
Call me Cloudflare because I'm Always Online™
  • Canada
  • 19:20 (UTC -04:00)
View GitHub Profile
@brettpetch
brettpetch / Jellyfin 4K Transcode Killer.md
Last active March 20, 2024 04:09
A 4K Transcode Killing script with custom message for Jellyfin.

Jellyfin 4K Transcode Killer

  1. Ensure you have an operational Jellyfin install.
  2. Open Jellyfin settings, go to the API tab, generate an api credential named something like checker
  3. Run the commands below to create the neccesary files to run the software, changing the API_BASE_URL to the appropriate value and the API_KEY as well.

Installing the Script

Note: if you don't have root, you may install it in $HOME/.local/bin/

Tuning Jellyfin for Large Libraries

Jellyfin, at least in its current state hasn't been great for media server

Database

It is no secret that Jellyfin's database has its shortcomings, espeically when trying to search large media collections. To remedy this, we'll be manually setting some PRAGMA values in the sqlite database.

While it is important to note that these optimizations may cause issues should sudden powerloss occur, it should be pretty safe to run them in an environment like a datacenter, which is where most of my gear resides.

@brettpetch
brettpetch / .00-Kutt Install.md
Last active May 9, 2022 21:48
Kutt Installation

Kutt Installation

Introduction

Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics.

Key Features

  • Free and open source.
  • Custom domain support.
#!/bin/bash
# BDInfoCLI-ng Install Script
# Requires Swizzin and mono, Still in very very early beta.
# Should sorta-kinda work.
# Elevate like this ``sudo su -``
# Place me at ``/root/`` and ``chmod +x /root/bdinfo-install.sh && ./bdinfo-install.sh``
. /etc/swizzin/sources/globals.sh
. /etc/swizzin/sources/functions/mono
user=$(cut -d: -f1 < /root/.master.info)
@brettpetch
brettpetch / install-hetz.md
Last active March 20, 2024 04:09
Install Images to get up and going on Hetzner.

Plug n' Play Hetzner InstallImage

Cloudbox Config

Ubuntu 18.04, 2 HDD Model For SSD models, please sub in sdX with nvmeXn1.

# Hetzner Online GmbH - installimage
#
# This file contains the configuration used to install this

How to clone an OWL Resources / Dropbox tab to your OneDrive:

Install rclone on your system of choice: https://rclone.org/downloads/

Go to the OWL Resources tab for the class you're going to clone. Copy the link located under the 'transfer files' tab located at the top of the page. Go back to rclone

run rclone config in your command line, press n then enter enter the name of a remote (your source), for this we go to OWL. Set the source to webdav then input the URL from OWL. Press enter, then type in your owl login credentials and keep pressing enter until you reach a yes or no. When you get the yes/no, press y, then hit enter. You've now setup a remote.

To add onedrive to rclone, rclone config then press n then call it onedrive, then type onedrive press enter twice to skip the client ID / client secret section (you'll use a genaric one), then use auto config (press 'y'), it should open a web browser. Login to your UWO address, then when it asks which remote, press 0, enter

@brettpetch
brettpetch / sonarr-v3-migrate-swizzin.md
Last active September 4, 2020 22:42
Migrating to Sonarr v3 on a Self Hosted Swizzin Instance

Migrating to Sonarr v3 from v2 in Sonarr

This guide assumes using either Debian or Ubuntu. You must have screen installed, as well as wget or curl. Assumption is that your pwd is ~.

Start at: cd ~

Stop Sonarr Service sudo systemctl stop sonarr@yourusernamehere

Disable Sonarr Service (don't worry, we'll fix this later) sudo systemctl disable sonarr@yourusernamehere

Grab the update: wget http://download.sonarr.tv/v3/phantom-develop/3.0.3.913/Sonarr.phantom-develop.3.0.3.913.linux.tar.gz

#!/bin/bash
# RCLONE UPLOAD CRON TAB SCRIPT
# chmod a+x /media/sdan/ynbldgno/cron/rclone-upload.sh
# Type crontab -e and add line below (without #) and with correct path to the script
# * * * * * /media/sdan/ynbldgno/cron/rclone-upload.sh >/dev/null 2>&1
# if you use custom config path add line bellow in line 20 after --log-file=$LOGFILE
# --config=/path/rclone.conf (config file location)
# Feral config location: /media/sdan/your-username-here/.config/rclone/rclone.conf
if pidof -o %PPID -x "$0"; then
@brettpetch
brettpetch / Procfile
Last active April 17, 2024 21:06
The Evil Twitch Spam Bot
worker: spambot.js
def data_check(url='https://s3.amazonaws.com/amazon-reviews-pds/tsv/amazon_reviews_multilingual_US_v1_00.tsv.gz',
file='./data/amazon_reviews_multilingual_US_v1_00.tsv'):
"""
The following function does the following:
1. Check for file to exist
- Go to 3.
2. If file not exists:
a. Check if there is a data folder.
b. If there is no data folder, create one.
c. Download data from the website to the data folder.