Skip to content

Instantly share code, notes, and snippets.

View dotysan's full-sized avatar

Curtis Doty dotysan

View GitHub Profile
@dotysan
dotysan / wsl-minimal.ps1
Created May 5, 2024 23:52
WSL Minimal Install
#! /usr/bin/env pwsh
<#
Notes as code for creating a minimal WSL image.
This is not docker!
#>
#Requires -Version 7.4
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# TODO: parameterize all these hard-coded vars
@dotysan
dotysan / convert-geojson-to-wkt.py
Created April 20, 2024 19:01 — forked from drmalex07/convert-geojson-to-wkt.py
Convert GeoJSON to/from WKT in Python. #python #geojson #geometry
import json
import geojson
from shapely.geometry import shape
o = {
"coordinates": [[[23.314208, 37.768469], [24.039306, 37.768469], [24.039306, 38.214372], [23.314208, 38.214372], [23.314208, 37.768469]]],
"type": "Polygon"
}
s = json.dumps(o)
@dotysan
dotysan / Makefile
Created December 8, 2023 20:42
Install Node.js in a Python virtual environment
SHELL:= /usr/bin/env bash
PY:= python3.12
vb:= .venv/bin/
.PHONY: clean
$(vb)npm: $(vb)nodeenv
source $(vb)activate && \
nodeenv --python-virtualenv --node=lts && \
@dotysan
dotysan / mta-sts.js
Created April 29, 2022 19:45
CloudFlare Worker for MTA-STS policy
const mode= 'testing';
//const mode= 'enforce';
const max_age= 604800; // 1 week
const mx_list = [
'aspmx.l.google.com'
,'aspmx2.googlemail.com'
,'aspmx3.googlemail.com'
,'aspmx4.googlemail.com'
,'aspmx5.googlemail.com'
,'alt1.aspmx.l.google.com'
@dotysan
dotysan / rclone-build.sh
Last active November 14, 2023 23:27
Install rclone on a Go-less system using Go in Docker
#! /usr/bin/env bash
#
# Install rclone on a Go-less system using Go in Docker.
#
set -ex
# latest stable release
RC_TAG=v1.64.2
GO_VER=1-bookworm
@dotysan
dotysan / ghcli-build.sh
Last active November 14, 2023 19:01
Install GitHub CLI on a Go-less system using Go in Docker
#! /usr/bin/env bash
#
# Install GitHub CLI on a Go-less system using Go in Docker.
#
set -ex
# latest stable release
GHCLI_VER=v2.38.0
GO_VER=1-bookworm
@dotysan
dotysan / direnv-build.sh
Last active November 14, 2023 19:00
Install direnv on a Go-less system using Go in Docker
#! /usr/bin/env bash
#
# Install direnv on a Go-less system using Go in Docker.
#
set -ex
# latest stable release
#DIRENV_VER=v2.32.3
# don't use above as much is fixed in master
@dotysan
dotysan / Google Forms monitor
Last active November 14, 2023 02:58
Google Forms monitor
We couldn’t find that file to show.
@dotysan
dotysan / deobfuscated.js
Created May 10, 2023 20:45
Found this creepy tickler for Mobirise
(!document.querySelectorAll('a[href*="https://mobirise.site"]').length || !document.querySelector('a[href*="https://mobirise.site"]').parentElement.nodeName === 'SECTION') && document.querySelectorAll('link[href*="mbr-additional.css"]').forEach(function (_0x3c4461) {
_0x3c4461.remove();
});
@dotysan
dotysan / jetson-nano-post-install.sh
Created April 12, 2023 01:18
Post-install script for Jetson Nano
#! /usr/bin/env bash
#
# This is a custom post-install script for a Jetson Nano.
#
set -ex
me=$(whoami)
if [ "$me" != "root" ]
then
echo 'Must run as root!'