Last active
November 24, 2021 09:04
-
-
Save monk1337/3b4c2a155b56736ed3b8e1d669856dac to your computer and use it in GitHub Desktop.
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
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] |
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
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 |
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
# 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' |
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
#!/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