Skip to content

Instantly share code, notes, and snippets.

@fahadysf
fahadysf / gist:67342e359f334e58841484ee9f8767a4
Created September 10, 2025 09:25
Powershell-String-Replacement.ps1
# Set the paths for your files
$replacementListFile = "C:\temp\replace.txt"
$targetFile = "C:\temp\target.xml"
# Read the contents of the replacement list file
$replacementList = Get-Content -Path $replacementListFile
# Read the content of the target file into a single string
$content = Get-Content -Path $targetFile -Raw
@fahadysf
fahadysf / ghostty.config
Created September 9, 2025 10:56
Ghostty Dark Config
font-family = "JetBrainsMono Nerd Font Mono"
font-style = Regular
font-size = 13
font-thicken = true
adjust-underline-position = 40%
adjust-underline-thickness = -60%
cursor-style = block
cursor-style-blink = false
#!/bin/sh
dnsserver=“your-dns-server.ns.cloudflare.com"
host="your-record-name"
domain_name=“yourdomain.com”
cf_user_email="[email protected]"
cf_api_key=“—get-your-own-api-key--“
cf_zone_id="—get-your-own-zone-id—“”
cf_record_id=“check-your-own-record-id”
dnsrecord=$host.$domain_name
#!/usr/bin/env python3
"""
SCTP Client/Server
Author: Fahad Yousuf
This script implements a simple SCTP client/server using Python's socket module.
The server listens on port 62324 and the client connects to the server on the same port.
"""
#!/bin/bash
#
# Script to print out the current power cycles and capacity of Macbooks
# which provide this info.
# -------
CYCLE_COUNT=`system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'`
MAX_CAPACYTY=`system_profiler SPPowerDataType | grep "Maximum Capacity" | awk '{print $3}'`
echo "Cycle Count: $CYCLE_COUNT"
@fahadysf
fahadysf / Information.md
Created January 9, 2024 13:09
Kubernetes - Cloud Native Technologies Info
@fahadysf
fahadysf / user-creator.ps1
Last active December 7, 2023 08:22
Powershell Local DB User Creator for Panorama Template
### Needed stuff
Add-Type -AssemblyName System.Web
### GLOBAL Settings
$filePath = "C:\code\usernames.txt_CHANGE_ME"
$deviceUrl = "https://panorama_ip_or_fqdn_change_me"
$username = "admin"
$templateName = "template_name_change_me"
$Debug = $true
@fahadysf
fahadysf / panos-config-backup.py
Created August 31, 2023 08:54
Simple Python script to backup the running config from PAN-OS Firewalls or Panorama
import os
import sys
import requests
import argparse
import getpass
import time
# This is a simple Python script which can be run as a Scheduled Task
# to backup the running config from PAN-OS Firewalls or Panorama. Tested to work with
# Python 3.11.5 on Mac OSX and Windows Server 2019.
@fahadysf
fahadysf / panos-backup.ps1
Last active August 31, 2023 09:02
Powershell Script to backup PAN-OS Running Config
# This is a simple powershell script which can be run as a Scheduled Task
# to backup the running config from PAN-OS Firewalls. Tested to work with
# Powershell 5.1 (the default on Windows Server 2012/2016). For more
# up to date versions of powershell you can remove the add-type /
# New-Object TrustAllCertsPolicy section and use -SkipCertificateCheck
# in Invoke-WebRequest
#
# Usage Instructions:
# 1. Update the values of $panosHost and $panosUsername below at the start of the file.
# 2. Run once in the Powershell Promt to generate the API Key file
@fahadysf
fahadysf / xsoar-menu-hide.js
Created April 17, 2023 07:27
UserScript to Hide Navigation Elements in XSOAR
// ==UserScript==
// @name Dashboard Cleaner
// @namespace http://tampermonkey.net/
// @version 0.1b
// @description Removes extra content from XSOAR dashboard
// @author Pandy Brijesh <[email protected]> & Fahad Yousuf <[email protected]>
// @match https://xsoar.fy.loc/*
// @grant none
// ==/UserScript==
(function() {