Skip to content

Instantly share code, notes, and snippets.

View fstefanov's full-sized avatar

Filip Stefanov fstefanov

View GitHub Profile
@fstefanov
fstefanov / ephymeral_ports.sh
Last active December 19, 2018 10:01
Get two free random ports
# Original version https://superuser.com/a/1293762/622572
export SERVER_PORT_SERVICE SERVER_PORT_ADMIN
readarray -t RANDOM_PORTS < <(
comm -23 <(seq 65000 65535) \
<(ss -ant \
| tail -n +1 \
| awk '{print $4}' \
| awk -F ":" '{print $NF}' \
| sort | uniq) \
@fstefanov
fstefanov / python_decorator_guide.md
Created June 18, 2018 07:46 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@fstefanov
fstefanov / fix_git_sslread_9806.sh
Created November 5, 2017 16:58 — forked from entropiae/fix_git_sslread_9806.sh
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git