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
@aessing
aessing / install-AzCopy.ps1
Last active January 30, 2024 12:59
Install AzCopy on Windows (PowerShell)
# =============================================================================
# Install AzCopy on Windows (PowerShell)
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
# https://github.com/Azure/azure-storage-azcopy
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://www.andre-essing.de/)
# (https://github.com/aessing)
# (https://twitter.com/aessing)
# (https://www.linkedin.com/in/aessing/)
# -----------------------------------------------------------------------------
@sblack4
sblack4 / 01PostgreSQLSnippets.md
Last active August 13, 2020 17:15 — forked from DominikSerafin/01PostgreSQLSnippets.md
PostgreSQL Snippets
@sblack4
sblack4 / example.md
Last active February 9, 2021 14:26 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@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 / get_alphabetized_terraform_variables.sh
Created June 14, 2020 21:41
Get a list of all your terraform variables, alphabetized
#!/bin/bash
# requires:
# - https://github.com/hashicorp/terraform-config-inspect
# - jq
# - sort
terraform-config-inspect --json | jq -r '.variables | keys | .[]' | sort
#!/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 / comparing_file_types.md
Created May 3, 2020 16:02
Compare file types with bash

Compare File Types

Create the following script. The names uat and prod simply refer to the two filesystems this script was developed to test. They can be renamed to anything.

#!/bin/bash
uat=`file -bi "/mnt/my_files/${1}"`
prod=`file -bi "/mnt/my_other_files/${1}"`
@fabiob
fabiob / save-sqs-queue.py
Last active January 5, 2024 07:05 — forked from kern/save-sqs-queue.py
Saves all messages from an AWS SQS queue into a folder
#!/usr/bin/env python3
import argparse
import boto3
import json
import os
from datetime import datetime
parser = argparse.ArgumentParser(
description='Saves all messages from an AWS SQS queue into a folder.')
@enricop89
enricop89 / cloudformation-role.json
Created September 27, 2019 13:59
Serverless IAM Permission
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"lambda:CreateFunction",
"lambda:ListVersionsByFunction",
"dynamodb:DeleteItem",
@sblack4
sblack4 / README.md
Last active January 15, 2022 21:01
How to develop AMIs with Packer and Ansible

How to develop AMIs with Packer and Ansible

Things I wish they'd told me

Develop the Ansible role locally

When you try to debug something in packer by making a change in the Ansible role you want to see the effect immediately. To do that just symlink your project in ~/.ansible/roles with whatever name you are referencing it with. So, for example, a project refered to as rhythmic.jetty which is locally in ansible-role-jetty:

`ln -s $(pwd)/ansible-role-jetty ~/.ansible/roles/rhythmic.jetty`