#!/bin/bash

sudo apt update
sudo apt install -y tmux neovim tar psmisc make aria2 python3-venv
sudo apt install -y ffmpeg

pip install tensorboard scikit-learn omegaconf pynvim build
#pip install timm
pip install torchaudio sentencepiece soundfile 

sudo update-alternatives --install /usr/local/bin/vim vim /usr/bin/nvim 50
sudo update-alternatives --install /usr/local/bin/vi vi /usr/bin/nvim 50

cd /home/ubuntu
wget --no-check-certificate https://files.chrishong.dev/tmux.conf
mv tmux.conf .tmux.conf
wget --no-check-certificate https://files.chrishong.dev/ipsed
chmod +x ipsed
sudo mv ipsed /usr/local/bin/ipsed

wget --no-check-certificate https://files.chrishong.dev/root_ca.crt
sudo mv root_ca.crt /usr/local/share/ca-certificates
sudo update-ca-certificates

#aria2c -x 8 https://loc0.chrishong.dev:8003/dl/imagenet.tar
#tar xf imagenet.tar

mkdir /home/ubuntu/torchaudio
cd /home/ubuntu/torchaudio
aria2c -x 8 https://loc0.chrishong.dev:8003/dl/train-clean-100.tar.gz
aria2c -x 8 https://loc0.chrishong.dev:8003/dl/train-clean-360.tar.gz
aria2c -x 8 https://loc0.chrishong.dev:8003/dl/train-other-500.tar.gz
tar xf train-clean-100.tar.gz
tar xf train-clean-360.tar.gz
tar xf train-other-500.tar.gz


#wget --no-check-certificate https://files.chrishong.dev/e06949b0b85a485e9f280ea6d19e5492_tokenizer.model

cd /home/ubuntu
git config --global credential.helper store
#git clone https://gitlab.com/chongdl/vit-imagenet-rev.git
#git clone https://gitlab.com/chongdl/ctc-finetuning.git
git clone https://gitlab.com/chongdl/data2vec2.git
git clone https://gitlab.com/chongdl/chong_fairseq.git
cd chong_fairseq
make
