Skip to content

Instantly share code, notes, and snippets.

View benelog's full-sized avatar

Sanghyuk Jung benelog

View GitHub Profile
@benelog
benelog / opus-plan-sonnet-execute.md
Created May 13, 2026 12:31
Opus가 Plan, Sonnet이 Execute — Claude Code에서 캐시 효율을 지키는 패턴

Opus가 Plan, Sonnet이 Execute — 캐시 효율을 지키는 패턴

배경: opusplan의 캐시 문제

Claude Code의 /model opus-plan 모드는 Plan 단계는 Opus로, 실행 단계는 Sonnet으로 자동 전환된다. 편하지만 한 세션 안에서 모델이 바뀌는 순간 프롬프트 캐시가 무효화된다. Anthropic 캐시는 모델별로 분리돼 있어 Opus → Sonnet 전환 시 cache hit ratio가 떨어지고, 토큰 비용·지연이 다시 늘어난다.

해결 아이디어: 메인 세션은 Opus 그대로 두고, 실행 작업만 Sonnet 서브에이전트에 위임한다. 서브에이전트는 자체 컨텍스트와 캐시 라이프사이클을 가지므로 메인 캐시가 보존된다.


@benelog
benelog / brick-books.md
Last active May 17, 2026 14:22
살면서 한번은 벽돌책 (장강명, 글항아리) - 100권 구매 링크 모음 (Yes24/알라딘/교보문고/Google Play Books)

살면서 한번은 벽돌책 - 100권 구매 링크 모음

https://www.yes24.com/product/goods/181119990


1장 벽돌책을 읽은 사람은 전과 다른 방식으로 생각하게 된다

첫 도전용으로 좋은, 술술 넘어가는 벽돌책들

@benelog
benelog / spring-batch-4-to-6.md
Last active April 18, 2026 16:36
Spring Batch 4/5 → 6 업그레이드 체크리스트

Spring Batch 4 → 6 / Spring Boot 2.7 → 4 업그레이드 작업 지시서

작업 원칙

  • 아래 체크리스트를 위에서 아래로 순서대로 적용한다.
  • 각 소절에 실린 rg 패턴을 돌려서 걸리는 파일을 빠짐없이 확인하고 교체한다.
  • deprecated API는 무조건 비-deprecated 대체 API로 교체한다. "이전 형태도 동작한다"는 이유로 남겨 두지 않는다.
  • 확신이 없는 지점이 나오면 멈추고 사람에게 질문한다. 추측으로 진행하지 않는다.
  • 소절마다 컴파일과 테스트를 돌려 회귀가 없는지 확인한다.
  • 변경 근거를 커밋 메시지에 해당 소절 제목으로 남긴다.
@benelog
benelog / history.md
Created April 10, 2026 13:23
Dell XPS 13 9350 (Lunar Lake) 웹캠 패치 — Intel CVS SET_HOST_IDENTIFIER fix

웹캠 패치 완성까지의 과정

Dell XPS 13 9350 (Lunar Lake, OV02C10 센서) 웹캠 비작동 문제를 해결하기까지의 기록. 3/6~4/10, 약 1개월간 7+ 세션.


Phase 1: 증상 파악 (3/6)

Dell XPS 13 9350 (Lunar Lake)에서 웹캠 비작동. /dev/video0은 v4l2loopback 가상 디바이스일 뿐, 실제 카메라 없음. dmesg 에러 체인:

@benelog
benelog / README.md
Last active April 22, 2026 14:16
연세대 ibook 뷰어에서 책을 PDF로 다운로드

View to PDF

연세대 ibook 뷰어(https://ibook.yonsei.ac.kr)에서 책을 PDF로 다운로드합니다.

필요 환경

  • Python 3
  • img2pdf (pip install img2pdf)

사용법

내장 웹캠 불량 해결 기록

  • 날짜 : 2026-02-19

  • 장비: Dell XPS 13 9350 (Intel® Core™ Ultra 7 258V (Intel Lunar Lake) )

  • OS : Ubuntu 24.04 LTS

증상

부팅 후 내장 웹캠(/dev/video0, ``Intel MIPI Camera'')이 동작하지 않음.

@benelog
benelog / static-site-generation-by-claude.md
Last active February 14, 2026 14:04
정적 사이트 생성 프롬프트

Pandoc과 쉘 스크립트를 활용하는 정적 웹사이트 생성 프롬프트

아래 프롬프트를 Claude Code에서 사용하면 원하는 스타일의 정적 사이트를 만들 수 있습니다. 이 접근법의 장점은 다음과 같습니다.

항목 설명
의존성 최소 Pandoc + bash만 있으면 빌드 가능. 프레임워크 학습 불필요
구조 단순 템플릿 1개, 빌드 스크립트 1개로 전체 파이프라인 파악 가능
콘텐츠 분리 Markdown만 편집하면 되므로 비개발자도 기여 가능
@benelog
benelog / mysql-options.adoc
Last active May 31, 2026 07:46
MySQL JDBC Configuration for High-Performance Batch Jobs

MySQL JDBC Configuration for High-Performance Batch Jobs

Using Server-Side Prepared Statements

PreparedStatement helps optimize repeated query execution. Instead of declaring the entire SQL string such as SELECT * FROM CITY WHERE COUNTRY = 'KOREA' AND POPULATION > 10000, it separates the static SQL structure SELECT * FROM CITY WHERE COUNTRY = ? AND POPULATION > ? from the dynamic parameters.

@benelog
benelog / spring-retry.adoc
Last active December 2, 2025 22:43
Spring retry
Note
Spring Retry는 Spring Batch, Spring Integration 내부에서 재시도를 위해 사용되던 모듈이었다. Spring framework 7.0 부터는 Spring Core 모듈로 흡수가 되었다. 현재 버전의 유요한 사용법은 Resilience Features을 참고할 수 있다. 이 글에 소개된 @Recover@CircuitBreaker는 Spring framework 7.0에서는 지원되지는 않는다.

스프링 리트라이로 하는 재시도

실습 프로젝트 초기 설정

@benelog
benelog / Application.java
Created May 28, 2025 21:39
Smart UI : Model1 by Spring Boot
public class Application implements WebMvcConfigurer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/repos").setViewName("repos");
}