Howtos

A “for” loop in BASH

on the command line:

# for i in $(some command that produces a list); do a_command_that operates_on $i ; maybe_another_command; done

in a script:

for i in $(some command that produces a list);
do
a_command_that_manipulates $i
done

Amazon S3 policy document starter

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "s3:ListAllMyBuckets",
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation"
      ],
      "Resource": "arn:aws:s3:::<bucket_name>"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::<bucket_name>/*"
    }
  ]
}