-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
184 lines (159 loc) · 4.2 KB
/
install.sh
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
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
function info() {
printf "[i] ${GREEN}${1}${NC}\n"
}
function warn() {
printf "[!] ${YELLOW}${1}${NC}\n"
}
function error() {
printf "[X] ${Red}${1}${NC}\n"
}
function updateBrew() {
if [[ $(command -v brew) == "" ]]; then
info "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
warn "Homebrew is already present"
info "Updating Homebrew"
brew update
fi
}
function makeSudoUser() {
read -p "Enter user's name to be created: " user
if id -u "$user" >/dev/null 2>&1; then
warn "User already exists, skipping"
else
info "Creating user with $user"
sudo adduser $user
sudo passwd $user
sudo usermod -aG sudo $user
sudo usermod -aG wheel $user
fi
}
function setupZsh() {
if [ -d ~/.oh-my-zsh ]; then
warn "oh-my-zsh is already present"
else
info "Installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# sudo usermod -s /usr/bin/zsh $(whoami)
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt"
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestio
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/zsh-completions
git clone https://github.com/horosgrisa/mysql-colorize ${ZSH_CUSTOM:=~/.oh-my-zsh/custom}/plugins/mysql-colorize
sed -i.bak 's/^plugins=(\(.*\)/plugins=(zsh-autosuggestions zsh-syntax-highlighting zsh-completions mysql-colorize \1/' ~/.zshrc
fi
}
function setupNode() {
if [ -d $HOME/.nvm ]; then
warn "nvm is already present"
else
info "Installing NVM"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install --lts
nvm use --lts
fi
}
function setupZshrc() {
if [ -d $HOME/._bash ]; then
warn "zshrc is already setup"
else
info "Setting up .zshrc"
echo "source /usr/share/autojump/autojump.zsh" >>~/.zshrc
curl https://raw.githubusercontent.com/reezpatel/awesome-dev/master/linux/.bashrc >>~/.zshrc
echo 'load "https://raw.githubusercontent.com/reezpatel/awesome-dev/master/linux/__modules__/alias.sh"' >>~/.zshrc
echo "cd ~" >>~/.zshrc
fi
}
function brewi() {
info "Installing $1 from Homebrew"
brew install -q $1
}
function node() {
info "Installing $1 from NPM"
npm install --quiet --no-progress -g $1
}
echo "Setting up your system..."
makeSudoUser
updateBrew
brewi "curl"
brewi "zsh"
brewi "git"
brewi "coreutils"
brewi "moreutils"
brewi "findutils"
brewi "gcc"
setupZsh
setupNode
brewi "exa"
brewi "httpie"
brewi "icdiff"
brewi "autojump"
brewi "bat"
brewi "htop"
node "tldr"
node "fx"
node "git-stats"
node "balzss/cli-typer"
node "overtime-cli"
brewi "taskwarrior-tui"
brewi "python-yq"
node "gtop"
node "fkill"
node "yarn"
node "np"
brewi "gh"
brewi "openssh"
node "superstatic"
node "npm-check"
node "spot"
# Pen test
brewi "aircrack-ng"
brewi "bfg"
brewi "binutils"
brewi "binwalk"
brewi "cifer"
brewi "dex2jar"
brewi "dns2tcp"
brewi "fcrackzip"
brewi "foremost"
brewi "hashpump"
brewi "hydra"
brewi "john"
brewi "knock"
brewi "netpbm"
brewi "nmap"
brewi "pngcheck"
brewi "socat"
brewi "sqlmap"
brewi "tcpflow"
brewi "tcpreplay"
brewi "tcptrace"
brewi "ucspi-tcp"
brewi "xpdf"
brewi "xz"
brewi "ack"
brewi "git-lfs"
brewi "gs"
brewi "rename"
brewi "ssh-copy-id"
brewi "tree"
brewi "vbindiff"
brewi "neofetch"
brewi "lf"
brewi "zlib"
brewi "nano"
brewi "hadolint"
brewi "fzf"
brewi "pngquant"
brewi "stripe/stripe-cli/stripe"
brewi "awscli"
setupZshrc