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 | |
mktmpd() { | |
local tmpd=`mktemp -d "${TMPDIR:-/tmp}/tmp.d.XXXXXXXXXX"` ; | |
echo "$tmpd" ; | |
} | |
MkTemp() { | |
local tmpf=`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ; | |
echo "Temporary file: $tmpf" ; |
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 | |
ls_fullest() { | |
ls -a | egrep -v '^[.][.]?$' | while read e ; do x=`df -h "$e" | tail -1 | awk '{print $NF}'` ; [[ "$x" == "$tgt" ]] && sudo du -ks "$e" 2>/dev/null ; done | sort -n -k 1 | tail | |
} | |
tgt='/var' ; | |
cd "$tgt" ; | |
ls_fullest ; |
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 | |
set -u ; | |
log=$(basename "$0" | sed -e 's/[.][^.]*$//') ; | |
elog="$log.stderr.log" ; | |
log="$log.stdout.log" ; | |
die() { echo $1 ; 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
#!/bin/bash | |
# # # USAGE: hostname -f ; /bin/bash setHostname.sh new.hostname.to.be.set.in.some.domain ; hostname -f | |
# # # Per the official but mildly inaccurate AWS EC2 hostname docs | |
# # # (https://aws.amazon.com/premiumsupport/knowledge-center/linux-static-hostname-rhel7-centos7/) | |
setHostname() { | |
local fqdn=$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
#!/bin/bash | |
[[ $isolateRvm ]] || isolateRvm=true ; | |
useRubyVersion=2.2.2 ; | |
main() { | |
local use_rvm_or_rbenv='rvm' ; | |
rvm -v &> /dev/null || use_rvm_or_rbenv='rbenv' ; | |
local x='' ; | |
if [[ "rbenv" == "$use_rvm_or_rbenv" ]] ; 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 | |
# As root: | |
date=`date -u +'%Y%m%dT%H%M%Sz'` ; | |
new=/jenkins/new_plugins ; | |
old="/jenkins/old_plugins_$date" ; | |
j=/var/lib/jenkins ; | |
main() { |
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
AUGTOOL(1) Augeas AUGTOOL(1) | |
NAME | |
augtool - inspect and modify configuration files | |
SYNOPSIS | |
augtool [OPTIONS] [COMMAND] | |
DESCRIPTION | |
Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms them into a tree. Configuration changes are |
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 | |
main() { | |
forceRoot ; | |
local pkg='' ; | |
for pkg in awscli hiera-eyaml ; do | |
gem uninstall $pkg --executables ; | |
done ; | |
for pkg in awscli ; do | |
yum -y install $pkg ; |
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 | |
forceRoot() { | |
[[ "$(id -u)" == "0" ]] || { echo "ERROR: Must run $0 as root." ; exit 1 ; } | |
} | |
forceRoot ; | |
# |
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 | |
initDuks() { | |
tgt=$1 ; | |
[[ $tgt ]] || tgt='/var' ; | |
cd "$tgt" ; | |
duks ; | |
} |
OlderNewer