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 | |
# https://asciinema.org/a/6LZefsbvLjgsuwQHOnQsBEaSj | |
IF=notset | |
OF=notset | |
BS=128M | |
CURDIR=$(dirname $(realpath -s $0)) | |
SCRIPT=`basename "$0"` | |
if [[ ! -f /usr/bin/pv ]]; then | |
echo "pv is not installed. Please install pv and try again" |
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 | |
TERM=xterm-256color | |
bold=$(printf '\033[1m') | |
lred=$(printf '\033[91m') | |
lblue=$(printf '\033[94m') | |
white=$(printf '\033[97m') | |
green=$(printf '\033[92m') | |
lgreen=$(printf '\033[36m') | |
yellow=$(printf '\033[33m') |
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 | |
tempfile=$(tempfile 2>/dev/null) || tempfile=/tmp/test$$ | |
trap "rm -f $tempfile" 0 1 2 5 15 | |
INPUT=$(mktemp) | |
function get_all_sinks() { | |
pacmd list-sinks | grep -e 'name:' | cut -d: -f2 | cut -d\< -f2 | cut -d\> -f1 | |
} |
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 | |
options=':i:s:d:n:p:h:' | |
while getopts ${options} option | |
do | |
case ${option} in | |
i) interval=$OPTARG;; | |
s) site=$OPTARG;; | |
d) domain=$OPTARG;; | |
n) nameservers=$OPTARG;; |
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 | |
ulimit -n 10000 | |
PIDFILE=/var/run/backup.pid | |
LOGFILE=/var/log/backup.log | |
if [ -f "$PIDFILE" ]; then | |
RUNPID=`cat $PIDFILE` | |
if ps -p $RUNPID; then | |
echo "Backups are already running..." | |
exit 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
while [ "$hn" == "" ]; do | |
clear | |
read -p "Hostname: " hn | |
done | |
clear | |
echo "network --device eth0 --bootproto=dhcp --hostname ${hn}" > /tmp/network.ks | |
pw="" | |
while [ "$pw" == "" ]; 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 imgup | |
chmod 644 $argv | |
rsync -paqe ssh $argv mountain:~/images | |
for i in $argv | |
echo "http://images.cookietronics.net/$i" | |
end | |
end |
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 | |
# Create the lock file to prevent parallel instances. | |
LOCKFILE=/tmp/.backup.sh.lck | |
if [ -e ${LOCKFILE} ] && kill -0 `cat ${LOCKFILE}`; then | |
echo "already running" | |
exit | |
fi | |
# make sure the lockfile is removed when we exit and then claim it |
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 | |
LOCKFILE=/tmp/.wb.lck | |
HOST=web01.fisys.us | |
BACKUPHOST=25.23.239.150 | |
DOCROOT=/var/www | |
EXCLUDEDB='schema\|mysql' | |
EXCLUDE=.git | |
DATE=`date +%Y-%m-%d.%H%M` | |
BACKUPDIR=/mnt/backup | |
BACKUPFILE=$BACKUPDIR/$HOST.backup-$DATE.tar.bz2 |
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 | |
IP=`cat /tmp/ip` | |
PUBIP=`curl -s http://icanhazip.com` | |
EMAIL=youremail@domain.com | |
if [ "$IP" != "$PUBIP" ]; then | |
echo $PUBIP|mail -s "IP changed at home" $EMAIL | |
echo $PUBIP > /tmp/ip | |
fi |
NewerOlder