Skip to content

Instantly share code, notes, and snippets.

@IAmStoxe
IAmStoxe / wireguard_pihole_install.sh
Created September 1, 2020 05:33 — forked from sethenoka/wireguard_pihole_install.sh
A script for installing a Wireguard VPN with Pi-Hole (Unbound) recursive DNS
#!/bin/bash
# This file is designed to spin up a Wireguard VPN quickly and easily,
# including configuring Pi-Hole as a recursive local DNS server using
# Unbound to block ads a the DNS level
#
# Make sure to change the public/private keys before running the script
# Also change the IPs, IP ranges, and listening port if desired
# add wireguard repo
sudo add-apt-repository ppa:wireguard/wireguard -y
@IAmStoxe
IAmStoxe / Hard Coded Host.json
Created May 28, 2020 20:05
How to launch a Exchange Management Shell remotely with Windows Terminal. Add these to your settings.json for Windows Terminal to utilize
// Replace SERVER_NAME with the FQDN of your exchange server before using
{
"name": "PS Exchange Management Shell",
"tabTitle": "PS Exchange Management Shell",
"commandline": "powershell.exe -NoProfile -NoExit -Command Enter-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'http://SERVER_NAME/PowerShell/' -Credential (Get-Credential)"
}
@IAmStoxe
IAmStoxe / loop-json.sh
Last active June 17, 2025 17:04
This example shows you how to utilize jq to loop bash script through an array of JSON values.
jsonData='[{"name": "name#1","value": "value#1"},{"name": "name#2","value": "value#2"}]'
for row in $(echo "${jsonData}" | jq -r '.[] | @base64'); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
# OPTIONAL
# Set each property of the row to a variable
name=$(_jq '.name')
value=$(_jq '.value')

Let me create a README for your GIST:

Azure Web App Log Streaming Utility

A robust command-line utility for streaming logs from Azure Web Apps with support for deployment slots, local file logging, and automatic reconnection.

Features

  • Stream logs from any Azure Web App
  • Support for deployment slots

Recent Files Tracker for Obsidian

Track and display recently modified files across your Obsidian vault.

Features

  • Monitor files from specific folders
  • Group by subfolders
  • Customizable time periods and status indicators
  • Sort by priority

Gist README

Generate Sprites for All Videos in a Folder

This script loops through all video files in a specified folder, extracts a set number of frames (20 by default), and generates a single sprite sheet (vertical strip) for each video.

How It Works

  1. Input Folder: The first argument is the path to the folder containing video files.
  2. Output Folder: The second argument is the path to the folder where generated sprite sheets will be saved.
@IAmStoxe
IAmStoxe / ElevatedWindowsTerminal.md
Created November 6, 2024 18:35
This configuration allows you to launch a Windows Terminal session under your DA account directly from your standard account, giving you elevated access when needed without switching users entirely.

Step-by-Step Guide for Configuring an Elevated DA Account Profile in Windows Terminal

  1. Open Windows Terminal Settings:

    • Open Windows Terminal.
    • Click on the dropdown arrow and select Settings.
  2. Add a New Profile:

    • In the Settings panel, navigate to Profiles and click on Add a new profile.
    • Choose PowerShell (or Command Prompt, depending on your preference) as the base profile.
@IAmStoxe
IAmStoxe / Forward-Port.ps1
Created August 28, 2024 22:42
Forward port to WSL
# Define variables
$port = 80
$wslIp = (wsl hostname -I | ForEach-Object { $_.Split(" ")[0] }).Trim() # Get the first IP address of the WSL instance
$firewallRuleName = "AllowPort$portToWSL"
$netshRuleName = "WSL Port Forwarding $port"
# Add a firewall rule to allow inbound traffic on the specified port
Write-Host "Adding firewall rule to allow inbound traffic on port $port..."
New-NetFirewallRule -DisplayName $firewallRuleName -Direction Inbound -LocalPort $port -Protocol TCP -Action Allow
@IAmStoxe
IAmStoxe / Kill-PortProcess.ps1
Created June 3, 2024 19:05
This script finds and terminates the process listening on specified port.
# Find the process ID (PID) listening on port
$port = 3000
$processId = Get-NetTCPConnection -LocalPort $port | Select-Object -ExpandProperty OwningProcess
# Check if processId is found
if ($processId) {
# Kill the process with the found processId
Stop-Process -Id $processId -Force
Write-Output "Process with PID $processId listening on port 3000 has been terminated."
} else {
@IAmStoxe
IAmStoxe / BLOCKALL.bat
Created December 30, 2018 04:46
You can use a Simple Batch File. Open Notepad and copy/paste the script below into a blank document. Save the file as BLOCKALL.BAT. Now copy that file to the same directory as the EXEs you want to block and double click it. It will add outbound rules to advanced Windows Firewall settings blocking all EXEs in that folder and sub-folders as well. …
@ setlocal enableextensions
@ cd /d "%~dp0"
for /R %%a in (*.exe) do (
netsh advfirewall firewall add rule name="Blocked with Batchfile %%a" dir=out program="%%a" action=block
)