fail2ban

30.01.2020 / 0 comments

root@robot:~# fail2ban-client status sshd Status for the jail: sshd |- Filter | |- Currently failed: 2 | |- Total failed: 378280 | `- File list: /var/log/auth.log `- Actions |- Currently banned: 1 |- Total banned: 57244 `- Banned IP list: 222.186.173.154 root@robot:~# fail2ban-client unban 222.186.173.154 root@robot:~#  

заворот трафика через alias

29.01.2020 / 0 comments

root@robot:~# echo 200 ddos2 >> /etc/iproute2/rt_tables root@robot:~# ip route add default via <gateway> dev eth0 src <ddos2_alias> table ddos2 root@robot:~# ip rule add to 104.47.10.36/32 lookup ddos2 root@robot:~# ip rule add to 104.47.8.36/32 lookup ddos2  

Could not initialize master info structure for ‘ ‘; more error messages can be found in the MariaDB

28.01.2020 / 0 comments

После рестарта и переноса файлов, «START SLAVE;» вызывает отображение сообщения «Could not initialize master info structure for ‘ ‘; more error messages can be found in the MariaDB» Решил «STOP SLAVE; RESET SLAVE; FLUSH TABLES; START SLAVE;»

MikroTik RouterOS настройка интерфейсов

22.01.2020 / 0 comments

/interface bridge remove 0 /ip address add interface=ether2 address=192.168.1.7/24 [admin@MikroTik] /ip> /interface bridge port print Flags: X — disabled, I — inactive, D — dynamic # INTERFACE BRIDGE PRIORITY PATH-COST HORIZON 0 I ether1 *E 0x80 10 none 1 I ether2 *E 0x80 10 none [admin@MikroTik] /ip> /interface bridge port remove numbers=0,1 [admin@MikroTik] /ip>

Сброс пароля mysql

17.01.2020 / 0 comments

# systemctl stop mysql # mysqld_safe —skip-grant-tables & # mysql MariaDB [(none)]> UPDATE mysql.user SET Password=PASSWORD(‘vadimdenisov’) WHERE User=’root’; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> exit; # mysqladmin -u root -pvadimdenisov shutdown # systemctl start mysql  

Список всех подов во всем пространствах имён

15.01.2020 / 0 comments

kubectl get pods —all-namespaces  

Список пространств имён kubectl

15.01.2020 / 0 comments

kubectl get namespaces  

certbot cron renew

21.11.2019 / 0 comments

0 0 * * * /usr/bin/certbot renew —renew-hook «systemctl reload nginx»  

apache https redirect

20.11.2019 / 0 comments

RewriteCond %{HTTP_SCHEME} !https RewriteCond %{HTTP_HOST} !vadimdenisov.ru RewriteRule «.?» «-» [S=1] RewriteRule ^(.*)$ https://vadimdenisov.ru/$1 [R=301,L] Надо проверить

php redirect https

19.11.2019 / 0 comments

if ($_SERVER[‘HTTP_SCHEME’] != ‘https’) { header(«HTTP/1.1 301 Moved Permanently»); header(«Location: https://vadimdenisov.ru».$_SERVER[‘REQUEST_URI’]); exit(); } При наличии nginx, в конфиге nginx должно быть proxy_set_header Scheme $scheme;