Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ianomaly on github.
  • I am ianomaly (https://keybase.io/ianomaly) on keybase.
  • I have a public key ASBGn6Ug4bVg58V7zNrH00jrvafU7eVo5cNb-fYm_MI9igo

To claim this, I am signing this object:

# AWS NAT Gateways per AZ
aws ec2 describe-nat-gateways | jq -r '.NatGateways[]|select(.State=="available").SubnetId' | xargs aws ec2 describe-subnets --subnet-id | jq -r '.Subnets[].AvailabilityZone' | sort | uniq -c
# SSH command across all EC2 instance with name tag using bastion/jump-box and dumping 1024 DNS queries to EC2 DNS
aws --output text ec2 describe-instances --query 'Reservations[].Instances[?Tags[?Key==`Name`&&contains(Value,`my-name`)]].PrivateDnsName' | xargs -I % -n 1 -P $(sysctl -n hw.ncpu) ssh -i ~/.ssh/key.pem -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -J ubuntu@bastion.name admin@% "uname -n; sudo /usr/sbin/tcpdump -i eth0 -lnc 1024 dst 172.29.0.2"