This file contains hidden or 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/sh | |
DYN_HOST=''; | |
CF_BEARER_TOKEN=''; | |
CF_ZONE_ID=''; | |
CF_DNS_ID=''; | |
# --- | |
CURRENT_IP=$(curl -s https://checkip.amazonaws.com); |
This file contains hidden or 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 | |
# docs: https://dokov.bg/nginx-geoip2/ | |
echo "### nginx geoip2 builder ###" | |
echo "Enter nginx version: (f.g.: 1.21.0)" | |
read NGINX_VERSION | |
NGINX_SOURCE="https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" |
This file contains hidden or 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 | |
HOSTNAME=${COLLECTD_HOSTNAME:-rpi}; | |
INTERVAL=${COLLECTD_INTERVAL:-30}; | |
while sleep "$INTERVAL" | |
do | |
cpuraw=$(</sys/class/thermal/thermal_zone0/temp) | |
cputemp=$(bc -l <<< "scale=2; ${cpuraw}/1000") | |
echo "PUTVAL \"$HOSTNAME/exec-temp/temperature-cpu\" interval=$INTERVAL N:$cputemp" |
This file contains hidden or 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
PHP 5.6 environment | |
brew tap exolnet/homebrew-deprecated | |
brew install [email protected] | |
brew switch openssl 1.0.2t | |
brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/896d1018c7a4906f2c3fa1386aaf283497db60a2/Formula/icu4c.rb | |
brew switch icu4c 64.2 | |
PHP 7.x environment |
This file contains hidden or 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 | |
PLAYING=`curl -s -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}' http://localhost:8081/jsonrpc | jq -r '.result'` | |
if [ ${#PLAYING} -gt 2 ]; | |
then | |
curl -s -X POST -F 'limit=5192' http://localhost:8080/api/v2/transfer/setUploadLimit | |
else | |
curl -s -X POST -F 'limit=NaN' http://localhost:8080/api/v2/transfer/setUploadLimit | |
fi |
This file contains hidden or 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 | |
DOMAIN="your-letsencrypt-domain.com" | |
PASSWORD="changeit123" # strings, numbers are essential, at least 8 characters | |
NOW=$(date +"%Y-%m-%d") | |
### ======================= | |
certbot renew > update-ssl-$NOW.log 2>&1 |
This file contains hidden or 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 | |
HOSTNAME=${COLLECTD_HOSTNAME:-localhost}; | |
INTERVAL=${COLLECTD_INTERVAL:-60}; | |
while sleep "$INTERVAL" | |
do | |
for q in dovecot postfix roundcube-auth sasl ssh | |
do | |
count=$(sudo fail2ban-client status $q | grep 'Currently banned' | awk '{print $(NF)}') |
This file contains hidden or 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 | |
HOSTNAME=${COLLECTD_HOSTNAME:-localhost}; | |
INTERVAL=${COLLECTD_INTERVAL:-60}; | |
while sleep "$INTERVAL" | |
do | |
for q in maildrop incoming active defer deferred | |
do | |
count=$(find /var/spool/postfix/$q ! -type d -print | wc -l) |
This file contains hidden or 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 | |
HOSTNAME=${COLLECTD_HOSTNAME:-localhost}; | |
INTERVAL=${COLLECTD_INTERVAL:-60}; | |
while sleep "$INTERVAL" | |
do | |
for filter in active all downloading | |
do | |
url="http://localhost:8080/api/v2/torrents/info?filter=$filter" |