Skip to content

Instantly share code, notes, and snippets.

View matwerber1's full-sized avatar

Mathew Werber matwerber1

  • Seattle
View GitHub Profile
@matwerber1
matwerber1 / compose.yml
Last active November 9, 2023 18:16
AWS - Containers - Compose - mount ~/.aws/cred
version: "3.8"
services:
AwsCLI:
image: public.ecr.aws/aws-cli/aws-cli
container_name: aws-cli
platform: linux/x86_64
volumes:
- ~/.aws/:~/.aws/ # Mount local credentials into container to use AWS CLI/SDK
environment:
@matwerber1
matwerber1 / aws-profile
Created November 27, 2023 05:46
Super Duper AWS CLI Profile Switching Script
#! /bin/bash -i
set -e
# Constants
PROFILE_NICKNAME_FILE=".awsprofile.env"
AWS_CONFIG_FILE="$AWS_CONFIG_FILE"
# Variables
original_request="$1"
requested_profile=""
@matwerber1
matwerber1 / readme.md
Created December 13, 2023 08:01
Querying AWS Cost and Usage V2 (CURv2) with Amazon Athena - DDL and Queries

DDL for Athena Table

This could be improved, but does the trick for now. This is for a report configured as "daily" with resource IDs:

CREATE EXTERNAL TABLE IF NOT EXISTS `org_data`.`curv2` (
  `discount_bundled_discount` string,
  `discount_total_discount` string,
  `identity_line_item_id` string,
  `identity_time_interval` string,
@matwerber1
matwerber1 / README.md
Created June 23, 2025 08:34
Terraform - Deploy Windows BitBucket Self-hosted Runner as a service using AWS SSM Run Command

Terraform to create an AWS Systems Manager (SSM) RunCommand that can be used to configure an EC2 Windows instance as a bitbucket pipeline runner.

The installation uses WinSW to wrap the runner process as a Windows service and configures it to restart on failure / reboots as described in https://jira.atlassian.com/browse/BCLOUD-21928, also based on https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/

This is for a workspace-level runner.

A repository-level runner requires an extra parameter in the XML file and the SSM document.

Not all of the install scripts are included as they're pretty straightforward (e.g. choco install xyz, apart from the initial install of chocolately (see powershell-scripts/winEc2-choco-install-git.ps1) and disabling of pagefile+swapfile (see powershell-scripts/winEc2-disable-pagefile-and-swapfile.ps1).

@matwerber1
matwerber1 / ask-tracking.md
Last active August 27, 2025 21:05
AI Agent - Amazon Q - Rule - Basic Task Tracking

Task planning and tracking

Every time I ask you to perform work, you MUST strictly adhere to the following rules:

  • You MUST create a new tracking file in ./task-tracking/ with a file name formatted as YYYY-MM-DD_ID_TITLE where YYYY-MM-DD is today's date, ID is a number you increment for each new file on a given day beginning with a value of 1 for the first file you create on that day, and TITLE being a snake_case title of no more than five words that characterizes the purpose of the work performed.

  • You MUST briefly summarize my request and your strategy to fulfill the request in a first-level heading of # Task Overview