Skip to content

Instantly share code, notes, and snippets.

View rexwhitten's full-sized avatar

Rex Whitten rexwhitten

View GitHub Profile
@rexwhitten
rexwhitten / inventory_crud.py
Last active January 21, 2026 20:33
Inventory
import json
import boto3
import logging
import os
from datetime import datetime, timezone
from decimal import Decimal
from typing import Any, Dict, List
from boto3.dynamodb.conditions import Key
# Configure structured logging

Here is a complete, working example of a .gitlab-ci.yml file that meets your requirements.

I have chosen a Python base image for this example because it makes installing the AWS CLI (via pip) extremely straightforward and fast for a test scenario.

1. The Configuration (.gitlab-ci.yml)

Copy and paste this into your repository's CI/CD configuration file.

stages:

Option 1: Adapt to the RHEL Environment (Immediate Fix) If you must use this specific runner, you need to use RHEL commands.

Replace your before_script with this:

YAML

before_script:

RHEL uses yum/dnf. We install 'make' and 'unzip' (needed for AWS CLI)

  • sudo yum install -y make unzip
@rexwhitten
rexwhitten / parse_plan.sh
Last active July 3, 2025 21:08
Terraform Scripts
#!/bin/bash
# Check if the JSON file is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <terraform-plan-output.json>"
exit 1
fi
# Function to get an emoticon based on the action
get_emoticon() {
@rexwhitten
rexwhitten / cleanup_okta_users.sh
Last active June 12, 2024 11:42
Okta and Vault Test Credential Automation
#!/bin/bash
# You should have these envvars setup already
# VAULT_ADDR="https://your-vault-address"
# VAULT_TOKEN="your-vault-token"
# Define Okta and Vault configuration variables
OKTA_DOMAIN="yourOktaDomain"
VAULT_API_TOKEN_PATH="secret/data/okta/api_token"
VAULT_USER_CREDS_PATH="secret/data/okta/users"
@rexwhitten
rexwhitten / index.js
Created February 1, 2024 20:30
Git Commit Message Creator
#! /usr/bin/env node
import OpenAI from "openai";
import { exec } from 'child_process';
exec('git status', async (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
if (stderr) {
@rexwhitten
rexwhitten / install-hashicorp.ps1
Last active October 13, 2022 12:10
HashiCorp Install Script
param(
[string]$productName = "terraform",
[string]$os = "linux",
[string]$arch = "amd64",
[string]$version = "latest"
)
Function Get-Products {
Invoke-RestMethod -Uri https://api.releases.hashicorp.com/v1/products | Format-Table
}
@rexwhitten
rexwhitten / install-azure-cli.sh
Created March 23, 2022 14:08
Install Azure CLI on Ubuntu
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-get -y install apt-transport-https
sudo apt-get update && sudo apt-get -y install azure-cli
# create a tinycorelinux fs with custom .tcz packages
# prerequisites: apt-get install squashfs-tools, npm i nugget -g
# dl release + packages (add your packages here)
nugget http://tinycorelinux.net/6.x/x86_64/release/CorePure64-6.3.iso http://tinycorelinux.net/6.x/x86_64/tcz/{pkg-config,make,gcc,gcc_base-dev,gcc_libs-dev,gcc_libs,glibc_base-dev,linux-3.16.2_api_headers,fuse}.tcz -c
# to support compiling addons
unsquashfs -f pkg-config.tcz
unsquashfs -f make.tcz
unsquashfs -f gcc.tcz
@rexwhitten
rexwhitten / .bashrc
Created August 2, 2019 13:36 — forked from VasekPurchart/.bashrc
GIT global configuration and enhancements
# used by Git (commit messages, rebase, ...)
export EDITOR=vim