Skip to content

Instantly share code, notes, and snippets.

View k-zakhariy's full-sized avatar
🔥

Zakhariy k-zakhariy

🔥
View GitHub Profile
@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
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
@orottier
orottier / RetryTest.php
Last active July 21, 2023 10:10
Retry function for PHP with exponential backoff
<?php
class RetryTest extends TestCase
{
public function setUp()
{
parent::setUp();
// abuse superglobal to keep track of state
$_GET['a'] = 0;
}
@gaelbillon
gaelbillon / .htaccess
Created September 29, 2012 13:56
custom htaccess for speed, cache, gzip, ETags, etc
### ENVIRONMENT VARIABLES ###
SetEnv PHP_VER 5
SetEnv REGISTER_GLOBALS 0
### MAIN DEFAULTS ###
Options All -Indexes
DirectoryIndex index.html index.htm index.php
AddDefaultCharset UTF-8
### MIME TYPES ###
@trisweb
trisweb / ffmpeg-avchd-conversion.md
Created March 5, 2012 18:13
ffmpeg commands for converting AVCHD-Lite video to better format(s)

FFMpeg Commands for Transcoding MTS video (from AVCHD-Lite Cameras, like Panasonic DMC-TS1/2)

720p -> H.264 (x264) video + AAC 128kbps audio:

Medium quality 720p:

ffmpeg -i 00001.MTS -threads 3 -y -vcodec libx264 -sameq -acodec libfaac -ab 128k -ar 44100 -ac 2 -s 1280x720 -vpre normal -b 1M output.mp4

High quality 720p: