Skip to content

Instantly share code, notes, and snippets.

View quickmute's full-sized avatar

Hyon quickmute

View GitHub Profile
@quickmute
quickmute / new_rest_api.ps1
Last active February 7, 2022 02:54
new rest api
# You should have gotten these from previous steps
$ROLE_ARN = "arn:aws:iam::999999999999:role/delete_me_hyon"
$SNS_TOPIC_ARN = "arn:aws:sns:us-east-1:999999999999:delete_me_hyon"
$REGION = "us-east-1"
# Create a new AWS API GW - REST API
$api_id = aws apigateway create-rest-api --name 'delete_me_hyon' --output text --query 'id' --region $REGION
# Test it
aws apigateway get-resources --rest-api-id $API_ID
@quickmute
quickmute / inotify-docker.sh
Last active January 3, 2022 04:26
Run inotifywait to update ecr
#!/bin/sh
# get Docker Root Director
DOCKERROOT=`docker info | grep 'Docker Root Dir' | awk -F ": " '{print $2}'`
# Append the image SHA256 to the above path, this is where the new images go
IMAGEMETADATA="$DOCKERROOT/image/overlay2"
# create a notify event on this dir, specifically we are watching repositories.json file
sudo inotifywait -m -e moved_to $IMAGEMETADATA \
| while read FILENAME
do
/home/ubuntu/update_ecr.sh
@quickmute
quickmute / test.ps1
Created December 12, 2021 03:52
Powershell script to test the lambda container function
$body = '{"Name":"Jack"}'
$output = Invoke-WebRequest -Method Post -Body $body -Uri "http://localhost:9000/2015-03-31/functions/function/invocations"
$output.RawContent