Skip to content

Instantly share code, notes, and snippets.

View gaptekupdate's full-sized avatar

Muhammad Februriyanto gaptekupdate

View GitHub Profile
@holmberd
holmberd / php-pools.md
Last active September 25, 2024 05:44
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

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?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@pgporada
pgporada / centos7_kernel_update.md
Last active December 18, 2021 11:11
Upgrade Kernel on Centos7 via ELRepo
Install the ELRepo and GPG key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install -y http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Enable kernel updates from elrepo
yum-config-manager --enable elrepo-kernel
@khanhicetea
khanhicetea / nginx.conf
Created November 5, 2015 07:26
NginX https redirect ( Cloudflare's flexible ssl )
server {
listen 80;
server_name example.com www.example.com;
if ($http_x_forwarded_proto = "http") {
return 301 https://$server_name$request_uri;
}
... directives to generate a response
}
@brandonmwest
brandonmwest / example.cs
Last active June 27, 2024 04:03
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@kasparsd
kasparsd / disable-title-rewrite-wordpress-seo.php
Last active November 22, 2023 12:13
Disable page title rewrite feature in WordPress SEO plugin
<?php
// Remove the wp_title filter
add_action( 'init', 'remove_wpseo_title_rewrite' );
function maybe_remove_wpseo_title_rewrite() {
global $wpseo_front;
remove_filter( 'wp_title', array( $wpseo_front, 'title' ), 15 );
}