July 31

deny connection by user agent in nginx

to deny connection by user agent put the following line on your nginx config:

if ($http_user_agent ~ (Synapse) ) {
return 403;
}

For multi block:

if ($http_user_agent ~ ("Synapse|some_agent|and_another_agent") ) {
return 403;
}

in case with Engintron, put it to /etc/nginx/custom_rules

July 2

xfce4 custom keys presets inside terminal

1) Run xfce4-appearance-settings, go to Settings and activate Enable
editable accelerators
2) In XFCE Terminal with the mouse select the in Help the Contents that
also says F1 at the end
3) To delete the option, press ‘Delete’ or ‘Backspace’. Backspace edits
the F1 to Backspace, so it re-assigns another key.
If you want e.g. F3 as the ‘Help’ button (like old times) you press F3

June 23

How to restore Real IPs in Engintron

To fix the mod_remoteip after software update:

cp -pv /etc/apache2/conf.modules.d/*remoteip.conf.rpmsave /etc/apache2/conf.modules.d/mod_remoteip.conf

To restore the logs if the issue with the logs:

1.
cp -a /var/cpanel/templates/apache2_4/ea4_main.default /var/cpanel/templates/apache2_4/ea4_main.local

2.
replace all %h by %{X-Real-IP}i
in /var/cpanel/templates/apache2_4/ea4_main.local

3.
/scripts/rebuildhttpdconf

4.
/engintron.sh purgecache

June 19

Create mysql/mariadb DB and user

mysqladmin create somename_workdb

for user from any host:

CREATE USER 'somename_workdb'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON somename_workdb.* TO 'somename_workdb'@'%';
FLUSH PRIVILEGES;

for user from localhost only:

CREATE USER 'somename_workdb'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON somename_workdb. * TO 'somename_workdb'@'localhost';
FLUSH PRIVILEGES;

 

Add remote host to firewall in order to allow connection to mysql:

 

tcp|in|d=3306|s=host_ip