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 | |
# See: https://gist.github.com/starkers/234909caf153904e5428 | |
#Check xpass exists | |
if [ ! -x "$(which xclip)" ]; then | |
echo "Please install xclip" ; exit 1 | |
fi | |
#Length of string: | |
LEN=32 |
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 | |
# NB: I use this on centos 6 but should work on other stuff | |
# | |
# Ensure that reverse DNS works so it can lookup its IP/hostname | |
# Also relies on "zip" and dig | |
# | |
# ....I should probably do some more checks on: | |
# Destination folders existence | |
# client cert is correctly inserted into the index | |
# host lookup worked |
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 | |
# 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 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 | |
# 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 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 | |
# 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 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 | |
# | |
# simple templating script for Generating CSR's [email protected] 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 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 | |
#set -x | |
# Prune and volumes older than 2 months: | |
PAST=`date --date='-2 months 0 day ago' +%Y-%m-%d` | |
#EG a hard coded date | |
#PAST="2012-11-29" | |
#PAST="2013-11-29" |
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 | |
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 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
# I wanted a dead simple reminder if I'm in a git managed directory | |
# This takes the standard ubuntu $PS1 and adds (branch-name) in "default" terminal colour just before your $ / # | |
# | |
# the correct way on centos is to add it to something like /etc/sysconfig/bash-prompt-{xterm,default,screen} | |
# I can't be arsenaled... [email protected] | |
# | |
# centos6: add to /etc/bashrc | |
# ubuntu14/mint: add to /etc/bash.bashrc | |
# vim:ts=2:sw=2 |
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 | |
# 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" |
OlderNewer