Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
Get-ChildItem -Recurse -Filter *.heic | % {
$out = Join-Path $_.DirectoryName ($_.BaseName + '.jpg')
$h = if ($_.Length -ge 12) { [byte[]](Get-Content $_.FullName -Encoding Byte -TotalCount 12) }
if (-not $h) {
'{0}: EMPTY ({1} bytes)' -f $_.FullName, $_.Length
} elseif ($h[0] -eq 0xFF -and $h[1] -eq 0xD8) {
Copy-Item $_.FullName $out
} elseif ([Text.Encoding]::ASCII.GetString($h,4,4) -eq 'ftyp') {
magick $_.FullName -quality 90 $out
} else {
Get-ChildItem "C:\Program Files","C:\Program Files (x86)" -Directory -Force | % { $a=(Get-Acl $_.FullName -EA 0).Access.IdentityReference.Value; if ($a -notcontains 'NT AUTHORITY\SYSTEM') { $_.FullName } }
# For any folder it lists, run
takeown /f "<folder>" /r /d y
# then
icacls "<folder>" /reset /t
# to restore the normal inherited permissions
https://claude.ai/share/edd63976-dd6d-4e73-b46d-fc9dfc6b6b4a
                       _/\/\/\_
                      /########\
                      |========}~~
                      |#(o  o)#|  ~
                   _.--'\ -- /'---._
                 .'::.  \    /  .::'.
                / .--.:  \  /  .:::  \
               ( /  .::.  \/ .:::.   \
               | |  .::_(mmm)::::.  .-.)
@easierbycode
easierbycode / diablo-freeze-log.bat
Last active October 14, 2026 03:59
diablo-log.ps1
powershell -NoExit -ExecutionPolicy Bypass -File "%~diablo-freeze-log.ps1"