Skip to content

Instantly share code, notes, and snippets.

@JarrettR
Created January 22, 2019 20:30
Show Gist options
  • Save JarrettR/2904e56a9729c223faf1b754cfb5c05b to your computer and use it in GitHub Desktop.
Save JarrettR/2904e56a9729c223faf1b754cfb5c05b to your computer and use it in GitHub Desktop.
#Install all required applications
apt-get install -y sshfs autossh python3-dev build-essential libjpeg8-dev zlib1g-dev python3-pip python3-setuptools
#opencv tools
#apt-get install -y libatlas3-base libwebp6 libtiff5 libjasper1 libilmbase12 libopenexr22 libilmbase12 libgstreamer1.0-0 libavcodec57 libavformat57 libavutil55 libswscale4 libgtk-3-0 libpangocairo-1.0-0 libpango-1.0-0 libatk1.0-0 libcairo-gobject2 libcairo2 libgdk-pixbuf2.0-0
#Install required Python modules
pip3 install wheel
pip3 install pillow picamera adafruit-io
#pip3 install opencv-python-headless
#Set up passwordless login
ssh-keygen -t rsa
#ssh-copy-id timelapse@192.168.1.225
#SSH disabled at server - Copy output into /home/timelapse/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pub
#Setup network drives
mkdir images
mkdir config
crontab -e
@reboot sshfs [timelapse@]192.168.1.225:/home/timelapse/images /root/images
@reboot sshfs [timelapse@]192.168.1.225:/home/timelapse/config /root/config
@reboot autossh -M 10984 -N -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 6969:localhost:22 timelapse@192.168.1.225 &
@reboot python3 /root/config/cam.py &
#sshfs [timelapse@]192.168.1.225:images images
#sshfs [timelapse@]192.168.1.225:config config
#Set up reverse ssh shell
autossh -M 10984 -N -o "PubkeyAuthentication=yes" -o "PasswordAuthentication=no" -R 6969:localhost:22 timelapse@192.168.1.225 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment