Skip to content

Instantly share code, notes, and snippets.

View mayanez's full-sized avatar

Miguel A. Arroyo mayanez

View GitHub Profile
phlinhng /
Last active June 2, 2024 09:55
Clash as transparent proxy gateway via TPROXY


  1. If your local network use public IP ranges instead of private ones, make sure to add respecive RETURN rules to iptables to prevent looping issue
  2. Set clash as DHCP's only DNS server to allow domain-based filter (shunting) rules work
  3. Use lsof -i udp:53 to check if clash's DNS module work fine, otherwise you may have to kill systemd-resolved and any other processes occupying the UDP 53 port
  4. The given scripts will NOT hangle the traffic of gateway itself since it is not recommend to do so. If you want to redirect the egress traffic of the gateway, the following material may be useful


tossmilestone /
Last active November 10, 2022 19:25
V2ray transparent proxy for TCP
echo "Install v2ray..."
if [[ ! -f /usr/bin/v2ray/v2ray ]]
curl -Ls | bash
mkdir -p /etc/v2ray
willsthompson /
Last active July 20, 2024 20:44
SACD Ripping Guide
saniaky /
Last active June 24, 2024 07:31
Docker + nginx-proxy + let's encrypt + watchtower + fail2ban

Complete solution for websites hosting

This gist contains example of how you can configure nginx reverse-proxy with autmatic container discovery, SSL certificates generation (using Let's Encrypt) and auto updates.


  • Automatically detect new containers and reconfigure nginx reverse-proxy
  • Automatically generate/update SSL certificates for all specified containers.
  • Watch for new docker images and update them.
  • Ban bots and hackers who are trying to bruteforce your website or do anything suspicious.
MattPD /
Last active July 18, 2024 21:09
Program Analysis Resources (WIP draft)
GregRos /
Last active May 3, 2021 15:58
Some notes on "Configuring a pretty and usable terminal emulator for WSL"

These comments are based on a few years of experience working with WSL. It's based on this tutorial:

And are basically updates to make it more relevant.

Opening a shell

In the past, to make the WSL run a command from cmd or somewhere else, you had to run the bash.exe program from windows, which fired up bash (and always bash) in the WSL and made it execute a command.

kekru /
Last active June 19, 2024 17:24
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.


  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    TLS SNI support enabled
mbinna /
Last active July 20, 2024 22:17
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](

mswell / config
Last active May 27, 2023 21:20
Terminator Dracula theme
window_state = maximise
handle_size = 0
title_hide_sizetext = True
title_transmit_fg_color = "#bd93f9"
title_inactive_fg_color = "#f8f8f2"
title_receive_bg_color = "#282a36"
title_transmit_bg_color = "#282a36"
title_receive_fg_color = "#8be9fd"
aallan / mac-vendor.txt
Last active July 22, 2024 13:39
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000009 powerpipes?