http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html https://www.youtube.com/watch?v=_wiGpBQGCjU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Source: https://gist.github.com/627fcfbfbc17a683a70210947e02eaa3 | |
| ########## | |
| # Kaniko # | |
| ########## | |
| open https://github.com/vfarcic/kaniko-demo | |
| # Fork it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [ -z "${DELETE_PATTERN}" ] | |
| then | |
| echo "please set DELETE_PATTERN environment variable with pattern to delete" | |
| exit | |
| fi | |
| if [ -z "${AWS_PROFILE}" ] | |
| then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export AWS_DEFAULT_PROFILE="" | |
| # to display parameter store variables for aws latest linux | |
| aws ssm get-parameters-by-path --path "/aws/service/ami-amazon-linux-latest" --region us-west-2 | |
| # get the list of parameter store variables in the account | |
| aws ssm describe-parameters | jq '.Parameters[].Name' | |
| # remove the last path and filter higher level path | |
| aws ssm describe-parameters | jq '.Parameters[].Name' | sed -e 's,\(.*\)/.*,\1",g' | sort | uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws cloudformation list-stacks --stack-status-filter REVIEW_IN_PROGRESS | jq -c '.StackSummaries[] | .StackName' | xargs -L 1 aws cloudformation delete-stack --stack-name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| from boto3.session import Session | |
| def assume_role(arn, session_name): | |
| """aws sts assume-role --role-arn arn:aws:iam::00000000000000:role/example-role --role-session-name example-role""" | |
| client = boto3.client('sts') | |
| account_id = client.get_caller_identity()["Account"] | |
| print(account_id) |
EMOJI CHEAT SHEET
Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.
People
😄
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
|---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # generate your private key, put the public key on the server you will be connecting to | |
| ssh-keygen -t rsa -f ./my_key | |
| # generate the password/secret you will store encrypted in the .travis.yml and use to encrypt your private key | |
| cat /dev/urandom | head -c 10000 | openssl sha1 > ./secret | |
| # encrypt your private key using your secret password | |
| openssl aes-256-cbc -pass "file:./secret" -in ./my_key -out ./my_key.enc -a | |
| # download your Travis-CI public key via the API. eg: https://api.travis-ci.org/repos/travis-ci/travis-ci/key |
NewerOlder