Skip to content

Instantly share code, notes, and snippets.

View teror4uks's full-sized avatar

Pavel Sirotkin teror4uks

  • Berlin, Germany
View GitHub Profile
@teror4uks
teror4uks / MYSQL_README.md
Last active April 28, 2018 11:14
Mysql reminder

Create db in utf-8 encoding

CREATE DATABASE <db_name> CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Recovery backup from archive

tar -xzOf <archive_name>.tar.gz | mysql -u root -p <db_name>
import requests
MS_STOCK_URL = 'https://online.moysklad.ru/exchange/rest/stock/json'
MOD_TRUE = 'showConsignments=true'
ALL_STOCK = 'stockMode=ALL_STOCK'
MS_USER = 'user'
MS_PASSWORD = 'pass'
with_mods = '{}?{}&{}'.format(MS_STOCK_URL, MOD_TRUE, ALL_STOCK)
r = requests.get(with_mods, auth=(MS_USER, MS_PASSWORD))
@teror4uks
teror4uks / build_docker_nginx_container.txt
Last active May 17, 2018 09:16
Docker Nginx configuration for dev enviroment with Django app
docker run --name rezerv-nginx \
-v /path/to/nginx/config/nginx.conf:/etc/nginx/conf.d/app.conf \
-v /path/to/django/project/folder/:/var/www/html/ \
-v /path/to/uwsgi/socks/folder/:/var/run/ \
-v /path/to/log/folder/:/var/log/nginx/ -d -p 8080:8080 nginx:latest