Skip to content

Instantly share code, notes, and snippets.

View haghighi's full-sized avatar
🦁

Ahmad Haghighi haghighi

🦁
View GitHub Profile
@haghighi
haghighi / nextcloud-docker-disable-totp.sh
Created April 3, 2021 11:44
Nextcloud docker disable totp
# php occ twofactorauth:disable [--output [OUTPUT]] [--] <uid> <provider_id>
sudo docker exec --user www-data nextcloud php occ twofactorauth:disable USERNAME totp
@haghighi
haghighi / owasp-dependencytrack-docker-compose.yml
Created August 10, 2020 09:45
OWASP Dependency-Track (dtrack) Docker (docker-compose.yml)
version: '3.7'
services:
dtrack:
environment:
# The Dependency-Track container can be configured using any of the
# available configuration properties defined in:
# https://docs.dependencytrack.org/getting-started/configuration/
# All properties are upper case with periods replaced by underscores.
#
# Database Properties
@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 / sonarqube-docker-compose.yml
Created September 4, 2019 12:37
sonarqube-docker-compose
version: "2"
services:
sonarqube:
image: sonarqube
restart: always
ports:
- "9000:9000"
networks:
- sonarnet
@haghighi
haghighi / prometheus-docker-compose.yml
Created September 4, 2019 12:36
prometheus-docker-compose
version: "3"
services:
prometheus:
image: prom/prometheus
volumes:
- "prometheus_storage:/prometheus"
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
restart: always
ports:
@haghighi
haghighi / grafana-docker-compose.yml
Created September 4, 2019 12:35
grafana-docker-compose
version: "3"
services:
grafana:
image: grafana/grafana
volumes:
- "grafana-storage:/var/lib/grafana"
- "./grafana-config/grafana.ini:/etc/grafana/grafana.ini"
restart: always
ports:
@haghighi
haghighi / nexus3-nginx-reverse-proxy
Created September 4, 2019 12:28
nexus3-nginx-reverse-proxy
server {
listen *:80;
server_name repo.samim.int;
# allow large uploads of files
client_max_body_size 1G;
# optimize downloading files larger than 1G
#proxy_max_temp_file_size 2G;
@haghighi
haghighi / nexus3-docker-compose.yml
Last active October 13, 2019 05:27
nexus3-docker-compose
version: "3"
services:
nexus:
image: sonatype/nexus3
volumes:
- "nexus-docker-compose_nexus-data:/nexus-data"
restart: always
environment:
- INSTALL4J_ADD_VM_PARAMS="-Xms4G -Xmx4G -XX:MaxDirectMemorySize=4014M " # 12 GB physical Memmory