Skip to content

Instantly share code, notes, and snippets.

View SergeGray's full-sized avatar

Sergey Shayderov SergeGray

View GitHub Profile
### 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 shayderov.ru port 80 protocol http
then restart
if 3 restarts within 5 cycles then timeout
@SergeGray
SergeGray / first_file.txt
Created January 28, 2020 10:51
QnA Test Gist
Text here
postgres=# CREATE DATABASE test_guru;
CREATE DATABASE
postgres=# CREATE TABLE categories (
postgres(# id serial PRIMARY KEY,
postgres(# title varchar(50)
postgres(# );
CREATE TABLE
postgres=# CREATE TABLE tests (
postgres(# id serial PRIMARY KEY,
postgres(# title varchar(50),
postgres=# CREATE DATABASE test_guru;
CREATE DATABASE
postgres=# CREATE TABLE categories (
postgres(# id serial PRIMARY KEY,
postgres(# title varchar(50)
postgres(# );
CREATE TABLE
postgres=# CREATE TABLE tests (
postgres(# id serial PRIMARY KEY,
postgres(# title varchar(50),
@SergeGray
SergeGray / GET with parameters
Created August 22, 2019 11:22
HTTP requests
serge@EVO:~$ ncat -C httpbin.org 80
GET /anything?id=23&type=cool HTTP/1.1
Host: httpbin.org
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Content-Type: application/json
Date: Thu, 22 Aug 2019 11:10:12 GMT
Referrer-Policy: no-referrer-when-downgrade