Skip to content

Instantly share code, notes, and snippets.

View usmanovbf's full-sized avatar
🗿
My stone face when I code

usmanovbf usmanovbf

🗿
My stone face when I code
  • com.github.usmanovbf.*
  • Remote
View GitHub Profile
@usmanovbf
usmanovbf / init.sh
Created December 29, 2023 13:42
git pull all projects recursively in parallel
find . -name ".git" -type d | sed 's/\/.git//' | xargs -P10 -I{} git -C {} pull
@usmanovbf
usmanovbf / tag_s3_objects_multithreading.py
Created January 8, 2023 09:00
Tag the AWS S3 objects in multithreading way by Boto3 and ThreadPoolExecutor()
import sys
from concurrent.futures import ThreadPoolExecutor, wait
from time import sleep
from typing import List
import boto3
S3_BUCKET = sys.argv[1]
S3_PREFIX = sys.argv[2]
TAG_KEY = sys.argv[3]
@usmanovbf
usmanovbf / .tbls.yml
Created January 3, 2023 20:46
My tbls config file
# .tbls.yml
# Prefix path to generate document
docPath: doc/schema
er:
# Skip generation of ER diagram
skip: false
# ER diagram image format
format: png
@usmanovbf
usmanovbf / aws-s3-objects-with-tags.sh
Last active November 17, 2022 16:47 — forked from filipenf/aws-s3-buckets-with-tags.sh
Print a list of AWS S3 objects along with their tags
#!/bin/bash
# lists all objects along with their tags in the following format:
# key | { tag_name: tag_value }
# depends on AWS CLI and JQ
# Execute it in the next way: ./aws-s3-objects-with-tags.sh replace-by-your-bucket-name
for key in `aws s3api list-objects --bucket $1 | jq -r '.Contents[].Key' | tr -d \"`; do
tags=$(aws s3api get-object-tagging --key $key --bucket $1 | jq -c '.TagSet[] | {(.Key): .Value}' | tr '\n' '\t')
echo $key '|' $tags
done
@usmanovbf
usmanovbf / delete_all_cloudformation_stacks.sh
Created September 5, 2021 11:03
Delete all protected from termation AWS CloudFormation stacks
#!/usr/bin/bash
for stack_name in $(aws cloudformation describe-stacks | jq -r '.Stacks| .[] |.StackName'); do
aws cloudformation update-termination-protection --stack-name $stack_name --no-enable-termination-protection;
aws cloudformation delete-stack --stack-name $stack_name;
done