JLindvig

Commands

Oct 30th, 2019
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.14 KB | None | 0 0
  1. https://www.balena.io/etcher/
  2.  
  3. https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-04-09/2019-04-08-raspbian-stretch-lite.zip
  4.  
  5. https://putty.org/
  6.  
  7. sudo apt update -y && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean -y && sudo apt autoclean -y
  8.  
  9. sudo raspi-config
  10.  
  11. sudo apt-get install mc -y
  12.  
  13. cd
  14. curl -fsSL get.docker.com -o get-docker.sh
  15. sudo sh get-docker.sh
  16. sudo usermod -aG docker pi
  17. docker --version
  18.  
  19. sudo reboot
  20.  
  21. sudo apt-get install python-pip -y
  22. sudo pip install docker-compose~=1.23.2
  23. docker-compose --version
  24.  
  25. sudo mkdir /opt
  26. sudo chown pi:pi /opt
  27. cd /opt
  28. mkdir dockermon homeassistant organizr portainer duckdns
  29.  
  30. nano docker-compose.yaml
  31.  
  32. docker-compose pull
  33.  
  34. docker-compose up -d homeassistant
  35.  
  36. docker-compose up -d portainer
  37.  
  38. echo 'echo url="https://www.duckdns.org/update?domains=DIT_SUB_DOMAIN&token=DIT_TOKEN&ip=" | curl -k -o /opt/duckdns/duck.log -K -' > ./duckdns/duck.sh
  39. echo 'echo url="https://www.duckdns.org/update?domains=lindvig-delux&token=31c62cca-3ead-4039-a460-11284dbe0f8f&ip=" | curl -k -o /opt/duckdns/duck.log -K -' > ./duckdns/duck.sh
  40.  
  41. chmod 700 ./duckdns/duck.sh
  42. crontab -e
  43. ./duckdns/duck.sh
  44. cat ./duckdns/duck.log
  45.  
  46. cd /
  47. sudo wget https://dl.eff.org/certbot-auto
  48. sudo chmod 755 certbot-auto
  49. cat /etc/pip.conf
  50. sudo rm /etc/pip.conf -f
  51. ./certbot-auto certonly --standalone --preferred-challenges http-01 --email mail@apptoo.dk -d lindvig-delux.duckdns.org
  52. ./certbot-auto certonly --standalone --preferred-challenges http-01 --email mail@apptoo.dk -d ha.lindvig-delux.duckdns.org
  53. ./certbot-auto certonly --standalone --preferred-challenges http-01 --email mail@apptoo.dk -d portainer.lindvig-delux.duckdns.org
  54.  
  55. cd /opt
  56. nano organizr/nginx/nginx.conf
  57. server_names_hash_bucket_size 64; UNCOMMENT
  58.  
  59. rm organizr/nginx/site-confs/default
  60. nano organizr/nginx/site-confs/default
  61.  
  62. nano organizr/nginx/site-confs/homeassistant
  63.  
  64. nano organizr/nginx/site-confs/portainer
  65. docker-compose restart organizr
  66.  
  67. cd /etc/systemd/system
  68. sudo nano docker-compose-opt.service
  69. sudo systemctl enable docker-compose-opt
  70.  
  71. cd /opt
  72. docker-compose down
  73. sudo reboot
  74. docker ps
Add Comment
Please, Sign In to add comment