-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrookie_install.sh
94 lines (83 loc) · 3.13 KB
/
rookie_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
# install pre-requisite
sudo apt-get install -y vim git gitk git-gui curl
# config git account
## generate ssh key
ssh-keygen -t rsa -C "[email protected]"
## 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 xxx # 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 [email protected]:.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
# install RabbitMQ
## install erlang dependency
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install -y erlang
## install mq
curl -s https://packagecloud.io/install/repositories/rabbitmq/rabbitmq-server/script.deb.sh | sudo bash
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get install -y rabbitmq-server
## 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
# install gcc/g++-4.8
sudo apt-get install -y gcc-4.8 gcc-4.8-multilib g++-4.8 g++-4.8-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5.4 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 40
# 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
# make Tab auto-completion case-insensitive in Bash
echo set completion-ignore-case on | sudo tee -a /etc/inputrc
## enter password, and restart terminal