Skip to content

Instantly share code, notes, and snippets.

View iL53n's full-sized avatar

Illia Hrybko iL53n

  • EPAM Systems @epam
  • Poland, Krakow
View GitHub Profile
@iL53n
iL53n / qna.monit.rc
Last active September 18, 2019 20:22
### 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 157.245.66.174 port 80 protocol http
then restart
#app/config/unicorn/production.rb
# paths
app_path = "/home/deployer/qna"
working_directory "#{app_path}/current"
pid "#{app_path}/current/tmp/pids/unicorn.pid"
# listen
listen "#{app_path}/shared/tmp/sockets/unicorn.qna.sock", backlog: 64
#>>1. С помощью SQL (DDL):
#Создайте базу данных test_guru
postgres=# create database test_guru;
CREATE DATABASE
#Таблицу categories с атрибутом title
test_guru=# CREATE TABLE categories (
test_guru=# id serial PRIMARY KEY,
Задание_Архитектура клиент-сервер и HTTP-протокол
1. Сформируйте и отправьте по указанному выше url:
....................................................
1.1 GET запрос без параметров
....................................................
> ncat -C httpbin.org 80
GET / HTTP/1.1
Host:httpbin.org