Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
jfeilbach / bluey.md
Last active August 23, 2023 18:06
Fixing Season 2 of Bluey

Bluey Season 2

Fixing Bluey Season 2 to conform to the TVDB order. This fixes the giant mess displayed in Plex. Otherwise titles, descriptions. and other metadata will not match to the correct file.

Reorder

Move the incorrect episode number to the correct episode number temporarily. This avoids overwriting needed files.

mv -v Bluey\ \(2018\).S02E01.Dance\ Mode.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E02.Hammerbarn.WEBDL-1080p.h264.EAC3.mkv-tmp
mv -v Bluey\ \(2018\).S02E02.Hammerbarn.WEBDL-1080p.h264.EAC3.mkv 'Bluey (2018).S02E03.Featherwand.WEBDL-1080p.h264.EAC3.mkv-tmp'
mv -v Bluey\ \(2018\).S02E03.Featherwand.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E01.Dance\ Mode.WEBDL-1080p.h264.EAC3.mkv-tmp
mv -v Bluey\ \(2018\).S02E05.Hairdressers.WEBDL-1080p.h264.EAC3.mkv Bluey\ \(2018\).S02E11.Charades.WEBDL-1080p.h264.EAC3.mkv-tmp
@jfeilbach
jfeilbach / ubuntu_22.04_motd.md
Last active April 20, 2024 12:09
Make Ubuntu 22.04 less annoying. Remove ESM Ubuntu Advantage

Ubuntu 22.04 Annoyances

Here are a few collected ways I like to customize Ubuntu 22.04 servers. I used to love Ubuntu, but I hate auto updates and snaps. They also put ads and other usless ads diguised as "news" in MOTD. ESM FUD is spread throughout the OS including simple apt functions. You do not need ESM and thus Ubuntu 22.04 has become super annoying. unattended-upgrade is an automatic installation of security (and other) upgrades without user intervention. Consider the ramifications of disabling this service.

Disable unattended upgrades

The Unattended Upgrades feature is enabled by default and it runs at system boot without the user's permission. The configuration is stored in /etc/apt/apt.conf.d/20auto-upgrades

Disable: sudo dpkg-reconfigure unattended-upgrades then a TUI will come up, select "No"

This will not permantently disable the function. After an update it will be enabled. In the file /etc/apt/apt.conf.d/20auto-upgrades change these values from 1 to 0. Even doing this it will

@jfeilbach
jfeilbach / build.sh
Created January 21, 2021 21:12
build netifaces .whl
#!/bin/bash
git clone https://github.com/al45tair/netifaces.git /wheel/netifaces
/opt/python/cp39-cp39/bin/pip wheel /wheel/netifaces -w /tmp
auditwheel repair /tmp/netifaces-0.10.9-cp39-cp39-linux_x86_64.whl -w /output
# docker run -v "$(pwd)":/output quay.io/pypa/manylinux1_x86_64 /output/build.bash && pip install *.whl
@jfeilbach
jfeilbach / transmission-openvpn.sh
Last active April 15, 2023 18:24
docker pull, stop container, rm container, rotate log file, backup config, start new image as container, add dig, check public ip address
#!/bin/bash
host=<>
name=transmission-openvpn
log=transmission-openvpn.log
echo "Stopping ${name}"
/usr/bin/docker stop ${name}
echo "Removing ${name}"
/usr/bin/docker rm ${name}
@jfeilbach
jfeilbach / backup_jackett.sh
Last active January 5, 2021 16:23
simple backup script for Jackett config running in docker
#!/bin/bash
# I misspelled Jackett when I mapped the docker vol, oops
work_dir=/'opt/docker/jacket_config/Jackett'
# Use Sonarr/Radarr backup date format
date=$(date +%Y.%d.%m_%H.%M.%S)
# This works on the linuxserver.io docker image
ver=$(docker exec -it jackett /app/Jackett/jackett --version | head -n 1 | awk '{ print $2 }' | tr -d '\r')
/usr/bin/zip -r \
${HOME}/jackett_backup_${ver}_${date}.zip \
@jfeilbach
jfeilbach / sysctl.conf.md
Last active March 1, 2024 10:30
10/40 Gb NIC Linux Kernel Performance Tuning for samba file server

TCP tuning

The most important TCP tuning areas since kernel 4.9 are:

  • packet pacing
  • dynamic TSO sizing
  • TCP small queues
  • BBR TCP congestion algorithm

Definitions

  • Gb = gigabit
@jfeilbach
jfeilbach / search_trans.sh
Last active November 11, 2020 17:46
search for string e.g. tracker.example.com and move torrent via samba to new client
#!/bin/bash
NC='\033[0m' # No color
Green='\033[0;32m' # Green
White='\033[0;37m' # White
Red='\033[0;31m' # Red
Yellow='\033[0;33m' # Yellow
id=${1}
remote_host=uhura.local:9091
@jfeilbach
jfeilbach / purge.sh
Created November 8, 2020 23:28
Purge old torrents from host
#!/bin/bash
NC='\033[0m' # No color
Green='\033[0;32m' # Green
White='\033[0;37m' # White
Red='\033[0;31m' # Red
check=$(/usr/bin/transmission-remote uhura.local:9091 -l | grep 'Stopped' | awk '{ ORS=" " } ; { print $1 }')
usage=$(df -h |grep dl | awk '{ print $5,$6 }')
for x in ${check} ; do
@jfeilbach
jfeilbach / start.sh
Last active November 8, 2020 05:14
during migration put on cron job to start torrents added to transmission
#!/bin/bash
NC='\033[0m' # No color
Green='\033[0;32m' # Green
White='\033[0;37m' # White
Red='\033[0;31m' # Red
Yellow='\033[0;33m' # Yellow
counter='1'
cmd=/usr/bin/transmission-remote
@jfeilbach
jfeilbach / search.sh
Last active November 8, 2020 04:59
Search through <path>/*.torrent files for string $1. Passes two variables $(hash} and ${name} to rsync.sh script for migration.
#!/bin/bash
# Searches through directory of .torrent files for matchign string. If string found move to host, stop torrent, and add to new host.
# If you want to just move all .torrents then comment out "result" and uncomment the alternative version.
NC='\033[0m' # No color
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple