Securing WordPress using a combination of configuration changes and plugins.
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
-- Query the database to calculate a recommended innodb_buffer_pool_size | |
-- and get the currently configured value | |
-- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB. | |
SELECT | |
TABLE_SCHEMA, | |
CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1)) | |
Recommended_InnoDB_Buffer_Pool_Size, | |
( | |
SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1)) |
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
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 |
Moved to git repository: https://github.com/denji/nginx-tuning
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
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
if (typeof console != "undefined") | |
if (typeof console.log != 'undefined') | |
console.olog = console.log; | |
else | |
console.olog = function() {}; | |
console.log = function(message) { | |
console.olog(message); | |
$('#debugDiv').append('<p>' + message + '</p>'); | |
}; |
I'll enumerate below a suite of guides I've followed to setup a Ubuntu server:
- https://www.informaticar.net/security-hardening-ubuntu-20-04
- https://linuxize.com/post/secure-nginx-with-let-s-encrypt-on-ubuntu-20-04/
- https://www.linuxbabe.com/mail-server/setup-basic-postfix-mail-sever-ubuntu
- https://www.linuxbabe.com/ubuntu/automatic-security-update-unattended-upgrades-ubuntu
- https://www.linuxbabe.com/security/harden-ssh-server
- https://www.linuxbabe.com/mail-server/host-multiple-mail-domains-in-postfixadmin
- https://www.linuxbabe.com/mail-server/block-email-spam-postfix
- https://www.linuxbabe.com/mail-server/block-email-spam-check-header-body-with-postfix-spamassassin
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
<?php | |
/** | |
* | |
* Gmail attachment extractor. | |
* | |
* Downloads attachments from Gmail and saves it to a file. | |
* Uses PHP IMAP extension, so make sure it is enabled in your php.ini, | |
* extension=php_imap.dll |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. | |
* |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "../utils/Context.sol"; | |
/** | |
* @dev Contract module which provides a basic access control mechanism, where | |
* there is an account (an owner) that can be granted exclusive access to | |
* specific functions. | |
* |
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
NewerOlder