먼저 cifs-utils
를 설치한다.
sudo apt install cifs-utils
이제 /etc/fstab
을 열어서 부팅 시 자동으로 폴더를 mount 되게 만들어야 한다. 그 전에, 마운트할 경로는 미리 만들어야 한다. 주의할 것은, fstab
에서 공백은 모두 tab
이다.
class CollateTensors: | |
""" | |
Pads and collates multidimensional tensors with variable length in a batch, according to maximum length. | |
Adapted from https://discuss.pytorch.org/t/dataloader-for-various-length-of-data/6418/8 | |
""" | |
def __init__(self, dim=0): | |
""" | |
:param dim: the dimension to be padded (dimension of time in sequences) | |
""" |
filetype plugin indent on | |
autocmd FileType py setlocal tabstop=4 shiftwidth=4 expandtab | |
set number | |
call plug#begin('~/.local/share/nvim/site/plugged') | |
" nvim-yarp | |
Plug 'roxma/nvim-yarp' | |
" NCM2 |
function gotojob { | |
if (( $# == 0 )); then | |
echo "gotojob v0.1.0 by Minjoon Hong" | |
echo "change current directory to working directory of a slurm job" | |
echo "usage: $FUNCNAME [SLURM_JOBID]" | |
return | |
fi | |
workdir=$(scontrol show job $1 | grep Dir | awk -F '=' '{print $2}') | |
cd $workdir | |
} |
import matplotlib.ticker | |
class MyLocator(matplotlib.ticker.AutoMinorLocator): | |
def __init__(self, n=2): | |
super().__init__(n=n) | |
matplotlib.ticker.AutoMinorLocator = MyLocator |
# ffmpeg -framerate $frame_rate -i $filename_pattern $output_filename | |
# example) | |
ffmpeg -framerate 30 -i filename-%03d.jpg output.mp4 |
import ase.io | |
from ase.visualize.plot import plot_atoms | |
import matplotlib.pyplot as plt | |
import matplotlib_inline | |
def view_atoms(atoms): | |
fig, axs = plt.subplots(nrows=1, ncols=3, facecolor="w", dpi=130) | |
axs[0].set_title("Top", fontfamily="Arial", fontsize=16, fontweight="bold") | |
axs[1].set_title("Side", fontfamily="Arial", fontsize=16, fontweight="bold") |
def make_progbar(num_done, total_length): | |
num_done_syms = int((num_done + 1) / total_length * 30) | |
if total_length > 1 and num_done == 0: | |
progbar = "[" + ">".ljust(30, ".") + "]" | |
elif num_done < total_length - 1: | |
progbar = "[" + "=" * num_done_syms + ">".ljust(30 - num_done_syms, ".") + "]" | |
else: | |
progbar = "[" + ">".rjust(30, "=") + "]" | |
return progbar |
from typing import Iterable, Union | |
Numeric = Union[int, float] | |
IncarValue = Union[bool, str, Numeric, Iterable[Union[str, Numeric]]] | |
class Incar: | |
def __init__(self, **kwargs): | |
self.__dict__ = kwargs |