Skip to content

Instantly share code, notes, and snippets.

View sblack4's full-sized avatar
:shipit:
taking care of business

Steven B sblack4

:shipit:
taking care of business
View GitHub Profile
@sblack4
sblack4 / screw-this-sg.sh
Created March 1, 2023 16:59
Nuke a security group. Deletes all rules referencing it. you may have to turn this multiple times if there are security groups that reference your group in multiple rules
#!/bin/bash
# abbreviations refer to resource IDs
# security group = SG
# security group rule = SGR
# referencing security group = RGS
# SG to delete
SG=$1
@nitrocode
nitrocode / Atlantis-with-awscli-v2.md
Last active December 3, 2024 02:43
Atlantis with awscli v2

Atlantis with awscli v2

Commands

Download the Dockerfile

wget https://gist.githubusercontent.com/nitrocode/62505b0623cd9bf27e4b39a3f98412f5/raw/Dockerfile
@dansmith65
dansmith65 / Install-AWSCLIV2.ps1
Created August 23, 2022 01:33
Install version 2 of AWS CLI via PowerShell
# https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
$dlurl = "https://awscli.amazonaws.com/AWSCLIV2.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
$env:Path += ";C:\Program Files\Amazon\AWSCLIV2"
@sblack4
sblack4 / copy-changes-from-pr.sh
Created June 28, 2022 13:27
Copy all the changes from a PR into another branch or repo
#!/bin/bash
# clone to copies of the same repo, side by side
# add this script to the repo you want to copy from
# the name of the repo you want to copy to
REPO_NAME="myrepo"
# the PR number with the modifications
PR_NUMBER="5"
@ChristopherA
ChristopherA / Mermaid_on_Github_Examples.md
Last active August 1, 2025 21:16
Mermaid on Github Examples

Mermaid on Github Examples

All of these diagrams are dynamically rendered during html display by Github, the images generated from text inside the Github-Flavored Markdown. None are static images. Mermaid support was released for Github on 2022-02-14

Pros & Cons:

  • Pro: You don't need to care about the layout.
  • Con: You cannot control the layout.

Notes:

  • Not all the features of Mermaid (in particular symbols B-->C[fa:fa-ban forbidden], hyperlink and tooltips) are supported by Github.
@sblack4
sblack4 / file-crawler.py
Created August 26, 2021 15:52
Crawls through files and provides hooks to process name or contents
#!/usr/bin/env python3
import glob
import os.path
root_dir = ''
def filename_hook(filename):
print(filename)
@sblack4
sblack4 / nohup-yes.sh
Created June 1, 2021 20:42
nohup stdout and stder to logfile, send process to background
#!/bin/bash
[ -f nohup.log ] && rm -f nohup.log
nohup \
yes \
> nohup.log 2>&1 &
@sblack4
sblack4 / save-sqs-queue.py
Last active August 26, 2021 15:33 — forked from fabiob/save-sqs-queue.py
Saves all messages from an AWS SQS queue into a folder, messages are TXT or JSON
#!/usr/bin/env python3
import argparse
import boto3
import json
import os
from datetime import datetime
parser = argparse.ArgumentParser(
@sblack4
sblack4 / ubuntu-pod.yaml
Created March 25, 2021 14:49
Ubuntu Pod
---
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
restartPolicy: Always
containers:
@sblack4
sblack4 / update-terraform-module.sh
Last active December 7, 2021 20:22
Updates a module to whatever is in our template module: https://github.com/rhythmictech/terraform-terraform-template
#!/bin/bash -e
# run with
# git clone https://gist.github.com/a43c1352d3ddc84f61af43bf38661beb.git
# bash ./a43c1352d3ddc84f61af43bf38661beb/update-terraform-module.sh
git clone https://github.com/rhythmictech/terraform-terraform-template.git tmp
rm -rf .github bin
mv tmp/.github .github