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
#!/bin/bash | |
function parse_yaml { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\):|\1|" \ | |
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; |
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
#!/bin/bash | |
# $1 - BUCKET - The S3 bucket to scan | |
# $2 - PATH_TO_CLEAN - The base path to clean. This will | |
# select only subfolders of this path. No leading | |
# or trailing slash. | |
# $3 - DEPTH_TO_KEEP - The number of levels of folders | |
# to exclude from PATH_TO_CLEAN. All folder objects | |
# below this level will be removed. If files still | |
# exist in the folder, the folder will remain visable. |
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
# From my .bashrc | |
# Thanks to https://github.com/onmomo/superdrive-enabler | |
SDE=/usr/local/sbin/superdriveEnabler | |
if [ ! -f $SDE ]; then | |
curl -s -o $SDE https://raw.githubusercontent.com/onmomo/superdrive-enabler/master/dist/x86_64/superdriveEnabler_x86_64 | |
chmod a+x $SDE | |
fi | |
SDERULES=/etc/udev/rules.d/99-superdrive.rules | |
if [ -f $SDE ]&&[ ! -f $SDERULES ]; then |
NewerOlder