Skip to content

Instantly share code, notes, and snippets.

View santosh-gouda's full-sized avatar

Santosh Kumar Gouda santosh-gouda

  • 14:06 (UTC +05:30)
View GitHub Profile
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
#!/usr/bin/env bash
DBT_ENV=~/.virtualenvs/dbt
DBT_BETA_ENV=~/.virtualenvs/dbt-beta
process_environment() {
env=$1
release=$2
if [[ -d "$env" ]]; then
@santosh-gouda
santosh-gouda / dbt_debugger.py
Created October 28, 2025 08:23 — forked from ralfsantacruz/dbt_debugger.py
python-based dbt debugging utility
"""
dbt debugging utility as suggested by Snowflake.
This debugger will behave the same as running `dbt ...` commands, but is designed for
for debugging purposes. dbt's native debug logging is not as sophisticated, and we require
deeper levels of logging at the Snowflake python connector level that we can't get via dbt's logging.
The "entrypoint" of this script is `dbt`, so there is no need to prepend `dbt` to any commands.
This script requires these environment variables to be set:
@santosh-gouda
santosh-gouda / main_template.sh
Created October 27, 2025 07:49 — forked from idleuncle/main_template.sh
[Bash main script] #bash
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
# --- Helper scripts begin ---
#/ Usage: saltstackcmd <command> [options...]
#/
#/ Commands:
@santosh-gouda
santosh-gouda / glue_py.md
Created October 27, 2025 06:21 — forked from jhannah/glue_py.md
Terraform: AWS Glue: A Python script + dependencies from a requirements.txt file

Claude Sonnet 4:

In Terraform how do I create a Glue Job from Python script foo.py, and also specify additional-python-modules from a requirements.txt file I provide?

# S3 bucket for Glue scripts
resource "aws_s3_bucket" "glue_scripts" {
  bucket = "my-glue-scripts-bucket"
}
resource "aws_s3_bucket" "data" {
bucket = "wikipedia-${var.account_id}"
force_destroy = true
}
resource "aws_iam_role" "role" {
name = "glue-role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
resource "aws_glue_job" "raw_to_prepared" {
for_each = toset(var.dl_s3_prefixes)
name = "${var.dl_glue_job_raw_to_prepared.name}_${each.key}"
role_arn = aws_iam_role.glue_jobs.arn
security_configuration = aws_glue_security_configuration.s3_encrypt_decrypt.name
glue_version = var.dl_glue_job_raw_to_prepared.glue_version
number_of_workers = var.dl_glue_job_raw_to_prepared.number_of_workers
worker_type = var.dl_glue_job_raw_to_prepared.worker_type
@santosh-gouda
santosh-gouda / bash_functions.sh
Created October 24, 2025 17:02 — forked from monobot/bash_functions.sh
bash: useful bash utilities
# my functions
function mkcd {
mkdir -p $1 && eval cd $1
}
function totaldir {
ls -la $1 | awk '{ sum += $5 } { num += 1} END { print num, "ficheros", sum / 1024 , "Kb" }'
}
function total () {
@santosh-gouda
santosh-gouda / utils.sh
Created October 23, 2025 17:55 — forked from Motyak/utils.sh
cool functions
function cap { cat > /tmp/capture.out; }
function cap_copy { tee /tmp/capture.out; }
function ret { cat /tmp/capture.out; }
function to_var { var=$("$@"); }
# Check which process is using a port.
lsof -i tcp:57454
# Bash scrict mode.
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Exit script if you try to use an uninitialized variable.