Skip to content

Instantly share code, notes, and snippets.

@maphew
maphew / conda-downgrade-report.txt
Created January 25, 2022 18:52
example of `conda install pkg=old.ver.num` downgrading existing packages
#
# 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 / google-policy-faq-sample-aaa.txt
Created January 6, 2024 01:43
Google policy FAQ v.xxxxx, 2024-01-05, CA
((the FAQ M.Wilkie sees which is reportedly different from what another person in the same city sees at the same url on the same day.))
Whitehorse, Yukon, Canada, 2024-01-05 18:40.
https://policies.google.com/faq
Google
How does Google protect my privacy and keep my information secure?
We know security and privacy are important to you – and they are important to us, too. We make it a priority to provide strong security and give you confidence that your information is safe and accessible when you need it.
@maphew
maphew / a-PythonCaller.py
Last active October 17, 2023 20:48
A session via chatbotui.com coaching gpt-4 to write and FME PythonCaller function to report on python environment. Elapsed time was ~30-45 minutes. Output html is bit garbage since ChatbotUI doesn't have a share feature yet. The session export json and script to convert is also attached if curious. View rendered html at https://htmlpreview.githu…
import fme
import fmeobjects
import sys
import os
import platform
import pkg_resources
from distutils.sysconfig import get_python_lib
class FeatureProcessor(object):
@maphew
maphew / Install-Leo-code-download.cmd
Last active October 16, 2023 04:43
**Install Leo on Windows Recipe**. Choose among the .cmd for installing from code download, using git, or pypi release. The last one, `Install-Leo`, has all 3 in one file, so don't run as is.
:: Install Leo on windows recipe by matt wilkie
:: Requires App Installer from Microsoft Store be installed first
:: opinionated personal preferences, adjust to suit
::
winget install wget
winget install gsudo
md c:\bin
wget https://raw.githubusercontent.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd -O c:\bin\RefreshEnv.cmd
sudo setx /M path %path%;c:\bin
@maphew
maphew / console.log
Last active September 15, 2023 22:57
Attempting to make 'q' to Quit (exit) app to work
Textual Development Console v0.37.0
▌Run a Textual app with textual run --dev my_app.py to connect.
▌Press Ctrl+C to quit.
────────────────────────────────────────────────────────────────────── Client '127.0.0.1' connected ───────────────────────────────────────────────────────────────────────
[15:46:44] SYSTEM app.py:2036
Connected to devtools ( ws://127.0.0.1:8081 )
[15:46:44] SYSTEM app.py:2040
---
[15:46:44] SYSTEM app.py:2042
driver=<class 'textual.drivers.windows_driver.WindowsDriver'>
doctorow.medium.com
When the Town Square Shatters - Cory Doctorow - Medium
Cory Doctorow
8 - 10 minutes
Once again, science fiction fandom shows us how to use the internet.
Cory Doctorow
Fanlore
@maphew
maphew / 8-Stitches.md
Last active May 18, 2023 07:00
8 Stitches

"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,

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 / gdal-copy-rpc.py
Created January 10, 2022 15:56
Copy RPC metdata from IN raster to OUT raster
'''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 / add-arc-lm-firewall.bat
Last active February 14, 2023 18:25
Allow ArcGIS License Manager through the firewall
@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