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 / 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 December 19, 2023 17:42
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
@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'"
@ryan-blunden
ryan-blunden / install-sourcegraph-ubuntu.sh
Last active November 27, 2023 09:58
Install Sourcegraph on Ubuntu 18.04
#!/usr/bin/env bash
export SOURCEGRAPH_VERSION=3.14.0
export USER_HOME=/home/ubuntu
export SOURCEGRAPH_CONFIG=/etc/sourcegraph
export SOURCEGRAPH_DATA=/var/opt/sourcegraph
export PATH=$PATH:/usr/local/bin
export DEBIAN_FRONTEND=noninteractive
export CAROOT=${SOURCEGRAPH_CONFIG}
export IP_ADDRESS=$(echo $(hostname -I) | awk '{print $1;}')
@ryan-blunden
ryan-blunden / install_gitlab_dev.sh
Created November 8, 2019 19:12
Install GitLab dev Sourcegraph branch
yum clean all
yum update -y
yum upgrade -y
amazon-linux-extras install -y ruby2.6 redis4.0 GraphicsMagick1.3 \
postgresql10 epel
yum install -y postgresql-server postgresql-devel libicu-devel cmake \
gcc gcc-c++ ed fontconfig freetype libfreetype.so.6 libfontconfig.so.1 \
@ryan-blunden
ryan-blunden / what_is_sourcegraph.md
Last active October 24, 2019 21:33
What is Sourcegraph resources

What is Sourcegraph resources

Use the below content to quickly understand and see what Sourcegraph can do.


Sourcegraph overview

Developer platform built on 3 pillars: