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
until nc -z ${POSTGRES_PORT_5432_TCP_ADDR} ${POSTGRES_PORT_5432_TCP_PORT}; do | |
echo "$(date) - waiting for postgres..." | |
sleep 1 | |
done |
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
brew install swig | |
env LDFLAGS="-L$(brew --prefix openssl)/lib" \ | |
CFLAGS="-I$(brew --prefix openssl)/include" \ | |
SWIG_FEATURES="-cpperraswarn -includeall -I$(brew --prefix openssl)/include" \ | |
pip install m2crypto |
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
Kraków - university city - ex-capital - where I lived for 13 years | |
a trip to Auschwitz - difficult but worth | |
a trip to Wieliczka - picturesque salt mine with loads of salt sculptures, and underground salt church | |
restaurant - Jarema - for properly made traditional food | |
Wrocław - smaller, just charming - plenty of German architecture influences | |
beautiful walks over riverbanks | |
Gdańsk - the oldest, and the most important port city - go to the old town - german/danish, influence |
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
#check logs | |
curl http://localhost:9200/_cluster/health?pretty | |
curl http://localhost:9200/_cat/indices?v | |
curl http://localhost:9200/_cat/nodes?v | |
curl http://localhost:9200/_cat/shards?v | |
curl localhost:9200/_nodes/process?pretty | |
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
from gevent import socket as g_socket | |
assert g_socket.timeout == socket.timeout | |
print "gevent monkey patch for socket confirmed" |
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
BASE_ALPHABET = "123456789abcdefghijkmnopqrstuvwxyz" | |
def encode_base_x(n): | |
base = len(BASE_ALPHABET) | |
def chars(num): | |
while num >= base: | |
num, mod = divmod(num, base) | |
yield BASE_ALPHABET[mod] |
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
mkdir -p /mnt/shared | |
mount -t vboxsf -o uid=1000,gid=1000 shared /mnt/shared |
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
class SchrodingerUser(AnonymousUser): | |
""" | |
Imagine that you are making the experiment and want to measure your results. | |
But Greenpeace has just came to the office and claims that 50% of cats life | |
is better for the cat than certain life or death. | |
Returned on DB access error. | |
""" | |
pass |
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
class DebugContext(object): | |
def __init__(self): | |
print self.__class__, "init" | |
def __enter__(self): | |
print self.__class__, "enter" | |
def __exit__(self, type, value, traceback): |
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
# recommended ntp pool (/etc/ntp.conf) | |
server 0.amazon.pool.ntp.org iburst | |
server 1.amazon.pool.ntp.org iburst | |
server 2.amazon.pool.ntp.org iburst | |
server 3.amazon.pool.ntp.org iburst | |
ntpq | |
> peers | |
check for connection prefixed with * | |
> as |