This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo cons | nc localhost 2181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rg.apache.commons.codec.digest.DigestUtils | |
val origin = "test text" | |
val hash = DigestUtils.md5Hex(origin) | |
println(hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select pid, | |
usename, | |
pg_blocking_pids(pid) as blocked_by, | |
query as blocked_query | |
from pg_stat_activity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def string2hex(str: String): String = str.toSeq.map(_.toInt.toHexString).mkString(" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./kafka-consumer-groups \ | |
--bootstrap-server $BROKER_LIST \ | |
--group $CONSUMER_GROUP \ | |
--topic $TOPIC \ | |
--reset-offsets \ | |
--to-datetime 2021-04-20T15:00:00.000 \ | |
--execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ํน์ ๋จ์ด๊ฐ ํฌํจ๋ ํ์ผ ์ฐพ๊ธฐ | |
find $FILE_PATH_TO_FIND -type f -print | xargs grep $WORD_TO_FIND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ์ด๋ฏธ์ง ํ์ธ์ ์ํด ์์๋ก /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 ์ฌ์์ |
NewerOlder