Skip to content

Instantly share code, notes, and snippets.

drmikecrowe /
Last active Oct 13, 2017 — forked from antimius/
Script to find and print the latest stable, Ubuntu version
# prints latest, stable, HVM, EBS GP2 backed AMIs for major OSs
REGIONS="us-east-1 us-east-2 us-west-1 us-west-2"
for REGION in $REGIONS; do
echo -n "$REGION: "
aws ec2 describe-images --region=$REGION --owners $UBUNTU --filters 'Name=name,Values=*hvm-ssd*16.04*' --query 'Images[*].[ImageId,CreationDate,Name]' --output text | sort -k2 -r | head -n 1
usage() {
cat << EOF
Usage: $0 [OPTION]... COMMAND
Execute the given command in a way that works safely with cron. This should
typically be used inside of a cron job definition like so:
* * * * * $(which "$0") [OPTION]... COMMAND
docker-yml() {
docker inspect -f $'
image: {{.Config.Image}}
entrypoint: {{json .Config.Entrypoint}}
environment: {{range .Config.Env}}
- {{.}}{{end}}
' $1
View app.yml
# file: roles/app/tasks/main.yml
- name: ensure logging directory exists
file: path=/var/log/acme state=directory
- install
- name: ensure config directory exists
file: path=/etc/acme/app state=directory
You can’t perform that action at this time.