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
#Login to ECR with AWS SDK v1 | |
#$(aws ecr get-login --no-include-email) | |
#Login to ECR with AWS SDK v2 | |
aws ecr get-login-password \ | |
| docker login \ | |
--password-stdin \ | |
--username AWS \ | |
"xxx.dkr.ecr.us-west-2.amazonaws.com" |
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
#Login to ECR with AWS SDK v1 | |
#$(aws ecr get-login --no-include-email) | |
#Login to ECR with AWS SDK v2 | |
aws ecr get-login-password \ | |
| docker login \ | |
--password-stdin \ | |
--username AWS \ | |
"xxx.dkr.ecr.us-west-2.amazonaws.com" |
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
def power(base, exp): | |
""" Fast power calculation using repeated squaring """ | |
if exp < 0: | |
return 1 / power(base, -exp) | |
ans = 1 | |
while exp: | |
if exp & 1: | |
ans *= base | |
exp >>= 1 | |
base *= base |
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 | |
#stop all containers: | |
docker kill $(docker ps -q) | |
#remove all containers | |
docker rm $(docker ps -a -q) | |
#remove all docker images | |
docker rmi $(docker images -q) |
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
rabbitmqctl add_user test test | |
rabbitmqctl set_user_tags test administrator | |
rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |