Hello and welcome to #root.bg!
Here you can find tutorials about linux, networks and their firewall, games and fun, as well as hobbies – rollers, drones and many more.
Here you can find tutorials about linux, networks and their firewall, games and fun, as well as hobbies – rollers, drones and many more.
Николай Николов Howto charset, mysql, mysql 8, wordpress 0
Hello,
I’m fan of new technologies and I love updates;))
For this reason, root.bg is now working on MySQL 8!
In this post I will share the special features of releasing version 8 and what we need to do our wordpress – especially if its base is large, old and with different types of charset and collation. To emphasize that I migrated from MariaDB 10.2 and for this purpose I picked up a new MySQL server – I did not do mysql_upgrade, and dump and restore the base!
More details about the new features in MySQL 8 can be found on their official site.
What is important for wordpress is precisely this :
latin1
to utf8mb4
. The utf8mb4
character set has several new collations, including utf8mb4_ja_0900_as_cs
, the first Japanese language-specific collation available for Unicode in MySQL. For more information, see Section 10.10.1, “Unicode Character Sets”.This is the problem I encountered after I poured the root.bg base of the new mysql server. Here are all the publications written in Cyrillic:
The reason for this is the encoding in MySQL.
This problem can be solved in two ways – by setting it on the server itself or in our wordpress configuration file.
Here are two ways:
character-set-server=latin1
We can test this from mysql console:
SHOW VARIABLES LIKE 'character\_set\_%';
and we should see this result :
+--------------------------+---------+ | Variable_name | Value | +--------------------------+---------+ | character_set_client | utf8mb4 | | character_set_connection | utf8mb4 | | character_set_database | latin1 | | character_set_filesystem | binary | | character_set_results | utf8mb4 | | character_set_server | latin1 | | character_set_system | utf8 | +--------------------------+---------+ 7 rows in set (0.00 sec)
In the wordpress configuration file – wp-config.php, we add the following line:
define('DB_CHARSET', 'latin1');
And now we have a working wordpress on MySQL 8!
P.S.
root.bg lives on :
ubuntu 18.04.1
nginx 1.14.0
php 7.2.11
mysql 8.0.13
memcached 1.5.6
Thats it!
Николай Николов Howto mcrypt, php, php 7.2, whm 0
Hello,
Since mcrypt version 7.1 is no longer supported by PHP developers,
and 7.2 can no longer be installed.
In this post I will share how we can install mcrypt on the WHM server in php7.2.
We execute the following commands :
Install EPEL repo :
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
We install the necessary libraries for mcrypt :
yum install libmcrypt yum install libmcrypt-devel
Install mcrypt via PECL :
/opt/cpanel/ea-php72/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.1
We test whether the module is successfully installed :
/opt/cpanel/ea-php72/root/usr/bin/php -m|grep mcrypt
Thats it!
Николай Николов Howto, Iphone/MacOS macos, специални символи, terminal 0
Hello,
In this post I will share how we can exclude the special characters of our MacOS.
The following table lists these symbols, and in order to use, we just hold the specified letter or the combination below.
Accent | Key Strokes | Available Characters |
Grave ` | option ` + the character | À È Ì Ò Ù à è ì ò ù |
Acute ´ | option e + the character | Á É Í Ó Ú á é í ó ú |
Circumflex ^ | option i + the character | Â Ê Î Ô Û â ê î ô û |
Tilde ~ | option n + the character | Ã Ñ Õ ã ñ õ |
Umlaut ¨ | option u + the character | Ä Ë Ï Ö Ü Ÿ ä ë ï ö ü ÿ |
Key Stroke |
+Option | +Option- Shift |
Key Stroke |
+Option | +Option- Stroke |
A | å | Å | 0 | º | ‚ |
B | † | ¹ | 1 | ¡ | Ž |
C | ç | Ç | 2 | ™ | € |
D | | Î | 3 | £ | Ð |
E | ´ | 4 | ¢ | ð | |
F | ƒ | Ï | 5 | ƒ | Þ |
G | © | › | 6 | § | þ |
H | ™ | Ó | 7 | ¶ | ý |
I | ˆ | 8 | • | ° | |
J | | Ô | 9 | ª | · |
K | š | • | – | – en dash | — em dash |
L | ¬ | Ò | = | ‚ | ± |
M | µ | Â | [ | “ | ” |
O | ø | Ø | ] | ‘ | ’ |
P | ¼ | ½ | \ | ´ | ª |
Q | œ | Œ | ‘ | æ | Æ |
R | ® | ‰ | , | ¾ | ¯ |
S | ß | Í | . | „ | ˜ |
T | Ý | | ; | … | Ú |
U | ¨ | ` | ` | ||
V | ˆ | × | / | ÷ | ¿ |
W | … | „ | |||
X | ‰ | œ | |||
Y | ¥ | Á | |||
Z | ‡ | ¸ |
When writing in a terminal or anywhere else in our MacOS, things happen somewhat slower than a linux desktop, for example. This is precisely because of these special symbols.
A typical example is the deletion or forwarding or forwarding of an IDE or a terminal – it is very slow!
To fix this problem, we need to write the following 3 lines in our terminal and then exit the user and log in again (or restart the mac)
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false defaults write NSGlobalDomain KeyRepeat -int 1 defaults write NSGlobalDomain InitialKeyRepeat -int 12
The result is impressive!! 🙂
If we accidentally want to go back to his old one – to have special characters we have to write in the terminal and get out again and get in :
defaults write -g ApplePressAndHoldEnabled -bool true
Thats it !
Николай Николов Howto CSP, firewall, header, nginx, security, xss 0
Hello,
In this post I will share how we can protect our site if we use nginx for a web server.
Led by Scott Helme for CSP, I started to test the CSP header of root.bg. I used his securityheaders.com tool and finally achieved the desired result – A + 🙂
In the virtual host of our site we add the following lines after location /
add_header Content-Security-Policy "block-all-mixed-content; frame-ancestors 'self' root.bg cdn.root.bg s.root.bg go.root.bg git.root.bg fonts.gstatic.com;"; add_header Content-Security-Policy-Report-Only "default-src https: data: 'unsafe-inline' 'unsafe-eval'; report-uri https://rootbg.report-uri.com/r/d/csp/reportOnly";
I made a report on the site report-uri.com and so I started collecting information from my webserver for XSS attacks, web server configuration errors, monitoring and everything else related to the new web standards.
I personally have a bit of luck with the addition of redundant header, but almost all of them are for protection 🙂
HTTP/2 200 date: Wed, 17 Oct 2018 07:13:17 GMT content-type: text/html; charset=UTF-8 vary: Accept-Encoding set-cookie: PHPSESSID=d2lar8sp9vq24752mip9lu31ls; path=/; secure; HttpOnly expires: Thu, 19 Nov 1981 08:52:00 GMT cache-control: no-store, no-cache, must-revalidate pragma: no-cache x-powered-by: 🐧 link: https://root.bg/wp-json/; rel="https://api.w.org/" link: https://go.root.bg/21; rel=shortlink server: rws strict-transport-security: max-age=31536000; includeSubDomains; preload x-cache: HIT x-xss-protection: 1; mode=block; report=https://rootbg.report-uri.com/r/d/xss/enforce x-frame-options: SAMEORIGIN x-content-type-options: nosniff p3p: Can I help you? Contact me via https://root.bg/contacts/, CP=CAO ADMa DEVa IND PHY ONL UNI COM LOC feature-policy: sync-xhr 'self' https://root.bg content-security-policy: block-all-mixed-content; frame-ancestors 'self' root.bg cdn.root.bg s.root.bg go.root.bg git.root.bg fonts.gstatic.com; content-security-policy-report-only: default-src https: data: 'unsafe-inline' 'unsafe-eval'; report-uri https://rootbg.report-uri.com/r/d/csp/reportOnly referrer-policy: no-referrer-when-downgrade expect-ct: enforce; max-age=86400; report-uri=https://rootbg.report-uri.com/r/d/ct/enforce x-app-server: gevi x-slogan: Respect is earned, not given!
Thats it!