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 / 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 / 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 / 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 / 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!'
@dotysan
dotysan / ssh_purge.sh
Created March 27, 2023 02:25
Purge your SSH known_hosts file
# was reading https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/
# and decided to perform a simple purge...
awk '/^#/||$2=="ssh-rsa"&&length($3)<544 {print}' ~/.ssh/known_hosts >~/.ssh/known_hosts.buh-bye.`date -Im` && \
awk '/^#/||$2=="ssh-rsa"&&length($3)<544{next}{print}' ~/.ssh/known_hosts >~/.ssh/known_hosts.new && \
mv ~/.ssh/known_hosts.new ~/.ssh/known_hosts