Skip to content
- aws ec2 describe-instances | jq -cr ‘.Reservations[].Instances[0]|[.InstanceId,.InstanceType,.KeyName,.State,.Tags]’ # list instances
- aws ec2 describe-instance-status –instance-id <INST-ID> | jq ‘ .InstanceStatuses | .[].InstanceState.Name’ # show instance
- aws ec2 start-instances –instance-id <INST-ID> # start instance
- aws elbv2 describe-load-balancers| jq -c ‘.LoadBalancers[]|[.LoadBalancerName,.LoadBalancerArn]’ # list arns
- aws elbv2 describe-listeners –load-balancer-arn <ARN> | jq -c ‘.|.Listeners[]|[.Protocol,.Port,.ListenerArn] # list listeners
- aws elbv2 describe-rules –listener-arn <ARN> | jq -c ‘.Rules[]|.Conditions,.Actions’ # list rules
- Connect to mongodb: $ mongo
- show dbs;
- db.<collection>.stats(1024000000) # gb – ref
- db.<collection>.find({},{<field>:<value>}).sort({<field>:1}).limit(5); # find top 5
- db.<collection>.find({},{<field>:1}).sort({<field>:-1}).limit(5); # find bottom 5
- db.<collection>.find({<field>:{ $lt: <val>}},{<field>:1}).count(); # count matches
- db.runCommand({compact:'<collection>’}) # compact collection