Skip to content

Instantly share code, notes, and snippets.

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

Ian Spence ecnepsnai

🏳️‍🌈
View GitHub Profile
@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
@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 / 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 / ContentView.swift
Created September 16, 2023 02:08
SwiftUI Regression
//
// ContentView.swift
// SwiftUITest
//
// Created by Ian Spence on 2023-09-15.
//
import SwiftUI
struct ContentView: View {
@ecnepsnai
ecnepsnai / psp.json
Created August 17, 2023 21:04
PSP FFMpeg Preset
{
"PresetList": [
{
"AlignAVStart": false,
"AudioCopyMask": [
"copy:aac",
"copy:ac3",
"copy:dtshd",
"copy:dts",
"copy:mp3",
@ecnepsnai
ecnepsnai / Update-Golang.ps1
Last active January 16, 2024 21:07
Install or Update Go on Windows
function Get-LatestRelease() {
$response = Invoke-WebRequest "https://go.dev/dl/?mode=json"
$results = ConvertFrom-JSON $response
$latest = $results[0]
$arch = "amd64"
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
$arch = "arm64"
}
@ecnepsnai
ecnepsnai / Update-GeforceDrivers.ps1
Created April 21, 2023 01:02
Powershell Update Geforce Drivers
<#
.SYNOPSIS
Download and install the latest Nvidia GeForce drivers
.PARAMETER SeriesID
The product series ID. Defaults to "GeForce RTX 20 Series"
.PARAMETER FamilyID
The product family ID. Defaults to "GeForce RTX 2080 Super"
.PARAMETER OSID
The operating system ID. Defaults to Windows 11.
.PARAMETER LanguageCode
@ecnepsnai
ecnepsnai / vyos.md
Last active November 10, 2022 04:19
Build VyOS with custom package

Build VyOS with Custom Packages

VyOS allows you to include custom packages when an image is built.

Requirements

  • Debian packages compiled for the correct kernel release matching the VyOS release (I.E. don't use Ubuntu packages)
  • A GPG key. Any old key will do, because just like GPG itself - it doesn't really matter.

Sign and serve the packages

@ecnepsnai
ecnepsnai / Edge.mobileconfig
Last active February 28, 2023 04:49
Disables bad/annoying/borderline-malicious features of Edge, making it a tolerable browser.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>UserFeedbackAllowed</key>
<false/>
<key>AutofillCreditCardEnabled</key>
@ecnepsnai
ecnepsnai / README.md
Created February 26, 2022 23:45
Better Podman SystemD Unit

This is a systemd unit file for running a podman container as a systemd service.

For rootless containers, you can use systemd user units (More info)

Broken down, it does the following:

  1. ExecStartPre pulls the image. If you use the :latest tag, then every time you start this service it'll pull the latest version
  2. ExecStart runs the container. It's important to use a container name, since it's referenced elsewhere. Don't detact the container (I.E. don't include -d)
  3. ExecStopPost after the container is stopped, it'll remove the container (if it is still present), and remove the image. Removing the image is useful if you're using the :latest image tag.