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 | |
# Depends on curl and dig | |
TIMEOUT=1 | |
SERVER=4.2.2.3 | |
IP=`curl -s --connect-timeout "$TIMEOUT" https://outboundip.com 2>/dev/null` | |
#echo :$?: | |
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 | |
# any2mp3 | |
# Converts to mp3 anything mplayer can play | |
# requires: mplayer and lame | |
# Also ensure you have space to dump the .wav | |
TMP=audiodump-`date +%s`.wav | |
[ "$1" ] || { echo "Usage: $0 file1.wma file2.mp4"; 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
#!/usr/bin/env bash | |
# This script loops forever and waits for a standard STDIN for each loop. | |
# | |
# When you hit [RETURN] it pipes you're input into the command you launched the script with | |
# | |
# For example.. If I want to compare public DNS records (on 4.2.2.3 for example) with the | |
# records on my own DNS server.. EG: 1.2.3.4 I would split a terminator it two and run: | |
# Terminal 1: doorman dig @4.2.2.3 +short | |
# Terminal 2: doorman dig @1.2.3.4 +short |
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 | |
# | |
# simple templating script for Generating CSR's -david@starkers.org 121001 | |
# .. this relies on having openssl availble in your path .. | |
# Its not elegant but its easy to use.. | |
# | |
# TODO: too much ugly wraping of whitespace into openssl commands | |
# (there is another way but I forgot and this works) | |
# This program is free software. It comes without any warranty, to |
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 | |
ENV="$(env)" | |
if ! grep -q DISPLAY= <<<"$ENV" ; then | |
echo dunno what your DISPLAY= is, setting default and crossing fingers | |
export DISPLAY=:0 | |
fi | |
# simple script that watches for a Yubikey being plugged in.. | |
# |
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 | |
# quickly backs up a wordpress install for you, just specify the wordpress install path | |
ConfFile="$1/wp-config.php" | |
if [ "X$1" == "X" ]; then | |
echo ".. quickly backs up a wordpress database for you, just specify the wordpress install path" |
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 | |
## This rar's a file up with a password and emails it | |
## not as good as using openssl to encrypt but I'm not about to explain openssl pipes to my users | |
# rar does the job :/ | |
FILE=/var/log/some_logfile.log | |
PASS="your super top secret password" |
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 | |
set -o nounset # Treat unset variables as an error | |
# | |
# you can call this script as such if needed: | |
# ./grants --user="mymysqlusername" --pass="password" --host="somehost" | |
# | |
# I much prefer .my.cnf or similar |
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 | |
# This script allows me to run a crontab at a random point in the next hour. | |
# WHY? | |
# Using something like a little delay can also stop ALL the servers hammering a proxy at once for example. | |
# ...or if something breaks I don't take the entire cluster down at once | |
# Do the task at some random point within the next X minutes: | |
X=60 |
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 | |
#who gets alerted | |
DEST=your@email.com | |
#from address | |
FROM="noreply@server.example.org" | |
#directory to monitor | |
DIR=/www |
OlderNewer