Skip to content

Instantly share code, notes, and snippets.

View dapacruz's full-sized avatar

David Cruz dapacruz

View GitHub Profile
@dapacruz
dapacruz / pan-group-sort.py
Created July 9, 2020 16:24
Sorts PAN-OS address/service group object members in XML formatted configurations
#!/usr/bin/env python3
'''PAN-OS Group Object Sorter
pan-group-sort.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@dapacruz
dapacruz / get-wan-circuit-info.py
Created July 20, 2020 18:30
Exports WAN circuit details to an Excel spreadsheet and sends to recipients via email
#!/usr/bin/env python3
'''Parse WAN circuit details from router configurations
get-wan-circuit-info.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@dapacruz
dapacruz / panw-remove-tags.py
Last active January 27, 2021 16:25
Removes tags from Panorama
#!/usr/bin/env python3
'''Removes tags from Panorama
panw-remove-tags.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@dapacruz
dapacruz / panorama-dynamic-inventory.py
Created August 7, 2020 01:20
Panorama Dynamic Inventory for Ansible Tower
#!/usr/bin/env python2.7
import argparse
import json
import os
import sys
import urllib
import urllib2
import xml.etree.ElementTree as ET
@dapacruz
dapacruz / generate-ip-addresses.py
Created February 8, 2021 18:02
Generate a list of IP addresses
#!/usr/bin/env python3
'''Generate a list of IP addresses
generate-ip-addresses.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.6
@dapacruz
dapacruz / citrix_ctrl_alt_win.json
Last active March 10, 2021 01:00 — forked from jdleslie/citrix_ctrl_alt_win.json
Map Apple modifiers (Ctrl, Option, Command) to Windows modifiers (Ctrl, Win, Alt) in Citrix Workspace using Karabiner Elements, with working Alt+Tab and Windows key shortcuts
{
"title": "Citrix Receiver/Workspace modifiers for Ctrl, Alt, Windows order",
"rules": [
{
"description": "In Citrix, add fn modifier to tab so it is forwarded",
"manipulators": [
{
"from": {
"key_code": "tab",
"modifiers": { "optional": [ "any" ] }
@dapacruz
dapacruz / validate-security-policies.py
Created July 25, 2022 22:34
Validates recently created/modified Palo Alto Networks security policies
#!/usr/bin/env python3
'''Validates recently created/modified security policies
validate-security-policies.py
Author: David Cruz (davidcruz72@gmail.com)
Python version >= 3.9
Required Python packages:
None
Features:
Checks for duplicate address objects
@dapacruz
dapacruz / waitForKeyElements.js
Last active April 29, 2025 17:38
A utility function, for user scripts, that detects and handles AJAXed content.
/**
* A utility function for userscripts that detects and handles AJAXed content.
*
* @example
* waitForKeyElements("div.comments", (element) => {
* element.innerHTML = "This text inserted by waitForKeyElements().";
* });
*
* waitForKeyElements(() => {
* const iframe = document.querySelector('iframe');