-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetting_for_docker.sh
More file actions
129 lines (105 loc) · 3.2 KB
/
setting_for_docker.sh
File metadata and controls
129 lines (105 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env bash
apt-get update && apt-get install -y \
build-essential \
git \
wget \
curl \
htop \
unzip \
nvtop \
tmux \
tzdata \
software-properties-common \
gnupg \
ca-certificates \
zip \
locales \
g++ \
zsh \
fontconfig \
stow \
fzf \
ripgrep \
fd-find \
lua5.1 \
luarocks
apt autoremove -y
# The reason for doing apt-get update && apt-get install -y before doing this step is that the initialized image PPA is not fully functional.
yes '' | add-apt-repository ppa:neovim-ppa/unstable
apt-get update && apt-get install -y neovim
# huggingface-cli login
pip install huggingface_hub
huggingface-cli login --token YOUR_HUGGINGFACE_TOKEN
echo 'export HF_HOME=/mnt/shared/cache_storage/huggingface' >>~/.bashrc
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
cat <<'EOF' >>~/.bashrc
# nvm initialization
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
EOF
# install rust ,but installation took too long so clearml timeout
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source ~/.cargo/env
rustup update
# install yazi
cargo install --locked yazi-fm yazi-cli
# Install lsd
cargo install lsd
# conda
conda init bash
source ~/.bashrc
# load nvm manually
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# install node
nvm install --lts
# time zone
TZ=Asia/Taipei
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
echo $TZ >/etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# set locale
locale-gen en_US.UTF-8
export LANG=en_US.UTF-8
# install fonts
FONT_TMP=~/fonts_download
mkdir -p "$FONT_TMP"
cd "$FONT_TMP"
wget -q https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Tinos.zip
unzip -o Tinos.zip
cd ..
mkdir -p ~/.fonts
cp "$FONT_TMP"/*.ttf ~/.fonts/
fc-cache -fv
rm -rf "$FONT_TMP"
# install lazygit
LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygit/releases/latest" | \grep -Po '"tag_name": *"v\K[^"]*')
curl -Lo lazygit.tar.gz "https://github.com/jesseduffield/lazygit/releases/download/v${LAZYGIT_VERSION}/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
install lazygit -D -t /usr/local/bin/
rm -rf lazygit.tar.gz lazygit
# install starship
curl -sS https://starship.rs/install.sh | sh -s -- -y
git clone https://github.com/yaocongchen/dotfiles.git
cd dotfiles
stow zsh starship nvim tmux yazi
# Set Zsh as the default login shell
if command -v zsh >/dev/null 2>&1; then
chsh -s "$(which zsh)" || echo "Please manually switch the default shell to zsh"
fi
echo 'export HF_HOME=/mnt/shared/cache_storage/huggingface' >>~/.zshrc
echo 'source ~/.clearmlrc' >>~/.zshrc
conda init zsh
# no show (env name because starship already processed)
conda config --set changeps1 false
# Exit the default virtual environment
cat <<'EOF' >>~/.zshrc
if command -v conda >/dev/null 2>&1 && [[ -n "$CONDA_PREFIX" ]]; then
conda deactivate
elif [[ -n "$VIRTUAL_ENV" ]]; then
deactivate
fi
EOF
exec zsh