Skip to content

Instantly share code, notes, and snippets.

View kmcquade's full-sized avatar

Kinnaird McQuade kmcquade

View GitHub Profile

I'm using zsh on a mac.

Always update the docs/COMPLETE.md document with what you did, and add any appropriate followup ideas to docs/TODO.md

Store any useful knowledge that you might want to refer to later that are specific to this repository in docs/KNOWLEDGE.md

Store top level knowledge about the design in docs/DESIGN.md as you go along

Store a working PRD in docs/PRD.md as you go along.

@kmcquade
kmcquade / README.md
Created January 21, 2025 17:46
libxmlsec1 installation fix

This xmlsec github issue on fixing pip install xmlsec was really annoying to parse through. I pumped the contents into ChatGPT, which got me most of the way, and then I had to follow one of the other comments to get it working. I am documenting it here in case it helps someone else or if I need to reference it in the future.

  1. Revert to libxmlsec1 v1.2.37:
    • Use Homebrew to uninstall the current version:
      brew uninstall libxmlsec1
    • Download the previous version of the formula:
@kmcquade
kmcquade / merge_files.py
Last active November 16, 2024 20:48
Merge GitHub Repository files for usage in an LLM. Optionally split into smaller chunks
"""
This script merges all files in a specified repository directory into a single text file.
It includes features for filtering, excluding specific directories, and splitting the output
into smaller files. By default, it excludes test-related directories unless specified otherwise.
### Man page
usage: merge_files.py [-h] [-o OUTPUT] [--split SPLIT] [--filter-extensions FILTER_EXTENSIONS] [--no-exclude-tests] repo_path
Merge all files in a repository into a single text file.
@kmcquade
kmcquade / README.md
Created November 5, 2024 15:08
JWT None example app

JWT None example app

Start the app:

docker compose up -d

Get the JWT:

This is an interesting exercise in how ZAP handles Swagger files on import. My primary concern is that ZAP does not support importing injectable URL parameters from a Swagger file, and interprets a path like {id} as a literal id string.

You can see the difference between the endpoints that NightVision discovers (on the left) and the spidered URLs from ZAP (on the right): https://www.diffchecker.com/JKaeR6rg/ (expires in 30 days).

If you clone this gist, you can run python3 print_endpoints.py to print the endpoints that are in swagger-paths.csv (the ones discovered by NightVision).

And you can see the endpoints that are discovered by the ZAP Spider in spidered-paths.csv.

Observation

@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:
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 / 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"