Skip to content

Instantly share code, notes, and snippets.

View nosun's full-sized avatar
🏠
Working from home

郭华伟 nosun

🏠
Working from home
View GitHub Profile
@nosun
nosun / jupyter_shortcuts.md
Created October 16, 2017 22:52 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@nosun
nosun / tmux-cheatsheet.markdown
Created January 25, 2018 06:43 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@nosun
nosun / spotify.py
Created February 3, 2018 09:33 — forked from jorgebastida/spotify.py
Rudimentary Spotify Web Proxy using mitmproxy
#!/usr/bin/env python
"""
Rudimentary Spotify Web Proxy using mitmproxy.
Use it by your own responsibility!!
This was only entertainment!!
"""
import random
import hashlib
@nosun
nosun / nginx-cache-purge.lua
Last active January 4, 2023 19:00 — forked from titpetric/purge-multi.lua
Delete NGINX cached items with a PURGE with wildcard support
-- Tit Petric, Monotek d.o.o., Tue 03 Jan 2017 06:54:56 PM CET
--
-- Delete nginx cached assets with a PURGE request against an endpoint
-- supports extended regular expression PURGE requests (/upload/.*)
-- combine single,all,match three mode
-- updated by nosun nosun2008@126.com
local md5 = require 'md5'
function file_exists(name)
@nosun
nosun / nginx.time.conf
Created December 28, 2018 04:52 — forked from eagleon/nginx.time.conf
Nginx expire 时间单位
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
etag off; #关闭etag
expires 1d; #有效期一天
# expires的单位可以使用
# ms: 毫秒
# s: 秒
# m: 分钟
# h: 小时
# d: 天
# w: 星期
@nosun
nosun / ip_blacklist.lua
Created March 21, 2023 13:18 — forked from chrisboulton/ip_blacklist.lua
Redis based IP blacklist for Nginx (LUA)
-- a quick LUA access script for nginx to check IP addresses against an
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403.
--
-- allows for a common blacklist to be shared between a bunch of nginx
-- web servers using a remote redis instance. lookups are cached for a
-- configurable period of time.
--
-- block an ip:
-- redis-cli SADD ip_blacklist 10.1.1.1
-- remove an ip:
@nosun
nosun / llm-wiki.md
Created April 7, 2026 12:35 — 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.