123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- #!/bin/bash
- #53,78,102,123,159
- #------------------------install use user--------------------------
- #Item1 In Common Use
- sudo apt install python3.6 -y
- sudo apt-get install python3-pip -y
- sudo apt-get install git -y
- sudo apt-get install wget -y
- #Item2 LAMP
- echo 'start install LAMP'
- sudo apt install tasksel -y
- sudo tasksel install lamp-server
- echo 'install phpmyadmin'
- cd /tmp/
- pwd
- wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.tar.gz
- tar -zxvf phpMyAdmin-5.1.0-all-languages.tar.gz
- rm phpMyAdmin-5.1.0-all-languages.tar.gz
- mv phpMyAdmin-5.1.0-all-languages /var/www/html/phpmyadmin
- cd /var/www/html/phpmyadmin/
- mkdir tmp
- sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip -y
- #php version
- sudo apt install php7.2-mbstring -y
- sudo apt install php7.2-xml -y
- sudo apt install php7.2-mysql -y
- sudo apt install php7.2-common -y
- sudo apt install php7.2-curl -y
- sudo apt install php7.2-json -y
- sudo apt install php7.2-zip -y
- echo 'open apache2 '
- sudo service apache2 start
- echo 'setting mysql pass'
- sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Gold@53743001';"
- echo 'done'
- #------------------------install use root--------------------------
- #Item3 MQTT
- # install&setting mqtt server
- sudo pip3 install paho-mqtt
- sudo apt-get install mosquitto -y
- #sudo ufw enable
- sudo systemctl start mosquitto
- sudo systemctl enable mosquitto
- #sudo ufw allow 1883/tcp
- #sudo ufw allow 8080/tcp
- cd /home/nanotf/sh/
-
- # get mqtt server file mosquitto.conf
- git clone -b mosquitto --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/nanotf/sh/mosquitto/
- # get mqtt server file passwd.conf
- git clone -b passwd --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/nanotf/sh/passwd/
- mv /home/nanotf/sh/mosquitto/mosquitto.conf /etc/mosquitto/
- mv /home/nanotf/sh/passwd/passwd /etc/mosquitto/
- rm -rf /home/nanotf/sh/mosquitto/
- rm -rf /home/nanotf/sh/passwd/
- sudo systemctl stop mosquitto
- sudo systemctl start mosquitto
- # install&setting mqtt client
- # to be confirm packegs
- #cd /usr/sbin/
- # get mqtt client file aisky.mqttd
- #git clone http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git
- #Item4 Watchdog
- #cd /
- # get watchdog file proc-wdtd.conf
- git clone -b procwdtdconf --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/procwdtdconf/
- # get watchdog file proc-wdtd
- git clone -b procwdtd --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/procwdtd/
- #maybe use git clone to copy rc.local file?
- #sudo nano /etc/rc.local/
- # get watchdog file rc.local
- git clone -b rclocal --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/rclocal/
- mv /home/nanotf/sh/procwdtdconf/proc-wdtd.conf /etc/
- mv /home/nanotf/sh/procwdtd/proc-wdtd /usr/sbin/
- mv /home/nanotf/sh/rclocal/rc.local /etc/
- rm -rf /home/nanotf/sh/procwdtdconf/
- rm -rf /home/nanotf/sh/procwdtd/
- rm -rf /home/nanotf/sh/rclocal/
- sudo systemctl restart rc-local.service
- #Item5 Git Server
- sudo apt-get install golang -y
- cd /home/nanotf/sh/
- git clone http://60.250.156.230:3000/fatwolf/gogsfile.git /home/nanotf/sh/gogs
- mv gogs/gogs_0.12.3_linux_amd64.tar.gz /home/nanotf/sh/
- rm -rf gogs/
- tar -C /home/nanotf/sh/ -zxvf gogs_0.12.3_linux_amd64.tar.gz
- #git clone --depth 1 https://github.com/gogs/gogs.git gogs
- #cd gogs
- #go build -o gogs
- # ./gogs web
- #Item6 Python packegs Library
- sudo pip3 install flask
- sudo pip3 install Flask-SQLAlchemy
- sudo pip3 install pymysql
- sudo pip3 install flask_mqtt
- sudo pip3 install flask_migrate
- sudo pip3 install flask-jwt-extended
- sudo pip3 install numpy
- sudo pip3 install pandas
- sudo pip3 install opencv-python==4.3.0.38
- sudo pip3 install BeautifulSoup4
- sudo pip3 install selenium
- sudo pip3 install geocoder
- #Item7 AP(WebPage)
- cd /home/nanotf/sh/
- git clone http://60.250.156.230:3000/benson/SixthProject.git /home/nanotf/sh/Sixth/
- mkdir /etc/Sixth/
- cd Sixth/
- mv Sixth-Backend.tar.gz /etc/Sixth
- cd ..
- rm -rf Sixth/
- cd /etc/Sixth
- tar -zxvf Sixth-Backend.tar.gz
- #------------------------install use user--------------------------
- #Item8 ROS ubuntu 18.04 melodic
- #ROS It should be install in user not install in root
- #install
- sudo apt-get install -y chrony ntpdate
- sudo ntpdate -q ntp.ubuntu.com
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- sudo apt-get update && sudo apt-get upgrade -y
- sudo apt install ros-melodic-desktop-full -y
- sudo apt-get install ros-melodic-rqt* -y
- sudo apt-get install python-rosdep -y
- sudo rosdep init
- rosdep update
- sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
- #setup
- source /opt/ros/melodic/setup.bash
- echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
- source ~/.bashrc
- #Create Ros Workspace
- mkdir -p ~/catkin_ws/src
- cd ~/catkin_ws/
- catkin_make
- #Setup
- source ~/catkin_ws/devel/setup.bash
- echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
- source ~/.bashrc
- # need user name
- echo $ROS_PACKAGE_PATH /home/nanotf/sh/catkin_ws/src:/opt/ros/melodic/share
- source ~/.bashrc
- printenv | grep ROS
- #sudo reboot
|