Skip to content

Instantly share code, notes, and snippets.

Gani Rakhmatov rahmatov

Block or report user

Report or block rahmatov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rahmatov
rahmatov / nginx-tuning.md
Created Nov 9, 2016 — forked from denji/nginx-tuning.md
NGINX tuning for best performance
View nginx-tuning.md

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 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (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.

@rahmatov
rahmatov / ssh-telegram.sh
Created Jan 1, 2018 — forked from matriphe/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
View ssh-telegram.sh
# save it as /etc/profile.d/ssh-telegram.sh
# use jq to parse JSON from ipinfo.io
# get jq from here http://stedolan.github.io/jq/
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ]; then
View set_irq_affinity.sh
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
# char buf[IFNAMSIZ+6];
#
# sprintf(buf, "%s-%s-%d",
View flussonic-securelink.php
@rahmatov
rahmatov / nginx.conf
Created Nov 24, 2018 — forked from rustamtolipov/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@rahmatov
rahmatov / example.com
Created Nov 26, 2018 — forked from 1hakr/example.com
Supercharge your NGIX config
View example.com
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@rahmatov
rahmatov / html5_video_conv.bash
Created Dec 4, 2018 — forked from zpea/html5_video_conv.bash
little shell script to convert video files to the various HTML5 video formats/codecs using ffmpeg. Also generates the line for embedding the video using the videoJS plugin for wordpress.
View html5_video_conv.bash
#!/bin/bash
#
# video conversion script for publishing as HTML 5 video, via videojs (with hd button extension)
# 2011 by zpea
# feel free to use as public domain / Creative Commons CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/)
#
FFMPEG=/usr/bin/ffmpeg
HD_SUFFIX='_hd'
You can’t perform that action at this time.