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 / Install-AWSCLIV2.ps1
Created May 10, 2024 16:00 — forked from dansmith65/Install-AWSCLIV2.ps1
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'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
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 / ecs-run
Last active April 15, 2024 17:36 — forked from vcastellm/ecs-run
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
# looops through subdirs
# look for file or symlink named Makeifle
# creates a new one
for folder in $(echo *); do
if [ -d $folder ]; then
cd $folder
# test for file
if [ -f "Makefile" ]
@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
#!/usr/bin/env python
"""
sort terraform variables
it's easy to do, just follow these steps:
python sort_terraform_variables.py variables.tf > sorted_variables.tf
mv sorted_variables.tf variables.tf
"""
from __future__ import print_function
import sys
@sblack4
sblack4 / azure-pipelines.yml
Created October 7, 2019 15:40
Azure Pipelines Cheatsheet
name: name_of_your_pipeline
trigger:
- master
- other_branches
pool:
vmImage: 'ubuntu-latest'
variables: # variables: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables
@sblack4
sblack4 / install-kafka-minimal.sh
Created January 2, 2019 17:24
Bash script to install the most minimal Kafka
#!/bin/bash
# this script installs and starts kafka
# the most minimal installation of kafka possible
KAFKA_URL=http://mirror.olnevhost.net/pub/apache/kafka/2.1.0/kafka_2.11-2.1.0.tgz
install_kafka() {
@sblack4
sblack4 / terrorize_ssm.py
Last active August 22, 2022 20:57
Script to turn all the SSM parameters into terraform resources. Uses Pagination. Can also output JSON.
#!/bin/env python3
"""
Script to turn all the SSM parameters in one region into terraform resources
it can also turn them into JSON with get_parameters_with_values_as_json()
Use different regions with the env var AWS_DEFAULT_REGION
ie for Northern Cali use:
export AWS_DEFAULT_REGION=us-west-1
"""
@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 / 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)