Skip to content

Instantly share code, notes, and snippets.

View jasonforte's full-sized avatar

Jason Forté jasonforte

View GitHub Profile
@jasonforte
jasonforte / statefulset.yaml
Created August 7, 2018 12:40
Sample statefulset with EBS on EKS
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: gp2
provisioner: kubernetes.io/aws-ebs
parameters:
type: gp2
reclaimPolicy: Retain
mountOptions:
- debug
@jasonforte
jasonforte / Makefile
Created August 10, 2018 10:49
Self Documenting Makefile
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@jasonforte
jasonforte / script.sh
Created October 14, 2018 08:49
Useful bash commands
# Generate a file of a certain size (24Mb)
dd if=/dev/zero of=output.dat bs=1M count=24
@jasonforte
jasonforte / update-iam-credentials.sh
Last active November 4, 2018 16:33
Update IAM Credentials Script
#!/usr/bin/env bash
set -e
CREDENTIALS_DIR=$HOME/.aws
region=${1:-us-east-1}
role=$2
command -v aws >/dev/null 2>&1 || { echo -e >&2 "Required: AWS CLI not installed\n\nPossible fix:\n-------------\nsudo -H pip3 install -U awscli\n\nAborting..."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo -e >&2 "Required: jq not installed\n\nPossible fix:\n-------------\nsudo apt update && sudo apt install -y jq\n\nAborting..."; exit 1; }
if ! [ -d $CREDENTIALS_DIR ]
@jasonforte
jasonforte / main.tfvars
Created December 29, 2019 11:25
S3 Static Site w/ CloudFront - Terraform
hostname = ""
acm_certificate_arn = ""
@jasonforte
jasonforte / README.md
Last active June 2, 2021 15:02
Amazon CloudWatch Logs - Standard Setup - Ubuntu

Amazon CloudWatch Agent - Setup Instructions

Install the Amazon CloudWatch Agent on the instances. We want to monitor the memory usage mostly but the CPU & disk metrics are nice to have available too.

Installation

Connect to the instance and run the following:

$ wget https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
@jasonforte
jasonforte / README.md
Created July 31, 2024 11:34
Dynamic Configuration Example for AWS AppConfig in Python

Dynamic Configuartion using AWS AppConfig

This gist provides a Python class that allows retrieval of dynamic configuration from AWS AppConfig.

Pre-Requisites

This assumes a Freeform, JSON configuration is available in AWS AppConfig as follows:

{
@jasonforte
jasonforte / README.md
Last active May 27, 2025 13:57
Alembic Migration Script

Migrations Script Usage

This script provides a standard way to access postgres from a remote server. It will fetch db credentials based on the following inputs:

  • DB_CREDENTIALS_NAME is the name of the Secrets Manager secret to retrieve the db credentials from. (Required)
  • DB_NAME is the database name to connect to (Optional, Default: postgres)
  • ENV should be set to prod to modify the remote database, else it returns for a local environment. (Optional)
@jasonforte
jasonforte / main.go
Created July 31, 2025 11:41
Connecting Elixir (Phoenix) to Amazon Aurora DSQL
package main
import (
"context"
"flag"
"fmt"
"log"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/dsql/auth"
@jasonforte
jasonforte / README.md
Created August 10, 2025 12:45
Python Sample - Invoke Qwen 2.5 VL Instruct on Amazon Bedrock

Invoke Qwen2.5 VL Instruct via Amazon Bedrock

This is part of a YouTube tutorial series by MakeOps.

The file is a script that invokes Qwen2.5 VL via Amazon Bedrock to describe and image.

usage: main.py [-h] image

positional arguments: