Skip to content

Instantly share code, notes, and snippets.

View dotysan's full-sized avatar

Curtis Doty dotysan

View GitHub Profile
@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
@dotysan
dotysan / bootstrap-cuda-toolkit.sh
Last active January 22, 2023 00:10
Auto-installer for CUDA Toolkit inside WSL2
#! /usr/bin/env bash
#
# Auto-installer for CUDA Toolkit inside Windows Subsystem for Linux.
#
if [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]
then
echo "ERROR: Only tested on Bourne-Again SHell v4/v5."
exit 1
fi >&2