Skip to content

Instantly share code, notes, and snippets.

View haghighi's full-sized avatar
๐Ÿฆ

Ahmad Haghighi haghighi

๐Ÿฆ
View GitHub Profile
@haghighi
haghighi / nginx-tuning.md
Created April 29, 2020 11:32 — 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.

@haghighi
haghighi / nginx.conf
Created April 29, 2020 10:50 — 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
@haghighi
haghighi / README.md
Created April 28, 2020 19:43 — forked from abdennour/README.md
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
@haghighi
haghighi / ansible-role-test.sh
Last active August 5, 2019 11:41 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@haghighi
haghighi / kafka-cheat-sheet.md
Created December 11, 2018 05:22 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@haghighi
haghighi / gist:6803accdf4942593b577e6ba8a6a6d48
Created September 1, 2018 05:11 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
@haghighi
haghighi / ciphertest.sh
Created February 12, 2018 13:22 — forked from mtigas/ciphertest.sh
test what SSL ciphersuites a given server supports
#!/usr/bin/env bash
#
# Modified version of http://superuser.com/a/224263
#
# You should make sure you have an OpenSSL 1.0.1+ installed. (Mac OS X? Use homebrew.
# This script automatically hooks into homebrew's installation of 1.0.1e, see line 22.)
#
#######
#
# usage:
@haghighi
haghighi / elasticsearch.txt
Created January 21, 2017 06:31 — forked from tsaito-cyber/elasticsearch.txt
elasticsearch
- state: `curl -XGET localhost:9200/_cluster/state?pretty=true`
- alias: `curl -XGET localhost:9200/_aliases?pretty`
- mapping: `curl -XGET http://localhost:9200/_mappings`
- settings: `curl -XGET localhost:9200/_settings?pretty`
- index ใซๆŽฅ็ถš: `curl -XGET localhost:9200/index`
- ใ‚นใ‚ญใƒผใƒž็ขบ่ช: `curl -XGET localhost:9200/index/_mappings?pretty`
- ่กจ็คบ: `curl -XGET localhost:9200/index/_search?pretty' -d '{"query": {"match_all" : {}}}`
- ๅ…จใฆใฎ index ใ‚’่กจ็คบ: `curl -XGET localhost:9200/_cat/indices?v`
@haghighi
haghighi / syslog-client.py
Created July 20, 2016 05:29 — forked from nfarrar/syslog-client.py
A simple command line python syslog client for generating test messages.
#!/usr/bin/env python
import argparse
import logging
import logging.handlers
parser = argparse.ArgumentParser(__file__,
description="A syslog message generator")
parser.add_argument("--address",