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 / claude-setup-guide.md
Last active March 28, 2026 04:19
Setup Claude Code In Envitonment

Claude Code Developer Setup Guide

Overview

This guide walks through setting up Claude Code with AWS Bedrock for new developers on Ubuntu/Linux or macOS systems. The setup includes automatic cost tracking per developer and per model, with intelligent Bedrock region discovery.

Prerequisites

  • Ubuntu/Linux or macOS system (Bash 4+ required on macOS)
  • AWS CLI v2 installed and configured
@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 March 2, 2026 16:39
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 {
@swateek
swateek / databricks_sqlwarehouse.py
Created June 18, 2025 04:02
DataBricks SQL WareHouse
from databricks import sql
DATABRICKS_USE2_PAT = ""
use2_workspace = sql.connect(
server_hostname="<YOUR-SERVER-HOSTNAME>",
http_path="<YOUR-HTTP-PATH>",
access_token=DATABRICKS_USE2_PAT,
catalog="<YOUR-CATALOG-NAME>",
schema="<YOUR-SCHEMA-NAME>"
@swateek
swateek / blobs_in_singlestore.md
Created April 17, 2025 08:20
Blobs In Singlestore
USE information_schema;

DESC MV_DATA_DISK_USAGE;

SELECT * FROM MV_DATA_DISK_USAGE;

SELECT DATABASE_NAME, FORMAT(SUM(`BLOBS_B`) / 1024/1024, 0) MB
FROM MV_DATA_DISK_USAGE
GROUP BY DATABASE_NAME