Skip to content

Instantly share code, notes, and snippets.

View swateek's full-sized avatar
🎯
One Small Step at a Time

Swateek Jena swateek

🎯
One Small Step at a Time
View GitHub Profile
@swateek
swateek / terraform-iam-audit.md
Created April 26, 2026 17:10
An IAM Audit for Terraform Resources
name terraform-iam-audit
description Analyse Terraform code in a given path (or CWD) and output the exact minimum AWS IAM permissions an IAM user needs to run terraform apply and terraform destroy against that project. Grouped by resource type, no wildcards. Invoke with /terraform-iam-audit [optional-path], or when user asks "what IAM permissions does this Terraform need", "what AWS permissions are required to deploy this", "list permissions for this terraform project".
tools Bash, Read, Glob, WebFetch
version 2.0.0

Terraform IAM Audit Skill

Scan Terraform source files and emit a precise, grouped list of AWS IAM actions required to deploy and destroy the infrastructure. No wildcards. No over-permissioning. Every action must be justified by an actual Terraform resource or data source in the code, verified against the live AWS Service Authorization Reference.

@swateek
swateek / S3-Helpers.md
Last active April 22, 2026 17:19
AWS S3 Helper Script

helpers-s3

A command-line tool for common AWS S3 operations: upload files, list objects, delete individual objects, and empty an entire S3 prefix.

Prerequisites

  • Python >= 3.11
  • uv package manager
  • AWS IAM credentials with S3 read/write access
@swateek
swateek / claude-setup-guide.md
Last active April 20, 2026 16:55
Setup Claude Code In Envitonment

setup-claude-code-developer

Onboards a developer with Claude Code on AWS Bedrock, creating per-developer Application Inference Profiles for cost tracking.

Requirements

  • Ubuntu/Linux or macOS (Bash 4+ required on macOS — install via brew install bash)
  • AWS CLI v2 installed and configured with a dev profile
  • Bedrock Anthropic model access enabled in at least one AWS region
  • Administrator access to install global npm packages
@swateek
swateek / vagrant-vm-repair.sh
Created March 27, 2026 04:23
Repairs Vagrant VMs By Removing Lock and Swap Files
#!/bin/bash
###############################################################################
# Vagrant VMware Repair Script
#
# Purpose: Fix "Directory not empty" and disk access errors when a computer
# restarts while Vagrant is running or the VM crashes unexpectedly.
#
# Usage:
# bash vagrant-vmware-repair.sh <vm-name> # Interactive mode (recommended)
@swateek
swateek / fetch_mfa_creds.sh
Created March 4, 2026 05:00
Fetch MFA Creds
#!/usr/bin/env bash
# =============================================================================
# fetch_aws_mfa_creds.sh
# Fetches temporary AWS session credentials using an MFA token and stores
# them under a dedicated [mfa] profile in ~/.aws/credentials.
#
# Usage:
# ./fetch_aws_mfa_creds.sh <6-digit MFA token>
#
# Prerequisites:
@swateek
swateek / vagrant_cleanup.sh
Last active April 10, 2026 05:01
Vagrant Cleanup Script
#!/bin/bash
CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BOLD='\033[1m'
NC='\033[0m'
# Use $HOME by default, or override with CLEANUP_HOME env var
@swateek
swateek / README.md
Created December 8, 2025 10:17
Create Calendar Events From a Simple CSV file

CSV to ICS Converter

This script converts a CSV file containing event details into an ICS file that can be imported into Google Calendar (and other calendar applications).

Usage

  1. Prepare your CSV file: The CSV file should have the following columns (case-insensitive):
    • start date (Format: YYYY-MM-DD HH:MM or YYYY-MM-DD for all-day)
  • end date (Format: YYYY-MM-DD HH:MM or YYYY-MM-DD)
@swateek
swateek / extract_http_requests.py
Created August 15, 2025 05:12
Extract HTTP Requests From an HAR File
import json
# Path to your HAR file
har_file = "example.har"
# Load HAR file
with open(har_file, "r", encoding="utf-8") as f:
har_data = json.load(f)
# HAR files store entries under log.entries
@swateek
swateek / aws_route53_management.sh
Created August 14, 2025 04:07
AWS Route53 Management Script
#!/usr/bin/env bash
set -euo pipefail
AWS_PROFILE="devops"
function hosted_zone_exists() {
local domain=$1
aws route53 list-hosted-zones-by-name \
--dns-name "$domain" \
--query "HostedZones[?Name=='${domain}.'] | length(@)" \
import { DBSQLClient } from "@databricks/sql";
import IDBSQLSession from "@databricks/sql/dist/contracts/IDBSQLSession";
interface DataBricksWareHouseConnect {
token: string;
host: string;
path: string;
}
class DataBricksManager {