Skip to content

Instantly share code, notes, and snippets.

View c4pt0r's full-sized avatar

dongxu c4pt0r

View GitHub Profile
@c4pt0r
c4pt0r / test_jwks.json
Created March 17, 2026 18:22
Test JWKS for db9 RLS E2E testing
{
"keys": [
{
"kty": "RSA",
"kid": "test-rls-key-1",
"use": "sig",
"alg": "RS256",
"n": "xgQ1cR6qcWD6TYtjhN7AVXv9bXL_HXRGfxCw9w0ybrbc9NS8xsYPK63gAHKW4Dh9tkmSO7Sr5L8jQm9RBegrSfxie4hUdd201e31zbTk30nr5KymbLKvl3Z2LHs6qzko440qaWfi9tUJKsao4Y-Hn2sGeKTWcSbW_rIIbbBKUJU4gHZlg-GfzNvwREJ5bspXc6iYhOMeRONb9Hi9otNAHRluLsMA2zTrzQhtTjF1Mb7-Mei2sPmmFcpNMVzTNZpWYmUDK_DHku2WHrJ_5__3p97DH5LcJ57pcGrmq-3MqhFTlN7UjCmFl5Sa7ivGpo5D4cpvC_9wpX1ulfNFPugxMQ",
"e": "AQAB"
}

my-claw-dash (openclaw-db9-audit) plugin — Installation, Uninstallation, and User Guide

my-claw-dash plugin can:

Mirrors OpenClaw runtime data to DB9 for auditing and analysis. It continuously syncs session transcripts and agent runtime events into DB9 (PostgreSQL + DB9 FS).

Stores conversations in structured SQL tables. This allows you to run queries on sessions, messages, tool calls, and usage patterns using standard SQL.

Logs detailed agent events as append-only JSONL files. Tool calls, lifecycle events, and execution traces are written chronologically for debugging and investigation.

@c4pt0r
c4pt0r / fs9-million-user-scale-design.md
Created February 6, 2026 22:33
FS9 百万用户规模改造设计文档

FS9 百万用户规模改造设计文档

版本: 1.0
日期: 2026-02-06
状态: DRAFT — 待评审


目录

@c4pt0r
c4pt0r / filesystem.go
Created October 17, 2025 07:34
Interface
package filesystem
import (
"io"
"time"
)
// Common Meta keys used across all plugins
const (
MetaKeyPluginName = "plugin-name" // Plugin name that provides this file/directory
@c4pt0r
c4pt0r / main.go
Created April 13, 2023 00:26
Small tool to split large CSV file
package main
import (
"bufio"
"bytes"
"compress/gzip"
"encoding/base64"
"encoding/csv"
"flag"
"fmt"
@c4pt0r
c4pt0r / vortex.go
Created March 7, 2023 00:36
Vortex1.go
package main
import (
"fmt"
"math"
"math/rand"
"os"
"os/exec"
"strconv"
"strings"
@c4pt0r
c4pt0r / poll.py
Created September 15, 2022 06:19
poll db for new rows, like tail -f
#!/usr/bin/env python3
# Usage:
# ./poll.py --host <xxx.tidbcloud.com> --port 4000 --user <username> --password <pwd> | jq --unbuffered .text | grep http
import signal
import time
import os
import argparse
import MySQLdb
parser = argparse.ArgumentParser(description='polls db for new rows')
@c4pt0r
c4pt0r / bigetc.go
Last active June 7, 2022 01:31
bigetc.go
package bigetc
import (
"database/sql"
"time"
"github.com/c4pt0r/log"
_ "github.com/go-sql-driver/mysql"
)
@c4pt0r
c4pt0r / jq.go
Last active June 11, 2025 13:27
Job Queue using TiDB
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"time"
"github.com/fatih/color"

Install TiUP

$ curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

Start a TiDB Cluster

$ tiup playground