Skip to content

Instantly share code, notes, and snippets.

View thany's full-sized avatar

Martijn Saly thany

  • iO
  • Netherlands
  • 04:09 (UTC +02:00)
View GitHub Profile
@thany
thany / get-denso-mapcode.sh
Last active April 28, 2021 09:05
Get Denso Mapcode from Denso server using a bash command
wget http://post.denso-communications.jp/dn/navicon_start.php --method=POST --body-data="lat=35.872722875676274&lng=139.73869658316153" -O - -q | grep -Po '(?<=id="mapcode">)([^<]*)'
@thany
thany / suppress-terminate-batch-job.cmd
Last active November 6, 2019 14:02
A CMD script that suppresses the "Terminate batch job" question upon pressing Ctrl+C, and ends the script immediately instead
@echo off
if "%~1"=="-FIXED_CTRL_C" (
shift
) else (
call <nul %0 -FIXED_CTRL_C %*
goto :EOF
)
rem DO STUFF HERE
@thany
thany / non-cancellable.cmd
Created November 6, 2019 14:01
A CMD script that is not cancellable by pressing Ctrl+C
@echo off
setlocal
if "%~1" equ "NonCancelable" goto NonCancelable
start "" /B cmd /C "%~F0" NonCancelable
exit
:NonCancelable
rem DO STUFF HERE
@thany
thany / Lightroom filenames & creators.sql
Last active June 7, 2023 22:54
Getting full image filenames + creators from a Lightroom catalog
select
replace(AgLibraryRootFolder.absolutePath || AgLibraryFolder.pathFromRoot || AgLibraryFile.idx_filename, '/', '\') as filename,
AgInternedIptcCreator.value as creator
from AgHarvestedIptcMetadata
left join AgInternedIptcCreator on AgHarvestedIptcMetadata.creatorRef=AgInternedIptcCreator.id_local
left join Adobe_images on AgHarvestedIptcMetadata.image=Adobe_images.id_local
left join AgLibraryFile on Adobe_images.rootFile=AgLibraryFile.id_local
left join AgLibraryFolder on AgLibraryFile.folder=AgLibraryFolder.id_local
@thany
thany / Revive GlobalProtect.cmd
Created August 23, 2023 13:16
Revive GlobalProtect VPN service
@echo off
echo Checking for administrative permissions
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
echo Adding to autoruns
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v GlobalProtect /t REG_EXPAND_SZ /d "%%ProgramFiles%%\Palo Alto Networks\GlobalProtect\PanGPA.exe" /f /reg:64
echo Setting service to automatic start
sc config PanGPS start= auto
@thany
thany / Kill GlobalProtect.cmd
Created August 23, 2023 13:17
Kill GlobalProtect VPN service
@echo off
echo Checking for administrative permissions
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
echo Deleting from autoruns
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v GlobalProtect /f /reg:64
echo Stopping service
sc stop PanGPS