This file contains 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
# Sample haproxy postgresql master check | |
# | |
# haproxy listen: 5431 | |
# pg, instance #1 listen: 5432 (master node) | |
# pg, instance #2 listen: 5433 (replica node) | |
# external failover, promoting replica to master in case of failure | |
# passwordless auth for user web | |
# template1 database is accessible by user web | |
# | |
# haproxy will pass connection to postgresql master node: |
This file contains 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
# Generate Private Key | |
$ openssl genrsa -out server.key 2048 | |
# Generate CSR | |
$ openssl req -new -out server.csr -key server.key -config openssl.cnf | |
# => Fill in info | |
# Check CSR | |
$ openssl req -text -noout -in server.csr | |
# Sign Cert | |
$ openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt -extensions v3_req -extfile openssl.cnf |
This file contains 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 simple config | |
# author: worldwide community | |
# edit: Vladislav Klimanov ([email protected]) | |
# note: replace 'example.com' with your domain | |
# i like use uncommented this section for nginx/sites-available/default and comment next | |
#server { | |
# listen 80 default_server; | |
# error_log /dev/null crit; | |
# return 403; |
This file contains 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
This playbook has been removed as it is now very outdated. |
This file contains 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
function declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |