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
# initialize | |
ip link | |
sudo su | |
apt update | |
apt upgrade -y | |
apt install -y openssh-server vim | |
# method-1 | |
sudo service network-manager stop | |
sudo update-rc.d -f network-manager remove |
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
## ENVs | |
# basic | |
export PWD=`pwd` | |
# docker | |
export CONTAINER_NAME=container_name | |
export DIR_DOCKER=docker | |
export DOCKERFILE_NAME=Dockerfile | |
export EXPOSED_PORT=8888 | |
export CONTAINER_ID=`docker ps --format {{.ID}}` | |
# -------------------------------------------------------- |
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
export PWD=`pwd` | |
export DIR=. | |
export FILENAME=main | |
# =========================================== | |
en: ## compile LaTeX with English | |
@make tex CONTAINER=pman0214/alpine-texlive-ja-epspdf | |
@make aux CONTAINER=pman0214/alpine-texlive-ja-epspdf | |
@make tex CONTAINER=pman0214/alpine-texlive-ja-epspdf | |
@make tex CONTAINER=pman0214/alpine-texlive-ja-epspdf | |
@make dvi CONTAINER=pman0214/alpine-texlive-ja-epspdf |
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 tensorflow as tf | |
AUTOTUNE = tf.data.experimental.AUTOTUNE | |
import pathlib | |
import random | |
import os | |
import IPython.display as display | |
import matplotlib.pyplot as plt | |
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
# for docker inside, "ls ./ && ls ../" | |
import os; print(os.listdir('./'), os.listdir('../')) | |
# ===== | |
# images | |
# ===== | |
'''read tif''' | |
!pip install tifffile==2020.9.3 | |
import tifffile | |
tifffile.imread('filename.tif') |
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
touch Makefile | |
touch Dockerfile | |
touch .gitignore | |
touch .dockerignore | |
touch requirements.txt | |
# gigignore | |
echo '.ipynb_checkoints' >> .gitignore | |
echo '__pycache__' >> .gitignore |
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
def unet(x, ch, depth, cut_path=False): | |
conv_kwargs = {'kernel_size': (3, 3), 'strides'=(1, 1), 'dilation_rate'=(1, 1), | |
'padding'='same', 'use_bias'=True, 'bias_initializer'='zeros', 'kernel_initializer'='he_normal'} | |
for _ in range(2): | |
x = tf.keras.layers.Convolution2D(ch, **conv_kwargs)(x) | |
x = tf.keras.layers.BatchNormalization()(x) | |
x = tf.keras.layers.Activation('relu')(x) | |
if(depth != 0): | |
path = x |
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 skimage import io | |
import matplotlib.pyplot as plt | |
def imshow(img, dpi=150): | |
if(len(img.shape)==2):#grayscale | |
plt.figure(dpi) | |
plt.imshow(img) | |
plt.gray() | |
plt.show() | |
else: |
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
# 色を使用 | |
autoload -Uz colors | |
colors | |
# scp needs locate this | |
echo "[loading] ~/.zshrc" | |
# 補完 | |
# autoload -Uz compinit | |
# compinit |
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
echo "[loading] ~/.zprofile" | |
# ========================================= | |
## hook command: cd -> cd + ls | |
cdls () | |
{ | |
\cd "$@" && ls | |
} | |