Skip to content

Instantly share code, notes, and snippets.

@maphew
maphew / 8-Stitches.md
Last active May 18, 2023 07:00
8 Stitches
View 8-Stitches.md

"Only the woman is wearing complete protective gear."

An observation my wife makes while we watch the [Bridge Breaking Competition][0]. A dozen engineers mill about, loading metal weights into buckets, and measuring when the popsicle sticks and dental floss contraptions slide, blow and explode into constituent pieces to the oohs and ahs of the delighted and dismayed onlooking crowd of grade school students and families. All of the engineers wear glasses, a few sport steel toed boots, though most have sneakers, and two hard hats are in attendance.

"Oh. That's interesting." says me, and softly led the thought to the background, there being more interesting things to think about. Crack! Crash! and another broken bridge suffers catastrophic ignomy and flies into pieces to the waiting floor and bucket. "Oh wow, that one supported 72kg!"

Applause. We leave. Time passes. Life goes on.

Four hours later I'm sitting in the emergency room clutching a fileted finger and cycling through alternating turns of waiting,

View cmd_pompt_here.reg
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd_here]
@="@shell32.dll,-8506"
"Icon"="cmd.exe,0"
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd_here\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\Directory\shell\cmd_here]
@maphew
maphew / add-arc-lm-firewall.bat
Last active February 14, 2023 18:25
Allow ArcGIS License Manager through the firewall
View add-arc-lm-firewall.bat
@echo off
:: Run this on the LM server machine
setlocal
set _p=C:\ArcGIS\License_Manager\LicenseManager\bin
:inbound
netsh advfirewall firewall add rule name="ArcGIS License Manager - arcgis" dir=in action=allow program="%_p%\arcgis.exe" enable=yes
netsh advfirewall firewall add rule name="ArcGIS License Manager - lmgrd" dir=in action=allow program="%_p%\lmgrd.exe" enable=yes
netsh advfirewall firewall add rule name="ArcGIS License Manager - LSA" dir=in action=allow program="%_p%\LSA.exe" enable=yes
@maphew
maphew / Install-Stork-Windows.md
Last active February 1, 2023 05:20
Recipe to install Stork Search on Windows
View Install-Stork-Windows.md

Install [Stork-search][0] on Windows

Assumes winget is installed and in PATH. If not go to MS Store and install 'App Installer'.

winget install Microsoft.VisualStudio.2022.BuildTools

Then Start >> Visual Studio installer >> and Select 'Desktop development with C++' kit (req. ~7 GB)

winget install rustup
@maphew
maphew / disable-network-thumbdb.reg
Created December 1, 2022 16:47
Fix "can't delete network folder because thumbs.db is open"
View disable-network-thumbdb.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\Explorer]
"DisableThumbsDBOnNetworkFolders"=dword:00000001
@maphew
maphew / PS-BGInfo.ps1
Created April 27, 2022 20:38 — forked from dieseltravis/PS-BGInfo.ps1
update wallpaper background image with powershell (like Sysinternals BGInfo)
View PS-BGInfo.ps1
# PS-BGInfo
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it.
# run as a lower priority task
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal'
# Configuration:
# Font Family name
$font="Input"
@maphew
maphew / console-log.txt
Created April 13, 2022 20:04
troubles installing rustc (gcc, libc-dev) on Ubuntu 20.4
View console-log.txt
#
# part of https://askubuntu.com/questions/1402336/apt-trying-to-fetch-versions-not-available-in-archive-ubuntu-com-ubuntu-pool-mai?noredirect=1#comment2434286_1402336
#
(rio-viz) geoadmin@geonix:~$ sudo mv /var/lib/apt/lists/* apt-temp/
[sudo] password for geoadmin:
(rio-viz) geoadmin@geonix:~$ ls /var/lib/apt/lists
(rio-viz) geoadmin@geonix:~$ sudo apt update
Get:1 https://mirror.it.ubc.ca/ubuntu focal InRelease [265 kB]
Get:2 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
@maphew
maphew / conda-downgrade-report.txt
Created January 25, 2022 18:52
example of `conda install pkg=old.ver.num` downgrading existing packages
View conda-downgrade-report.txt
#
# a console output snippet that shows conda does downgrade to older version of currently installed package
# https://stackoverflow.com/questions/23974217/how-do-i-revert-to-a-previous-package-in-anaconda
#
$ conda install gdal=3.4.0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: done
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
@maphew
maphew / gdal-copy-rpc.py
Created January 10, 2022 15:56
Copy RPC metdata from IN raster to OUT raster
View gdal-copy-rpc.py
'''Copy RPC metdata from IN raster to OUT raster
Adapted from @user7821537
https://gis.stackexchange.com/questions/264644/transfer-rpc-metadata-from-one-geotiff-to-another
'''
import os
import sys
from osgeo import gdal
gdal.UseExceptions()
@maphew
maphew / clean.ps1
Last active January 6, 2022 20:34
Recipe for setting up environment for geospatial processing on Windows [DRAFT]
View clean.ps1
scoop uninstall scoop
$xlist = "$env:userprofile\scoop", "c:\apps\geo", "$env:userprofile\.condarc", "$env:userprofile\.conda", "$env:userprofile\.config\scoop"
foreach ($x in $xlist) {
if (Test-Path $x) { Remove-Item $x}
}