Skip to content

Instantly share code, notes, and snippets.

View k8scat's full-sized avatar
:dependabot:
I may be slow to respond.

K8sCat k8scat

:dependabot:
I may be slow to respond.
View GitHub Profile
@k8scat
k8scat / llm-wiki.md
Created August 4, 2026 13:34 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

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.

The core idea

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.

@k8scat
k8scat / clean_traces.sh
Last active March 25, 2026 03:09
clean traces
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
exit 1
fi
unset HISTFILE
export HISTSIZE=0
export HISTFILESIZE=0
@k8scat
k8scat / run-mysql80.sh
Created October 7, 2025 09:39
run mysql80 in a docker container
docker volume create mysql80-data
docker run \
-e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD \
-d --name mysql8 \
-v mysql8-data:/var/lib/mysql \
-p 33060:3306 mysql:8.0
@k8scat
k8scat / run-mysql56.sh
Last active October 7, 2025 09:40
run mysql56 in a docker container
docker volume create mysql56-data
docker run \
-e MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD \
--privileged=true \
-d --name mysql56 \
-v mysql56-data:/var/lib/mysql \
-p 33061:3306 \
--ulimit nofile=65536:65536 \
mysql:5.6
#!/bin/bash
set -e
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor > /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
@k8scat
k8scat / port_forwarding.sh
Created September 1, 2023 03:32
ssh port_forwarding functions
# read in zsh is different from bash
# https://superuser.com/questions/555874/zsh-read-command-fails-within-bash-function-read1-p-no-coprocess
# in bash, read -p "prompt" var
# but in zsh, read "var?prompt"
function port_forwarding_local() {
echo "port forwarding to remote server"
read "local_host?local_host (default is empty): "
read "local_port?local_port: "
if [[ -z "${local_port}" ]]; then
@k8scat
k8scat / docker-delete-volume-force.sh
Created December 13, 2022 09:34
[Docker] Delete volume force
volume=""
err=$(docker volume rm $volume 2>&1)
echo "err: $err"
container_ids=$(echo $err | awk -F'[' '{print $2}' | awk -F']' '{print $1}')
echo "ids: $ids"
IFS=', '
for container_id in $container_ids; do
echo "delete container: $container_id"

Linux 命令行编辑快捷键

初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。

  • 命令行快捷键:
    • 常用:
      • Ctrl L :清屏
  • Ctrl M :等效于回车
@k8scat
k8scat / es-query.json
Last active November 30, 2022 09:55
TooManyClauses[maxClauseCount is set to 1024]
{
"fields": [
"uuid",
"owner_uuid",
"team_uuid",
"project_uuid",
"reference_id",
"reference_type",
"type",
"ext_id",
@k8scat
k8scat / Makefile
Created November 21, 2022 18:14 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.