This file contains hidden or 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
*.pyc | |
*.sqlite | |
*.sqlite3 | |
*.sql | |
*.db | |
*.gz | |
*.orig | |
*.dump | |
media/ | |
.ropeproject/ |
This file contains hidden or 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
docker run -d --name=bind --publish=0.0.0.0:53:53/udp --publish=0.0.0.0:10000:10000 --env='ROOT_PASSWORD=aa' sameersbn/bind:latest | |
login on https://127.0.0.1:10000(docker hosy-system) with login root password aa | |
go to "Servers" -> "BIND DNS server" | |
create zone for overriding with "create master zone" for example "tyr66.ru" | |
go to zone and add sone hosts to resolve | |
dont forget to apply changes with "Apply conwiguration" round arrows in right-top corner on screen with all zones. | |
test on docker host system: host tyr66.ru 192.168.1.7(external ip address of docker-host-system) |
This file contains hidden or 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
ngrok - Публикация локального сервиса в интернет. Мощнейшая фича для быстрого тестирования. |
This file contains hidden or 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
# How to migrate Django from SQLite to PostgreSQL | |
Dump existing data with currens Sqlite db configured: | |
``` | |
./manage.py dumpdata > dump.json | |
``` | |
Switch DATABASE configuration in settings.py to Postgres backend. | |
Make sure you can connect on PostgreSQL. Then: |
This file contains hidden or 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
1) Создание интерпретатора с опцией -fPIC для возможности компилирования uWSGI: | |
env PYTHON_CFLAGS=-fPIC pyenv install -v 3.6.4 | |
pyenv virtualenv 3.6.4 prstat | |
2) ВАЖНО! Активация соданного интерпретатора и сборка ТОЛЬКО с помощью него. | |
pyenv activate prstat | |
3) Скачивание свежей версии исходников uWSGI | |
wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz | |
tar xf uwsgi-latest.tar.gz |
This file contains hidden or 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
Without swap mysql docker container for example will just not start on 512MB of RAM. | |
dd if=/dev/zero of=/swapfile bs=1M count=1024 | |
mkswap /swapfile | |
swapon /swapfile | |
Add string to /etc/fstab: /swapfile swap swap defaults 0 0 |
This file contains hidden or 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
docker-compose logs container_id |
This file contains hidden or 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
0) For VBox guest additions comilation: | |
- sudo pacman -Sy linux-headers | |
1) Uncomment wheel in sudoers + remove /etc/sudoers.d/10-install | |
2) fish: | |
- sudo pacman -Sy fish, ncurses(its an implicit dependency) | |
3) shared vbox folder | |
mkdir /media |
This file contains hidden or 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
1) В пипфайле нужно указывать такие версии интерпретаторов которые знает pyenv И на которые создает симлинки с такимиже именами после сборки. | |
2) При билдинге интерпретаторов pyenv принимает имя типа pypy3.5-6.0.0 | |
3) После того как pyenv строит интерпретатор он создает симлинки на интерпретатор в /home/aa/.pyenv/shims/ и там он называет его pypy3.5 или pypy3 | |
Финал: по имени pypy3.5 pyenv строить интерпретатор не хочет. | |
Таким образом для того чтобы pipenv install отработал на этапе строительства интерпретатора в Pipfile должно быть | |
[requires] | |
python_version = "pypy3.5-6.0.0" | |
А чтобы собственно далее отработал сам pipenv это имя должно быть находимо в /home/aa/.pyenv/shims/ но там только pypy3.5, аначит: |
This file contains hidden or 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
# coding: utf-8 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
# FUNCTION TO DUMP DATA | |
def backup_tables(apps, schema_editor): | |
from django.core import serializers | |
Campaign = apps.get_model('reminders', 'Campaign') | |
CampaignSnapshot = apps.get_model('reminders', 'CampaignSnapshot') |