# sample shared .bashrc and aliases
[ -e ~/.bash/bashrc ] && . ~/.bash/bashrc
[ -e ~/.bash/aliases.sh ] && . ~/.bash/aliases.sh
set -a; source .env; set +a
#! /bin/bash -eu
set -o pipefail
func() {
local arg1="${1}"
local x="${2%/}"
su - -s /bin/bash tomcat8
declare -A aliases
aliases=(
[mainline]='1 1.13 latest'
[stable]='1.12'
)
versions=( */ )
versions=( "${versions[@]%/}" ) # add to existing
# Need to play with this
self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
echo env |ssh -T mdc |grep TARG
#!/bin/sh
echo -------------
for f in "$@"; do
echo \"$f\"
done
#!/bin/sh
function command () {
echo
echo "command line: $@"
echo "command output:"
echo "-------------------------------"
"$@"
code=$?
echo "-------------------------------"
return $code
}
./mro.2 a b c
./mro.2 "a b" c
./mro.2 a "b c"
command ./mro.2 a b c
command ./mro.2 "a b" c
command ./mro.2 a "b c"
OPTIND=1
while getopts "hdp" opt; do
case "$opt" in
h) usage ;;
'?') usage ;;
d) PROFILE=dev ;;
p) PROFILE=prod ;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
shift "$((OPTIND-1))" # Shift off the options and optional --.
export CHART_BUCKET=s3://example-chart-store-$(cat /dev/random | LC_ALL=C tr -dc "[:alpha:]" | tr '[:upper:]' '[:lower:]' | head -c 32)
openssl rand 16 -hex
node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
uuidgen
pwgen 50 1 -s > passphrase
# Or use KeePassX generator
ruby -rsecurerandom -e 'puts SecureRandom.hex(32)'
cat /proc/sys/kernel/random/uuid
for i in {0..9}; do echo $i; done
for i in `seq 1 5`;do x; done
complete #list
complete -F _asdf b # assign to function
. <(eksctl completion bash)
DIR=$(dirname $([ -L $0 ] && readlink $0 || echo $0))
DIR=$(cd $DIR>/dev/null; pwd -P)
typeset
type <str>
tail -0F
echo webserver loadbalancer database | tr ' ' '\n' \
| xargs -I % -P 3 bash -c 'ansible-playbook $1.yml' -- %
for f in /sys/devices/system/cpu/vulnerabilities/*; do echo "${f##*/} -" $(cat "$f"); done