Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Old kevinold

View GitHub Profile
@kevinold
kevinold / manually-remove-resource-from-amplify-project.md
Created August 12, 2022 13:44 — forked from josefaidt/manually-remove-resource-from-amplify-project.md
Instructions for surgically removing non-existent resource from local Amplify project
View manually-remove-resource-from-amplify-project.md

Let's say we've removed a Lambda Layer from the Lambda Console and are no longer able to perform operations using the Amplify CLI.

An error occurred fetching the latest layer version metadata for ""

> amplify remove function
? Choose the resource you would want to remove 10263layer58c94806 (layer)
When you delete a layer version, you can no longer configure functions to use it.
However, any function that already uses the layer version continues to have access to it.
✖ Loading layer data from the cloud...
@kevinold
kevinold / find-ecr-image.sh
Created February 10, 2021 23:00 — forked from outofcoffee/find-ecr-image.sh
Check if Docker image exists with tag in AWS ECR
View find-ecr-image.sh
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
View cli-github-status-check.sh
#!/bin/bash
branchname=${1:-$(git rev-parse --abbrev-ref HEAD)}
if ! [ -x "$(command -v jq)" ]; then
echo 'Error: "jq" is not installed.' >&2
exit 1
fi
if [ ! $SECRET_GH_TOKEN ]; then
@kevinold
kevinold / delay-promise.js
Created June 18, 2019 22:26 — forked from joepie91/delay-promise.js
ES6 Promise.delay
View delay-promise.js
module.exports = function(duration) {
return function(){
return new Promise(function(resolve, reject){
setTimeout(function(){
resolve();
}, duration)
});
};
};
@kevinold
kevinold / README.md
Created June 17, 2019 13:42 — forked from NoriSte/README.md
Conio Business site monitoring
View README.md

A Cypress test checking the most common issues faced by Conio with the AWS/S3 management (with a custom configuration for Brotli)

View roles-stack.yaml
Parameters:
Env:
Description: An environment name that will be prefixed to resource names
Type: String
AllowedValues: ["development", "production"]
resources:
NetworkRole:
Type: "AWS::IAM::Role"
Properties:
@kevinold
kevinold / serverless-deploy-user.yaml
Created June 5, 2019 17:20 — forked from bsamuel-ui/serverless-deploy-user.yaml
Cloudformation template to deploy permissions for deploying a serverless project.
View serverless-deploy-user.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: >
Constructs a managed IAM policy to deploy a serverless project.
This template assumes the stack is being deployed in the current region and account.
You can then attach this policy to other IAM objects, such as users or roles.
Based on the work done in: https://github.com/serverless/serverless/issues/1439
@kevinold
kevinold / editPage.js
Created June 4, 2019 16:30 — forked from pmarquees/editPage.js
Edit page (bookmarlet)
View editPage.js
javascript:document.body.contentEditable = 'true'; document.designMode='on'; void 0
@kevinold
kevinold / postgres_queries_and_commands.sql
Created May 15, 2019 20:30 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'