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
# 88 | |
echo '=======================================================================================' | |
# 80 | |
echo '===============================================================================' | |
# 75 | |
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
#!/bin/bash | |
clear | |
#set -xv | |
HOME="$(pwd -P)" | |
# | |
printf '\n%s\n' 'cat is a core binary utility that is used to "concatenate" files' | |
#man cat | |
# | |
printf '\n\n%s\n\n' 'create things filled with no thing' | |
[ -f ./file1 -a -f ./file2 ] && rm -f ./file[1,2] || touch ./file1 ./file2 |
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
############################### | |
# FAHD SHARIFF'S BASH PROFILE # | |
############################### | |
HISTCONTROL=ignoredups | |
EDITOR=emacs | |
set -o notify | |
set -o braceexpand | |
set -o emacs |
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 | |
# | |
# Copyright 1995, by Hewlett-Packard Company | |
# | |
# The code in this file is from the book "Shell Programming | |
# Examples" by Bruce Blinn, published by Prentice Hall. | |
# This file may be copied free of charge for personal, | |
# non-commercial use provided that this notice appears in | |
# all copies of the file. There is no warranty, either | |
# expressed or implied, supplied with this code. |
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
# port knocker - input target server DNS name followed by space separated ports | |
# usage - Knock_Knock bob.test.foo 55000 54000 53000 | |
Knock_Knock() { | |
local SERVER="$1" | |
shift | |
for PORT | |
nmap -Pn --host_timeout 10 --max-retries 0 -p "$PORT" "$SERVER" | |
done |
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
# ==[ printSlack ]============================================================= | |
# Function to send output from the commandline to Slack. | |
# | |
# @parameter string $LEVEL INFO/ERROR/WARNING message. Changes emoji | |
# @parameter string $MESSAGE Message to send to slack. | |
printSlack() | |
{ | |
SLACK_HOSTNAME=${SLACK_HOSTNAME-'oops.slack.com'}; | |
SLACK_TOKEN=${SLACK_TOKEN-'oops'}; | |
SLACK_CHANNEL=${SLACK_CHANNEL-'#devops'}; |
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
#$1,2 = files containing x=y style key-values | |
#sort, awk, grep friendly | |
#Duplicate keys are not handled | |
function kvdiff() { | |
tmpfile=`mktemp` | |
OLD_IFS=$IFS; | |
IFS=$'\n' | |
declare -A left; | |
declare -A right; |
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
# Variables | |
FOO=here | |
FOO="here" # equivalent, always use quotes | |
BAR=$FOO | |
BAR="$FOO" | |
BAR="${FOO}" | |
BAR='$FOO' # single quotes, does not evaluate the variable |
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 | |
if [ $# -lt 2 ]; then | |
echo "Usage: send.bash USER_NAME MESSAGE [DATA ... DATA]" | |
exit 1 | |
fi | |
USER=$1 | |
MESSAGE=$2 | |
if [ $# -ge 3 ]; then |
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 | |
LOCAL_DB="" | |
REMOTE_DB="" | |
LOCAL_USER="root" | |
LOCAL_PASS="" | |
REMOTE_USER="root" | |
REMOTE_PASS='' |