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 | |
# | |
# Fixes MKV files to be more complient to XMBC, PLEX and other media server / players. | |
# Work for OSX. Needs mkvtoolnix (http://www.downloadbestsoft.com/MKVToolNix.html) | |
# | |
##################################################################################### | |
## | |
## PREFERENCES | |
## |
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 | |
CONFIG=$1 | |
#### Assign associative arrays from ini config file: key[section]=value | |
while IFS='\n' read line; do | |
# Ignore comments and empty lines | |
[[ ${line} =~ (^[[:space:]]*$|^[\;x\#]) ]] && continue | |
# Are we a section heading? |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
################################################################################ | |
""" | |
Download and create/extract different archive formats. | |
Copyright © 2016 by John Celoria <[REDACTED]>. |
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
#!/usr/bin/env bash | |
SELF=${0##*/}; SDIR=${0%/*}; PATH+=:${SDIR} | |
################################################################################ | |
# Block ads using dnsmasq | |
# | |
# *REQUIREMENTS* | |
# The Ubiquiti router I wrote this for did not ship with a GNU coreutils | |
# timeout binary. I instead used a Python timeout script provided by: | |
# https://github.com/timwarnock/timeout.py/blob/master/timeout.py |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
################################################################################ | |
""" | |
Remove completed torrents in Transmission. | |
Copyright © 2016 by John Celoria <[REDACTED]>. |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
################################################################################ | |
""" | |
Display host information based on application name | |
Copyright © 2016 by John Celoria <[REDACTED]>. |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
################################################################################ | |
""" | |
Query a ES index to find patterns | |
Copyright © 2016 |
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
[Unit] | |
Description=home-assistant in Docker container | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker stop home-assistant | |
ExecStartPre=-/usr/bin/docker rm home-assistant |
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
######################################################################################################################## | |
# ssh wrapper to continuously retry if unavailable | |
function ssh() { | |
local next prev host port | |
for ((i=1;i<=$#;++i)); do | |
next=$((i+1)); [[ $((i-1)) -eq 0 ]] || prev=$((i-1)) | |
case "${!i}" in | |
-p*) [[ "${!i}" =~ -p$ ]] && port=${!next} || port=${!i//-p} ;; | |
*@*) host=${!i##*@} ;; | |
-*) true ;; |
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
######################################################################################################################## | |
# Common Elasticsearch functions | |
function es() { | |
local id=$1; shift; local cmd=$1; shift; local connect region json curl="$(type -P curl) -sL --netrc-file ~/.netrc-es" | |
local actions=(aliases allocation health indices nodes recovery shards settings stats clear-cache) | |
local regex="+(*$(IFS='|';echo "${actions[*]}"|sed 's/|/|*/g'))" | |
function _help() { | |
echo "Usage: es <id> ${regex##*+}" >&2 |
OlderNewer