Tweaking Mail-in-a-Box

Disable greylisting Disabling greylisting helps to receive emails without any delay. touch /etc/postgrey/whitelist_clients.local nano /etc/postgrey/whitelist_clients.local Then add # Don’t greylist any domain. /.*/ Save and Exit, then enter commands: service postgrey restart service postfix restart Source:

Tweaking WSL (Windows Subsystem for Linux)

Change apt mirrors (India only) # Create backup first sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup # Download modified sources.list wget # Replace sudo mv sources.list /etc/apt/ Fix files/folder permissions Add some useful aliases cd && touch .bash_aliases add below lines

Get all system IPv4 addresses as array in PHP

/** * Get system ipv4 addresses. * Works on Linux only. * @return [array] */ function getSystemIPs() { $ips = shell_exec(‘hostname -I’); $ips = preg_split(‘/\s+/’, $ips, -1, PREG_SPLIT_NO_EMPTY); foreach ($ips as $ip) { if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE |

Use Rocket-Nginx under RunCloud

Login as root then enter following commands. cd /etc/nginx-rc git clone cd rocket-nginx cp rocket-nginx.ini.disabled rocket-nginx.ini php rocket-parser.php As of version 2.1.1 there is a typo in the rocket-nginx.ini , change media_header to medias_header My template: Create file {app-name}.location.main-before.rocket.conf

Upgrade cURL to latest version on Ubuntu

Tested on Ubuntu 16.04 only. Login as root then do the following: mkdir latestcurl cd latestcurl apt build-dep curl If E: Unable to find a source package for curl error appears then do the following otherwise skip the below part. sed

Create Self-Signed SSL Certificate in Windows

Download Full version EXE (64 bit) from OpenSSL Installer for Windows. Install files at C:\Program Files\OpenSSL Change OPENSSL_CONF variable in ENV Path. Goto C:\Program Files\OpenSSL\bin Create file domains.ext enter this codes. change/add your domains. authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation,

Optimal Settings & Tweaking UpdraftPlus

Optimal Settings: Untick ❌ -> UpdraftPlus Automatic Backups Untick ❌ -> Automatic updates Tick ✅ -> Backup more databases Tick ✅ -> Delete local backup Tweaking: Add below codes to: updraftplus.php /* Disable top admin bar */ defined( ‘UPDRAFTPLUS_ADMINBAR_DISABLE’ )

Disable cURL SSL verification in WordPress

/** * Don’t verify SSL certificates */ add_action( ‘http_api_curl’, function( $handle ) { curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, false ); });

Things to do after installing RunCloud

Some few things I do after connecting a server to runcloud. MySQL Create /etc/mysql/conf.d/custom_config.cnf with the following contents: [mysqld] # Disable binary log skip-log-bin # Set default MySQL character set and collation # Source: character-set-server = utf8mb4 collation-server =

Add headers to certain directories in Nginx under RunCloud

Sometimes we wants to add custom http headers to certain directories and their files. For example: I wanted to add X-Robots-Tag header to some some private directories so it does not get indexed. I’ve tried many methods in the internet

My Sublime Text 3 settings & packages

Few days ago I changed my default text editor from Notepad++ to Sublime Text. The main reason I switched because I wanted to improve my development workflow and I must admit it very much did indeed. I have been using

Use WP Smush without slowing down WordPress

I use WP Smush to compress images in WordPress. But lately the plugin became extremely slow because of excessive database queries. The media library takes 10 seconds to open while the plugin is active but takes only 2 seconds when