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 / csv_read_write.md
Last active February 27, 2021 06:21
[csv read write] #python #csv

Using csv

# -*- coding: utf-8 -*-

import os
import csv

data_dir = 'some_dir'
input_file = os.path.join(data_dir, 'some_input_file.tsv')
output_file = os.path.join(data_dir, 'some_out_file.tsv')
@Jongbhin
Jongbhin / get_score_handler_v2.py
Last active January 30, 2020 04:42
[get_score_handler_v2] #python #handler #pytorch
class GetScoreHandler_v2(BaseHandler):
def __init__(self, *args, **kwargs):
super(GetScoreHandler_v2, self).__init__(*args, **kwargs)
self.model = CleanscoringModelV2API()
@gen.coroutine
def post(self, slug=None):
try:
request_json_data = json.loads(self.request.body)
@Jongbhin
Jongbhin / daemon_utils.py
Last active January 13, 2020 07:13
pil and csv image load form url, file or data
import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import datetime
import PIL
from PIL import Image
from exifutil import exifutil
@Jongbhin
Jongbhin / clipboard
Last active January 5, 2021 04:11
[Clipboard] #clipboard
split_cmd = "split -n l/{} -d -a 2 {} meta_input".format(file_num, file_path)
nohup /app/puser/catalog_preprocessor/src/run.sh today 1002,1003,153118,1001,1004,153106,1006,1007,153108,1531201,1005,153111,153112 &> /app/puser/catalog_preprocessor/log/run.log.`date +"\%Y\%m\%d"` &
신규생성된 상품은 일주일간 추가매칭에서 제외한다.
신규생성이 존재하면 추가매칭은 제거한다.
11->12일 증분 결과
@Jongbhin
Jongbhin / image_load.py
Last active January 30, 2020 02:52
[Image load] #python #pil #cv2
#!/usr/bin/env python3
import pyvips
import cv2
from PIL import Image
import timeit
import numpy as np
import time
import cProfile
@Jongbhin
Jongbhin / check_cuda_cudnn.md
Last active November 4, 2024 22:28
[Cuda cudnn version check] #cuda #cudnn #nvidia

To check nvidia driver

modinfo nvidia

To check cuda version

cat /usr/local/cuda/version.txt
@Jongbhin
Jongbhin / crontab_list.md
Created January 30, 2020 09:50
[crontab backup]

crontab backup

00 00 * * * crontab -l &> /app/puser/crontab_list ~

Category Mapping

  • CTGRYi-11stbat02 : 172.21.16.82 v
  • IMGPRCSb-ctgr01 : 172.28.4.65 v
  • IMGPRCSb-ctgr02 : 172.28.4.66 v
  • IMGPRCSb-ctgr03 : 172.28.4.67

Clean Scoring

@Jongbhin
Jongbhin / conda_init.sh
Last active May 17, 2021 05:03
[conda initial shell] #conda
# for ann in dic
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh
# set alias for pip
cat >> ./etc/conda/activate.d/env_vars.sh << EOF
alias pip3='/app/recsy11/.conda/envs/ann/bin/pip3'
@Jongbhin
Jongbhin / conda_reference.md
Last active April 27, 2021 22:53
[conda reference] #conda #anaconda

Frequently used cmommand

conda env list
conda config --envs
conda config --set auto_activate_base false
conda remove --name myenv --all
conda create -n py27 python=2.7 anaconda
conda env remove -n ENV_NAME
@Jongbhin
Jongbhin / split_run.md
Last active March 31, 2020 08:31
[split run] #bash

Shell script

#!/bin/bash
for i in $(seq -f "%04g" 0000 0249)
do
    echo "=========================================================================================================="
    input_file="input$i"
    echo $input_file
    /app/jdk/bin/java -Xmx2048m -jar -Dtarget=$input_file cleanscoring-batch-0.0.1.jar cleanScoringJob >> ./logs/clean_scoring_all_product.log 2>&1
done