This tutorial assumes:
- a single computer (like a Raspberry Pi)
- MQTT broker (like Mosquitto) running
- the
mosquitto_pub
andmosquitto_sub
commands are available.
# best practice: linux | |
nano ~/.pgpass | |
*:5432:*:username:password | |
chmod 0600 ~/.pgpass | |
# best practice: windows | |
edit %APPDATA%\postgresql\pgpass.conf | |
*:5432:*:username:password | |
# linux |
pyenv local 3.7.5 | |
pyenv exec python -m pipenv sync -d |
pyenv local 3.7.5 | |
pyenv exec python -m pipenv sync -d |
with open('expected_data.json', 'w', encoding='utf8') as json_file: | |
json.dump(EXPECTED_DATA, json_file, ensure_ascii=False, indent=4, sort_keys=True) |
# Конфигурация для запуска nginx в качестве SSL прокси для других контейнеров. | |
# Не забудьте создать сеть перед запуском этой конфигурации: | |
# docker network create nginx-proxy | |
# и добавить следующую строку к проксируемым контейнерам '--network nginx-proxy'. | |
version: '2' | |
services: | |
nginx: | |
image: nginx |
import json | |
path_src = './references/migrations/0004_speciality.json' | |
path_dst = './references/migrations/0004_speciality.json' | |
src = open(path_src, 'r') | |
dst = open(path_dst, 'w') | |
payload = json.loads(src.read()) | |
result = [] | |
index = 0 | |
for i in payload: |
FROM alpine:3.8 | |
MAINTAINER Ruslan Popov <[email protected]> | |
ARG SOURCE_VERSION=UNSPECIFIED | |
ARG SOURCE_COMMIT=UNSPECIFIED | |
ENV \ | |
SOURCE_VERSION=${SOURCE_VERSION} \ | |
SOURCE_COMMIT=${SOURCE_COMMIT} \ |
#!/usr/bin/env python | |
import math | |
OUTBITS = 16 | |
BITS_PER_CYCLE = 16 | |
BITS_PER_QUARTER = BITS_PER_CYCLE - 2 | |
BITS = 8 | |
ONE = 1 << BITS | |
HALF = ONE / 2 | |
C = 70710 * ONE / 100000 |
#!/usr/bin/env python | |
""" | |
Install packages: | |
wajig install pylint pyflakes pep8 pychecker | |
pip install flake8 | |
""" | |
import os |