Skip to content

Instantly share code, notes, and snippets.

@monk1337
Last active November 24, 2021 09:04
Show Gist options
  • Save monk1337/3b4c2a155b56736ed3b8e1d669856dac to your computer and use it in GitHub Desktop.
Save monk1337/3b4c2a155b56736ed3b8e1d669856dac to your computer and use it in GitHub Desktop.
sshpass -p 'password' ssh [email protected]
printf "\n\n\nGpu name : name_of_gpu \nIP address : 10.0.0.0 \nalias : 'i' \n\n"
sshpass -p 'password' ssh [email protected]
f application "Terminal" is running then
tell application "Terminal"
# do script without "in window" will open a new window
do script "aa"
activate
end tell
else
tell application "Terminal"
# window 1 is guaranteed to be recently opened window
do script "aa" in window 1
activate
end tell
end if
# given that a jupyter notebook with this command jupyter notebook --no-browser --port=8188 running on particular server and particular port
stop 8123
echo 'http://localhost:8123/'
open http://localhost:8123
sshpass -p 'password' ssh -N -L 8123:localhost:8188 [email protected]
echo 'http://localhost:8123'
echo '421'
#!/bin/bash
touch temp.text
lsof -n -i4TCP:$1 | awk '{print $2}' > temp.text
pidToStop=`(sed '2q;d' temp.text)`
> temp.text
if [[ -n $pidToStop ]]
then
kill -9 $pidToStop
echo "Congrates!! $1 is stopped."
else
echo "Sorry nothing running on above port"
fi
rm temp.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment