Skip to content

Instantly share code, notes, and snippets.

View cdot65's full-sized avatar
πŸ’
πŸ’¨

Calvin Remsburg cdot65

πŸ’
πŸ’¨
  • Palo Alto Networks
  • Europa
View GitHub Profile
@cdot65
cdot65 / file_sizes.sh
Created July 15, 2023 13:12
To iterate over all folders in your current directory, and display the sizes of files in each directory sorted by size, you can use the du and sort commands in Bash. The du command estimates file and directory space usage, while sort can sort lines in text files.
#!/bin/bash
for d in */ ; do
echo "Processing directory: $d"
find "$d" -type f -exec du -ah {} \; | sort -rh | head -n 10
done
@cdot65
cdot65 / delete_files_by_name.sh
Created July 15, 2023 13:38
Loop through the arguments and find the files and folders to be deleted
#!/bin/bash
# Check if there are arguments
if [ $# -eq 0 ]; then
echo "No arguments supplied. Please provide the names of the files or directories to be deleted."
exit 1
fi
# Loop through the arguments and find the files and folders to be deleted
for name in "$@"; do
(function () {
/**
* This script performs a POST request to update an external XML configuration.
* The goal is to insert a new URL as a <member> into an existing <list> for a specified URL category.
*
* Steps:
* 1. Retrieve and log input variables: the website URL, URL category, and request number.
* 2. Build an x-www-form-urlencoded request body:
* - Encode an XPath string that points to the configuration entry for the URL category.
* - Create an XML fragment with the new URL.
* Always check for a PRD (Product Requirements Document) before starting a new task and follow it closely
* Look for comprehensive project documentation to understand requirements before making changes
* Focus only on code areas relevant to the assigned task
* Prefer iterating on existing code rather than creating new solutions
* Keep solutions simple and avoid introducing unnecessary complexity
* If you run into issues that take multiple iterations to fix. After you fix it, write up a description of the problem and how we fixed it and store it in a folder called "fixes", in an individual .md file with the name of the issue. Only do this for major issues and solutions.
* For issues that are taking multiple iterations to fix, check the fixes folder for previous fixes and see if the same issue has been fixed before.
* Keep a running list of patterns and technology used in the README.md file
* Reference the README.md file for patterns and technology used in the project
* If you run into the same persistent error
@cdot65
cdot65 / panorama-rule-hit-count-proxy.py
Created September 16, 2025 10:31
Panorama Firewall Hit Count Script
#!/usr/bin/env python3
"""
Script to query Panorama for connected firewall serial numbers
and then iterate over them to collect rule hit counts from each firewall.
"""
import requests
import xml.etree.ElementTree as ET
import json
from typing import List, Dict, Optional
@cdot65
cdot65 / microgpt.py
Created February 20, 2026 09:38 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@cdot65
cdot65 / prompts.md
Created February 26, 2026 20:41 — forked from mberman84/prompts.md
Prompts

OpenClaw: Extracted Prompts (Generalized)

22 copy/paste-ready prompts for building your own AI agent system. Each prompt builds a functional system or implements a proven best practice you can hand to an AI coding assistant.

Replace placeholders like <your-workspace>, <your-messaging-platform>, and <your-model> with your own values.


1. Personal CRM