Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Where is this notebook running?

import os
import platform
import socket
from pathlib import Path
# Detect environment and print key info

def detect_environment():
    print("System:", platform.system())
    print("Hostname:", socket.gethostname())
    print("Working directory:", os.getcwd())
    print("Home directory:", os.path.expanduser("~"))
    
    if "JUPYTERHUB_USER" in os.environ: print("Environment: JupyterHub")
    elif "COLAB_GPU" in os.environ: print("Environment: Google Colab")
    elif platform.system() == "Darwin": print("Environment: Likely Local Mac")
    elif platform.system() == "Windows": print("Environment: Likely Local Windows")
    else: print("Environment: Unknown / Local Linux")

detect_environment()
# Search for directories containing "shared" in the name, starting from home
# Limit search to Documents for local environments to avoid long searches on large home directories
home = Path.home()
# If on JupyterHub, search entire home; if local, limit to Documents
if "JUPYTERHUB_USER" in os.environ: 
    search_path = home
    print(f"Searching in: {search_path}")
else:
    # On local machine, limit to Documents folder or current directory
    search_path = home / "Documents" if (home / "Documents").exists() else Path.cwd()
    print(f"Searching in: {search_path} (limited for local)")

shared_dirs = [p for p in search_path.rglob("*shared*") if p.is_dir()]
if shared_dirs:  
    for d in shared_dirs: print(d)
else:
    print("No shared directories found.")
!find //Users/ericvandusen/Documents/GitHub/SmallLM-SP25/shared-rw | sed 's|[^/]*/|  |g'