# add the GPG key for the official Docker repository to the system
curl -fsSL | sudo apt-key add -

# add the Docker repository to APT sources
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

# update the package database with the Docker packages from the newly added repo
sudo apt-get update

# install from the Docker repo instead of the default Ubuntu 16.04 repo
apt-cache policy docker-ce

# install docker
sudo apt-get install -y docker-ce

# check if the docker daemon is running
sudo systemctl status docker

# add user to docker group
sudo usermod -aG docker ${USER}
su - ${USER}
id -nG


# Install nvidia-runtime
# Download nvidia-runtime packages
curl -s -L | \
  sudo apt-key add -
curl -s -L | \
  sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update

# Install nvidia-runtime
sudo apt-get install nvidia-container-runtime

# Docker Engine setup
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF
ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime
sudo systemctl daemon-reload
sudo systemctl restart docker

# Daemon configuration file
sudo tee /etc/docker/daemon.json <<EOF
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
sudo pkill -SIGHUP dockerd

# Command line
sudo dockerd --add-runtime=nvidia=/usr/bin/nvidia-container-runtime [...]

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

# Add the package repositories
curl -s -L | \
  sudo apt-key add -
curl -s -L | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker
sudo pkill -SIGHUP dockerd

# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi


sudo rm -rf /var/run/docker/
sudo rm -rf /etc/docker/
sudo apt-get purge -y docker-engine docker docker-ce

Sequential API๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

model = tf.keras.Sequential([

tf.keras.layers.Conv2D(32, 3, activation=relu,


                                               input_shape=(28, 28, 1)),




tf.keras.layers.Dense(64, activation='relu'),


tf.keras.layers.Dense(10, activation='softmax') ])


Functional API๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

input = keras.Input(shape=(28, 28, 1), name='img')

x = layers.Conv2D(16, 3, activation='relu')(input)

x = layers.Conv2D(32, 3, activation='relu')(x)

x = layers.MaxPooling2D(3)(x)

x = layers.Conv2D(32, 3, activation='relu')(x)

x = layers.Conv2D(16, 3, activation='relu')(x)

output = layers.GlobalMaxPooling2D()(x)

encoder = keras.Model(input, output, name='encoder')

Model Subclassing์„ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

class ResNet(tf.keras.Model):

    def __init__(self):

        super(ResNet, self).__init__()

        self.block_1 = ResNetBlock()

        self.block_2 = ResNetBlock()

        self.global_pool = layers.GlobalAveragePooling2D()

        self.classifier = Dense(num_classes)

    def call(self, inputs):

        x = self.block_1(input)

        x = self.block_2(x)

        x = self.global_pool(x)

        return self.classifier(x)

Layer List๋ฅผ ์ด์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•

layer_list = [layer1, layer2, ..., layern]

new_model = tf.keras.Sequential(layer_list)

## ๋˜๋Š”

new_model = tf.kears.Sequential(layers=layer_list)

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] focal stable"
sudo apt update
apt-cache policy docker-ce

sudo apt install docker-ce

sudo systemctl status docker

sudo usermod -aG docker ${USER}
id -nG
sudo reboot now
wget -qO - | sudo apt-key add -
sudo add-apt-repository 'deb ./'
sudo apt -y install typora
sudo apt -y install zsh
chsh -s `which zsh`

# Install oh my zsh!
curl -L | sh

# Install theme
git clone $HOME/.oh-my-zsh/custom/themes/powerlevel10k

# configs
mv $HOME/.zshrc $HOME/.zshrc.old
ln -s $HOME/git/UbuntuBang/zshrc $HOME/.zshrc

# Nerd Fonts
sudo mkdir /usr/share/fonts/truetype/MesloLGS_NF
sudo wget -O /usr/share/fonts/truetype/MesloLGS_NF/MesloLGS%20NF%20Regular.ttf
sudo wget -O /usr/share/fonts/truetype/MesloLGS_NF/MesloLGS%20NF%20Bold.ttf
sudo wget -O /usr/share/fonts/truetype/MesloLGS_NF/MesloLGS%20NF%20Italic.ttf
sudo wget -O /usr/share/fonts/truetype/MesloLGS_NF/MesloLGS%20NF%20Bold%20Italic.ttf

sudo mkdir /usr/share/fonts/truetype/FiraMono
sudo wget -O /usr/share/fonts/truetype/FiraMono/
sudo unzip /usr/share/fonts/truetype/FiraMono/ -d /usr/share/fonts/truetype/FiraMono
sudo rm /usr/share/fonts/truetype/FiraMono/

sudo mkdir /usr/share/fonts/truetype/UbuntuMono
sudo wget -O /usr/share/fonts/truetype/UbuntuMono/Ubuntu%20Nerd%20Font%20Complete%20Mono.ttf
sudo wget -O /usr/share/fonts/truetype/UbuntuMono/Ubuntu%20Nerd%20Font%20Complete.ttf

sudo fc-cache -f -v

p10k configure
wget -O $HOME/Downloads/alacritty.deb
sudo dpkg -i $HOME/Downloads/alacritty.deb
rm $HOME/Downloads/alacritty.deb

mkdir $HOME/.config/alacritty
ln -s $HOME/git/UbuntuBang/alacritty/yml $HOME/.config/alacritty/alacritty.yml
sudo curl | gpg --dearmor > microsoft.gpg
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64] stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt -y install apt-transport-https
sudo apt -y update
sudo apt -y install code


sudo apt install fcitx-hangul
im-config -n fcitx
sudo reboot now


sudo apt install uim uim-byeoru
im-config -n uim
sudo reboot now
sudo apt -y install language-pack-ko fonts-noto-cjk fonts-noto-cjk-extra msttcorefonts

sudo wget -O /usr/share/fonts/truetype/
sudo unzip /usr/share/fonts/truetype/ -d /usr/share/fonts/truetype/
sudo rm /usr/share/fonts/truetype/

sudo mkdir /usr/share/fonts/truetype/D2CodingNerd
sudo wget -O /usr/share/fonts/truetype/D2CodingNerd/D2CodingNerd.ttf

sudo mkdir /usr/share/fonts/truetype/ARIALUNI
sudo wget -O /usr/share/fonts/truetype/ARIALUNI/ARIALUNI.TTF

sudo mkdir /usr/share/fonts/truetype/BickhamScriptPro
sudo wget -O /usr/share/fonts/truetype/BickhamScriptPro/BickhamScriptPro-Bold.otf
sudo wget -O /usr/share/fonts/truetype/BickhamScriptPro/BickhamScriptPro-Regular.otf
sudo wget -O /usr/share/fonts/truetype/BickhamScriptPro/BickhamScriptPro-Semibold.otf

sudo fc-cache -f -v
sudo apt -y install gnome-font-viewer

+ Recent posts