Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Bring these back
Browse files Browse the repository at this point in the history
  • Loading branch information
rcthomas committed May 15, 2019
1 parent cc17b9c commit ffe87a2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
20 changes: 20 additions & 0 deletions jupyter-nersc/web-jupyterhub/hub-scripts/kill-cori.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Shut down all but the newest jupyterhub server running.

hostname=$1
username=$2
cert=/certs/$username.key
echo $username $cert
if [ ! -f $cert ]; then
echo " ... no cert for $username"
exit 1
fi
/usr/bin/ssh \
-i $cert \
-l $username \
-o PreferredAuthentications=publickey \
-o StrictHostKeyChecking=no \
-p 22 \
$hostname \
/global/common/shared/das/jupyterhub/kill-my-old-jupyters.sh
25 changes: 25 additions & 0 deletions jupyter-nersc/web-jupyterhub/hub-scripts/scram-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Useful when JupyterHub thinks a user has no server running
# but actually they do, and they still have a cert.

hostname=$1
username=$2
cert=/certs/$username.key
echo $username $cert
if [ ! -f $cert ]; then
echo " ... SKIPPED no cert for $username"
continue
fi
for i in 1 2 3
do
/usr/bin/ssh \
-i $cert \
-l $username \
-o PreferredAuthentications=publickey \
-o StrictHostKeyChecking=no \
-p 22 \
$hostname \
killall -u $username
sleep 1
done

0 comments on commit ffe87a2

Please sign in to comment.