Bonus points: turn it into a service that starts at boot so you can clone a bunch of droplets!
First, write a miner script:
cd ~
echo '
cd /root/primecoin/src
screen -d -m ./primeminer -poolip=54.200.248.75 -poolport=1337 -pooluser=Acrenf7WMZ3yFc7xkdbF8rGuuLw36Bkknr -poolpassword=PASSWORD -genproclimit=1' > startprime
chmod +x startprime
Now make the service that will keep it alive:
echo '
#!/bin/bash
until /root/startprime; do
echo "Restarting miner">&2
sleep 1
done' > primeservice
chmod +x primeservice
Now you can edit crontab to include this service to start at reboot. Type `crontab -e`, and in the last line of the file add:
@reboot /root/primeservice
Now reboot the droplet with `sudo reboot`. When you've logged back in, check to see if it worked by sending `screen -r`. This should open the miner info.
You can then `sudo poweroff` the droplet and take a snapshot. This snapshot is then used when creating a new droplet!