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
# ========================= | |
# SUBSCRIBER | |
# ========================= | |
cat << 'EOF' >/usr/local/sbin/broadcastHostnameSubscriber.sh | |
#!/bin/bash | |
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin | |
sleep $((RANDOM%15)) | |
for IP_ADDRESS in $(ip address show up |grep -E 'inet [0-9]' |grep -v '127.0.0.1' |sed -r 's:(^.*inet )([0-9].*)(/.*):\2:g') | |
do |
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
function bin2dec() | |
{ | |
echo -n $((2#${1})) | |
} | |
function dec2bin() | |
{ | |
D2B=({0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}{0..1}) | |
echo -n ${D2B[${1}]} |
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 | |
# rclone.wrapper | |
Arg1=${1} | |
Arg2=${2} | |
export PATH=/usr/local/bin:/usr/bin | |
help() | |
{ | |
cat << EOF | more |
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
sslTextEnc () { sslTextPwd ; read -p "Texto a cryptografar: " TEXT; echo "TEXT" | openssl aes-256-cbc -e -a -iter 2 -pass env:SSLPASS 2>/dev/null; unset SSLPASS; } | |
sslTextDec () { sslTextPwd ; read -p "Texto a des-cryptografar: " TEXT; echo "${@}" | openssl aes-256-cbc -d -a -iter 2 -pass env:SSLPASS 2>/dev/null; unset SSLPASS; } | |
sslTextPwd () { [[ -z $SSLPASS ]] && read -s -p "Password: " SSLPASS && export SSLPASS; } |
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
function tarpigz() { | |
BLOCKSIZE=$( grep "^cache size" /proc/cpuinfo |uniq |cut -d" " -f3 ) | |
NUMCPU=$(( `nproc` / 2 )) | |
PIGZ="pigz --best --blocksize ${BLOCKSIZE} --independent --processes ${NUMCPU} --synchronous" | |
time tar -cvf - ${2} |$PIGZ >${1} | |
} |