Skip to content

Instantly share code, notes, and snippets.

@sean-smith
sean-smith / ec2_ipython.md
Last active February 15, 2021 23:09
iPython using EC2 and LetsEncrypt

Setup an iPython Notebook on AWS with LetsEncrypt Certificate

The first step is to setup an EC2 Ubuntu 16.04 instance that you can ssh into. I won't go into detail here but you should be able to easily google it.

You can get free AWS credit here https://education.github.com/pack

A better guide w/ pictures is here: https://chrisalbon.com/jupyter/run_project_jupyter_on_amazon_ec2.html (Note this doesn't include LetsEncrypt, so it only has self signed certificates)

Once you've setup an instance and ssh'd in, do the following:

using GeometryTypes, Makie
include("noise.jl") #https://gist.github.com/SimonDanisch/89779b923d77a4ecdf61246cbe24611b#file-noise4-jl
# inspired by https://github.com/rougier/alien-life
resolution = (1000, 1000)
scene = Scene(resolution = resolution)
n = 60_000
# pkg"add AbstractPlotting#master"
using Makie, GeometryTypes, Colors
using AbstractPlotting: slider!, playbutton
using Observables
cd(@__DIR__)
psps = [rand(50, 50, 50) for i in 1:50]
mini, maxi = mapreduce(extrema, (a, b)-> (min(a[1], b[1]), max(a[2], b[2])), psps)
psps_n = map(psps) do vol