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.Узнаем версию pip и обновляем | |
python -m pip install --upgrade pip | |
2.Подключаем postgresql | |
************************************************* | |
DATABASES = { | |
'default': { |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'firstproject', | |
'USER': 'salan2000', | |
'PASSWORD': 'Mara12Fet', | |
'HOST': 'localhost', | |
'PORT': '5432' | |
} |
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. | |
sudo aptitude install postfix dovecot-common dovecot-imapd | |
(Select - no configure!) | |
2. | |
sudo mkdir -p /var/spool/mail/aweson.ru | |
3. | |
sudo groupadd -g 5000 virtual |
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
user nginx nginx; | |
worker_processes 2; | |
pcre_jit on; | |
error_log /var/log/nginx/error.log; | |
#error_log /var/log/nginx/error.log notice; | |
#error_log /var/log/nginx/error.log info; | |
pid /var/run/nginx.pid; |
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
Компиляции python 3.6 | |
# sudo apt-get install -y make build-essential libssl-dev zlib1g-dev | |
# sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm | |
# sudo apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev | |
# wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tgz | |
# tar xzf Python-3.7.1.tgz | |
# cd Python-3.7.1 | |
# ./configure --enable-optimizations |
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
Git работа с ветками | |
Cоздаете отдельную ветку и переходите на неё, с помощью команд: | |
git branch new_fork | |
git checkout new_fork | |
После чего, работаете с проектом обычным образом. |
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
Bash | |
************************************************************************** | |
Генератор случайных чисел | |
Используйте $RANDOM. Это часто полезно в сочетании с простой арифметикой оболочки. Например, для генерации случайного числа между 1 и 10: | |
$ echo $((1 + RANDOM % 10)) |
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
Aliases | |
alias alias_command_name='commands' | |
Чтобы просмотреть список всех доступных алиасов, просто выполните команду alias без аргументов | |
Если алиас вам больше не нужен, вы можете удалить его из системы, используя команду unalias. В качестве аргумента вставьте имя алиаса, который вы хотите удалить. | |
$ alias | grep ls | |
alias ls='ls -l' |
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
Install Python 3.7.0 on CentOS/RHEL 7 | |
1.Requirements: | |
yum install gcc openssl-devel bzip2-devel | |
2.Download Python 3.7: | |
cd /usr/src | |
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz |
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
wp-develop-работа с ветками | |
Cоздаете отдельную ветку и переходите на неё, с помощью команд: | |
git branch new_fork | |
git checkout new_fork | |
После чего, работаете с проектом обычным образом. |