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 March 29, 2023 15:39
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"
@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
@xaosaki
xaosaki / hide-slack-sidebar-icons
Last active November 23, 2020 19:47 — forked from ryanhatfield/hide-slack-sidebar-icons
Hide Slack Sidebar Icons
#! /usr/bin/env bash
##############
##
## A script to inject a custom style into Slack that hides the new sidebar icons.
## This script has very little error catching or extra debug output
##
## Run at your own risk.
## Anything done here can be "uninstalled" by reinstalling Slack
##
## To run Slack in debug mode, run the following: