This file contains 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
# In the server, (images what I mostly used) | |
docker pull nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 | |
# cuda 10.0 multiple ports volume binding | |
docker run -ti --runtime=nvidia --name dongkwan -p 8082:22 -p 8083:6006 --ipc=host -v /mnt/nas2:/mnt/nas2 -d nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 /bin/bash | |
# Unknown runtime specified nvidia | |
docker run -ti --gpus '"device=0,1,2,3"' --name dongkwan -p 8070:22 --ipc=host -d nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 /bin/bash | |
# For volume | |
docker volume create volume_name |
This file contains 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
sudo apt update | |
sudo apt install -y build-essential zlib1g-dev libssl-dev | |
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.8p1.tar.gz | |
tar -xvf openssh-9.8p1.tar.gz | |
cd openssh-9.8p1 | |
./configure | |
make |
This file contains 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 random | |
T = 596 | |
R, C = 37, 16 | |
numbers = list(range(1, T + 1)) | |
random.shuffle(numbers) | |
sets = [] | |
for _set in range(R): |
This file contains 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 | |
# usage bash toCamel.sh target.js | |
# snake_func -> snakeFunc | |
for i in $(seq 1 30) | |
do | |
cat $1 | sed -r 's/([a-z]+)_([a-z])([a-z]+)/\1\U\2\L\3/g' > temp | |
mv temp $1 | |
done |
This file contains 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
from typing import Tuple, List | |
try: | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
from matplotlib.ticker import LinearLocator | |
from mpl_toolkits.mplot3d import Axes3D | |
except ImportError: | |
pass | |
import numpy as np |
This file contains 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
nvidia-smi --query-compute-apps=pid,process_name,used_memory --format=csv | |
ps all --sort=-time | grep python | |
python -u analysis.py | tee log.txt | |
ps aux | grep -ie "query" | awk '{print $2}' | xargs kill -9 |
This file contains 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
\newcommand\todo[1]{\textcolor{red}{#1}} | |
\newcommand\g[1]{\textcolor{gray}{#1}} | |
\newcommand*{\scale}[2][4]{\scalebox{#1}{$#2$}}% | |
\newcommand*{\resize}[2]{\resizebox{#1}{!}{$#2$}}% | |
\newcommand\ko[1]{ | |
\begin{CJK}{UTF8}{} % require \usepackage{CJKutf8} | |
\CJKfamily{mj} | |
#1 | |
\end{CJK} | |
} |
This file contains 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
from typing import Dict, Any, List, Tuple | |
import torch | |
from torch import Tensor | |
def auto_index_select(value_tensor: Tensor, index_tensor: Tensor): | |
index_tensor = index_tensor.squeeze() | |
sizes = value_tensor.size() | |
for dim, dim_size in enumerate(sizes): |
This file contains 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
%%%%% NEW MATH DEFINITIONS %%%%% | |
\usepackage{amsmath,amsfonts,bm} | |
% Mark sections of captions for referring to divisions of figures | |
\newcommand{\figleft}{{\em (Left)}} | |
\newcommand{\figcenter}{{\em (Center)}} | |
\newcommand{\figright}{{\em (Right)}} | |
\newcommand{\figtop}{{\em (Top)}} | |
\newcommand{\figbottom}{{\em (Bottom)}} |
This file contains 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
/* get_link_for_letter(2019xxxx, YYMMDD, "이름석자"); */ | |
function get_link_for_letter(date_to_enter, date_of_birth, name) { | |
date_to_enter = Base64.encode(date_to_enter + ""); | |
date_of_birth = Base64.encode(date_of_birth + ""); | |
return `http://www.katc.mil.kr/katc/community/children.jsp?search:search_key1:child_search=etc_char8&search:search_key2:child_search=etc_char9&search:search_key3:child_search=etc_char1&search_val1=${date_to_enter}&search_val2=${date_of_birth}&search_val3=${name}` | |
} | |
// Base64 from cms.js from http://www.katc.mil.kr | |
var Base64 = { | |
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", |
NewerOlder