Skip to content

Instantly share code, notes, and snippets.

View praveenc's full-sized avatar
🎯
Focusing

Praveen Chamarthi praveenc

🎯
Focusing
  • United States
View GitHub Profile
@praveenc
praveenc / ruff-lint.md
Created July 27, 2025 17:59
ruff-lint - Claude code custom command
allowed-tools description
Bash(ruff check:*), Bash(ruff format:*), Read(~/.config/ruff/ruff.toml)
Lint and format codebase using Ruff

Lint codebase using Ruff

Your goal is to lint and format the codebase using Ruff.

Do the following:

@praveenc
praveenc / bedrock_utils_v2.py
Created June 14, 2025 16:01
Python util script to invoke Amazon Bedrock using ConverseAPI. Supports Document upload, Prompt Caching, Reasoning Enabled.
import re
import time
from dataclasses import dataclass
from functools import lru_cache
from pathlib import Path
from typing import Any, ClassVar, Final, Literal
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError
@praveenc
praveenc / bedrock_utils.py
Last active June 10, 2025 17:58
Python util script to invoke Amazon Bedrock using ConverseAPI. Supports Document upload, Prompt Caching, Reasoning Enabled.
# /// script
# requires-python = ">=3.12.9"
# dependencies = [
# "loguru==0.7.3",
# "boto3==1.38.32",
# "rich==14.0.0",
# ]
# ///
import time
@praveenc
praveenc / lancedb_operations.py
Created March 2, 2025 20:02
LanceDB vector store operations using OpenAI compatible custom embeddings function
from pathlib import Path
from typing import Any, Dict, List, Literal, Union
import lancedb
import numpy as np
import pandas as pd
import pyarrow as pa
from lancedb.embeddings import (
EmbeddingFunction,
EmbeddingFunctionRegistry,
@praveenc
praveenc / aws-ecr-migrate.sh
Created March 15, 2021 17:49
AWS ECR Migration Script (authenticate, pull, re-tag and push)
#!/bin/bash
set -xe
# The Enviroment where this script will be ran needs to have jq, aws cli and docker installed
# Set parameters
region=$1
original_aws_profile=$2
new_aws_profile=$3
original_aws_account_number=$4
@praveenc
praveenc / list-filenames-walk.py
Created May 21, 2020 17:57
Get all filenames (fqdn) under a given directory
#!/usr/bin/env python
from os import walk
from os.path import join
DIR_PATH='/path/to/dir'
## Get all pdf files under the dir DIR_PATH
for (dirpath, _, filenames) in walk(DIR_PATH):
full_names = [join(dirpath, fn) for fn in filenames if fn.endswith('pdf')]
break
@praveenc
praveenc / .vimrc
Created May 20, 2020 01:53
vimrc with plugins from vimawesome.com
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" No annoying sound on errors
set noerrorbells
@praveenc
praveenc / .rsync-exclude
Created April 19, 2020 17:11
rsync-exclude file
.DS_Store
~$*
.git
.terraform/
.venv/
venv/
env/
node_modules/
__pycache__/
@praveenc
praveenc / extract-aws-ipranges.py
Created April 9, 2020 17:33
Extracts IP Ranges from aws ip ranges and writes to file
"""
Extracts IPV4 and IPV6 prefix ranges from ip-ranges.json
REF: https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html#aws-ip-download
Author: Praveen Chamarthi
"""
import requests
import json
aws_ipranges_url = "https://ip-ranges.amazonaws.com/ip-ranges.json"
response = requests.get(aws_ipranges_url, stream=True)
@praveenc
praveenc / .aliases
Created April 4, 2020 16:57
.aliases
#!/usr/bin/env bash
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
alias srcdgcp="cd ~/dev/sourced/github/deploymentmanager-samples/community/cloud-foundation"