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 / 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 / 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 / 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 / reset_sourcegraph_admin_password.md
Last active April 20, 2023 18:52
Instructions for resetting the Sourcegraph admin password

Presuming you have access to the Sourcegraph Docker container and the container name is sourcegraph:

  1. Get the id for the admin account (should be 1 in most cases):
docker container exec sourcegraph psql -U postgres sourcegraph -c 'SELECT id, username, passwd FROM users'
  1. Set the $ID variable:
@ryan-blunden
ryan-blunden / xslt.py
Last active October 6, 2022 15:48
XSLT Preview Tool
#!/usr/bin/env python
'''Basic XSLT previewer'''
__author__ = 'Ryan Blunden'
__copyright__ = 'Copyright 2010, Ryan Blunden'
__license__ = 'GPL'
__email__ = 'ryan.blunden@gmail.com'
__status__ = 'Development'
@ryan-blunden
ryan-blunden / pybites-intro.py
Created November 30, 2021 11:58
Pybites commuity intro message fun
from dataclasses import dataclass
import random
pybites_init_questions = [
'If you were to build a chatbot what would it do'
]
@dataclass
class PybitesIntro:
@ryan-blunden
ryan-blunden / doppler-pem-test.sh
Last active September 13, 2021 12:26
Doppler PEM Test Alpine
#!/usr/bin/env sh
apk add --update openssl
echo '\n[info]: Verify private key by extracting public key\n'
openssl rsa -in ./secrets/tls.key -pubout
tail -f /dev/null # Pretend to be a long-running process
@ryan-blunden
ryan-blunden / gist:4f37dad2e46face5a0f03c1e1e1fe436
Created August 12, 2021 04:11
mandalorion-gifs-secrets-template.yaml
projects:
- name: mandaloriongifs-python
description: Mandalorion GIFS generator using the Flask framework
environments:
- slug: dev
name: Development
configs:
- slug: dev
secrets:
dev: