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
| git diff --name-only --diff-filter=MA | xargs grep 'SEARCH TERM' -rn |
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
| ssh -i ~/.ssh/key.pem -L 60101:127.0.0.1:60101 ubuntu@<INSTANCE IP> -N |
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
| safe_load_uri() { | |
| local URL="$1" | |
| local RESPONSE="$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET $URL)" | |
| local BODY="$(echo $RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')" | |
| local STATUS="$(echo $RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')" | |
| if [ $STATUS -ge 400 ]; then | |
| echo "$STATUS" | |
| exit 1 | |
| else | |
| echo "$BODY" |