Skip to content

Instantly share code, notes, and snippets.

@ngvannguyen
ngvannguyen / restore-zimbra-config+mails.sh
Created August 17, 2023 06:44 — forked from igalic/restore-zimbra-config+mails.sh
Restore Zimbra's ldap, mysql and config from backup, as well as the store
#!/bin/bash
# sources
# https://wiki.zimbra.com/wiki/LDAP_data_import_export
# http://wiki.zimbra.com/wiki/Mysql_Crash_Recovery
# http://wiki.zimbra.com/wiki/CLI_zmvolume
set -e
# set limits as per zmslapadd
ulimit -n 32768
ulimit -c unlimited
@ngvannguyen
ngvannguyen / nginx.conf
Created February 22, 2023 02:09 — forked from prasetiyohadi/nginx.conf
Mitigating DDOS Attack with Nginx
# Source: https://www.nginx.com/blog/mitigating-ddos-attacks-with-nginx-and-nginx-plus/
# DDOS characteristics:
# - traffic originates from a fixed set of IP addresses, much higher than requests from forward proxies
# - traffic is much higher than a human user can generate
# - The User-Agent header is sometimes set to a non-standard value
# - The Referer header is sometimes set to a value you can associate with the attack
# Limiting the rate of requests (example: 30 connection per minute per IP or allow request only every 2 seconds)
limit_req_zone $binary_remote_addr zone=one:10m rate=30r/m;
@ngvannguyen
ngvannguyen / Wordpress Nginx Config
Created February 10, 2023 16:03 — forked from rheinardkorf/Wordpress Nginx Config
/etc/nginx/wordpress.conf
##################################
# WORDPRESS NGINX CONFIGURATIONS
##################################
# /etc/nginx/wordpress.conf
#
# Contains a common configuration for use by nginx on a WordPress
# installation. This file should be included in any WordPress site
# nginx virtual host config located in sites-available with the following line:
#
# include /etc/nginx/wordpress.config;
@ngvannguyen
ngvannguyen / nginx-tuning.md
Created July 18, 2021 01:53 — 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.