Заметки по nix’ам

Изменение редактора по-умолчанию в OS Linux и FreeBSD

В Linux

В FreeBSD

Вывод dmesg с человеко-читабельной датой:

 

Переименовывание файлов цикле

 

Проверить на какие разделы установлен grub

Время в centos

rsync вместо scp для скачивания каталога с удаленного сервера с докачкой

вариант без rsync на удаленном сервере:

Hard reset сервера из консоли

Изменение имени сервера без перезагрузки (centos 7)

Блокируем пакет на обновление в CentOS на примере MongoDB

You can specify any available version of MongoDB. However yum upgrades the packages when a newer version becomes available. To prevent unintended upgrades, pin the package. To pin a package, add the following exclude directive to your /etc/yum.conf file:

exclude=mongodb-org,mongodb-org-server,mongodb-org-shell,mongodb-org-mongos,mongodb-org-tools

 

HAproxy

для letsencrypt

frontend block

# for le ssl generate certificates
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl

# LE Backend
backend letsencrypt-backend
server letsencrypt 127.0.0.1:8888

генерируем:

/root/certbot-auto certonly —standalone -d example.com -d www.example.com —non-interactive —agree-tos —email support@example.com —http-01-port=8888

форсированный редирект на https (секция frontend)
redirect scheme https if !{ ssl_fc }

редирект www на non-www

acl lepath path_beg -i /.well-known/acme-challenge
redirect scheme https code 301 if !{ hdr(host) -i enerest.world } !lepath !{ ssl_fc }
redirect prefix https://example.com code 301 if { hdr(host) -i www.example.com } !lepath

 

You have to enable the EPEL repo

yum —enablerepo=extras install epel-release

This command will install the correct EPEL repository for the CentOS version you are running.

After this you will be able to install python-pip.

 

zabbix Permission denied /var/log/

В данном случаи можно изменить пользователя и группу под которым запускается zabbix