Skip to content

Instantly share code, notes, and snippets.

View ThomasDalla's full-sized avatar

Tom Dalla ThomasDalla

View GitHub Profile
#!/bin/sh
# Small script to delete all archives in the given vault
# Based on https://docs.aws.amazon.com/amazonglacier/latest/dev/deleting-an-archive-using-cli.html
# Setup: account-id and vault-name
account=${1:-882328332680}
vault=${2:-DS216J_001132719CB4_1}
# Start the job to retrieve archive ids
@ThomasDalla
ThomasDalla / tvshows.sh
Created January 28, 2022 16:42
Convert the audio of MKV videos in a folder into AAC, retaining original audio as well
#!/bin/bash
#Example: ~/tvshows.sh (from within the desired folder)
ext=( *.mkv )
for e in "${ext[@]}"
do
for f in "$e"
do
if [ -f "$f" ]; then
episode=`echo "$f" | grep -oP 'S[0-9]{2}E[0-9]{2}'`
echo "Processing $episode"
@ThomasDalla
ThomasDalla / tvshow.sh
Created January 28, 2022 16:40
Convert the audio of a single video into AAC, retaining original audio as well
#!/bin/sh
# Example: ~/tvshow.sh file-without-extention mkv mp4
input="$1.$2"
output="$1.$3"
echo "$input --> $output"
if [ -f "$input" ];
then
ffmpeg -hide_banner -i "$input" -map 0:v -c:v copy -map 0:a -c:a copy -map 0:a:0 -c:a:0 aac -map 0:s -c:s mov_text -map_metadata 0 -movflags +faststart "$output" && \
rm "$input"
else
@ThomasDalla
ThomasDalla / 1and1-pictures
Last active January 28, 2022 19:20
Upload all 7z files (split with 7z-folder) for the given folder to 1and1
#!/bin/bash
if [ -z "$1" ]; then
echo "Need to pass the year to process"
else
YEAR=$1
echo "Processing year $YEAR"
for f in $(ls $YEAR.7z.*)
do
echo "Uploading $f"
rclone --config ~/.config/rclone/rclone.conf copy --progress $f 1and1:/Pictures/
@ThomasDalla
ThomasDalla / 7z-folder
Last active January 28, 2022 16:46
7z a folder into 1GB pieces adding md5 checksum
#!/bin/sh
if [ -z "$1" ]; then
echo "Need to pass the folder to process (year)"
elif [ ! -d "$1" ]; then
echo "Invalid folder: $1"
else
echo "Processing $1"
echo "Zipping..."
DOSSIER=$1
7za a -xr@${HOME}/exclude.txt -m0=Copy -v1000M $DOSSIER.7z $DOSSIER
@ThomasDalla
ThomasDalla / radarr-trailers.py
Created January 12, 2020 17:27
Auto download trailers after Radarr download
#!/volume1/@appstore/python3/bin/python3
import logging
import os
import sys
from os.path import join
import subprocess
import locale
import requests # not standard
@ThomasDalla
ThomasDalla / adhoc-trailers.py
Last active January 12, 2020 17:31
Ad-hoc download trailers for movies in given directories
#!/volume1/@appstore/python3/bin/python3
import logging
import os
import subprocess
from os import listdir
from os.path import isfile, join
from xml.dom import minidom
import locale