forked from OPEFFORT/ope-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Isaiah Stapleton <istaplet@redhat.com>
- Loading branch information
1 parent
e417c31
commit f14aa14
Showing
17 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# JUPYER HUB utilities | ||
|
||
This is a repo that contains a set of scripts that codify how I use jupyterhub | ||
bu book instances where home directories are not persistent | ||
|
||
Clone this repo as bin in your persistent directory and then source the setup script | ||
|
||
|
||
``` | ||
cd /opt/app-root/src | ||
git clone https://github.com/jappavoo/juphub-utils.git | ||
./juphub-utils/setup.sh | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
if [[ ! -a ~/Work && -a /opt/app-root/src ]]; then | ||
echo "linking: ln -s /opt/app-root/src ~/Work" | ||
ln -s /opt/app-root/src ~/Work | ||
fi | ||
|
||
. sshagent.sh | ||
|
||
#watchmem | ||
|
||
echo "do this" | ||
echo ". $ENVFILE" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
find $@ | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
findtree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
alias gl="git log --decorate --oneline --graph" | ||
alias gll="gl --all" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if [[ -d /opt/app-root/src/juphub-utils ]]; then | ||
cat >>~/.profile <<EOF | ||
# add persistent user bin to path | ||
if [[ -d /opt/app-root/src/juphub-utils ]]; then | ||
export PATH=/opt/app-root/src/juphub-utils:\$PATH | ||
fi | ||
EOF | ||
|
||
# Kludge when running locally profile is started before startup hook so we | ||
# explicitly add to path here | ||
export PATH=/opt/app-root/src/juphub-utils:$PATH | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
BASEDIR=${BASEDIR:-/opt/app-root/src} | ||
UCDIR=${UCDIR:-${BASEDIR}/UndertheCovers} | ||
DEST=${DEST:-jappavoo@csa2.bu.edu:www/UC/textbook/} | ||
|
||
if [[ -d ${UCDIR} ]]; then | ||
rsync -azq --delete ${UCDIR}/textbook/_build/html/ ${DEST} | ||
else | ||
echo "ERROR: can't find directory: $UCDIR" | ||
exit -1 | ||
fi | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
JUPY_EXTS="@jupyterlab/fileeditor-extension:plugin | ||
@jupyterlab/filebrowser-extension:widget | ||
@jupyterlab/filebrowser-extension:browser | ||
@jupyterlab/filebrowser-extension:download | ||
@jupyterlab/filebrowser-extension:open-browser-tab | ||
@jupyterlab/filebrowser-extension:open-with | ||
@jupyterlab/console-extension:tracker | ||
@jupyterlab/console-extension:foreign | ||
@jupyterlab/debugger-extension:main | ||
@jupyterlab/extensionmanager-extension:plugin | ||
@jupyterlab/launcher-extension:plugin | ||
@jupyterlab/apputils-extension:palette | ||
@jupyterlab/logconsole-extension:plugin | ||
@jupyterlab/codemirror-extension:commands | ||
@jupyterlab/inspector-extension:consoles | ||
@jupyterlab/inspector-extension:inspector | ||
@jupyterlab/inspector-extension:notebooks | ||
@jupyterlab/shortcuts-extension:shortcuts" | ||
|
||
for ext in ${JUPY_EXTS}; do | ||
echo "Enabling: $ext" | ||
jupyter labextension enable $ext | ||
done | ||
|
||
echo "resetting /opt/conda/share/jupyter/lab/settings/overrides.json" | ||
cat <<EOF > /opt/conda/share/jupyter/lab/settings/overrides.json | ||
{ | ||
"@jupyterlab/terminal-extension:plugin": { | ||
"shutdownOnClose": true | ||
}, | ||
"@jupyterlab/statusbar-extension:plugin": { | ||
"visible": false | ||
} | ||
} | ||
EOF | ||
|
||
echo "reload jupyterlab webpage for new setting to take effect" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
reenable_jup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sshagent.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# script to run after cloning the this repo | ||
# will install the startup hook script that | ||
# is part of this repo | ||
|
||
BASEDIR=${BASEDIR:-/opt/app-root/src} | ||
STARTUPHOOK=${BASEDIR}/.myjupyter_start.sh | ||
MYDIR=$(readlink -f $0) | ||
MYDIR=$(dirname $MYDIR) | ||
STARTUPHOOKSRC=${MYDIR}/myjupyter_start.sh | ||
|
||
if [[ ! -a ${STARTUPHOOK} ]]; then | ||
if [[ -a ${STARTUPHOOKSRC} ]]; then | ||
ln -s ${STARTUPHOOKSRC} ${STARTUPHOOK} | ||
else | ||
echo "ERROR: can't find ${STARTUPHOOKSRC}" | ||
exit -1 | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
#set -x | ||
duration=${1:-1.5} | ||
delay=${2:-10} | ||
typeset -i loops=$(echo "(60*60*$duration)/($delay*4)" | bc) | ||
#echo "loops=$loops"; sleep 1 | ||
for ((i=0; i<loops; i++)); do | ||
clear | ||
echo -n "|"; | ||
sleep $delay; | ||
clear; | ||
echo -n "/"; | ||
sleep $delay; | ||
clear; | ||
echo -n "-"; | ||
sleep $delay; | ||
clear; | ||
echo -n "\\"; | ||
sleep $delay; | ||
done | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
#set -x | ||
ENVFILE=~/.sa.env | ||
|
||
if [[ ! -a ~/.sa.env ]]; then | ||
ssh-agent > $ENVFILE | ||
. $ENVFILE | ||
ssh-add | ||
if ! grep -q $ENVFILE ~/.bashrc ; then | ||
cat >> ~/.bashrc <<EOF | ||
# sourcing $ENVFILE if it exits | ||
[[ -a $ENVFILE ]] && . $ENVFILE > /dev/null | ||
EOF | ||
fi | ||
else | ||
. $ENVFILE | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
count=$(for ((i=0;i<100; i++)); do gdb -ex starti -ex quit -q --batch /usr/bin/date 2>/dev/null | grep ld; done | tee out | uniq | wc -l) | ||
|
||
if [[ $count == 1 ]]; then | ||
echo "OK: Looks good" | ||
exit 0 | ||
else | ||
echo "ERROR: Failed to start a binary with a constant instruction addres: $count" | ||
exit -1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
MYDIR=$(readlink -f $0) | ||
MYDIR=$(dirname $MYDIR) | ||
|
||
#echo $MYDIR | ||
|
||
# from Erwan Granger @ Redhat | ||
|
||
watch " ps -eo size,command --sort -size | awk '{ hr=\$1/1024 ; sum +=hr} END {print sum \" MB of memory used\" }' | tee $MYDIR/watchmem.last" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
env | grep -i hub_host | ||
env | grep -i image |