1. Подключаемся к серверу:
Discover gists
| # Courtesy of: https://stackoverflow.com/a/11974399 | |
| {%- for item in items %} | |
| [ | |
| "{{item}}"{{ "," if not loop.last }} | |
| ] | |
| {%- endfor %} |
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.
One flat folder. One memory file. One index that points your AI at what it needs.
This file is the single entry point for your AI assistant. Instead of 15 folders with custom configs (ask me how I know that doesn't work), everything routes through here. Your AI reads this file, knows where to look, and gets to work.
✅ Your Requirements:
- 🔒 Ports 80/443 are firewalled to Cloudflare IPs only
- ☁️ You're behind Cloudflare, so Let's Encrypt (Certbot) cannot reach port 80 directly
- 🌐 You're using Apache, not Nginx
- You already have a self-signed or manually managed cert in use
| #!/usr/bin/env python3 | |
| """Claude Code status line: API-rate cost estimate (session / today).""" | |
| import json | |
| import sys | |
| import glob | |
| import os | |
| import datetime as dt | |
| # USD per 1M tokens: (input, output, cache_write_5m, cache_read) | |
| # Source: platform.claude.com/docs/en/about-claude/pricing |
| -- Step 1: Build daily event time series (last 90 days, excluding yesterday) | |
| WITH all_events AS ( | |
| SELECT | |
| PARSE_DATE('%Y%m%d', event_date) AS time_series_data, | |
| event_name, | |
| COUNT(*) AS total_events | |
| FROM | |
| `your_project.analytics_XXXXXXXXX.events_*` | |
| WHERE | |
| _TABLE_SUFFIX BETWEEN |
| #!/usr/bin/env python3 | |
| """ | |
| Patch the installed Codex macOS app by editing its Electron ASAR webview bundle. | |
| WARNING: Modifying files inside `/Applications/Codex.app` will break the app's code signature. | |
| You may need to re-sign the app (or adjust Gatekeeper settings) after patching. | |
| Codex.app also enables Electron's ASAR integrity check. After repacking `app.asar`, you must | |
| update `ElectronAsarIntegrity` in `Codex.app/Contents/Info.plist`, otherwise the app will exit | |
| on startup with: |