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
gen_dev_config() { | |
if [[ -z "$1" ]]; then | |
echo "Usage: gen_site_config <site_name>"; | |
echo; | |
return 1; | |
fi | |
password=$(</dev/urandom tr -dc '0-9!@#$%a-zA-Z' | head -c16; echo ""); | |
underscores=$(echo "$1" | sed 's/\./_/g' | sed 's/-//g'); | |
dev_underscores=$(echo "dev_$underscores"); |
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 outputs "\$conf" as desired | |
echo $'s/^(\\$conf\\[\'simplesamlphp_auth_installdir\'\\] = .*)/if(whatever){ $1 } else { whatever };/' | |
# Yes, it can also be done with this craziness | |
echo 's/^(\$conf\['"'"'simplesamlphp_auth_installdir'"'"'\] = .*)/if(whatever){ $1 } else { whatever };/' | |
# But it doesn't seem to be possible with "..." ? | |
echo "s/^(\$conf\['simplesamlphp_auth_installdir'\] = .*)/if(whatever){ \$1 } else { whatever };/" |
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
check_redirect () { | |
echo -n "$1: "; | |
curl -is "$1" | grep '^Location:' | perl -pe 's/^Location: //;chop;' | |
echo; | |
} |
NewerOlder