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
securecrt changes | |
win location | |
C:\Users\userid\AppData\Roaming\VanDyke\Config | |
SSH2.ini | |
D:"Enable Agent Forwarding"=00000001 | |
Color Schemes.ini |
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 | |
# return a list of directories the contain given text | |
# example: ~/scripts/tfgrep_dirs.sh '^\s*source\s*=\s*.*some_module_name' | |
file_paths=$(grep -irlP --include \*.tf --exclude-dir=.terraform --exclude-dir=.git $@) | |
dirs_array=() | |
for i in $file_paths; do | |
dirs_array+=($(dirname $i)) | |
done |
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
#s3 put notification | |
aws sqs receive-message --queue-url https://sqs.us-west-2.amazonaws.com/someaccount/somequeue --visibility-timeout 1 --max-number-of-messages 10 | jq -r '.Messages[].Body' | jq -r '.Message' | jq '.Records[].s3.object.key' |
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 | |
logpath=${HOME}/logs | |
random=$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 8) | |
logname=flowlog | |
mv ${logpath}/${logname} ${logpath}/archive/${logname}_${random} | |
mv ${logpath}/${logname}_sort ${logpath}/archive/${logname}_${random}_sort | |
mv ${logpath}/${logname}_top ${logpath}/archive/${logname}_${random}_top | |
mv ${logpath}/${logname}_reject ${logpath}/archive/${logname}_${random}_reject | |
mv ${logpath}/${logname}_rejectTop ${logpath}/archive/${logname}_${random}_rejectTop |
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 | |
# todo - add a cache so it will not have to query repeat eni ids | |
instanceId="" | |
instanceName="" | |
interfaceInfo="" | |
exitcode="" | |
declare -A cache=() | |
interfaceId=$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
{ | |
cmd = ". ./resolveInterface.sh "$2 | |
cmd | getline srcDesc | |
close(cmd) | |
printf "%5d %-16s %-16s %5d %s\n",$1, $3, $4, $5, srcDesc | |
} |
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
{ | |
printf "%-21s %-16s %-16s %-5s %s\n", $3, $4, $5, $7, $13 | |
} |
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
{ | |
cmd = "date -d @"$11" +%Y-%m-%dT%H:%M:%S" | |
cmd | getline myTime | |
close(cmd) | |
printf "%s %-16s %-5s %-16s %-5s %s\n", myTime, $4, $6, $5, $7, $13 | |
} |
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
# final final | |
string=$(cat sample.txt | grep -P '^\s+policy:' | sed -r 's/\s*policy:\s*//g; s/\\n//g; s/\\\"/"/g; s/\s+//g; s/=>/\n/g') | |
IFS=$'\n' GLOBIGNORE='*' command eval 'array=($string)' | |
diff <(echo ${array[0]} | sed -e 's/^"//g' -e 's/"$//g' | jq -S '.') <(echo ${array[1]} | sed -e 's/^"//g' -e 's/"$//g' | jq -S '.') | grep -v "^[0-9c0-9]" | |
# sed file | |
s/\s*policy:\s*//g | |
s/\\n//g | |
s/\\\"/"/g |
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
# might be a good starting point | |
https://stackoverflow.com/questions/6133989/what-grep-command-will-include-the-current-function-name-in-its-output |