Skip to content

Instantly share code, notes, and snippets.

View geunho's full-sized avatar
🎯
Focusing

Geunho Kim geunho

🎯
Focusing
View GitHub Profile
@geunho
geunho / application-properties.md
Last active April 29, 2025 08:32
spring-kafka application.properties

https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-application-properties.html spring.kafka prefixed properties

Key Default Value Description
spring.kafka.admin.client-id ID to pass to the server when making requests. Used for server-side logging.
spring.kafka.admin.fail-fast false Whether to fail fast if the broker is not available on startup.
spring.kafka.admin.properties.* Additional admin-specific properties used to configure the client.
spring.kafka.admin.ssl.key-password Password of the private key in the key store file.
spring.kafka.admin.ssl.key-store-location Location of the key store file.
@geunho
geunho / cnn.sh
Created April 15, 2024 02:31
zookeeper 클라이언트 IP 확인
echo cons | nc localhost 2181
@geunho
geunho / kubectl_cheat_sheet.sh
Last active March 29, 2023 11:36
kubectl cheat sheet 💫
# 이미지 확인을 위해 임시로 /bin/bash pod 띄우기
kubectl run $POD_NAME --rm -i --tty --restart=Never --image=$IMAGE:$TAG --command -- /bin/bash
# pod 상태 변경시 출력하기 - OOMKill 등 확인시 사용
kubectl get pod -w
# pvc 용량 증설 (변경 저장 후 물고있는 pod 재시작해야함)
kubectl edit pvc $PVC_NAME
# statefulset pod 재시작
@geunho
geunho / bash_date_loop.sh
Created October 14, 2022 11:03
시간을 순회하면서 처리해보자
start=20220101
end=20221014
while ! [[ $start > $end ]]; do
start=$(date -d "$start + 1 day" +%Y%m%d)
day=$(date -d "$start" +%d)
# 예시. 매월 1일은 처리 대상에서 제외
if [ $day != 01 ]; then
echo $start
## DO YOUR WORK
@geunho
geunho / citus_shard_to_node_map.sql
Created May 23, 2022 01:43
citus shard별 할당된 node 읽기
SELECT s.shardid id, shardminvalue min, shardmaxvalue MAX, p.nodename
FROM pg_dist_shard s
LEFT JOIN pg_dist_shard_placement p
ON s.shardid = p.shardid
WHERE logicalrelid = $TABLE_NAME::regclass;
import rg.apache.commons.codec.digest.DigestUtils
val origin = "test text"
val hash = DigestUtils.md5Hex(origin)
println(hash)
@geunho
geunho / pg_stat_activity.sql
Created May 2, 2022 09:56
실행중인, blocking된 쿼리 목록 조회
select pid,
usename,
pg_blocking_pids(pid) as blocked_by,
query as blocked_query
from pg_stat_activity
val contents = "문자열 base64 인코딩/디코딩 테스트."
val encoded = java.util.Base64.getEncoder.encode(contents.getBytes)
val decoded = java.util.Base64.getDecoder.decode(encoded)
val result = new String(decoded)
assert(contents == result)
# remove_old_files.sh /path/of/root 90
#
# 오래된 파일을 삭제한다.
##########################################
$root_path=$1
$days_past=$2
find $root_path -type d -ctime +$days_past | xargs rm -rf
@geunho
geunho / offset_rewind.sh
Last active September 12, 2021 12:52
kafka consumer group offset rewind
./kafka-consumer-groups \
--bootstrap-server $BROKER_LIST \
--group $CONSUMER_GROUP \
--topic $TOPIC \
--reset-offsets \
--to-datetime 2021-04-20T15:00:00.000 \
--execute