Skip to content

Instantly share code, notes, and snippets.

@zigforge
zigforge / agent.py
Created July 31, 2025 03:12 — forked from leerob/agent.py
agent.py
import os
import json
import subprocess
from anthropic import Anthropic
# Tool definitions
TOOLS = [
{
"name": "list_files",
"description": "List files and directories at a given path",
@zigforge
zigforge / WorkerQueue.ts
Created December 9, 2024 14:58 — forked from yonathan06/WorkerQueue.ts
WorkerQueue.ts (54 lines lightweight typescript worker queue)
interface QueueItem<T, R> {
task: T;
resolve: (result: R) => void;
reject: (error: Error) => void;
}
type Worker<T, R> = (task: T) => Promise<R>;
export class WorkerQueue<T, R> {
queue: QueueItem<T, R>[];
import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
@zigforge
zigforge / README.md
Created November 14, 2024 16:04 — forked from cld4h/README.md
Bypass the GFW; clash fake-ip and tproxy; iptables and transparent proxy on Linux; 在Linux上通过 iptables 以及 clash 配置透明代理用于本机及局域网翻墙网关; Linux 翻墙路由器配置

This article show you the ultimate way to set up a transparent proxy on Linux using clash and iptables to bypass the GFW in China.

We use:

You can go to github gist to download all files mentioned in this article.

@zigforge
zigforge / hls.sh
Created November 9, 2024 00:29 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@zigforge
zigforge / 00_install_fbsd_14_1_hetzner.md
Created October 11, 2024 12:55 — forked from ctsrc/00_install_fbsd_14_1_hetzner.md
Install FreeBSD 14.1 on Hetzner

Install FreeBSD 14.1 on Hetzner server

Hetzner no longer offers direct install of FreeBSD, but we can do it ourselves. Here is how :)

Boot the server into rescue mode

Boot the Hetzner server in Hetzner Debian based rescue mode. ssh into it.

The Hetzner rescue image will tell you hardware details about the server in the login banner. For example, with one of my servers I see:

@zigforge
zigforge / rdp_setup.sh
Last active September 30, 2024 12:26
rdp_setup.sh (IPv6)
#!/bin/bash
# Usage: sudo ./enhanced_rdp_setup.sh
set -e
# Error handling
handle_error() {
echo "An error occurred on line $1"
exit 1
}
@zigforge
zigforge / ssh_setup.sh
Last active September 30, 2024 05:01
SSH setup on Mac
#!/bin/bash
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Install Homebrew if not already installed
if ! command_exists brew; then
echo "Installing Homebrew..."
@zigforge
zigforge / .tmux.conf
Created September 29, 2024 09:58
tmux config
set -ga terminal-overrides ",screen-256color*:Tc"
set-option -g default-terminal "screen-256color"
set -s escape-time 0
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
set -g status-style 'bg=#333333 fg=#5eacd3'
bind r source-file ~/.tmux.conf
@zigforge
zigforge / ssh_command_center.sh
Last active September 29, 2024 04:16
autossh
#!/usr/bin/env bash
# Version
VERSION="1.3.0"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'