Lots of companies set up dashboards that allow them to keep an eye on their build pipelines and system monitoring. Often these involve large TV screens. Raspberry Pi’s are often a good option for the computer that connects and displays this information. They are low power, have the correct connectors, and running a web browser is trivial.
With everyone working from home at the moment lots of us are missing those dashboards. You may well have a Raspberry Pi and a screen or TV you can hook it up to, but contention over the VPN may be the bottleneck. A quick trick to allow you to ‘share’ the bit of the connection you need is to use ssh reverse port forwarding. This allows you to setup a port on the remote machine (the Pi) that connects to the address you provide, using your machine as a proxy.
From my machine I’m working from, connected to the VPN, I use this ssh command to connect to the raspberry pi:
ssh -f -R8080:jenkins.company-network.com:443 raspberrypi.local. ./kiosk.sh > /dev/null 2>&1
This opens up port 8080 on the Raspberry Pi for the https connection to the jenkins server.
I then add update my
/etc/hosts entry on the Pi to point that network name at localhost:
127.0.0.1 localhost jenkins.company-network.com
That should mean that
https://jenkins.company-network.com:8080 should then work. The high port number is so that we don’t need to ssh in as root, as ports < 1024 require root access to open. You can pick your own port numbers, you can also open up multiple connections to hosts on different ports by simply adding more -R options.
I also add a shell script on the host to fire up the browser, and tidy up the screen, ensuring the screen doesn’t turn off.
#!/bin/sh # try to ensure Chrome doesn’t complain about unclean exits sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences export DISPLAY=:0.0 xset s 0 0 xset s noblank xset s noexpose xset dpms 0 0 0 # sudo apt-get install unclutter # hides mouse cursor unclutter & chromium-browser https://jenkins.company-network.com:8080/view/Dash/ --kiosk
Note that if you are running from a Windows machine you should still be able to do reverse port forwarding using ssh, you just need to pick an acceptable ssh client to do it.