Skip to content

Instantly share code, notes, and snippets.

View onahirniak's full-sized avatar
💻
Continuously learning

Oleksandr Nahirniak onahirniak

💻
Continuously learning
View GitHub Profile
#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"
#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"
@onahirniak
onahirniak / pow.py
Created January 13, 2019 13:55 — forked from svdamani/pow.py
Fast Power calculation in Python
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
@onahirniak
onahirniak / docker_kill.sh
Created October 28, 2018 19:57
[Docker] Stop containers and remove images
#!/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)
@onahirniak
onahirniak / rabbitmq.txt
Created June 19, 2017 09:32 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"