Skip to content

Instantly share code, notes, and snippets.

View Gowiem's full-sized avatar
🌤️
Stoked on Terraforming

Matt Gowie Gowiem

🌤️
Stoked on Terraforming
View GitHub Profile
@jim80net
jim80net / tf_move_state.sh
Last active February 25, 2022 10:21
Move terraform state between projects.
#!/usr/bin/env bash
##
# Usage: tf_move_state.sh source_directory target_directory source_resource_name <target_resource_name (uses source_resource_name if not provided)>
# Provide source and target directories using relative paths.
# WARNING: TEST ON AN INCONSPICUOUS AREA AS STAINING MAY OCCUR
# Credit to https://github.com/mcalhoun
set -e
@RothAndrew
RothAndrew / gitlab_set_personal_access_token.tf
Last active September 24, 2020 21:32
Idempotently create a Personal Access Token for a user in GitLab running in Kubernetes
// WARNING: Don’t mess with gitlab-rails runner unless you REALLY know what you are doing.
// It gives root-level access to EVERYTHING at the database level.
// Idempotently create a Personal Access Token for a user in GitLab running in Kubernetes
// USE AT YOUR OWN RISK
resource "null_resource" "set_gitlab_personal_access_token" {
triggers = {
uuid = uuid()
}
provisioner "local-exec" {
@afmsavage
afmsavage / settings.json
Created May 8, 2020 02:09
Extensions List and my settings.json from VSCode
{
"git.autofetch": true,
"git.confirmSync": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
"vs-kubernetes": {
"vs-kubernetes.helm-path": "/home/pants/.vs-kubernetes/tools/helm/linux-amd64/helm",
"vs-kubernetes.minikube-path": "/home/pants/.vs-kubernetes/tools/minikube/linux-amd64/minikube",
"vs-kubernetes.draft-path": "/home/pants/.vs-kubernetes/tools/draft/linux-amd64/draft",
"vs-kubernetes.draft-path.linux": "/home/tony/.vs-kubernetes/tools/draft/linux-amd64/draft",

Notes on using Geodesic with repos created by cloudposse/reference-architectures

How to Use this Repo

AWS Setup

  1. Log in to console for root account as your IAM user name@example.com
  2. Go to https://console.aws.amazon.com/iam/home
  3. Add an MFA device to your user
  4. Generate an access key and store it securely to be added to aws-vault
@ryantbrown
ryantbrown / s3upload.sh
Created February 1, 2018 07:25
Bash script to Upload folder to S3
# Set AWS credentials and S3 paramters
AWS_KEY=""
AWS_SECRET=""
S3_BUCKET=""
S3_BUCKET_PATH="/"
S3_ACL="x-amz-acl:private"
function s3Upload
{
path=$1
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"
end
def red(text); colorize(text, 31); end
def green(text); colorize(text, 32); end
# Actual example
#puts 'Importing categories [ ' + green('DONE') + ' ]'
#puts 'Importing tags [' + red('FAILED') + ']'
function translateError(msg) {
var newErr = new Error(msg); // placed here to get correct stack
return e => {
newErr.originalError = e;
throw newErr;
}
}
async function asyncTask() {
const user = await UserModel.findById(1).catch(translateError('No user found'))
@michaelcurry
michaelcurry / rfc-template.md
Created September 29, 2016 18:07
RFC Template [Markdown]

RFC Template

Feature Name: (fill me in with a unique identity, myawesomefeature)

Type: (feature, enhancement)

Start Date: (fill me in with today's date, YYYY-MM-DD)

Author: (your names)

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@ygotthilf
ygotthilf / jwtRS256.sh
Last active April 25, 2024 19:58
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub