Skip to content

Instantly share code, notes, and snippets.

View slaysd's full-sized avatar
🍀
Working at Naver Clova AI

Jeeseung Han slaysd

🍀
Working at Naver Clova AI
View GitHub Profile
@slaysd
slaysd / pom.xml
Created April 30, 2017 10:11
메이븐 실행가능 Jar 빌드 플러그인
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.example</mainClass>
</manifest>
@slaysd
slaysd / gist:febd79ed93b778fadb8e18509536e3f7
Created August 12, 2017 13:40
파이썬 기초 환경 구축 시 bash쉘에 등록 해야할 것들
eval "$(pyenv init -)"
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
echo 'source /usr/local/opt/autoenv/activate.sh' >> ~/.bash_profile
@slaysd
slaysd / progressbar.py
Created September 22, 2017 05:06
파이썬 프로그래스바 함수
# Print iterations progress
def printProgressBar (iteration, total, prefix = '', suffix = '', decimals = 1, length = 100, fill = '█'):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)
suffix - Optional : suffix string (Str)
decimals - Optional : positive number of decimals in percent complete (Int)
@slaysd
slaysd / portainer.conf
Created January 26, 2018 03:43
Portainer Nginx 프록시 설정(웹소켓 안될시)
upstream portainer_yourdomain_com {
server 127.0.0.1:9000;
}
server {
listen 80;
server_name portainer.yourdomain.com;
location / {
@slaysd
slaysd / gif2jpg.py
Created September 11, 2018 05:31
gif2jpg from url
from PIL import Image
import urllib2 as urllib
import io
fd = urllib.urlopen("http://a/b/c")
image_file = io.BytesIO(fd.read())
im = Image.open(image_file)
im = im.convert('RGB')
im.save('example.jpg')
@slaysd
slaysd / alias.md
Last active December 24, 2018 01:19
Google Drive wget

Setup

Add this code to your ~/.bash_aliases file.

function gdrive_download () {
  CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
  rm -rf /tmp/cookies.txt
}
@slaysd
slaysd / medium_my_under55.cnf
Last active March 9, 2019 14:17
MySQL 5.5미만 UTF-8 해결방법 #blog
[client]
..
default-character-set = utf8
[mysqld]
..
init_connect="SET collation_connection = utf8_general_ci"
init_connect="SET NAMES utf8"
default-character-set = utf8
character-set-server = utf8
@slaysd
slaysd / medium_my_above55.cnf
Last active March 9, 2019 14:18
MySQL 5.5이상 UTF-8 해결방법 #blog
[mysqld]
..
collation-server = utf8_unicode_ci
character-set-server = utf8
skip-character-set-client-handshake
@slaysd
slaysd / initialize_jenkinsx.sh
Last active February 12, 2020 12:44
AWS EKS + Jenkins X 환경설치 스크립트
#!/bin/bash
CLUSTER_NAME={{TYPE YOUR CLUSTER NAME}}
REGION={{ TYPE YOUR AWS EKS REGION NAME }}
echo "AWS CLI 설치"
pip install awscli --upgrade --user
export PATH=$HOME/.local/bin:$PATH
echo 'export PATH=$HOME/.local/bin:$PATH' >> $HOME/.zshrc
@slaysd
slaysd / add_vpn_user.sh
Created January 17, 2020 04:44
k8s openvpn on jx
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Usage: $0 <CLIENT_KEY_NAME> <NAMESPACE>"
exit
fi
KEY_NAME=$1
NAMESPACE=$2