Skip to content

Instantly share code, notes, and snippets.

View imbgar's full-sized avatar

Brandon Garcia imbgar

  • San Antonio, Tx
View GitHub Profile
https://realpython.com/testing-third-party-apis-with-mock-servers/
{"lastUpload":"2022-08-01T16:46:28.557Z","extensionVersion":"v3.4.3"}
@imbgar
imbgar / terragrunt_light.js
Created May 11, 2020 03:41 — forked from dmattia/terragrunt_light.js
A less verbose terragrunt
/**
* Wrapper around terragrunt to display output succinctly on Atlantis.
*
* Terragrunt is notoriously verbose, which can cause Atlantis to output
* hundreds of comments on single PRs, which can be annoying.
*
* This script will output just the final plan for resources to update on
* successful terragrunt runs, but will output all terragrunt output on
* errors.
*/
@imbgar
imbgar / terragrunt_light.js
Created May 11, 2020 03:41 — forked from dmattia/terragrunt_light.js
A less verbose terragrunt
/**
* Wrapper around terragrunt to display output succinctly on Atlantis.
*
* Terragrunt is notoriously verbose, which can cause Atlantis to output
* hundreds of comments on single PRs, which can be annoying.
*
* This script will output just the final plan for resources to update on
* successful terragrunt runs, but will output all terragrunt output on
* errors.
*/
@imbgar
imbgar / Empty S3 Bucket
Created February 20, 2020 14:29
boto3 empty a bucket
import boto3
# very secure credential storage
so_access = ''
much_secret = ''
bucket = ''
# make a client with keys
client = boto3.client('s3', aws_access_key_id=so_access, aws_secret_access_key=much_secret)
@imbgar
imbgar / postgres_mgmt.sql
Last active December 12, 2019 03:41
postgres
-- Identify long running
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
query,
state
FROM pg_stat_activity
WHERE (now() - pg_stat_activity.query_start) > interval '5 minutes' order by duration desc;
-- Kill it slowly
@imbgar
imbgar / currently_running.sql
Created October 30, 2019 01:13
SQL Server currently running queries
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext