Last active
October 27, 2021 04:16
-
-
Save andrewkern/89a46ba8aaa27fa37020f0c1cb8a7cf4 to your computer and use it in GitHub Desktop.
osa script for automating the opening of a remote jupyter session on sesame
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
#!/usr/bin/osascript | |
tell application "iTerm2" | |
tell current session of current tab of current window | |
write text "ssh -X $USERNAME@sesame.uoregon.edu" | |
# i generally like to activate a conda environment | |
write text "conda activate stdpopsim" | |
write text "jupyter lab --no-browser --port 8088" | |
split horizontally with default profile | |
end tell | |
tell second session of current tab of current window | |
write text "ssh -N -L 8088:localhost:8088 $USERNAME@sesame.uoregon.edu" | |
end tell | |
end tell | |
tell application "Brave" | |
set URL of active tab of window 1 to "http://127.0.0.1:8088/lab?token=e6fd470a49b166748449c0d2dfb60d6272426a8dfa5fffcc" | |
end tell | |
say "welcome to zombocom." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment