Skip to content

Instantly share code, notes, and snippets.

@jhuangtw
jhuangtw / pipenv_jupyter.sh
Last active May 28, 2020 19:19
Running Jupyter with pipenv
pipenv install ipykernel jupyter
pipenv shell
python -m ipykernel install --user --name=$(basename $(pwd))
jupyter notebook
# then in UI, switch kernel to the one matching your pipenv shell name
@jhuangtw
jhuangtw / databricks_connection_to_gcloud_sql.py
Last active April 5, 2022 09:38
connecting from Databricks spark to Google cloud-sql via proxy
# Overview:
# Install cloud_sql_proxy binary with appropriate credentials on all driver and worker nodes.
# References:
# https://cloud.google.com/sql/docs/postgres/connect-external-app#proxy
# https://cloud.google.com/sql/docs/postgres/sql-proxy#authentication-options
# Step 1.
# Follow https://cloud.google.com/sql/docs/postgres/connect-external-app#proxy to set up:
# - enable Cloud SQL API