Skip to content

Instantly share code, notes, and snippets.

@dayne
Last active January 4, 2021 16:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dayne/f6a473bf6929517d66703dcae8ffb53e to your computer and use it in GitHub Desktop.
Save dayne/f6a473bf6929517d66703dcae8ffb53e to your computer and use it in GitHub Desktop.
sage2 helper stuff for pi

few random help scripts I'm using while I play with sage2 on my raspberry pi.

This is meant to go with my sage-cookbook and my own pis.

Capturing here incase others wander into this stuff and want to try it out.

To test this all out and just putter around with sage on my pi from my desktop I'm doing the following:

  • Launchinging tmux session with sage2 server using sage2tmux.sh
  • Launching a fullscreen iceweasle on the pi as pi using weblauncher.sh
  • Ssh'ing with portfowarding from mydesktop to my Pi (called workbench):
  • ssh -L 9292:localhost:9292 -L 9090:localhost:9090 pi@workbench.lan
  • Connecting to sage using my Desktop's web browser through http://localhost:9292

After the above I'm setup to try and and test sage on a pi.

Copypasta as Pi

git clone https://gist.github.com/dayne/f6a473bf6929517d66703dcae8ffb53e sage2notes
cd sage2notes
chmod +x *.sh
#!/bin/sh
tmux list-sessions | grep sage 2> /dev/null > /dev/null
if [ $? -eq 0 ]; then
echo "sage tmux already exists. "
else
echo "no sage tmux found - launching as session 'sage'"
tmux new-session -d -s sage 'sudo su - sage -c "cd ~; node server.js -i"'
fi
echo You can recoonnect with:
echo tmux attach-session -t sage
#!/bin/sh
# turn off screen blanking
xset s off
xset -dpms
xset s noblank
# stop firefox
killall -9 iceweasel
rm -fr ~/.mozilla/firefox/*.wall
iceweasel -CreateProfile wall
# start client 0
iceweasel -P wall http://localhost:9292/display.html?clientID=0 &
# go fullscreen
sleep 30
xte "key F11" -x:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment