All_installv3.2.sh 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. #!/bin/bash
  2. #Item1 In Common Use
  3. sudo apt install python3.8 -y
  4. sudo apt-get install python3-pip -y
  5. sudo apt-get install git -y
  6. sudo apt-get install wget -y
  7. #Item2 LAMP
  8. echo 'start install LAMP'
  9. sudo apt install tasksel -y
  10. sudo tasksel install lamp-server
  11. echo 'install phpmyadmin'
  12. cd /tmp/
  13. pwd
  14. wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.tar.gz
  15. tar -zxvf phpMyAdmin-5.1.0-all-languages.tar.gz
  16. rm phpMyAdmin-5.1.0-all-languages.tar.gz
  17. mv phpMyAdmin-5.1.0-all-languages /var/www/html/phpmyadmin
  18. cd /var/www/html/phpmyadmin
  19. mkdir /tmp
  20. sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip -y
  21. #php version
  22. sudo apt install php7.2-mbstring -y
  23. sudo apt install php7.2-xml -y
  24. sudo apt install php7.2-mysql -y
  25. sudo apt install php7.2-common -y
  26. sudo apt install php7.2-curl -y
  27. sudo apt install php7.2-json -y
  28. sudo apt install php7.2-zip -y
  29. echo 'open apache2 '
  30. sudo service apache2 start
  31. echo 'setting mysql pass'
  32. sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Gold@53743001';"
  33. echo 'done'
  34. #Item3 MQTT
  35. # install&setting mqtt server
  36. sudo pip3 install paho-mqtt -y
  37. sudo apt-get install mosquitto -y
  38. sudo systemctl start mosquitto
  39. sudo systemctl enable mosquitto
  40. sudo ufw allow 1883/tcp
  41. sudo ufw allow 8080/tcp
  42. cd /
  43. # get mqtt server file mosquitto.conf
  44. git clone -b mosquitto --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /mosquitto/
  45. # get mqtt server file passwd.conf
  46. git clone -b passwd --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /passwd/
  47. mv /mosquitto/mosquitto.conf /etc/mosquitto/
  48. mv /passwd/passwd /etc/mosquitto/
  49. rm -rf /mosquitto/
  50. rm -rf /passwd/
  51. sudo systemctl restart mosquitto
  52. # install&setting mqtt client
  53. # to be confirm packegs
  54. #cd /usr/sbin/
  55. # get mqtt client file aisky.mqttd
  56. #git clone http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git
  57. #Item4 Watchdog
  58. cd /
  59. # get watchdog file proc-wdtd.conf
  60. git clone -b procwdtdconf --single-branch http://60.250.156.230:3000/fatwolf/proc.git /procwdtdconf/
  61. # get watchdog file proc-wdtd
  62. git clone -b procwdtd --single-branch http://60.250.156.230:3000/fatwolf/proc.git /procwdtd/
  63. #maybe use git clone to copy rc.local file?
  64. #sudo nano /etc/rc.local/
  65. # get watchdog file rc.local
  66. git clone -b rclocal --single-branch http://60.250.156.230:3000/fatwolf/proc.git /rclocal/
  67. mv /procwdtdconf/proc-wdtd.conf /etc/
  68. mv /procwdtd/proc-wdtd /usr/sbin/
  69. mv /rclocal/rc.local /etc/
  70. rm -rf /procwdtdconf/
  71. rm -rf /procwdtd/
  72. rm -rf /rclocal/
  73. sudo systemctl restart rc-local.service
  74. #Item5 Git Server
  75. sudo apt-get install golang -y
  76. cd /home/username/
  77. git clone --depth 1 https://github.com/gogs/gogs.git gogs
  78. cd gogs/
  79. go build -o gogs
  80. # ./gogs web
  81. #Item6 Python packegs Library
  82. sudo pip3 install flask -y
  83. sudo pip3 install Flask-SQLAlchemy -y
  84. sudo pip3 install pymysql -y
  85. sudo pip3 install flask_mqtt -y
  86. sudo pip3 install flask_migrate -y
  87. sudo pip3 install flask-jwt-extended -y
  88. sudo pip3 install numpy -y
  89. sudo pip3 install pandas -y
  90. sudo pip3 install opencv-python==4.2.0.34 -y
  91. sudo pip3 install BeautifulSoup4 -y
  92. sudo pip3 install selenium -y
  93. sudo pip3 install geocoder -y
  94. #Item7 AP(WebPage)
  95. cd /
  96. git clone http://60.250.156.230:3000/benson/SixthProject.git /Sixth/
  97. mv /Sixth/Sixth-BBend.tar.gz /etc/Sixth
  98. rm -rf /Sixth/
  99. cd /etc/Sixth
  100. tar -zxvf Sixth-BBend.tar.gz
  101. #Item7 AP(WebPage)
  102. #Item8 ROS ubuntu 18.04 melodic
  103. #ROS It should be install in user not install in root
  104. #install
  105. sudo apt-get install -y chrony ntpdate
  106. sudo ntpdate -q ntp.ubuntu.com
  107. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  108. sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  109. sudo apt-get update && sudo apt-get upgrade -y
  110. sudo apt install ros-melodic-desktop-full -y
  111. sudo apt-get install ros-melodic-rqt* -y
  112. sudo apt-get install python-rosdep -y
  113. sudo rosdep init
  114. rosdep update
  115. sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
  116. #setup
  117. source /opt/ros/melodic/setup.bash
  118. echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
  119. source ~/.bashrc
  120. #Create Ros Workspace
  121. mkdir -p ~/catkin_ws/src
  122. cd ~/catkin_ws/
  123. catkin_make
  124. #Setup
  125. source ~/catkin_ws/devel/setup.bash
  126. echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
  127. source ~/.bashrc
  128. # need user name
  129. echo $ROS_PACKAGE_PATH /home/youruser/catkin_ws/src:/opt/ros/melodic/share
  130. source ~/.bashrc
  131. printenv | grep ROS