Last active
June 21, 2016 17:20
-
-
Save yock/ea7946dfb1972662eea53bb8f6638878 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
function static_server() { | |
PORT=8080 | |
lsof -i :$PORT > /dev/null | |
while (( $? == 0 )) { | |
PORT=$((PORT+1)) | |
lsof -i :$PORT | |
} | |
nohup python -m SimpleHTTPServer $PORT & | |
SERVERPID=$! | |
open -Wn http://localhost:$PORT | |
kill $SERVERPID | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment