Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
#
# Use the GitHub API to mass-add all repos inside an org to a team.
# (Tweak the GH_PERM value to change the permissions that are granted.)
#
import json
import os
import requests
import sys
#!/usr/bin/env python
from gevent import monkey, joinall, spawn
monkey.patch_all()
import base64
import gzip
import boto3
import sys
@finnigja
finnigja / terraform_aws_cloudformation_stack_debug.log
Last active July 21, 2021 19:31
Debug log extract for aws_cloudformation_stack failure to update to parameters
2021-07-21T11:56:00.135-0700 [INFO] Starting apply for aws_cloudformation_stack.test-stack
2021-07-21T11:56:00.135-0700 [DEBUG] aws_cloudformation_stack.test-stack: applying the planned Update change
2021-07-21T11:56:00.136-0700 [INFO] provider.terraform-provider-aws_v3.50.0_x5: 2021/07/21 11:56:00 [DEBUG] Updating CloudFormation stack: {
Capabilities: ["CAPABILITY_IAM"],
ClientRequestToken: "terraform-20210721185600136300000001",
Parameters: [{
ParameterKey: "TestParameter",
ParameterValue: "new parameter value"
}],
StackName: "arn:aws:cloudformation:us-west-2:586122851592:stack/test-stack/9b81b940-ea52-11eb-835a-0a92558e38af",
# got a list of IPs you need to do lookups for?
# map them back to their ASes with Team Cymru's DNS-based IP-to-ASN lookup service...
$ for asn in $(
for ip in $(cat ips.txt); do
revip=$(echo $ip | awk -F. '{print $4"."$3"."$2"."$1}');
dig +short $revip.origin.asn.cymru.com TXT;
done | cut -d ' ' -f 1 | cut -c 2- | sort | uniq
);
do dig +short AS$asn.asn.cymru.com TXT;
done
@finnigja
finnigja / autonmap.sh
Created May 26, 2023 21:29
Simple nmap scanner / differ
#!/usr/local/bin/bash
SCAN_TARGETS="x.x.x.x/28 x.x.x.x/27 x.x.x.x"
EMAIL_RECIPIENTS="[email protected]"
WEB_URL="https://tools.example.com/scans/scan-$DATE.xml"
RUN_DIRECTORY="/usr/local/scans/data/"
NMAP="/usr/local/bin/nmap"
NDIFF="/usr/local/bin/ndiff"