-
pull docker image
$ docker pull mysql
-
run docker image
$ docker run -p 3306:3306 \ --name snifferdb \ -e MYSQL_USER=admin \ -e MYSQL_ROOT_PASSWORD=sniffered \ -e MYSQL_PASSWORD=pungent \ -d mysql
-
install mysql client cli tools
$ yum install mysql
-
Restore Empty DB
$ mysql --host=127.0.0.1 -u root -psniffered \ < database/snifferdb-schema.sql
-
Restore DB with data
mysql --host=127.0.0.1 -u root -psniffered \ < snifferdb-schema-with-data.sql
-
install packages
$ sudo apt-get install mysql-server git vim -y
Noteyou’ll have to set a root password -
Enable MySql Service
$ systemctl enable mysql
-
Enable MySql to bind to anyIP
-
Start MySql Server
-
Add db User
$ mysql -u root -p mysql> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; mysql> mysql>
-
Download git project
NoteAssuming ssh-key was setup already and added to the repo -
rename hostname
$ sudo hostnamectl set-hostname sensordb.sd.spawar.navy.mil
-
update hosts file on each machine
# echo '127.0.0.1 sensordb.sd.spawar.navy.mil' >> /etc/hosts
-
Create user
$ sudo useradd -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,netdev,spi,i2c,gpio jmarley
-
Generate ssh keys
$ ssh-keygen -t rsa -f /Users/jasonmarley/projects/SPAWAR-Demo/keys/id_rsa_pi
-
Copy ssh keys
$ ssh-copy-id -i keys/id_rsa_pi.pub [email protected]
-
Restrict ssh to keys only
$ sudo vim /etc/ssh/sshd_config PermitRootLogin no PasswordAuthentication no $ sudo service ssh restart
php stuff
Bluetooth-discovery2.py code allows a Raspberry Pi 3 to detect devices with Bluetooth enabled. Devices will only be detected if they are on the Bluetooth screen.
Wifi-discovery.py code allows a Raspberry Pi 3 to detect a large number of devices through Wifi.