|
|
@@ -0,0 +1,137 @@
|
|
|
+#install essential software
|
|
|
+#sudo apt-get update
|
|
|
+
|
|
|
+read -p "Whats this box port (last 3 numbers with zero for padding)?" PORT
|
|
|
+
|
|
|
+ssh-keygen -t rsa -b 2048 -C "$HOSTNAME"
|
|
|
+
|
|
|
+echo "Please add the following public key to server's authorized keys:"
|
|
|
+
|
|
|
+cat ~/.ssh/id_rsa.pub
|
|
|
+
|
|
|
+read -p "Press enter to continue"
|
|
|
+
|
|
|
+echo "/usr/bin/autossh -N -f -M 7$PORT -oPubkeyAuthentication=yes -oPasswordAuthentication=no -oLogLevel=error -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i /home/niofis/.ssh/id_rsa -R 6$PORT:localhost:22 rtunnel@server.fourier.audio -p 22" > ssh-tunnel.sh
|
|
|
+
|
|
|
+curl -L -o ssh-tunnel.service https://gist.githubusercontent.com/niofis/bc24f1b33414fd77d77f/raw/
|
|
|
+sudo mv ssh-tunnel.service /etc/systemd/system/ssh-tunnel.service
|
|
|
+
|
|
|
+sudo systemctl enable ssh-tunnel
|
|
|
+sudo systemctl start ssh-tunnel
|
|
|
+
|
|
|
+curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
|
|
|
+sudo apt-get install -y tmux
|
|
|
+sudo apt-get install -y vim
|
|
|
+sudo apt-get install -y autossh
|
|
|
+sudo apt-get install -y git-core
|
|
|
+sudo apt-get install -y build-essential
|
|
|
+sudo apt-get install -y nodejs
|
|
|
+#sudo apt-get install -y mysql-server mysql-client
|
|
|
+sudo apt-get install -y python-dev
|
|
|
+sudo apt-get install -y lame
|
|
|
+sudo apt-get install -y ezstream
|
|
|
+sudo apt-get install -y cmake
|
|
|
+sudo apt-get install -y rtl-sdr
|
|
|
+wget https://bootstrap.pypa.io/get-pip.py
|
|
|
+sudo python get-pip.py
|
|
|
+sudo apt-get install -y portaudio19-dev
|
|
|
+sudo pip install pyaudio
|
|
|
+sudo apt-get install -y ffmpeg
|
|
|
+sudo pip install pydub
|
|
|
+sudo pip install numpy
|
|
|
+sudo apt-get install -y gfortran libopenblas-dev liblapack-dev
|
|
|
+sudo pip install scipy
|
|
|
+sudo apt-get install -y python-matplotlib
|
|
|
+#sudo apt-get install -y python-mysqldb
|
|
|
+sudo apt-get install -y curl
|
|
|
+#sudo pip install mysql-connector==2.1.4
|
|
|
+sudo pip install requests
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+#download fourier software
|
|
|
+cd ~
|
|
|
+mkdir programs
|
|
|
+cd ~/programs
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-server.git server
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier.git fourier
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-alt.git fourier-alt
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-monitor.git monitor
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-uploader.git uploader
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-ondemand.git ondemand
|
|
|
+git clone https://niofis@bitbucket.org/niofis/fourier-admanager.git admanager
|
|
|
+
|
|
|
+#install fourier-server dependencies
|
|
|
+cd ~/programs/server
|
|
|
+npm install
|
|
|
+#install fourier-monitor dependencies
|
|
|
+cd ~/programs/monitor
|
|
|
+npm install
|
|
|
+#install fourier-uploader dependencies
|
|
|
+cd ~/programs/uploader
|
|
|
+npm install
|
|
|
+#install fourier-ondemand dependencies
|
|
|
+cd ~/programs/ondemand
|
|
|
+npm install
|
|
|
+#install fourier-admanager dependencies
|
|
|
+cd ~/programs/admanager
|
|
|
+npm install
|
|
|
+
|
|
|
+sudo npm install -g pm2
|
|
|
+
|
|
|
+#build sdr lib
|
|
|
+sudo apt-get install -y libusb-1.0-0-dev
|
|
|
+cd ~/programs
|
|
|
+git clone https://github.com/niofis/rtl-sdr.git
|
|
|
+cd ~/programs/rtl-sdr
|
|
|
+mkdir build
|
|
|
+cd build
|
|
|
+cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON
|
|
|
+make
|
|
|
+sudo cp ./src/rtl_fm /usr/bin/rtl_fm
|
|
|
+#sudo make install
|
|
|
+echo "SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", MODE:="0666"" | sudo tee -a /etc/udev/rules.d/rtl-sdr.rules
|
|
|
+
|
|
|
+#build and install nim
|
|
|
+cd ~/programs
|
|
|
+curl -L https://nim-lang.org/download/nim-0.17.0.tar.xz -o nim-0.17.0.tar.xz
|
|
|
+tar xvf nim-0.17.0.tar.xz
|
|
|
+cd nim-0.17.0
|
|
|
+sh build.sh
|
|
|
+bin/nim c koch
|
|
|
+./koch tools
|
|
|
+echo "export PATH=~/programs/nim-0.17.0/bin:$PATH" >> ~/.bashrc
|
|
|
+
|
|
|
+#build fourier-alt
|
|
|
+cd ~/programs/fourier-alt
|
|
|
+nimble build
|
|
|
+
|
|
|
+#configure ramdisk
|
|
|
+#sudo mkdir -p /mnt/ramdisk
|
|
|
+#echo "ramfs /mnt/ramdisk ramfs nodev,nosuid,noexec,nodiratime,umask=000,noatime,size=256m 0 0" | sudo tee -a /etc/fstab
|
|
|
+#sudo chgrp plugdev /mnt/ramdisk
|
|
|
+#sudo chmod g+w /mnt/ramdisk
|
|
|
+#sudo chmod +t /mnt/ramdisk
|
|
|
+#cd ~
|
|
|
+
|
|
|
+#curl -L -o fourier.service https://gist.githubusercontent.com/niofis/86e6e3fbe72a01263fbd388bde7953ea/raw/
|
|
|
+#sudo mv fourier.service /etc/systemd/system/fourier.service
|
|
|
+#sudo systemctl enable fourier
|
|
|
+
|
|
|
+sudo mysql -u root -e "create database fourier;"
|
|
|
+sudo mysql -u root -e "create user 'fourier'@'localhost' identified by 'Sup3rDuper!';"
|
|
|
+sudo mysql -u root -e "grant all privileges on fourier.* to 'fourier'@'localhost';flush privileges;"
|
|
|
+
|
|
|
+cd ~
|
|
|
+curl -L -o fourier.sql https://gist.githubusercontent.com/niofis/cd843500ac96fe8ddc8f39a58a4afc55/raw/
|
|
|
+sudo mysql -u root -h localhost fourier < fourier.sql
|
|
|
+
|
|
|
+curl -L -o fourier-config.json https://gist.githubusercontent.com/niofis/0e95b950faa333909407b5a65270376d/raw/
|
|
|
+sudo mv fourier-config.json /etc/fourier-config.json
|
|
|
+
|
|
|
+curl -L -o Fourier-key.json https://gist.githubusercontent.com/niofis/7f8ced8fc878acf8c9b45d8db3bb5458/raw/
|
|
|
+sudo mv Fourier-key.json /etc/Fourier-key.json
|
|
|
+
|
|
|
+echo "****************************************************************************"
|
|
|
+echo "REMEMBER: Initialize attached storage and create a symlink named /var/fourier pointing to the storage volume"
|
|
|
+echo "****************************************************************************"
|