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
| <!-- <form action="" method="post"> | |
| {{ form.csrf_token() }} | |
| {% for field in form if field.name != "csrf_token" %} | |
| {{ field.label() }} | |
| {{ field }} | |
| <br> | |
| {% endfor %} | |
| <button type="submit">поиск</button> | |
| </form> --> |
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
| sudo apt-get update | |
| sudo apt-get install postgresql postgresql-contrib | |
| sudo -u postgres psql | |
| create user username with password 'password'; | |
| create database vscale_db; | |
| grant all privileges on database vscale_db to username; | |
| \q |
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
| ### Nginx ### | |
| check process nginx with pidfile /run/nginx.pid | |
| start program = "/usr/sbin/service nginx start" | |
| stop program = "/usr/sbin/service nginx stop" | |
| if cpu > 60% for 2 cycles then alert | |
| if cpu > 80% for 5 cycles then restart | |
| if memory usage > 80% for 5 cycles then restart | |
| if failed host 188.68.209.3 port 80 protocol http | |
| then restart | |
| if 3 restarts within 5 cycles then timeout |
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
| text test |
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
| ############ | |
| #В имени поля не нужно дублировать имя таблицы | |
| test_guru=> \d categories | |
| Table "public.categories" | |
| Column | Type | Modifiers | |
| ----------------+-----------------------+--------------------------------------------------------- | |
| id | integer | not null default nextval('categories_id_seq'::regclass) | |
| category_title | character varying(20) | not null | |
| Indexes: |
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
| # create database | |
| postgres=# CREATE DATABASE test_guru; | |
| CREATE DATABASE | |
| postgres=# \l | |
| List of databases | |
| Name | Owner | Encoding | Collate | Ctype | Access privileges | |
| -----------+----------+----------+-------------+-------------+----------------------- | |
| postgres | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | | |
| template0 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres + |
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
| ncat -C httpbin.org 80 | |
| POST /anything HTTP/1.1 | |
| Host: httpbin.org | |
| Content-Length: 9 | |
| test=TEST | |
| HTTP/1.1 200 OK | |
| Connection: keep-alive | |
| Server: gunicorn/19.9.0 | |
| Date: Mon, 17 Sep 2018 15:32:49 GMT |
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.GET request without parameters | |
| ncat -C httpbin.org 80 | |
| GET /anything HTTP/1.1 | |
| Host: httpbin.org | |
| HTTP/1.1 200 OK | |
| Connection: keep-alive | |
| Server: gunicorn/19.9.0 | |
| Date: Mon, 17 Sep 2018 08:00:01 GMT | |
| Content-Type: application/json |