Skip to content

Instantly share code, notes, and snippets.

@dhsathiya
Last active September 4, 2020 07:31
Show Gist options
  • Save dhsathiya/da3981bdc71a126ac875bacb44e801a1 to your computer and use it in GitHub Desktop.
Save dhsathiya/da3981bdc71a126ac875bacb44e801a1 to your computer and use it in GitHub Desktop.
# <droplet name> <droplet IP>
doctl compute droplet list -o json | jq -r '.[] | "\(.name) \(.networks.v4[].ip_address)"'
# <instance tag value: Name>
aws ec2 describe-instances | jq -r ".Reservations[].Instances[].Tags[].Value" | perl -lne "print unless /Backup/"
# <Instance IP> <Instance tag value: Name>
aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | "\(.PublicIpAddress) \(.Tags[].Value)"' | perl -lne "print unless /Backup/"
# cURL headers
curl -XGET -IL https://example.com
# Get response code
curl -XGET -IL -w 'code: %{response_code}' https://example.com
# WP S3-Uploads
aws s3 cp s3://example.com/wp-content/uploads s3://example.com/wp-content/uploads --recursive --metadata-directive REPLACE --acl public-read --cache-control max-age=2592000,public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment