Skip to content

Instantly share code, notes, and snippets.

View anthumchris's full-sized avatar

anthumchris

  • Colorado
View GitHub Profile
@anthumchris
anthumchris / httpsSocketRequest.js
Last active June 23, 2025 04:35
HTTPS request with NodeJS TLS Socket
#!/usr/bin/env node
import tls from 'node:tls'
const host = 'one.one.one.one' // Cloudflare DNS
const port = 443
const timeout = 5_000
const path = '/dns/'
const request = trim(`
@anthumchris
anthumchris / .profile
Created October 1, 2026 06:41
Alpine Linux apk add package without root as unprivileged user
## Install packages locally without doas/sudo
APK_LOCAL="$HOME/apk"
export PATH="$APK_LOCAL/bin:$APK_LOCAL/sbin:$APK_LOCAL/usr/bin:$APK_LOCAL/usr/sbin:$PATH"
apk-local() {
if [ ! -f "$APK_LOCAL/lib/apk/db/installed" ]; then
mkdir -p "$APK_LOCAL/etc/apk"
ln -s /etc/apk/keys "$APK_LOCAL/etc/apk/keys"
ln -s /etc/apk/repositories "$APK_LOCAL/etc/apk/repositories"