-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewdeb.sh
executable file
·170 lines (153 loc) · 4.41 KB
/
newdeb.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
#!/bin/bash
ANSI_RED=$'\033[1;31m'
ANSI_YEL=$'\033[1;33m'
ANSI_GRN=$'\033[1;32m'
ANSI_VIO=$'\033[1;35m'
ANSI_BLU=$'\033[1;36m'
ANSI_WHT=$'\033[1;37m'
ANSI_RST=$'\033[0m'
echo_cmd() { echo -e "${ANSI_BLU}${@}${ANSI_RST}"; }
echo_note() { echo -e "${ANSI_YEL}${@}${ANSI_RST}"; }
echo_info() { echo -e "${ANSI_GRN}${@}${ANSI_RST}"; }
echo_prompt() { echo -e "${ANSI_WHT}${@}${ANSI_RST}"; }
echo_warn() { echo -e "${ANSI_YEL}${@}${ANSI_RST}"; }
echo_debug() { echo -e "${ANSI_VIO}${@}${ANSI_RST}"; }
echo_fail() { echo -e "${ANSI_RED}${@}${ANSI_RST}"; }
prepare_server(){
sudo apt update
sudo apt upgrade -y
sudo apt install git zsh vim curl wget fonts-powerline software-properties-common apt-transport-https ca-certificates -y
}
install_ohmyzsh(){
#oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zdharma/fast-syntax-highlighting.git ~ZSH_CUSTOM/plugins/fast-syntax-highlighting
#Fuzzy Finder
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
}
#vscode
install_vscode(){
echo_info " ** Installing VSCode ** "
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
sudo apt update
sudo apt install code -y
}
#golang
install_golang() {
echo_info " ** Installing GoLang ** "
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go -y
}
install_docker_ce() {
echo_info " ** Installing Docker ** "
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce -y
sudo groupadd docker
sudo usermod -aG docker $USER
}
install_dockercompose() {
echo_info " ** Installing Docker Compose ** "
if [[ -z $(which docker) ]]; then
echo "Need To install Docker first "
fi
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo docker-compose --version
}
install_typora() {
echo_info " ** Installing Typora ** "
wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add -
sudo add-apt-repository 'deb https://typora.io/linux ./'
sudo apt-get update
sudo apt-get install typora -y
}
install_node() {
echo_info " ** Installing NodeJS 12 and npm node package manager ** "
cd ;
sudo apt install gcc g++ make -y
mkdir ~/.npm-global
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo -v
sudo apt update
sudo apt install -y nodejs
npm config set prefix "$HOME/.npm-global"
echo "export PATH=$HOME/.npm-global/bin:$PATH" | tee -a $HOME/.profile
source $HOME/.profile
npm install npm@latest -g
}
#chrome
install_chrome(){
echo_info " ** Installing Google Chrome ** "
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb -y
}
while :
do
echo ""
echo ""
echo_note "New DEB Instalation :"
echo ""
echo "[1] Prepare Server"
echo "[2] Install OH-MY-ZSH"
echo "[3] Install VSCode"
echo "[4] Install golang"
echo "[5] Install docker"
echo "[6] Install docker-compose"
echo "[7] Install Typora"
echo "[8] Install NodeJS"
echo "[9] Install Google Chrome"
echo "[18] Run All"
echo "[19] Exit"
echo ""
read choice
case $choice in
1)
prepare_server
;;
2)
install_ohmyzsh
;;
3)
install_vscode
;;
4)
install_golang
;;
5)
install_docker_ce
;;
6)
install_dockercompose
;;
7)
install_typora
;;
8)
install_node
;;
9)
install_chrome
;;
18)
echo "Run All"
prepare_server
install_ohmyzsh
install_vscode
install_golang
install_docker_ce
install_dockercompose
install_typora
install_node
install_chrome
;;
19)
exit
;;
esac
done