Skip to content

Instantly share code, notes, and snippets.

@sjelfull
sjelfull / README.md
Last active January 29, 2026 09:58
Proxmox LXC setup script for Dante SOCKS5 proxy - route traffic through residential IP via Tailscale exit node

Proxmox Dante SOCKS5 Proxy LXC

Automated setup script for creating a minimal Dante SOCKS5 proxy in a Proxmox LXC container. The proxy sits on your home LAN and is accessed through your existing Tailscale exit node.

Architecture

┌─────────────┐     Tailscale      ┌─────────────┐       LAN        ┌─────────────┐
│   Fly.io    │ ────────────────── │  Exit Node  │ ──────────────── │  Dante LXC  │
│  (yt-dlp)   │       mesh         │    LXC      │   192.168.x.x    │   (proxy)   │
@sjelfull
sjelfull / README.md
Last active January 27, 2026 22:29
Proxmox Tailscale LXC - Create minimal LXC for Tailscale exit node / subnet router

Proxmox Tailscale LXC

Creates a minimal Debian 12 LXC container on Proxmox with Tailscale pre-installed and configured for use as an exit node or subnet router.

Requirements

  • Proxmox VE host - Run this script directly on your Proxmox server via SSH or the web console shell
  • Root access (the script will verify)
  • Internet connectivity (to download Debian template and Tailscale)
@sjelfull
sjelfull / migrate.ts
Created July 4, 2025 21:51
Migrate script from Sanity dataset to Media Library. Pulled from https://www.sanity.io/docs/media-library/media-migration#k7772445e6b09
import * as fs from 'node:fs'
import * as path from 'node:path'
import {config} from 'dotenv'
import ndjson from 'ndjson'
// Define interface for migration options
export interface MigrateMediaOptions {
projectId: string
dataset: string
mediaLibraryId: string
@sjelfull
sjelfull / download.ts
Created February 25, 2025 14:49
Download random/curated images from Unsplash
import { writeFile, mkdir } from "fs/promises";
import { join } from "path";
import PQueue from "p-queue";
import ora from "ora";
import chalk from "chalk";
// Add these type declarations at the top
declare module "fs/promises";
declare module "path";
declare global {
@sjelfull
sjelfull / sentry-issues-csv-export.js
Created February 24, 2025 08:37
Download Sentry issues as CSV
function extractIssues() {
const issues = [];
const rows = document.querySelectorAll('[data-test-id="group"]');
rows.forEach(row => {
const issue = {
id: row.getAttribute('data-group-id'),
title: row.querySelector('[data-sentry-component="EventOrGroupTitle"]').textContent.trim(),
status: row.querySelector('[data-sentry-element="GraphText"]').textContent.trim(),
lastSeen: row.querySelector('time').getAttribute('datetime'),
@sjelfull
sjelfull / anthropic.ts
Created April 25, 2024 20:46 — forked from CallumVass/anthropic.ts
Haiku structured data - My own implementation of instructor for Haiku
import Anthropic from "@anthropic-ai/sdk";
import type { MessageParam } from "@anthropic-ai/sdk/resources";
import dotenv from "dotenv";
import { Instructor } from "./instructor";
import type { z } from "zod";
dotenv.config();
function sendToClaude<T>(message: MessageParam, schema: z.Schema<T>) {
const anthropicClient = new Anthropic({
<?
# MIT license, do whatever you want with it
#
# This is my invoice.php page which I use to make invoices that customers want,
# with their address on it and which are easily printable. I love Stripe but
# their invoices and receipts were too wild for my customers on Remote OK
#
require_once(__DIR__.'/../vendor/autoload.php');
import { GetServerSideProps } from "next";
import Head from "next/head";
import { useEffect, useRef, useState } from "react";
// I suggest to create a read-only Stripe key with access to invoices + customers for this)
const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY_INVOICE_GENERATOR);
export default function InvoicePage(props) {
const invoice = props.invoice;
@sjelfull
sjelfull / removeContent.js
Created October 2, 2022 21:30 — forked from RiFi2k/removeContent.js
Cloudflare Worker Function to find and replace content on a page
addEventListener("fetch", event => {
event.respondWith(handle(event.request))
})
async function handle(request) {
// Fetch from origin server.
let response = await fetch(request)
// Make sure we only modify text, not images.
let type = response.headers.get("Content-Type") || ""
@sjelfull
sjelfull / index.js
Last active August 25, 2022 13:36 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
const isNpx = process.argv.some((segment) => segment.includes('_npx') || segment.includes('npx'))
console.log('yay gist');
console.log(process.argv, process.argv0);
console.log(`${isNpx ? 'likely npx' : 'not likely to be npx'}`)
console.log(process.env)
console.log(['env._ ends with npx', process.env._.endsWith('/npx')])