All_installv3.4.sh 4.9 KB

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