Skip to content

Instantly share code, notes, and snippets.

View ryan-blunden's full-sized avatar

Ryan Blunden ryan-blunden

  • Brisbane, Australia
View GitHub Profile
@ryan-blunden
ryan-blunden / secrets_getsecretvalue.js
Created July 22, 2021 07:39
The secrets_getsecretvalue.js file demonstrates how to retrieve a secret from AWS Secrets Manager.
/**
* From https://docs.aws.amazon.com/code-samples/latest/catalog/javascript-secrets-secrets_getsecretvalue.js.html
*
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* This file is licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License. A copy of
* the License is located at
*
* http://aws.amazon.com/apache2.0/
@ryan-blunden
ryan-blunden / README.md
Created July 9, 2021 08:50
Doppler Cloudflare Pages Secrets Sync

Doppler Cloudflare Pages Secrets Sync Script

NOTE: This script is a work in progress

Bash script to sync secrets from Doppler to Cloudflare Pages using the Pages Update Project API.

Usage

The following enviroment variables must be set or else you will be prompted when running the script:

@ryan-blunden
ryan-blunden / config.py
Created May 7, 2021 11:48
Python class for App Configuration
import os
from typing import get_type_hints, Union
from dotenv import load_dotenv
load_dotenv()
class AppConfigError(Exception):
pass
def _parse_bool(val: Union[str, bool]) -> bool: # pylint: disable=E1136
@ryan-blunden
ryan-blunden / carbon-config.json
Created April 26, 2021 10:45
carbon-config.json
{
"paddingVertical": "0px",
"paddingHorizontal": "0px",
"backgroundImage": null,
"backgroundImageSelection": null,
"backgroundMode": "color",
"backgroundColor": "rgba(255,255,255,1)",
"dropShadow": false,
"dropShadowOffsetY": "0px",
"dropShadowBlurRadius": "85px",
@ryan-blunden
ryan-blunden / .gitignore
Last active April 12, 2021 07:14
AWS SAM template automated embedding of environment variables using the Doppler CLI and a Node.js script
template-deploy.yaml
@ryan-blunden
ryan-blunden / .gitignore
Last active April 12, 2021 07:13
AWS SAM template automated embedding of environment variables using the Doppler CLI
template-deployment.yaml
@ryan-blunden
ryan-blunden / Makefile
Created January 21, 2021 01:23
Chuck Norris random quote generator
dev:
FLASK_ENV=development python3 chuck.py
@ryan-blunden
ryan-blunden / list_aws_account_access_keys.py
Created May 11, 2020 10:37
Dump the list of AWS access keys for an account
#!/usr/bin/env python3
# usage (dump a json list of user objects): python3 list_aws_account_access_keys.py
# usage (dump a combined lsit of access keys): python3 list_aws_account_access_keys.py keys_only
from dataclasses import dataclass
import json
import sys
from typing import List
@ryan-blunden
ryan-blunden / main.tf
Last active March 23, 2020 03:46
Deploy Sourcegraph on AWS using Terraform
module "sourcegraph" {
source = "github.com/sourcegraph/deploy-sourcegraph-aws"
vpc_id = "vpc-b3708ed4"
subnet_id = "subnet-091a876e"
app_name = "sourcegraph-demo"
instance_type = "t2.xlarge"
key_name = "ryan-blunden"
}
@ryan-blunden
ryan-blunden / aws-cli-commands.sh
Last active March 23, 2020 02:44
List AWS VPCs showing the VPC Id and Tags
alias aws-list-vpcs="aws ec2 describe-vpcs | jq '.Vpcs[] | {VpcId,Tags}'"
alias aws-list-key-pairs="aws ec2 describe-key-pairs | jq '.KeyPairs[].KeyName'"