Skip to content

Instantly share code, notes, and snippets.

View ArrayIterator's full-sized avatar

ArrayIterator ArrayIterator

View GitHub Profile
@denji
denji / nginx-tuning.md
Last active July 3, 2024 22:18
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

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.

@pentagonal
pentagonal / XmlBuilderTrait.php
Last active November 20, 2022 09:21
Nested XML Builder With Definition
<?php
/*
* XML EXAMPLE FOR RETURNING GET REAL DATA VALUE
* This for Tricky XML Return Data
* if got invalid attribute will be use tag as
* <tag key="key name of tag" type="type value"></tag>
*
// SET DATA
[
'Array1' => [ # array
@ammgws
ammgws / proxmox_CT_distupgrade_fix.md
Last active November 16, 2023 14:54
Fix for Proxmox container failing to start after dist-upgrade
  • Upgraded from Ubuntu 16.04 LTS to 18.04 (pre-release) using dist-upgade
  • Upon restart CT would not start
  • Error displayed in Web GUI: command 'systemctl start pve-container@101' failed: exit code 1
  • SSHd in and manually ran CT with pct start 101:
>root@server:~# pct start 101
Job for pve-container@101.service failed because the control process exited with error code.
See "systemctl status pve-container@101.service" and "journalctl -xe" for details.
command 'systemctl start pve-container@101' failed: exit code 1
@ArrayIterator
ArrayIterator / SchemaParser.php
Last active April 6, 2018 14:01
TL Schema Parser
<?php
declare(strict_types=1);
namespace ArrayIterator\MTProto;
/**
* Class SchemaParser
* @package ArrayIterator\MTProto
* @link https://core.telegram.org/mtproto/TL
*/
@ArrayIterator
ArrayIterator / DesktopUserAgent.php
Last active February 12, 2020 17:54
PHP Response Generator , Simple Token Generator & User-Agent Helper
<?php
declare(strict_types=1);
namespace ArrayIterator\Library\Source\Generator;
use InvalidArgumentException;
use RangeException;
use TypeError;
/**
@ArrayIterator
ArrayIterator / ISO4217.json
Last active December 10, 2022 08:34
FULL 2020/02 - ISO 4217 Currency codes
{
"BDT": {
"code": "BDT",
"name": "Bangladeshi Taka",
"symbol": "\u09f3"
},
"EUR": {
"code": "EUR",
"name": "Euro",
"symbol": "\u20ac"
@ArrayIterator
ArrayIterator / ISO8601.json
Created February 12, 2020 17:26
FULL 2020/02 - ISO 8601 Date and time format
{
"Australia/Adelaide": {
"country_name": "Australia",
"country_codes": "AU",
"latitude": -34.91667,
"longitude": 138.58333,
"zone_name": "Australia/Adelaide",
"abbreviation": "CAST",
"offset": 34200,
@ArrayIterator
ArrayIterator / REFERENCE.MD
Created February 12, 2020 17:39
ISO - 8601 + 4217 + 3166
@ArrayIterator
ArrayIterator / PolygonFixer.php
Created February 19, 2020 08:02
Fix Right Hand Rule Geo JSON clockwise
<?php
declare(strict_types=1);
namespace ArrayIterator;
/**
* Class PolygonFixer
* @package ArrayIterator
* Like a Geo Jeon right-hand-rule Fixer based on {@link https://mapster.me/right-hand-rule-geojson-fixer/}
@ArrayIterator
ArrayIterator / Lzw.js
Last active July 14, 2020 04:04
LZW (Lempel–Ziv–Welch) Data Compression - JS & PHP
/*!
* @link https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch
* @license MIT
*/
(function(win) {
function convert_compat_string(e) {
if (e === undefined || e === null || typeof e === 'boolean') {
e = e ? '1' : '';
}
return String(e);