This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Hide command output for a cleaner experience | |
:: Check if the script is running with admin rights | |
:: This attempts to access a protected system file to trigger a permissions error if not elevated | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
:: If the previous command failed, we are not running as admin | |
if '%errorlevel%' NEQ '0' ( | |
echo Requesting administrative privileges... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Subnet Ping Scanner | |
Scans a specified subnet by sending ICMP ping requests to every IP address in the range, then reports which hosts are responsive and which are not. | |
Features: | |
- Pings all hosts in a given IPv4 subnet (CIDR notation) | |
- Uses concurrent threads for fast scanning | |
- Customizable timeout and worker thread count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ------------------------------------------------------------------------ | |
# setup-vacuum.sh | |
# | |
# This script creates a systemd journal cleanup script and installs a cron | |
# job to run it weekly (Sunday at 2:00 AM). It ensures that journal logs | |
# are automatically trimmed to a maximum of 500MB total disk usage. | |
# | |
# USAGE: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Unity Library and Node Modules Folder Cleaner - Clean Version v2.0 | |
This script recursively searches for Unity Library folders and node_modules folders | |
in a given directory tree, then interactively asks the user whether to delete each one. | |
Usage: | |
python folder_cleaner.py /path/to/main/folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Identifies the "ultimate owner" of a given process by tracing its parent process hierarchy and analyzing its command-line arguments. | |
.DESCRIPTION | |
This script finds all instances of a specified process name and attempts to determine the application that spawned it. | |
It does this by: | |
1. Retrieving all matching processes from the system. | |
2. Checking if the process's command-line arguments include `--webview-exe-name=`, which often reveals the true owner. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List the directories in PATH on Windows for either User or Machine | |
# Specify the target (User or Machine) | |
# Usage .\path_pretty_print.ps1 -Target Machine | |
# or .\path_pretty_print.ps1 -Target User | |
param( | |
[Parameter(Mandatory=$false)] | |
[ValidateSet("User", "Machine")] | |
[string]$Target = "User" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove Duplicate paths in the PATH on Windows (for either User or Machine). Has an optional 'Dry Run' mode | |
# Specify the target (User or Machine) and dry run mode | |
# example... | |
# .\remove_path_duplicates.ps1 -Target Machine -DryRun true | |
# .\remove_path_duplicates.ps1 -Target User -DryRun false | |
param( | |
[Parameter(Mandatory=$false)] | |
[ValidateSet("User", "Machine")] | |
[string]$Target = "User", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Repairs the PATH variable for VS Code (if it gets lost or removed). | |
# | |
# Specify the target (User or Machine) and dry run mode | |
# .\repair_vscode_path.ps1 -Target Machine -DryRun true | |
# | |
# If dry run is true (default) the it only shows you what it would | |
# have done if dryrun had been false... it's a safety thing! | |
# Specify the target (User or Machine) and dry run mode | |
param( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Powershell script to remove a directory from the PATH on Windows for either System or User | |
# Can optionally run it in dry run mode to be certain it's going to do what you require | |
# | |
# Specify the target (User or Machine), dry run mode, and directory to remove | |
# Examples | |
# .\remove_from_path.ps1 -DirectoryToRemove "C:\Path\To\Directory" | |
# This will remove C:\Path\To\Directory from the user PATH. | |
# | |
# .\remove_from_path.ps1 -DirectoryToRemove "C:\Path\To\Directory" -Target Machine | |
# This will remove C:\Path\To\Directory from the system PATH. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Original tool from Hannes Paulsson | |
From: https://gist.github.com/Happsson/af02d7a644db6b44bc834c8699bf3495 | |
Updated 2023/05/15 by Mark Castle (and ChatGPT :P) to add excluded paths and to also | |
give the option of opening files in the current editor, plus some minor tweaks | |
to keep re-sharper happy. | |
https://gist.github.com/markcastle/be019a471b44016d73c11f308feb5249 |
NewerOlder