Created
March 11, 2016 10:14
-
-
Save jrialland/38110b1d59c94b8e1b4a to your computer and use it in GitHub Desktop.
bash -> gets a random free tcp port to bind
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
FREE_TCP_PORT=`python -c "from socket import*;s=socket(AF_INET,SOCK_STREAM);s.bind(('',0));s.listen(1);print s.getsockname()[1];s.close()"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment