Skip to content

Instantly share code, notes, and snippets.

View ecnepsnai's full-sized avatar
🏳️‍🌈

Ian Spence ecnepsnai

🏳️‍🌈
View GitHub Profile
@ecnepsnai
ecnepsnai / ScrollLock+Numpad.ahk
Created February 17, 2024 04:07
Scroll Lock Numpad
#If GetKeyState("ScrollLock", "t")
1::Numpad1
2::Numpad2
3::Numpad3
4::Numpad4
5::Numpad5
6::Numpad6
7::Numpad7
8::Numpad8
9::Numpad9
@ecnepsnai
ecnepsnai / update_node.sh
Created June 10, 2024 18:24
Update Node
#!/bin/bash
set -e
VERSION=$(curl -Ss https://nodejs.org/download/release/index.json | jq -r '.[0].version')
INSTALL_DIR="/usr/local/node"
if [[ ! -d ${INSTALL_DIR} ]]; then
echo "Install directory '${INSTALL_DIR}' does not exist, sudo required to create it..."
sudo mkdir -p ${INSTALL_DIR}
fi
@ecnepsnai
ecnepsnai / uniquenet.go
Last active April 3, 2025 21:36
Deduplicate an list of CIDR subnets
// Command uniquenet takes a file containing a list of CIDR-notated subnets and returns a de-duplicated list.
// Deduplication is more than just literal duplicates, it also takes into consideration if a subnet is fully represented
// by another larger subnet in the list.
//
// Usage: uniquenet [-6] <File path>
// By default, uniquenet only returns a list of IPv4 subnets. Pass -6 to switch to IPv6 only.
// File path must be a text file where each line contains only a CIDR address, that is a network address '/' prefix
// length.
package main