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 / 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 / create_doppler_service_token.sh
Created April 16, 2021 01:20
Crate a Doppler Service Token from the Command Line
#!/usr/bin/env bash
# Requires a CLI token
DOPPLER_TOKEN="$(doppler configure get token --plain)" \
DOPPLER_PROJECT="$(doppler configure get project --plain)" \
DOPPLER_CONFIG="$(doppler configure get config --plain)" \
\
SERVICE_TOKEN=$(curl -sS --request POST \
--url https://api.doppler.com/v3/configs/config/tokens \
@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 / .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 / Setting Terraform Cloud and Environment Variables using the Workspace Variables API.md
Created March 18, 2021 23:27
Setting Terraform Cloud and Environment Variables using the Workspace Variables API

Setting Terraform Cloud and Environment Variables using the Workspace Variables API

This presumes you've already signed up for Terraform Cloud and went through the onboarding flow which uses the tfc-getting-started repository.

The commands below use the first organization and workspace and presumes no Terraform variables (apart from provider_token) and environment variables exist.

It also only shows how to create a Terraform or environment variable.

NOTE: Before continuing, make sure you've created a user access token and exported it as TERRAFORM_TOKEN.

@ryan-blunden
ryan-blunden / .env
Last active June 24, 2025 04:02
Python Application Config and Secrets Class
API_KEY="357A70FF-BFAA-4C6A-8289-9831DDFB2D3D"
HOSTNAME="0.0.0.0"
PORT="8080"
# Optional
# DEBUG="True"
# ENV="development"
@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