Skip to content

Instantly share code, notes, and snippets.

View wesley-dean-flexion's full-sized avatar
👍
Awesome

Wes Dean wesley-dean-flexion

👍
Awesome
View GitHub Profile
@wesley-dean
wesley-dean / sanitize.sed
Last active April 20, 2020 15:19
basic, generic sed script to sanitize things like AWS account numbers, IPv4 addresses, SSNs, TINs, etc. from text files, program output, etc.
#!/usr/bin/env -S sed -Ef
# Replace 12-digit strings (AWS Account IDs)
# 123456789012 => 123*********
s/([^0-9])([0-9]{3})[0-9]{9}([^0-9])/\1\2*********\3/g
# Replace Social Security Numbers (SSNs) with dashes =>
# 123-45-6789 => 123-**-****
s/([^0-9])([0-9]{3})-([0-9]{2})-([0-9]{4})([^0-9])/\1\2-**-****\5/g
@wesley-dean
wesley-dean / date_from_now_terraform.sh
Last active July 17, 2020 16:43
This is a shell script that may be used to acquire the time from now using Terraform's External provider
#!/bin/sh
# Terraform's External provider:
# https://www.terraform.io/docs/providers/external/data_source.html
#
# Sample usage (Terraform):
# data "external" "nextmonth" {
# program = ["sh", "${path.module}date_from_now_terraform.sh"]
#
# query = {
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 30, 2024 16:33
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites