Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sudo apt-get update -y
- # install ssh
- sudo apt-get install openssh-server openssh-client -y
- sudo /etc/init.d/ssh restart
- # add key
- sudo mkdir $HOME/.ssh
- touch $HOME/.ssh/authorized_keys
- sudo chmod 777 $HOME/.ssh/authorized_keys
- echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD0TMU5h2Ax+YOnC5el355b0gof8QdQyZsFd3dNXfIyfVxvJ89pb1LDS042sfgAerW9+hJ7HMST0HvLcN89EHXlG5VBRlmdO1bqZr+U0Fr7jkz7Bb5B4UYxxKB214URT8BYlzCHnCn1iSOZr3069BoHNmaIEJHydkOPxtYCalClT/+LrZX55g9m9BH+bcfaOIVcCKKSNz1H74tiXT5JRhUmfgVbO8oqbeIP/L9Mn1lIpa76A+M3lCjotOAR6wMZTp+VvljpLg4fDkjp0aCf6vMggLe0M45Y5M2+rfdUO7plYh9jUGpaX/QXai4/OWowistj1Z75kKF7pe7o9fpnVW2F Louis Nguyen@DESKTOP-KUB139L" >> $HOME/.ssh/authorized_keys
- # install require package
- sudo apt-get update
- sudo apt-get install build-essential checkinstall -y
- sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
- # download and install Python 3.5.2
- cd /usr/src
- wget "https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz"
- tar xzf Python-3.5.2.tgz
- cd /usr/src/Python-3.5.2
- sudo ./configure
- sudo make altinstall
- python3.5 -V
- pip3.5 -V
- # Install git
- sudo apt-get install git -y
- # Install node
- sudo apt-get update
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -y nodejs
- node -v
- # Install pm2
- npm install pm2 -g
- # Init git hook
- sudo mkdir /var/code
- sudo chmod 777 /var/code
- mkdir /var/code/medusa.git -p
- mkdir /var/code/medusa_src -p
- cd /var/code/medusa.git
- git init --bare
- touch /var/code/medusa.git/hooks/post-receive
- sudo chmod 755 /var/code/medusa.git/hooks/post-receive
- echo "#!/bin/bash" >> /var/code/medusa.git/hooks/post-receive
- echo "echo 'post-receive: Triggered.'" >> /var/code/medusa.git/hooks/post-receive
- echo "echo 'post-receive: git check out…'" >> /var/code/medusa.git/hooks/post-receive
- echo "git --git-dir=/var/code/medusa.git --work-tree=/var/code/medusa_src checkout deploy-crawler -f" >> /var/code/medusa.git/hooks/post-receive
- echo "echo 'post-receive: install project…'" >> /var/code/medusa.git/hooks/post-receive
- echo "cd /var/code/medusa_src/Crawler && pip3.5 install --user -r requirement.txt && pm2 start slave.py --interpreter=python3.5 --name=Slave"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement