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 / cloudSettings
Last active April 20, 2020 08:21
VS Code Settings ⚙️
{"lastUpload":"2020-04-20T08:20:59.745Z","extensionVersion":"v3.4.3"}
@geunho
geunho / awk_tips.sh
Created April 14, 2020 09:53
awk tips 💫
# $OTHER_VAR이 숫자 형식의 문자일 경우 -v 옵션으로 awk 내 변수 지정을 해줘야 정상적인 산술 연산이 수행됨 😄
# 두 번째 항목이 $OTHER_VAR 보다 크거나 같은 라인을 찾는다.
awk -v t=$OTHER_VAR '$2 >= t' $FILE_PATH
@geunho
geunho / grep_tips.sh
Last active May 7, 2020 08:49
grep tips 💫
# 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
@geunho
geunho / kubernetes_commands.md
Last active April 3, 2020 01:45
Kubernetes 유용한 명령어 모음 ⌨️

생성 시간 순으로 모든 이벤트 조회

kubectl get events --all-namespaces  --sort-by='.metadata.creationTimestamp'
NAMESPACE   LAST SEEN   TYPE      REASON              OBJECT                                        MESSAGE
default     59m         Warning   FailedMount         pod/kafka-connect-history-744c4cb5f9-br66z    MountVolume.SetUp failed for volume "config-file" : configmap "kafka-connect-history-default-config" not found
default     54m         Warning   FailedMount         pod/kafka-connect-history-744c4cb5f9-br66z    Unable to mount volumes for pod "kafka-connect-history-744c4cb5f9-br66z_default(38034b71-8a92-42ed-9afd-b3894f79bc56)": timeout expired waiting for volumes to attach or mount for pod "default"/"kafka-connect-history-744c4cb5f9-br66z". list of unmounted volumes=[nubes ep-volume timezone config-file default-token-zgztl]. list of unattached volumes=[nubes ep-volume timezone config-file default-token-zgztl]
default     46m         Normal    ScalingReplicaSet   deployment/kafka-connect-history    
@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.
# Debian 7 “Wheezy” archived apt repository
echo "deb http://archive.debian.org/debian wheezy main" >> /etc/apt/sources.list
echo "deb http://archive.debian.org/debian-security wheezy/updates main" >> /etc/apt/sources.list
openssl s_client -connect my.domain.com:443 –showcerts
@geunho
geunho / HttpClient.java
Created November 7, 2019 05:08
Simple http client in Java
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
public class HttpClient {
public static void main(String[] args) {
if (args.length == 0) {
System.err.println("Url must be specified.");
return;
}
  1. download node_exporter binary to /usr/sbin/
  2. add systemd config file vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter

[Service]
User=root
ExecStart=/usr/sbin/node_exporter
listening() {
if [ $# -eq 0 ]; then
sudo lsof -iTCP -sTCP:LISTEN -n -P
elif [ $# -eq 1 ]; then
sudo lsof -iTCP -sTCP:LISTEN -n -P | grep -i --color $1
else
echo "Usage: listening [pattern]"
fi
}