Skip to content

Instantly share code, notes, and snippets.

View queglay's full-sized avatar
🎯
Focusing

Andrew Graham queglay

🎯
Focusing
View GitHub Profile
@queglay
queglay / llm-wiki.md
Created April 6, 2026 21:09 — 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.

[user@workstation vagrant-centos-gui2]$ VAGRANT_LOG=info vagrant up
INFO global: Vagrant version: 2.2.9
INFO global: Ruby version: 2.6.6
INFO global: RubyGems version: 3.0.3
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.9/gems/vagrant-2.2.9/bin/vagrant"
INFO global: VAGRANT_INSTALLER_VERSION="2"
WARN global: resolv replacement has not been enabled!
@queglay
queglay / ansible-crypt-environment-var
Last active March 1, 2020 07:19
Ansible crypt - encrypt string into an environment variable, to read - stash result into a file and use ansible to decrypt again. you will need to specify your own vault keys in place the missing variables shown.
testvar=$(echo -n "test some input that will be encrypted" | ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0) ; echo $testvar | base64 -d > ../secrets/keys/tmp.yml | ansible localhost -m debug -a var="testvar_name" -e "@../secrets/keys/tmp.yml" --vault-id $vault_key
# In practice, gnerating a one time var should not use stdin input. instead use this for the first stage of creating a var
ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0
# this example encrypts to an env var, and then decrypts the value inline without the need for an intermediary file.
testvar=$(echo -n "test some input that will be encrypted and stored as an env var" | ansible-vault encrypt_string --vault-id $vault_key --stdin-name testvar_name | base64 -w 0)
result=$(echo $testvar | base64 -d | /var/lib/snapd/snap/bin/yq r - "testvar_name" | ansible-vault decrypt --vault-id $vault_key); echo $result
@queglay
queglay / window-tiling-gnome3-centos7
Last active February 22, 2020 07:23
Quarter window tiling in Centos 7 RHEL 7
gsettings set org.gnome.shell.extensions.classic-overrides edge-tiling false
# Install shelltile gnome shell extension.
# Additionaly these config steps are prefereable - https://superuser.com/questions/394376/how-to-prevent-gnome-shells-alttab-from-grouping-windows-from-similar-apps
firehawkgateway: SSH auth method: private key
==> firehawkgateway: Machine booted and ready!
GuestAdditions are newer than your host but, downgrades are disabled. Skipping.
==> firehawkgateway: Checking for guest additions in VM...
firehawkgateway: The guest additions on this VM do not match the installed version of
firehawkgateway: VirtualBox! In most cases this is fine, but in rare cases it can
firehawkgateway: prevent things such as shared folders from working properly. If you see
firehawkgateway: shared folder errors, please make sure the guest additions within the
firehawkgateway: virtual machine match the version of VirtualBox you have installed on
firehawkgateway: your host and reload your VM.
[user@workstation firehawk]$ VAGRANT_LOG=info vagrant up
INFO global: Vagrant version: 2.2.6
INFO global: Ruby version: 2.4.9
INFO global: RubyGems version: 2.6.14.4
INFO global: VAGRANT_LOG="info"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded"
WARN global: resolv replacement has not been enabled!
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to quciktime compatible mp4
# not great for large numbers of files that will max out ram/cores, but will get the job done quicker than one by one, and great if you have a machine with a high core count and gobs of ram.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec h264 -acodec aac -pix_fmt yuv420p "mp4_${file%.*}.mp4" </dev/null > /dev/null 2>&1 &
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to quciktime compatible mp4
# not great for large numbers of files that will max out ram/cores, but will get the job done quicker than one by one, and great if you have a machine with a high core count and gobs of ram.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec h264 -acodec aac -pix_fmt yuv420p "mp4_${file%.*}.mp4" </dev/null > /dev/null 2>&1 &
#!/bin/bash
# Convert a bunch of mov / mp4 files in the current dir to prores format for editting in an NLE (FCP X, Davinci Resolve etc).
# not great for large numbers of files that will max out cores.
# Consider this post for thread limiting https://gist.github.com/Brainiarc7/2afac8aea75f4e01d7670bc2ff1afad1
shopt -s nullglob;
for file in "$arg"*.{mov,mp4,MOV,MP4} ; do
echo "convert $file"
ffmpeg -i "$file" -vcodec prores -acodec pcm_s16le "prores_${file%.*}.mov" </dev/null > /dev/null 2>&1 &