Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
ryanvgates / add_topics.py
Created March 26, 2024 18:54
AWS MSK Create & List Topics
from confluent_kafka.admin import AdminClient, NewTopic
import os
a = AdminClient(
{
'bootstrap.servers': os.environ.get("AWS_KAFKA_BOOTSTRAP_SERVERS"),
'security.protocol': 'SASL_SSL',
'sasl.mechanisms': 'AWS_MSK_IAM',
'sasl.aws.access.key.id': os.environ.get("AWS_ACCESS_KEY_ID"),
'sasl.aws.secret.access.key': os.environ.get("AWS_SECRET_ACCESS_KEY"),
@ryanvgates
ryanvgates / output.bash
Created February 16, 2024 22:02
Generate all PlantUML diagrams - Output
┌─[user@laptop] - [~/my-project] - [Fri Feb 16, 16:58]
└─[$] <git:(feature-branch)> find . -type f -iname "*.puml" -exec echo "Generating plantuml diagram for {}" \; -exec plantuml {} \;
Generating plantuml diagram for ./project1/footer.puml
Generating plantuml diagram for ./project1/1 Context.puml
Generating plantuml diagram for ./project1/header.puml
Generating plantuml diagram for ./project1/2 Container.puml
Generating plantuml diagram for ./project2/footer.puml
Generating plantuml diagram for ./project2/1 Context.puml
Generating plantuml diagram for ./project2/header.puml
@ryanvgates
ryanvgates / command.bash
Last active February 16, 2024 21:58
Generate all PlantUML diagrams - Command
find . -type f -iname "*.puml" -exec echo "Generating plantuml diagram for {}" \; -exec plantuml {} \;
@ryanvgates
ryanvgates / output.sh
Created February 14, 2024 20:20
Install Plant UML on Mac - PlantUML - Alread Installed
┌─[user@laptop] - [~] - [Wed Feb 14, 15:19]
└─[$] <> brew install plantuml
Warning: plantuml 1.2024.1 is already installed and up-to-date.
To reinstall 1.2024.1, run:
brew reinstall plantuml
@ryanvgates
ryanvgates / output.sh
Created February 14, 2024 20:18
Install Plant UML on Mac - PlantUML - New Install
┌─[user@laptop] - [~] - [Wed Feb 14, 15:16]
└─[$] <> brew install plantuml
==> Downloading https://ghcr.io/v2/homebrew/core/plantuml/manifests/1.2024.1
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/34e1194efa92f43fc1d37f47254e076fc6defb4330b5500d36e5685aed26e3e6--plantuml-1.2024.1.bottle_manifest.json
==> Fetching plantuml
==> Downloading https://ghcr.io/v2/homebrew/core/plantuml/blobs/sha256:3f9404a546ff9e549e1b640e77515b3815819a4b36239fc9b17effe8135c65e3
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/2d560846774dbc633917be48445efd06524e670aaf0b7299d210b7cff5c91afa--plantuml--1.2024.1.all.bottle.tar.gz
==> Pouring plantuml--1.2024.1.all.bottle.tar.gz
🍺 /opt/homebrew/Cellar/plantuml/1.2024.1: 4 files, 11.3MB
==> Running `brew cleanup plantuml`...
@ryanvgates
ryanvgates / output.sh
Created February 14, 2024 20:15
Install Plant UML on Mac - Java - New Install
┌─[user@laptop] - [~] - [Wed Feb 14, 15:13]
└─[$] <> brew install java
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##O=- # #
==> Downloading https://formulae.brew.sh/api/cask.jws.json
############################################################################################################################################################################################################# 100.0%
Warning: Cask homebrew/cask/java was renamed to homebrew/core/java.
==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/manifests/21.0.2
Already downloaded: /Users/user/Library/Caches/Homebrew/downloads/d437bb150fa297f0ee7f7f26594cb0a1e7aec55a45ec6570ed8660a033b7c3f9--openjdk-21.0.2.bottle_manifest.json
==> Fetching openjdk
@ryanvgates
ryanvgates / output.sh
Created February 14, 2024 20:10
Install Plant UML on Mac - Java - Already Installed
┌─[user@laptop] - [~] - [Wed Feb 14, 14:55]
└─[$] <> brew install java
==> Downloading https://formulae.brew.sh/api/formula.jws.json
############################################################################################################################################################################################################# 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
############################################################################################################################################################################################################# 100.0%
Warning: Cask homebrew/cask/java was renamed to homebrew/core/java.
Warning: openjdk 21.0.2 is already installed and up-to-date.
To reinstall 21.0.2, run:
brew reinstall openjdk
@ryanvgates
ryanvgates / solution.sh
Created August 4, 2023 20:21
Bash query json
read -a APP_NAMES < <(cat environments.json | jq -r '.[].apps' | jq -s 'add' | jq 'unique' | jq '.[]' | tr '\n' ' ' )
@ryanvgates
ryanvgates / output.json
Created August 4, 2023 20:16
Bash query json
{
"env1":
{
"apps":
[
"app1",
"app2",
"app3",
"app4"
]
@ryanvgates
ryanvgates / check_stacks.sh
Created July 5, 2023 20:12
Terraform staying current
IFS=$'\n' read -rd '' -A stacks <<<"$(terraspace list -t stack)"
for stack in $stacks; do
echo "Planning ${stack#$prefix}"
output=$(terraspace plan ${stack#$prefix} 2>&1)
echo $(echo $output | grep "Plan:")
done