Skip to content

Instantly share code, notes, and snippets.

View oppara's full-sized avatar
:octocat:
::

oppara oppara

:octocat:
::
View GitHub Profile
@oppara
oppara / llm-wiki.md
Created April 6, 2026 22:42 — 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.

@oppara
oppara / get_max_clients.sh
Created September 24, 2023 13:39
ApacheのMPMの設定において、MaxClientsに設定できる上限値を計算するシェルスクリプト
#!/bin/bash
_PIDS=(`pgrep httpd`)
_PROC_COUNT=${#_PIDS[@]}
_MEMORY_TOTAL=`free | grep Mem | awk '{print $2;};'`
#_MEMORY_FREE=`vmstat -a | awk 'NR==3{print $4+$5;};'`
_RSS_TOTAL=0
_SHARED_TOTAL=0
@oppara
oppara / README.md
Created January 17, 2022 01:12 — forked from kawarimidoll/README.md
Define keymappings for multiple modes at once in Vim or Neovim

multiple_keymap.vim

Define keymappings for multiple modes at once in Vim or Neovim.

Installation

Put codes in your configuration file, such as .vimrc or init.vim.

Usage

" define mappings at once
Keymap nx S DoSomething
<?php
/**
* trim(全角スペース含む)し、改行を取り除く
*
* @param string $str
* @return string
*/
function trim(string $str): string
{
$str = str_replace(["\r\n", "\r", "\n"], '', $str);
@oppara
oppara / update.sh
Created June 11, 2020 00:20
cask update.sh
#!/bin/bash
set -e
# https://github.com/rhysd/tweet-app/blob/master/Casks/update.sh
if [ ! -d '.git' ]; then
echo 'This script must be run at root of the repository' 2>&1
exit 1
fi
@oppara
oppara / summernote-ext-minidiag.js
Created May 7, 2020 08:55 — forked from bluecat76/summernote-ext-minidiag.js
Minimal dialog example for summernote v0.8.1
(function (factory) {
/* global define */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
// Node/CommonJS
module.exports = factory(require('jquery'));
} else {
// Browser globals
@oppara
oppara / create_user.sh
Created January 26, 2020 04:08
shell script loop pipe while read
#!/bin/bash
set -eu
users() {
# user password
cat << EOF
foo foofoo
bar barbar
baz bazbaz
EOF
@oppara
oppara / setup_mysql.md
Created January 20, 2020 10:37
Amazon Linux に MySQL をインストールする

mariaDB のアンインストール
# yum -y remove mariadb-libs

MySQL のリポジトリを追加
# yum -y install http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

インストール
# yum install mysql-community-server
@oppara
oppara / syslog.cron
Last active January 10, 2020 11:21
Log cron log to syslog
12 4 * * * /path/to/command 2>&1 | logger -t <NAME> -p local0.info