Skip to content

Instantly share code, notes, and snippets.

View EldonMcGuinness's full-sized avatar

Eldon McGuinness EldonMcGuinness

View GitHub Profile
@EldonMcGuinness
EldonMcGuinness / renameMovies
Last active November 10, 2024 02:53
renameMovies
#!/bin/bash
#Version 1.20
# TODO: Handle multipart files .pt1.mkv .pt2.mkv etc
# Guess the Title
function guessTitle {
TEMP=$(echo $1 | sed 's/_/./g' | sed -E 's/\{.*?\}//g' | sed -E 's/\(\)//g' |sed -E 's/\(([0-9]{4})\)/\1/g' | sed -E 's/(.+)[0-9]{4}.*$/\1/' | sed -E 's/(.+)[0-9]{4}[^p].*$/\1/I' | sed -E 's/(.+)(1080|720|576|480)p.*$/\1/' | sed -E 's/(.+)[0-9]{4}$/\1/' | sed -E 's/([^\.]{2,})\./\1 /g' | sed -E 's/^([ai])\./\1 /gI' | sed -E 's/ ([ai0-9])\.([^0-9])/ \1 \2/gI' | sed -E 's/(([a-z0-9]\.)+)/\1 /gI' | sed -E 's/([0-9]+)\. ([0-9]+)/\1.\2/g' | sed -E 's/ / /' | sed -E 's/ $//' | sed -E 's/ $//' | sed -E 's/ ([0-9]+)\./ \1/')
@EldonMcGuinness
EldonMcGuinness / diskStandBy
Last active October 24, 2023 13:48
diskStandBy
#!/bin/bash
###
# How to use: Set this up as a Cron job and have it call at a regular interval.
# Example Cron time: */5 * * * *
###
#This needs to mach the name you gave the script in the unraid UI
SCRIPT_NAME=driveStandBy
@EldonMcGuinness
EldonMcGuinness / gist:d43d4ec8200db0b10c07b3f722505048
Last active July 23, 2023 01:53
PMM Colors Based on Status
=================
status.yml
=================
overlays:
airing_shows:
variables: {key: airing, weight: 40, text: AIRING, last: 14, back_color: <<back_color_<<key>>>>}
template: [name: standard, name: status]
returning_shows:
variables: {key: returning, weight: 30, text: RETURNING, back_color: <<back_color_<<key>>>>}
@EldonMcGuinness
EldonMcGuinness / adobe-cc-2019-host.txt
Created April 6, 2021 11:41
Adobe CC 2019 activation host block
0.0.0.0 activate.adobe.com
0.0.0.0 practivate.adobe.com
0.0.0.0 ereg.adobe.com
0.0.0.0 wip3.adobe.com
0.0.0.0 activate.wip3.adobe.com
0.0.0.0 3dns-3.adobe.com
0.0.0.0 3dns-2.adobe.com
0.0.0.0 adobe-dns.adobe.com
0.0.0.0 adobe-dns-2.adobe.com
0.0.0.0 adobe-dns-3.adobe.com
@EldonMcGuinness
EldonMcGuinness / google-to-radicale
Created January 16, 2020 01:10
Copy a calendar from google into radicale
GOOGLE_CAL="ics url"
LOGIN_CAL="user:pass"
DEST_CAL="url to radicale calendar"
curl "$GOOGLE_CAL" | curl -u "$LOGIN_CAL" -X PUT "$DEST_CAL" --data-binary @-
# If you're looking to share a calendar then use symlinks
#ln -sf /path/to/src /path/to/dest
#chown radicale:radicale /opt/radicale /etc/radicale -fR
#find /opt/radicale/ -type d -exec chmod 0750 "{}" \;
#find /etc/radicale/ -type d -exec chmod 0750 "{}" \;
@EldonMcGuinness
EldonMcGuinness / localization.php
Last active November 26, 2019 23:21
Simple localization script
<?php
class Localization {
private $localization_directory = null;
private $language = null;
private $localization_array = null;
private $test_data = '{
"00000000": "Hello",
@EldonMcGuinness
EldonMcGuinness / gist:d5edb240c9fc3fccc2a73bacc9eaa244
Last active November 9, 2019 16:32
Download Ubuntu (and perhaps other) Linux ISOs to a watch directory as they are posted to a website
#! /bin/bash
WATCH_DIR=$1
URL=https://ubuntu.com/download/alternative-downloads
cd "$WATCH_DIR"
for i in $(curl -sq "$URL" -- | grep -hoE 'http.+?torrent'); do wget -q $i; done
### Keybase proof
I hereby claim:
* I am eldonmcguinness on github.
* I am eldonmcguinness (https://keybase.io/eldonmcguinness) on keybase.
* I have a public key ASBWBwMsv0MZRhwMxx0t7D340FhllyAn6PkgaxWxq31DKwo
To claim this, I am signing this object:
@EldonMcGuinness
EldonMcGuinness / gist:7d65e26705315c7b2c95df52c06e4b2d
Created February 13, 2018 04:45
KDE Turn Off Monitors When Locking Screen
In System Settings -> Notifications -> Screen Saver -> Screen Locked, add the following command.
/bin/sleep 3 && /usr/bin/xset dpms force standby
@EldonMcGuinness
EldonMcGuinness / epub2mobi
Created February 10, 2018 23:09
Convert epub to mobi using calibre, see included note for bulk converting
#!/bin/bash
FILE=$(basename "$1" .epub)
if [ -e "${FILE}.mobi" ]; then
echo nothing to do
else
echo converting
ebook-convert "${FILE}.epub" "${FILE}.mobi"
fi