This file contains hidden or 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
| # grep string with unicodes | |
| grep -aP "abc\001\002" | |
| # grep only matched word and sort unique value | |
| cat $FILE | grep -o "\w*15864\w*" | sort -u | |
| # grep nfs mountpoints | |
| cat /proc/mounts | grep nfs | |
| # count numbers in line |
This file contains hidden or 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
| # $OTHER_VAR이 숫자 형식의 문자일 경우 -v 옵션으로 awk 내 변수 지정을 해줘야 정상적인 산술 연산이 수행됨 😄 | |
| # 두 번째 항목이 $OTHER_VAR 보다 크거나 같은 라인을 찾는다. | |
| awk -v t=$OTHER_VAR '$2 >= t' $FILE_PATH |
This file contains hidden or 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
| {"lastUpload":"2020-04-20T08:20:59.745Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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 재시작 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) |