Skip to content

Instantly share code, notes, and snippets.

View troydieter's full-sized avatar

Troy Dieter troydieter

View GitHub Profile
@troydieter
troydieter / amazon_s3_object_bucket_cleanup.py
Created May 23, 2024 02:04
Delete Amazon S3 objects and buckets based on a pattern
import boto3
import re
import argparse
# Initialize the S3 client
s3 = boto3.client('s3')
def list_buckets():
"""List all S3 buckets"""
response = s3.list_buckets()
###########################[ ALL PROTECTION 4.9b4 ]##########################
# #
# Author : Opposing a.k.a Sir_Fz (Fayez Zouheiry) #
# Version : 4.9b4 #
# Released: September 08, 2016 #
# Source: https://github.com/sirfz/allprotection.tcl #
## #
# Description: Has all kinds of channel protections + Botnet channel flood #
# protections and private protections. #
# #
@troydieter
troydieter / list.txt
Created August 2, 2023 20:05 — forked from shortjared/list.txt
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@troydieter
troydieter / csr.sh
Created August 2, 2023 17:55
sh-csr
openssl req -new -newkey rsa:4096 -nodes -sha256 -keyout star.spectrumhealth.org.key -subj "/C=US/ST=Michigan/L=Grand Rapids/O=Spectrum Health System/CN=*.spectrumhealth.org" -out star.spectrumhealth.org.csr -config <(
cat <<-EOF
[req]
default_bits = 4096
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
[ req_ext ]
subjectAltName = @alt_names
@troydieter
troydieter / index.js
Created September 6, 2022 17:59
lambda@edge URL redirect
'use strict';
exports.handler = (event, context, callback) => {
/*
* Generate HTTP redirect response with 302 status code and Location header.
*/
const response = {
status: '302',
statusDescription: 'Found',
headers: {
@troydieter
troydieter / redirect_data.json
Created October 22, 2021 04:00
URI Rewrite for Lambda@Edge
{
"/test":"https://www.ask.com/",
"/test2":"https://www.amazon.com/"
}
@troydieter
troydieter / splunk_input_integration.tf
Created September 9, 2021 16:08
Splunk integration
resource "aws_iam_user" "splunk" {
name = var.iam_user_name
force_destroy = true
}
resource "aws_iam_access_key" "splunk" {
user = aws_iam_user.splunk.name
}
resource "aws_iam_user_policy" "splunk_add_on_for_aws" {
@troydieter
troydieter / emr-lb
Created November 16, 2020 01:53
EMR LB
# EMR Load Balancer Creation
# www.troydieter.com
# Certificate and domain
data "aws_acm_certificate" "wildcard-cert" {
domain = "*.example.com"
statuses = ["ISSUED"]
}
### Keybase proof
I hereby claim:
* I am troydieter on github.
* I am troydieter (https://keybase.io/troydieter) on keybase.
* I have a public key ASDuWVbjbbBJv_7wkrrGQV5W6OgE1TcGZCYZVkYGpEJTnAo
To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am troydieter on github.
  • I am tdieter (https://keybase.io/tdieter) on keybase.
  • I have a public key ASD0DzX-QB-gtygmtWHGcnLhEFhdwxGzZeUpXi_XYNmb4go

To claim this, I am signing this object: