Skip to content

Instantly share code, notes, and snippets.

View norton120's full-sized avatar
🖖

Ethan Knox norton120

🖖
View GitHub Profile
@norton120
norton120 / login.sh
Last active March 13, 2024 23:18
Docker login AWS ECR via identity manager
# export REPO=<your ECR repo>
# export AWS_DEFAULT_REGION=us-east-2
# then paste the login creds from identity manager
docker login --username AWS --password $(docker run \
-e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
-e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
-e AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
-e AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} --rm amazon/aws-cli ecr get-login-password) $REPO
@norton120
norton120 / bash-dog-ecs-secrets-manager-envars.json
Last active December 29, 2023 20:44
Allows ECS to get secrets for ENVARS
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "secretsAccess",
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue",
"secretsmanager:ListSecretVersionIds",
"secretsmanager:ListSecrets"
@norton120
norton120 / policy-partial.json
Last active December 29, 2023 20:49
codebuild-bash-dog-pipeline-service-role policy updates
{
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::codepipeline-us-east-2-xxxxxxxxxxx",
"arn:aws:s3:::codepipeline-us-east-2-xxxxxxxxxxx/*",
],
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:GetObjectVersion",
@norton120
norton120 / appspec.yaml
Last active December 28, 2023 20:03
Core CodePipeline Files
version: 0.0
Resources:
- TargetService:
Type: AWS::ECS::Service
Properties:
TaskDefinition: <TASK_DEFINITION>
LoadBalancerInfo:
ContainerName: "bash-dog-nginx"
ContainerPort: 80
PlatformVersion: "LATEST"
@norton120
norton120 / gist:7e0090d207348171d3eb7434a9bac572
Created November 2, 2023 15:20
add latest version of python package to requirements.txt
#!/usr/bin/python3
import sys
import subprocess
from pathlib import Path
def get_latest(pkg:str) -> str:
response = subprocess.run(["pip3","install", f"{pkg}=="], capture_output=True)
err = response.stderr.decode('utf-8')
first_line = err.split("\n")[0]
versions_dirty = first_line.split(",")
@norton120
norton120 / docker-compose.yml
Created February 21, 2020 17:24
docker compose for SnowShu
version: "3.5"
services:
snowshu:
image: health-union/snowshu
volumes:
- .:/app
- /var/run/docker.sock:/var/run/docker.sock
command: tail -f /dev/null
networks:
- snowshu
@norton120
norton120 / keybase.md
Created August 28, 2017 13:23
Keybase proof

Keybase proof

I hereby claim:

  • I am norton120 on github.
  • I am ethan_k (https://keybase.io/ethan_k) on keybase.
  • I have a public key ASAPkHCeaUhmCykmDCaf15wLO85bYDshdU_z7RFwX3u9ego

To claim this, I am signing this object: