Skip to content

Instantly share code, notes, and snippets.

@hostmiza
hostmiza / create-large-file.sh
Created October 11, 2020 16:23 — forked from olivertappin/create-large-file.sh
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240
@hostmiza
hostmiza / nginx.conf
Created January 30, 2019 21:07 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@hostmiza
hostmiza / nginx-tuning.md
Created January 30, 2019 21:07 — forked from denji/nginx-tuning.md
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.

@hostmiza
hostmiza / gist:b714dafe72dddb6df4192eecbc026067
Created August 7, 2018 08:17 — forked from boboni/gist:2369405
DNS Blacklist Check Script
<?php
include 'dnsbl.php';
$ip = "127.0.0.1";
$dnsbl = new DNSBL;
if($dnsbl->lookup($ip)){
echo "IP is listed in ";
} else {
echo "IP is not listed in DNSBL";
}
$reason = $dnsbl->dnsbl_type_check($ip);
@hostmiza
hostmiza / dnsbl.php
Created August 7, 2018 08:17 — forked from tbreuss/dnsbl.php
IP Blacklist Check Script - This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.
<?php
/***********************************************************************************************************************
* This is a simple PHP script to lookup for blacklisted IP against multiple DNSBLs at once.
**********************************************************************************************************************/
?>
<html>
<head>
<title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
</head>
<body>