Skip to content

Instantly share code, notes, and snippets.

View Jongbhin's full-sized avatar

Jongbhin Park Jongbhin

  • SK Planet
  • Pangyo
View GitHub Profile
@Jongbhin
Jongbhin / haproxy.md
Last active April 1, 2020 09:39
[HAProxy] #haproxy

Install

sudo apt show haproxy
sudo apt install -y haproxy

Commands

systemctl restart haproxy

Configuration

@Jongbhin
Jongbhin / linux_command_reference.md
Last active July 25, 2022 07:42
[linux command reference] #linux #command #reference

Linux netstat command find out which process is listing upon a port

Find out the process that opened thr port

netstat -tulpn
ls -l /proc/1138/exe

Find out the processes PID that opened tcp port 7000, enter:

fuser 7000/tcp
@Jongbhin
Jongbhin / pil_plugin.py
Last active April 9, 2020 12:21
[PIL to scikit-image] #pil #scikit-image
__all__ = ['imread', 'imsave']
from distutils.version import LooseVersion
import warnings
import numpy as np
from PIL import Image, __version__ as pil_version
from ...util import img_as_ubyte, img_as_uint
@Jongbhin
Jongbhin / img_test.py
Created April 26, 2020 23:21
[PIL open cv image open and convert to numpy array] #pil, #cv2, #numpy
# -*- coding:utf-8 -*-
import sys
import os
from tqdm import tqdm
import cv2
from collections import defaultdict
import numpy as np
from PIL import Image
@Jongbhin
Jongbhin / kafka_reference.md
Created June 19, 2020 02:17
[kafka] kafka reference

Zookeeper and Kafka start

nohup ./bin/zookeeper-server-start.sh ./config/zookeeper.properties &
nohup ./bin/kafka-server-start.sh ./config/server.properties &

Create a topic

./bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 20 --topic test
@Jongbhin
Jongbhin / delimiter.md
Last active June 22, 2020 08:14
[search delimeter] #delimiter

command line ctrl + v + k

vi ctrl + shift + kkk

@Jongbhin
Jongbhin / kafka.md
Last active July 6, 2020 23:58
[kafak reference] #kafka

Reference

session.timeout.ms

Install

wget https://www.apache.org/dyn/closer.cgi?path=/kafka/2.5.0/kafka_2.12-2.5.0.tgz
tar -xzf kafka_2.12-2.5.0.tgz
cd kafka_2.12-2.5.0
@Jongbhin
Jongbhin / slack.md
Created July 1, 2020 23:10
[Slack reference] #slack
@Jongbhin
Jongbhin / utils.py
Last active July 6, 2020 06:22
[Util functions with product] #python #11st #product #util
def get_prd_no(image_path):
prd_no = image_path.split('/')[-1].split('_')[0]
return prd_no