Skip to content

Instantly share code, notes, and snippets.

View byung-u's full-sized avatar
๐Ÿ€

Byungwoo Jeon byung-u

๐Ÿ€
  • Seoul, Republic of Korea
View GitHub Profile
proc_stat_list[proc_list_idx].mem_percent =
(double)(proc_stat_list[proc_list_idx].proc_rss * 100.0) / total_mem;
@byung-u
byung-u / subtitle_time_remove_space.py
Last active December 28, 2016 06:29
๊ตฌ๊ธ€ ๊ธฐ๊ณ„๋ฒˆ์—ญ ํ›„ ์ž๋ง‰์˜ ์‹œ๊ฐ„ ์ •๋ณด๊ฐ€ ๋ฐ”๋€Œ๋Š”๋ฐ ์ด๋ฅผ ํ•œ๋ฒˆ์— ์ˆ˜์ •ํ•ด์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ
#!/usr/bin/env python3.5
#
# ์ž๋ง‰์˜ ์›๋ณธ ํŒŒ์ผ์˜ ์‹œ๊ฐ„ ํ˜•์‹ : 00:36:47.450 --> 00:36:50.560
# ๊ตฌ๊ธ€ ๊ธฐ๊ณ„๋ฒˆ์—ญ ํ›„์˜ ์‹œ๊ฐ„ ํ˜•์‹ : 00 : 37 : 24.250 -> 00 : 37 : 30.160
#
# ์ฐจ์ด์ 
# 1. ':' ์•ž๋’ค๋กœ ๊ณต๋ฐฑ ์ถ”๊ฐ€
# 2. '-'๊ฐ€ 1๊ฐœ ์‚ฌ๋ผ์ง
#
# ์ด๋ฅผ ์›๋ž˜์˜ ์ž๋ง‰ ์‹œ๊ฐ„ ํ˜•์‹์œผ๋กœ ๋˜๋Œ๋ ค ์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ
@byung-u
byung-u / remove_subtitle_new_line.py
Last active December 29, 2016 00:31
์ž๋ง‰ํŒŒ์ผ์—์„œ ์ž๋ง‰์— ๋ถ™์–ด์žˆ๋Š” ๊ฐœํ–‰๋ฌธ์ž ์ œ๊ฑฐํ•ด์ฃผ๋Š” ์Šคํฌ๋ฆฝํŠธ
#!/usr/bin/env python3.5
#
# ์›๋ณธ
# 00:14:17.810 --> 00:14:22.529
# since the previous function was a generator
# that returns a list of positions, the caller
# ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰ ํ›„ ๊ฐœํ–‰๋ฌธ์ž ์ œ๊ฑฐ
# 00:14:17.810 --> 00:14:22.529
# since the previous function was a generator that returns a list of positions, the caller
#
# I wanna make `grep` result like this
#
# % jgrep pStStps *.c
#
# vi -R MS_Stf.c +1006 if (!HINSERT(HTbl[T->i], &pStStps->lkey, 0, pStStps))
# vi -R MS_Stf.c +1009 pStStps->lkey, errno);
# vi -R MS_Stf.c +1010 CancelEvent(T->pool, pStStps->iTimer);
# vi -R MS_Stf.c +1011 free(pStStps);
# vi -R MS_Stf.c +1014 return pStStps;
## Cell์—์„œ AA๋กœ ์‹œ์ž‘ํ•˜์ง€ ์•Š๋Š” ๊ฒƒ๋“ค์€ ๋ชจ๋‘ ์•ˆ๋ณด์ด๊ฒŒ ํ•˜๊ณ  ์‹ถ๋‹ค๋Š”
## ์š”๊ตฌ์‚ฌํ•ญ์— ๋Œ€ํ•ด์„œ ์ด๋ฅผ ์ถœ๋ ฅํ•ด์ฃผ๋Š” ์ฝ”๋“œ
import pandas as pd
def main():
df = pd.read_csv('./test.csv', delimiter='|', header=None)
for row in range(df.shape[1]):
df[row] = df[row].str.replace(r'^((?!AA).)*', '')
@byung-u
byung-u / kerberos_setup.md
Created August 22, 2019 09:40 — forked from ashrithr/kerberos_setup.md
Set up kerberos on Redhat/CentOS 7

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

@byung-u
byung-u / exit_while_loop_by_enter_key.py
Last active March 10, 2022 21:42
Exit while loop by user hitting enter key (python)
#!/usr/bin/env python3
# http://stackoverflow.com/questions/7255463/exit-while-loop-by-user-hitting-enter-key
while True:
i = input("Enter text (or Enter to quit): ")
if not i:
print("excape") # Enter key to quit
break
print("Your input:", i)
@byung-u
byung-u / llm-wiki.md
Created April 7, 2026 11:49 — 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.