Skip to content

Instantly share code, notes, and snippets.

View root-ali's full-sized avatar
:octocat:

Ali Soltani root-ali

:octocat:
View GitHub Profile
@githubfoam
githubfoam / tcpdump cheat sheet
Last active November 30, 2025 21:00
tcpdump cheat sheet
----------------------------------------------------------------------------------------------------
tcpdump -s 0 #capture entire etherner header and IP packet
tcpdump -ni tap55ec3c7f-91 ip6 #locate the ICMPv6 packets
tcpdump -s0 -n -i any -w /tmp/$(hostname)-smbtrace.pcap #if the SMB client or SMB server is a Unix host,Troubleshooting Server Message Block (SMB)
tcpdump -D #Print the list of the network interfaces available on the system and on which tcpdump can capture packet
tcpdump -X -vvv -n -i eth0
@krisek
krisek / alert.rules.yml
Last active December 5, 2025 12:33
Prometheus alert rules for node exporter
groups:
- name: node_exporter_alerts
rules:
- alert: Node down
expr: up{job="monitoring-pi"} == 0
for: 2m
labels:
severity: warning
annotations:
title: Node {{ $labels.instance }} is down
@thomaspoignant
thomaspoignant / Makefile
Last active August 30, 2025 22:19
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@Hakky54
Hakky54 / curl-with-java-keystore.md
Last active May 11, 2025 15:14
Curl with Java KeyStore

Curl with Java KeyStore

Curl doesn't have support for java keystore file, so therefor the file should be converted to a PEM format. It consists of the following multiple steps:

  1. Convert keystore to p12 file
  2. Convert p12 file to pem file
  3. Run curl command with pem files

One way TLS/SSL/Authentication

Convert keystore to p12 file

@twpayne
twpayne / main_test.go
Last active December 4, 2023 09:45
CockroachDB bulk insert test case
package main
import (
"bytes"
"database/sql"
"flag"
"html/template"
"strconv"
"strings"
"testing"
@holmberd
holmberd / php-pools.md
Last active November 13, 2025 10:56
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@denji
denji / nginx-tuning.md
Last active December 6, 2025 06:25
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.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active December 11, 2025 14:31
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname