This repository has been archived by the owner on Jan 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
system-setup-linux
executable file
·148 lines (119 loc) · 3.66 KB
/
system-setup-linux
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
#!/bin/bash
<<DETAILS
Set up a new system with my preferred packages.
Usage: ./system-setup
DETAILS
echo -e "Starting system setup...\n"
##############
# Programming
##############
# Install python3 -m pip for default python3 on Linux
echo -e "\n\nPython3 and pip:\n"
sudo apt update
sudo apt install python3-pip
# Intall bash-wakatime
echo -e "\n\nWakaTime coding metrics:\n"
python3 -m pip install --user wakatime
git clone https://github.com/gjsheep/bash-wakatime.git ~/.local/share/bash-wakatime
# Wakatime config file
if [ ! -f ~/.wakatime.cfg ]; then
echo -e "\n\nWakaTime config file setup:\n"
read -p "Enter WakaTime API Key: " key
echo -e """[settings]
debug = false
hidefilenames = false
ignore =
COMMIT_EDITMSG$
PULLREQ_EDITMSG$
MERGE_MSG$
TAG_EDITMSG$
api_key=$key
""" > ~/.wakatime.cfg
fi
# Node.js
echo -e "\n\nNode.js LTS:\n"
curl --fail -LSs https://install-node.now.sh/lts | sudo bash
npm config set prefix '~/.local'
# TypeScript
echo -e "\n\nTypeScript:\n"
npm i -g typescript ts-node @types/node
npm i -g lodash @types/lodash
## ts-node speedup using swc - Rust based transpiler
## https://typestrong.org/ts-node/docs/transpilers/#bundled-swc-integration
npm i -g @swc/core @swc/helpers regenerator-runtime
# Java (default v11)
echo -e "\n\nDefault JDK installation:\n"
sudo apt install default-jdk
# LaTeX
read -rep $'\n\nLaTeX [y/n]: ' opt_latex
if [ "$opt_latex" == 'y' ]; then
echo -e "\nInstalling..."
sudo apt-get install texlive texlive-pictures texlive-latex-extra texlive-xetex
sudo apt install chktex # linter used by ale for vim
else
echo -e "Skipping...\n"
fi
##########
# Neovim
##########
echo -e "\n\nNeovim:\n"
sudo add-apt-repository ppa:neovim-ppa/stable
sudo apt update
sudo apt install neovim
echo -e "\n\nPython3 provider for nvim:\n"
python3 -m pip install --user --upgrade pynvim
# linting/formatting
echo -e "\n\nALE linters/fixers:\n"
## python
python3 -m pip install --user isort
python3 -m pip install --user autopep8
python3 -m pip install --user flake8
## html, css, js, md, etc.
npm i -g prettier @prettier/plugin-xml
## shell
sudo apt install shellcheck
## java
java_format="google-java-format-1.11.0-all-deps.jar"
wget https://github.com/google/google-java-format/releases/download/v1.11.0/"$java_format" -O ~/.local/lib/"$java_format"
# HTML live server
echo -e "\n\nHTML live server:\n"
npm i -g live-server
###############
# Misc./System
###############
# fzf fuzzy finder
echo -e "\n\nFuzzy finder fzf:\n"
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install
# Rigrep
echo -e "\n\nRipgrep (rg):\n"
sudo apt-get install ripgrep
# zsh
echo -e "\n\nzsh, oh-my-zsh:\n(Note: \"exit\" from oh-my-zsh to resume setup)\n"
sudo apt install zsh
# oh my zsh will start a sub-shell, just "exit" and the this setup script will continue
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc
sudo apt install command-not-found
# trash-cli (safer alternative to rm -rf)
echo -e "\n\nTrash CLI:\n"
sudo apt install trash-cli
# tl;dr (man, but with examples)
echo -e "\n\nTLDR:\n"
sudo apt install tldr && tldr
# https://github.com/chubin/cheat.sh
echo -e "\n\nCheat sheat:\n"
curl https://cht.sh/:cht.sh > ~/.local/bin/cht.sh
chmod +x ~/.local/bin/cht.sh
# zip (in case tar.gz won't do)
echo -e "\n\nZip:\n"
sudo apt install zip
# bat (a cat clone, with syntax highlighting)
echo -e "\n\nBat:\n"
wget https://github.com/sharkdp/bat/releases/download/v0.15.4/bat_0.15.4_amd64.deb
sudo dpkg -i bat_0.15.4_amd64.deb
rm -rf bat_0.15.4_amd64.deb
# git-pull-all
echo -e "\n\ngit-pull-all:\n"
npm i -g git-pull-all
echo -e "\nSystem setup complete!\n"