Skip to content

Instantly share code, notes, and snippets.

@xiaochen-2050
xiaochen-2050 / envoy-basic.yaml
Created August 10, 2023 09:07 — forked from vnayar/envoy-basic.yaml
A skeletal configuration for Envoy which forwards requests to Envoy's website.
# Resources loaded at boot, rather than dynamically via APIs.
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap-staticresources
static_resources:
# A listener wraps an address to bind to and filters to run on messages on that address.
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener.proto#envoy-v3-api-msg-config-listener-v3-listener
listeners:
# The address of an interface to bind to. Interfaces can be sockets, pipes, or internal addresses.
# https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#envoy-v3-api-msg-config-core-v3-address
- address:
# This address is for a network socket, with an IP and a port.
@xiaochen-2050
xiaochen-2050 / resources.md
Created May 7, 2023 15:40 — forked from muff-in/resources.md
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@xiaochen-2050
xiaochen-2050 / nginx-tuning.md
Created June 30, 2021 03:57 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

@xiaochen-2050
xiaochen-2050 / .screenrc-main-example
Created April 29, 2021 09:24 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - [email protected]
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@xiaochen-2050
xiaochen-2050 / script-template.sh
Created December 27, 2020 08:45 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@xiaochen-2050
xiaochen-2050 / nginx.conf
Created March 13, 2018 01:38 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@xiaochen-2050
xiaochen-2050 / cors.nginxconf
Created December 4, 2017 06:52 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {