Commit 44287792 authored by Sebastian Wahl's avatar Sebastian Wahl

appl fix to bypass googleapis from tunneling script to remote_jupyter_manager.sh

parent 21d72b0e
......@@ -25,13 +25,20 @@ function connect() {
ssh -f -D localhost:${socks_5_port} $hname sleep 15
page=$(ssh $hname "\${HOME}/miniconda3/bin/python \${HOME}/miniconda3/bin/jupyter notebook list" | grep http | awk '{print$1}')
# Proxy bypass list (this will make sure certain domains are _not_ contacted
# through the proxy), courtesy of Willi Rath:
add_proxy_bypass=$(
echo {'*.',}{google.,googleapis.}{com,fr,de} '*.gvt1.com' '*.gstatic.com' \
| tr '[:blank:]' '\n' | paste -s -d';')
echo " Won't use proxy for any of:" ${add_proxy_bypass}
if [[ "$(uname)" == "Darwin" ]]; then
chrome=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
if [[ -f "$chrome" ]]; then
# TODO: disable warning output
"$chrome" --new-window --user-data-dir="/tmp/chromium_user_data_$(date +%s%N)" \
--proxy-bypass-list="<-loopback>" --proxy-server='socks5://localhost:'${socks_5_port} $page &
--proxy-bypass-list="<-loopback>;${add_proxy_bypass}" --proxy-server='socks5://localhost:'${socks_5_port} $page &
echo " Cleaning tmp data on /tmp (if any)"
find /tmp/ -maxdepth 1 -mtime +30 -name "chromium_user_data*" -exec rm -rf {} \;
else
......@@ -42,7 +49,7 @@ function connect() {
else
if which chromium-browser >/dev/null; then
chromium-browser --new-window --user-data-dir="/tmp/chromium_user_data_$(date +%s%N)" \
--proxy-bypass-list="<-loopback>" --proxy-server="socks5://localhost:${socks_5_port}" \
--proxy-bypass-list="<-loopback>;${add_proxy_bypass}" --proxy-server="socks5://localhost:${socks_5_port}" \
$page &
# delete user data older than 30 days
echo " Cleaning tmp data on /tmp (if any)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment