Skip to content

Instantly share code, notes, and snippets.

View walice's full-sized avatar

Alice Lépissier walice

View GitHub Profile
@walice
walice / jupyter_lab_config.py
Last active March 13, 2025 02:43
JupyterLab configuration file for the multi-user JupyterHub server. This file should be placed in `~/jupyter/jupyter_lab_config.py`.
c = get_config() #noqa
#------------------------------------------------------------------------------
# ServerApp Configuration
#------------------------------------------------------------------------------
c.ServerApp.ip = '0.0.0.0'
c.ServerApp.port = 8888
c.ServerApp.open_browser = False
c.ServerApp.allow_remote_access = True
@walice
walice / jupyterhub_config.py
Created March 13, 2025 02:41
Configuration file to set up the portable training platform. This file should be located in `/etc/jupyterhub/jupyterhub_config.py`.
c = get_config() #noqa
#------------------------------------------------------------------------------
# JupyterHub app configuration
#------------------------------------------------------------------------------
# Use Local Spawner for system users
c.JupyterHub.spawner_class = 'jupyterhub.spawner.LocalProcessSpawner'
# Default to JupyterLab for all users
c.Spawner.default_url = '/lab'
@walice
walice / jupyterhub.service
Created March 13, 2025 02:47
Configuration file needed to run JupyterHub as a service. The file should be placed in `/etc/systemd/system/jupyterhub.service`.
[Unit]
Description=JupyterHub Service
After=network.target
[Service]
User=root
ExecStart=/usr/local/bin/jupyterhub -f /etc/jupyterhub/jupyterhub_config.py
WorkingDirectory=/root
Restart=always
RestartSec=10
@walice
walice / training
Created March 13, 2025 02:57
Contents of the Nginx configuration file for the multi-user JupyterHub. This file should be placed in `/etc/nginx/sites-available/training`.
server {
server_name <yourdomain.com>;
listen 80;
# RStudio Proxy
location /rstudio/ {
proxy_pass http://127.0.0.1:8787/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@walice
walice / jupyterhub-setup-guide.txt
Created March 13, 2025 03:22
This is the concise summary of commands to run to set up the multi-user JupyterHub server with JupyerLab and RStudio. This won't make sense without the full tutorial posted at https://alicelepissier.com/programming/portable-training-platform.
ssh root@<droplet-ip>
sudo umount /mnt/volume_...
sudo mkdir /data && sudo mount /dev/sda /data
sudo nano /etc/fstab
sudo mount -a
sudo mkdir -p /data/home && sudo mv /home /data && sudo ln -s /data/home /home
@walice
walice / index-preamble.ipynb
Last active August 12, 2025 21:57
Preamble of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walice
walice / index-scraping.ipynb
Created August 12, 2025 13:12
Web scraping section of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walice
walice / index-gsheets.ipynb
Last active August 12, 2025 13:25
Google Sheets API section of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walice
walice / ipynb-pandas.ipynb
Last active August 12, 2025 13:31
Web styling with pandas section of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@walice
walice / index-automation.ipynb
Last active August 12, 2025 13:40
Crucial automation section of a Jupyter notebook that is converted into a self-updating webpage. Full tutorial available at: https://alicelepissier.com/programming/automated-notebook.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.