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
#user nobody; | |
worker_processes 4; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
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 | |
echo "[+] Make custom ssh server directory" | |
SSHD_DIR=${HOME}/.custom_ssh | |
if [ ! -d ${SSHD_DIR} ]; then | |
mkdir ${SSHD_DIR} | |
fi | |
# Generate ssh server key | |
if [ ! -f ${SSHD_DIR}/ssh_host_rsa_key ]; then |
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
echo "[+] Download Mecab files" | |
curl -L https://github.com/cosmoquester/mecab-ko-docker/releases/download/v1.0/mecab.tgz > mecab.tgz | |
echo "[+] Unzip Mecab files" | |
tar zxvf mecab.tgz | |
echo "[+] Install Mecab" | |
cp mecab/mecabrc /usr/local/etc/mecabrc | |
cp -r mecab/lib/* /usr/local/lib/ | |
cp -r mecab/bin/* /usr/local/bin/ |
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 | |
if [ -z "$LOCAL_SSH_PORT" ]; then | |
LOCAL_SSH_PORT=22 | |
fi | |
if [ -z "$PROXY_SERVER_HOST"]; then | |
PROXY_SERVER_HOST=nas-dummy-ssh | |
fi |
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
function get_papers() { | |
titles = document.querySelectorAll("#main-container > div.content > ol > li > p.title") | |
abstracts = document.querySelectorAll("#main-container > div.content > ol > li > p.abstract > span.abstract-full") | |
urls = document.querySelectorAll("#main-container > div.content > ol > li > div > p > a") | |
title_array = Array.from(titles).map(x => x.innerText.trim()) | |
abstract_array = Array.from(abstracts).map(x => x.innerText.trim()) | |
url_array = Array.from(urls).map(x => x.href.trim()) | |
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 | |
keyword="python" | |
header=`free -m | grep total | sed -E 's/^ (.*)/\1/g' | sed -e 's/ \+/\t/g'` | |
echo -e "date\t\ttime\t${header}\t${keyword}_memory" | |
while true; | |
do | |
memory_keyword=`ps hax -o rss,user,cmd | grep $keyword | awk '{s += $1;} END { print s/1024;}'` | |
datetime=$(date '+%Y-%m-%d%t%H:%M:%S') |
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 argparse | |
import sys | |
import httpimport | |
import tokenizers | |
from transformers import PreTrainedTokenizerFast | |
SENTENCEPIECE_URI = "https://raw.githubusercontent.com/google/sentencepiece/master/python/src/sentencepiece" | |
parser = argparse.ArgumentParser(description="convert sentencepiece unigram to tokenizers modl") |
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
CUR_SHELL="$(ps -p $$ -o command | grep -Eo '[a-z]+sh')" | |
# control + t: Undo | |
if [[ $CUR_SHELL == *"zsh" ]]; then | |
bindkey '\C-t' undo | |
bindkey \^U backward-kill-line # bash Ctrl+U와 똑같이 동작하도록 수정 | |
elif [[ $CUR_SHELL == *"bash" ]]; then | |
bind '"\C-t":undo' | |
else | |
echo "Cannot find current shell!" |