Skip to content

Instantly share code, notes, and snippets.

@mgangl
mgangl / checkLatestAMICompliance.sh
Last active June 1, 2021 15:30
NGAP AMI Compliance Check
#!/bin/bash
for var in "$@"
do
echo "Checking NGAP compliance for $var"
export AWS_ACCOUNT=`aws sts get-caller-identity --profile $var | jq -r .Account`
export LATEST_AMI=`aws ssm get-parameter --name image_id_amz2 --profile $var | jq -r .Parameter.Value`
export LATEST_ECS_AMI=`aws ssm get-parameter --name image_id_ecs_amz2 --profile $var | jq -r .Parameter.Value`
@davidphasson
davidphasson / show.html.erb
Created April 8, 2009 03:42
ERB and the case statement
# Doesn't work
<p>
<% case @request.author_hosted %>
<% when "yes" %>
The school <b>has</b> hosted an author before.
<% when "no" %>
The school <b>has not</b> hosted an author before.
<% end %>
</p>