Skip to content

Instantly share code, notes, and snippets.

View neuralpain's full-sized avatar
💻
Solving problems

neuralpain neuralpain

💻
Solving problems
View GitHub Profile
@neuralpain
neuralpain / cmdUAC.cmd
Last active August 8, 2024 02:59
Invoke UAC prompt for Windows Batch scripts.
:: fsutil [...] is a universal method for checking
:: administrator privilages. works from Windows XP
:: and onwards
fsutil dirty query %systemdrive% >nul
:: if error, we do not have admin.
if %ERRORLEVEL% NEQ 0 (
cls & echo.
echo This script requires administrative priviledges.
echo Attempting to elevate...
goto UAC_Prompt
@neuralpain
neuralpain / Compare-IsValidHash.ps1
Last active May 1, 2024 07:37
PowerShell: Get hash from file and compare against the original
function Compare-IsValidHash {
<#
.SYNOPSIS
Compares the file hash (MD5) of the specified file against the provided hash.
.DESCRIPTION
This function uses PowerShell's Get-FileHash cmdlet to retrieve the hash of the specified file.
It then compares the retrieved hash against the provided hash. If the two hashes match, the function returns $true,
otherwise it returns $false.
@neuralpain
neuralpain / WSL-KALI-APT-UPDATE-ERROR.md
Created September 21, 2022 01:07 — forked from MooreDerek/WSL-KALI-APT-UPDATE-ERROR.md
Installing Kali on WSL getting apt update error

Installing Kali

wsl --install -d kali-linux

When terminal starts up try running

sudo apt upgrade and get the following error:

Get:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease [30.6 kB]
Err:1 http://wlglam.fsmg.org.nz/kali kali-rolling InRelease
 The following signatures were invalid: EXPKEYSIG ED444FF07D8D0BF6 Kali Linux Repository 
@neuralpain
neuralpain / ghdt-crlf-fix.sh
Last active September 20, 2022 06:07
Bug fix for GitHub desktop changing line endings from LF to CRLF
# fix issue with GitHub desktop changing line endings from LF to CRLF
# go to Repository -> Open in {terminal}
# execute the code below in the exact order
git config core.eol lf
git config core.autocrlf input