-
Notifications
You must be signed in to change notification settings - Fork 7
/
rookie_install_20.sh
135 lines (122 loc) · 5.03 KB
/
rookie_install_20.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
# env: ubuntu 20.04
# install pre-requisite
sudo apt-get install -y vim git gitk git-gui curl net-tools cmake cmake-curses-gui
# config git account
## generate ssh key
ssh-keygen -t rsa -C "hj.chen@bmi-tech.com"
## start ssh-agent
eval $(ssh-agent -s)
## add key
ssh-add ~/.ssh/id_rsa
## add ssh key in ~/.ssh to your git account
## clone a project to test
git config --global user.name kiki
git config --global user.email hj.chen@bmi-tech.com # todo
# config git for easy use
git config --global alias.cpick cherry-pick
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.ss 'stash save'
git config --global alias.sl 'stash list'
git config --global alias.sp 'stash pop'
git config --global alias.unstage 'reset HEAD --'
git config --global alias.pullo 'pull origin'
git config --global alias.pusho 'push origin'
git config --global url.git@github.com:.insteadOf https://github.com/
# install ssh-server for remote access
sudo apt-get install -y openssh-server
# install wireshark
sudo apt-get install -y wireshark
sudo groupadd wireshark
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 4755 /usr/bin/dumpcap
sudo gpasswd -a kiki wireshark
# install mysql
sudo apt-get install -y mysql-server mysql-client
# install phpmyadmin
sudo apt-get install -y phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
## open localhost/phpmyadmin
## error: the mbstring extension is missing. please check your php configuration
## sudo apt-get -y install php-mbstring php-gettext
## sudo service apache2 restart
# install redis server
sudo apt-get install -y redis-server
## sudo vim /etc/redis/redis.conf
### requirepass admin
### bind 0.0.0.0
## sudo systemctl restart redis-server.service
# install RabbitMQ
## 1. Install RabbitMQ Server
## Install all necessary packages.
sudo apt-get install wget apt-transport-https -y
## Install RabbitMQ repository signing key.
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
## Add the RabbitMQ repository.
echo "deb https://dl.bintray.com/rabbitmq-erlang/debian focal erlang-22.x" | sudo tee /etc/apt/sources.list.d/rabbitmq.list
## Install RabbitMQ Server.
sudo apt-get install rabbitmq-server -y --fix-missing
## Check status of the RabbitMQ service.
sudo systemctl status rabbitmq-server
## 2. Enable RabbitMQ Management Dashboard
## The management dashboard allows interaction with the processes and control activities on the server.
sudo rabbitmq-plugins enable rabbitmq_management
## Default user guest can only log in via localhost. Create an administrator account to access the dashboard. Make sure you modify the SecurePassword to your own password.
## create user
sudo rabbitmqctl add_user admin admin
sudo rabbitmqctl set_user_tags admin administrator
sudo rabbitmqctl set_permissions -p / admin '.*' '.*' '.*'
sudo rabbitmqctl list_user_permissions admin
## After enabling the plugins for the web management portal, you can go to your browser and access the page by through http://your_IP:15672. Example: http://192.0.2.11:15672.
## Login with admin as your username and your SecurePassword as your password. Make sure you modify the SecurePassword to your own password.
# install gcc/g++
sudo apt-get install -y gcc g++
# install gcc-5/g++-5
## sudo vim /etc/apt/sources.list
## deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
## deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
## sudo apt update
## sudo apt-get install -y g++-5 gcc-5
## switch version
# sudo update-alternatives --config gcc
## delete version options
# sudo update-alternatives --remove gcc /usr/bin/gcc-4.5
# install docker
sudo apt-get install -y docker.io
## create docker user-group
sudo groupadd docker
## add kiki to docker user-group
sudo gpasswd -a kiki docker
## update docker user-group
newgrp docker
## test
docker version
# install gvm, namely go version manager
## install dependencies
sudo apt-get install -y curl git mercurial make binutils bison gcc build-essential
## download script https://github.com/moovweb/gvm/blob/master/binscripts/gvm-installer
chmod +x gvm-installer
./gvm-installer
## Go 1.5+ removed the C compilers from the toolchain and replaced them with one written in Go.
## Obviously, this creates a bootstrapping problem if you don't already have a working Go install.
## In order to compile Go 1.5+, make sure Go 1.4 is installed first.
## if error "Could not find bison" happens, exec `sudo apt-get install -y bison`
gvm install go1.4 -B
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
## install other versions for golang
gvm install go1.15
gvm install go1.17
## choose golang version(use --default to set default golang version for all terminals)
gvm use go1.17 --default
## list go versions
gvm list
## list all go versions available for download
gvm listall
## completely remove gvm and all installed Go versions and packages
# gvm implode
# make Tab auto-completion case-insensitive in Bash
echo set completion-ignore-case on | sudo tee -a /etc/inputrc
## enter password, and restart terminal