Skip to content

Instantly share code, notes, and snippets.

View eramm's full-sized avatar
🏉
Ready for action

Eliezer Ramm eramm

🏉
Ready for action
View GitHub Profile
@eramm
eramm / grepfqdn.md
Created July 24, 2022 16:25
use grep to extract a FQDN from a file

grep -oiE '([a-zA-Z0-9][a-zA-Z0-9-]{1,61}\.){1,}(\.?[a-zA-Z]{2,}){1,}'

@eramm
eramm / aws-elb-describe-load-balancers.md
Last active July 13, 2022 22:17
aws-elb-describe-load-balancers

Do you ever find yourself having to look through your AWS ELBs to find bad TLS/SSL configurations ?

aws elb describe-load-balancers --output json | jq -r '.LoadBalancerDescriptions[] | [ (.LoadBalancerName, .ListenerDescriptions[].Listener.Protocol), (.ListenerDescriptions[].PolicyNames[]), (.Scheme)] | @csv' >> all-loadbalancers.csv

List ELB Names, Listeners, Security Policy, and whether the ELB is Internal or Internet facing. Save as CSV

@eramm
eramm / awsenv.md
Last active September 27, 2023 15:45
List your AWS Profiles

grep profile ~/.aws/config | sed -ne 's/^\[profile\s\(.*\)\]/export AWS_PROFILE=\1/p'

Note: If you are on a MacOS you will discover that this doesn't work due to the fun fact Mac does't use GNU sed ! (Boo Hiss !!!!) :-)

try this instead (2 ways): grep profile ~/.aws/config | sed -ne 's/^\[profile[[:space:]]\(.*\)\]/export AWS_PROFILE=\1/p'

grep profile ~/.aws/config | sed -ne 's/^\[profile\(.*\)\]/export AWS_PROFILE=\1/p' | sed 's/ //2'