-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_user.sh
More file actions
403 lines (313 loc) · 12.8 KB
/
run_user.sh
File metadata and controls
403 lines (313 loc) · 12.8 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
#!/bin/bash
prepend_path() {
case ":$PATH:" in
*":$1:"*) ;;
*) PATH="$1:$PATH" ;;
esac
}
refresh_go_toolchain_path() {
if [ -x "$HOME/.go/bin/go" ]; then
export GOROOT="$HOME/.go"
prepend_path "$GOROOT/bin"
fi
}
ensure_pipx() {
if command -v pipx >/dev/null 2>&1; then
pipx ensurepath --force || true
return 0
fi
if python3 -m pip --version >/dev/null 2>&1; then
python3 -m pip install --user pipx
python3 -m pipx ensurepath --force || true
return 0
fi
echo "pip is unavailable; skipping pipx bootstrap"
}
export GOPATH="$HOME/go"
export FNM_PATH="$HOME/.local/share/fnm"
export BUN_INSTALL="$HOME/.bun"
prepend_path "$HOME/.local/bin"
prepend_path "$HOME/.cargo/bin"
prepend_path "$GOPATH/bin"
prepend_path "$HOME/.fzf/bin"
prepend_path "$FNM_PATH"
prepend_path "$HOME/.pixi/bin"
prepend_path "$BUN_INSTALL/bin"
prepend_path "$HOME/.opencode/bin"
prepend_path "$HOME/.nvim/bin"
refresh_go_toolchain_path
export PATH
# install dev tools
mkdir -p ~/.local/bin
# install pipx
ensure_pipx
# install bat
wget -O bat.zip https://github.com/sharkdp/bat/releases/download/v0.25.0/bat-v0.25.0-x86_64-unknown-linux-musl.tar.gz
tar -xvzf bat.zip -C ~/.local/bin
mv ~/.local/bin/bat-v0.25.0-x86_64-unknown-linux-musl/bat ~/.local/bin/bat
rm -r ~/.local/bin/bat-v0.25.0-x86_64-unknown-linux-musl
rm bat.zip
# install fnm for nodejs
curl -o- https://fnm.vercel.app/install | bash
# install neofetch
git clone --depth 1 --branch "7.1.0" https://github.com/dylanaraps/neofetch ~/neofetch
cd ~/neofetch && make PREFIX=~/.local install
cd ~ && rm -rf ~/neofetch
# install ncdu
wget https://dev.yorhel.nl/download/ncdu-2.3-linux-x86_64.tar.gz
tar -xvzf ncdu-2.3-linux-x86_64.tar.gz -C ~/.local/bin
rm ncdu-2.3-linux-x86_64.tar.gz
# install gitkraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
tar -xvzf gitkraken-amd64.tar.gz
mv gitkraken ~/.gitkraken
rm gitkraken-amd64.tar.gz
ln -s ~/.gitkraken/gitkraken ~/.local/bin/gitkraken
# set tmux color
echo "set -g default-terminal \"screen-256color\"" >> ~/.tmux.conf
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# change default shell
chsh --shell $(which zsh) $(whoami)
# download theme
curl -fsSL https://raw.githubusercontent.com/ControlNet/my-zsh-theme-env/main/files/mzz-ys.zsh-theme > ~/.oh-my-zsh/themes/mzz-ys.zsh-theme
# modify the .zshrc file to change the theme and add plugins
cat ~/.zshrc | sed 's/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"mzz-ys\"\nZSH_DISABLE_COMPFIX=\"true\"/' \
| sed 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' \
| sed 's/# export PATH=$HOME\/bin:$HOME\/.local\/bin:\/usr\/local\/bin:$PATH/export PATH=$HOME\/.cargo\/bin:$HOME\/.local\/bin:$HOME\/bin:\/usr\/local\/bin:$PATH/' \
> ~/temp.zshrc
mv ~/temp.zshrc ~/.zshrc
# Disable oh-my-zsh auto update notification
echo "export DISABLE_UPDATE_PROMPT=true" | cat - ~/.zshrc > temp && mv temp ~/.zshrc
# set the TERM=xterm-256color for tmux and Mosh
echo "export TERM=xterm-256color" | cat - ~/.zshrc > temp && mv temp ~/.zshrc
# install other plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# setup git history visualization
git config --global alias.lsd "log --graph --decorate --pretty=oneline --abbrev-commit --all"
# setup git credential
git config --global credential.helper store
# install miniconda
curl -s -L -o miniconda_installer.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash miniconda_installer.sh -b
rm miniconda_installer.sh
# initialize conda
~/miniconda3/bin/conda init zsh
# hide conda prefix
echo "changeps1: false" >> ~/.condarc
# setup cargo
curl https://sh.rustup.rs -sSf | sh -s -- -y
# setup go
wget -q -O - https://raw.githubusercontent.com/ControlNet/golang-tools-install-script/refs/heads/master/goinstall.sh | bash
refresh_go_toolchain_path
export PATH
# setup 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/latest/download/lazygit_${LAZYGIT_VERSION}_Linux_x86_64.tar.gz"
tar xf lazygit.tar.gz lazygit
install lazygit ~/.local/bin/lazygit
rm lazygit.tar.gz lazygit
# setup neovim
curl -LO https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz
tar -xzf nvim-linux64.tar.gz
mv nvim-linux64 ~/.nvim
ln -s $HOME/.nvim/bin/nvim $HOME/.local/bin/nvim
rm nvim-linux64.tar.gz
# setup GoLang environment variables (which is only set for bash in previous)
echo '# GoLang' >> ~/.zshrc
echo 'export GOROOT=$HOME/.go' >> ~/.zshrc
echo 'export PATH=$GOROOT/bin:$PATH' >> ~/.zshrc
echo 'export GOPATH=$HOME/go' >> ~/.zshrc
echo 'export PATH=$GOPATH/bin:$PATH' >> ~/.zshrc
# setup fnm environment variables
echo 'export FNM_PATH="$HOME/.local/share/fnm"' >> ~/.zshrc
echo 'if [ -d "$FNM_PATH" ]; then' >> ~/.zshrc
echo ' export PATH="$FNM_PATH:$PATH"' >> ~/.zshrc
echo ' eval "`fnm env`"' >> ~/.zshrc
echo 'fi' >> ~/.zshrc
echo 'eval "$(fnm completions --shell zsh)"' >> ~/.zshrc
# install fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
# setup fzf environment variables
echo '[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh' >> ~/.zshrc
eval "$(fnm env --shell bash)"
# install nodejs
fnm install --lts --use
eval "$(fnm env --shell bash)"
# setup LunarVim
LV_BRANCH='release-1.4/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.4/neovim-0.9/utils/installer/install.sh) -y
~/miniconda3/bin/python -m pip install neovim
# setup conda
~/miniconda3/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
~/miniconda3/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
~/miniconda3/bin/conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/msys2
# use faster libmamba solver for conda
~/miniconda3/bin/conda install -n base -y conda-libmamba-solver
~/miniconda3/bin/conda config --set solver libmamba
# install jupyter
~/miniconda3/bin/conda install -y ipywidgets ipykernel jupyterlab jupyter
# setup lazydocker
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
# install lemonade for neovim/lunarvim clipboard for SSH
go install github.com/lemonade-command/lemonade@latest
# install cargo-binstall for faster cargo installation
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
export BINSTALL_DISABLE_TELEMETRY=true
export BINSTALL_NO_CONFIRM=true
echo "export BINSTALL_DISABLE_TELEMETRY=true" >> ~/.zshrc
echo "export BINSTALL_NO_CONFIRM=true" >> ~/.zshrc
# install zellij
cargo binstall zellij
echo "alias zel='zellij'" >> ~/.zshrc
curl -fsSL https://raw.githubusercontent.com/ControlNet/envira/master/files/fix_zellij_kdl.py | python3
# install lsd with alias to ls
cargo binstall lsd
echo "alias ls='lsd'" >> ~/.zshrc
# install cargo cache for cleaning cache of cargo
cargo binstall cargo-cache
# install git-delta
cargo binstall git-delta
# add duf as the alias to df
go install github.com/muesli/duf@latest
echo "alias df='duf'" >> ~/.zshrc
# add dust as the alias to du
cargo binstall du-dust
echo "alias du='dust'" >> ~/.zshrc
# add fd as the alias to find
cargo binstall fd-find
# echo "alias find='fd'" >> ~/.zshrc
# add riggrep as the alias to grep
cargo install --features "pcre2" ripgrep
# echo "alias grep='rg'" >> ~/.zshrc
# install gping as the alias to ping
cargo binstall gping
echo "alias ping='gping'" >> ~/.zshrc
# install procs as the alias to ps
cargo binstall procs
echo "alias ps='procs'" >> ~/.zshrc
# install xh (http client)
cargo binstall xh
# install uv (faster pip)
pipx install uv
# install pixi (conda + poetry)
curl -fsSL https://pixi.sh/install.sh | bash
echo 'export PATH="$HOME/.pixi/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pixi completion --shell zsh)"' >> ~/.zshrc
mkdir -p ~/.config/pixi
echo "shell.change-ps1 = false" > ~/.config/pixi/config.toml
# install speedtest-cli (internet speed test)
pipx install speedtest-cli
# install gdown (google drive downloader)
pipx install gdown
# install archey4
pipx install archey4
# install genact
cargo install genact
# install rust-motd, work later
# cargo install --git https://github.com/rust-motd/rust-motd
# install zoxide (better cd)
curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
echo 'eval "$(zoxide init bash)"' >> ~/.bashrc
echo 'eval "$(zoxide init zsh)"' >> ~/.zshrc
# install micro (better nano)
curl https://getmic.ro | bash
mv micro ~/.local/bin
echo "alias nano='micro'" >> ~/.zshrc
# install scc (code counter)
go install github.com/boyter/scc/v3@latest
# install viu (image viewer)
cargo binstall viu
# install dive (docker image explorer)
go install github.com/wagoodman/dive@latest
# install tldr (CLI command help)
pipx install tldr
# install huggingface CLI
pipx install "huggingface-hub[cli,hf_xet]"
# install superfile (CLI file manager)
bash -c "$(curl -sLo- https://superfile.netlify.app/install.sh)"
CFG="$HOME/.config/superfile/config.toml"
URL="https://raw.githubusercontent.com/yorukot/superfile/main/src/superfile_config/config.toml"
mkdir -p "$HOME/.config/superfile"
[ -f "$CFG" ] || curl -fsSL "$URL" -o "$CFG"
sed -i -E 's/^\s*auto_check_update\s*=.*/auto_check_update = false/' "$CFG"
# install yazi (CLI file manager)
cargo install yazi-build
mkdir -p ~/.config/yazi
ya pack -a BennyOe/onedark
echo '[flavor]' > ~/.config/yazi/theme.toml
echo 'use = "onedark"' >> ~/.config/yazi/theme.toml
# install pm2
npm config set prefix "$HOME/.local"
npm install -g pm2
# install CLI agents
npm install -g @openai/codex@latest
mkdir -p ~/.codex
echo "network_access = true" >> ~/.codex/config.toml
npm install -g @google/gemini-cli
curl -fsSL https://cursor.com/install | bash
curl -fsSL https://claude.ai/install.sh | bash
curl -fsSL https://opencode.ai/install | bash
curl -fsSL https://bun.sh/install | bash
~/.bun/bin/bunx oh-my-opencode install --no-tui --claude=no --openai=no --gemini=no --copilot=no
~/.bun/bin/bun add -g @openchamber/web
curl -fsSL https://raw.githubusercontent.com/can1357/oh-my-pi/main/scripts/install.sh | sh
# add more relavent tools for agents
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/zjrosen/perles/main/install.sh | bash
# install dolt for beads
arch="$(uname -m)" && \
case "$arch" in
x86_64|amd64) asset="dolt-linux-amd64.tar.gz" ;;
aarch64|arm64) asset="dolt-linux-arm64.tar.gz" ;;
*) echo "Unsupported arch: $arch" >&2; exit 1 ;;
esac && \
tmpdir="$(mktemp -d)" && \
curl -L "https://github.com/dolthub/dolt/releases/latest/download/$asset" -o "$tmpdir/dolt.tgz" && \
tar -xzf "$tmpdir/dolt.tgz" -C "$tmpdir" && \
install -m 755 "$tmpdir"/*/bin/dolt ~/.local/bin/dolt && \
rm -rf "$tmpdir"
# because it's installed in bash, so we need to manually add it to .zshrc
echo '[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"' >> ~/.zshrc
echo 'export BUN_INSTALL="$HOME/.bun"' >> ~/.zshrc
echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> ~/.zshrc
# install rustscan
cargo binstall rustscan
# install gotify
go install github.com/gotify/cli@latest
mv ~/go/bin/cli ~/go/bin/gotify
# Monitoring tools
# install bottom (system monitoring)
cargo binstall bottom
# install nvitop (nvidia gpu monitoring)
pipx install nvitop
# install nviwatch (nvidia gpu monitoring)
cargo binstall nviwatch
# install bpytop (better htop)
# pipx install bpytop
# echo "alias top='bpytop'" >> ~/.zshrc
# now we use btop instead
wget https://github.com/aristocratos/btop/releases/download/v1.4.5/btop-x86_64-linux-musl.tbz -O btop.tbz
tar -xvf btop.tbz
cp btop/bin/btop ~/.local/bin
rm -r btop
rm btop.tbz
echo "alias top='btop'" >> ~/.zshrc
# install rich cli
pipx install rich-cli
# install github CLI
curl -sS https://webi.sh/gh | sh
# install syncthing (file sync)
# curl -sS https://webinstall.dev/syncthing | bash
# mkdir -p ~/.config/systemd/user
# wget https://raw.githubusercontent.com/ControlNet/my-zsh-theme-env/main/files/syncthing.service -O ~/.config/systemd/user/syncthing.service
# systemctl --user enable syncthing.service
# systemctl --user start syncthing.service
# setup the jupyter systemctl
# wget https://raw.githubusercontent.com/ControlNet/my-zsh-theme-env/main/files/jupyter.service -O ~/.config/systemd/user/jupyter.service
# systemctl --user enable jupyter.service
# systemctl --user start jupyter.service
cargo cache -a
# change to zsh and apply theme
zsh