Skip to content

Instantly share code, notes, and snippets.

View tuananhlai's full-sized avatar

Lại Tuấn Anh tuananhlai

  • Japan
  • 11:25 (UTC -12:00)
View GitHub Profile
@tuananhlai
tuananhlai / plex-client-ipv6.md
Created December 26, 2025 14:09
Allow Plex Clients to Discover IPv6-only Media Servers

Allow Plex Clients to Discover IPv6-only Media Servers

As of December 2025, Android and iOS Plex clients aren't able to discover Plex Media Server via IPv6 endpoint (i.e https://[5c76:b38e:5e32:ee45:905a:57c7:81d2:6508]:32400). For this to happen, we need to set up a domain and generate a valid SSL certificate for our server.

This guide is for MacOS users, but it can be adapted to Linux users as well.

Prerequisites

  • A registered domain with DNS management access. This guide assumes that your domain is yourdomain.com.
  • A Plex Media Server publicly accessible via IPv6.
@tuananhlai
tuananhlai / forward-ipv6-inbound-ax3000.md
Last active December 26, 2025 14:09
Forward all IPv6 inbound traffic through TPLink AX3000 router

Forward all IPv6 inbound traffic through TPLink AX3000 router

As of December 2025, TPLink AX3000's router admin panel UI doesn't have any way to configure firewall for IPv6 traffic. In order for IPv6 inbound requests to pass through, we need to decrypt, modify and reapply the router's configuration file.

Warning

After following this guide, your router will forward all IPv6 inbound requests to devices within your network, which will make them publicly accessible without additional security mechanisms like firewalls, so proceed with care. I take no responsibility for any issues, security risks, or damages resulting from the use of this guide.

Prerequisites

#!/bin/zsh
echo "🖥️ Mac Setup Script"
echo "===================="
# Ask if this is a company machine
echo ""
echo "Is this a company-issued machine? (y/n)"
read is_company_machine
echo ""
@tuananhlai
tuananhlai / kafka-copy-topic.sh
Last active March 23, 2022 04:27
Copy all messages from a source topic to a target topic
DELIM="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1)";
# Add `-c 1` to test with 1 message
kcat -b localhost:9092 -C -t source_topic -D "$DELIM" -K: -e -o beginning | kcat -b localhost:9092 -P -D "$DELIM" -t target_topic -K:
@tuananhlai
tuananhlai / docker-compose.kafka-network-host.yml
Last active July 4, 2021 01:04
A docker-compose file for creating a zookeeper node and 3 kafka brokers, with kafdrop as Web UI
version: "3.9"
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
network_mode: host
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_SERVERS: localhost:22888:23888
ZOOKEEPER_CLIENT_PORT: 2181
# This program is meant to use to calculate SBFL ranking metric
# Example usage:
# - Passing values directly through command line arguments:
# python3 fault-localization.py -f 1 --tf 1 -p 4 --tp 5 --fo ochiai
# - Passing filepath and formula:
# python3 fault-localization.py values.txt --fo tarantula
import sys
from math import sqrt
@tuananhlai
tuananhlai / brute_force.py
Created March 24, 2021 05:33
The code I used to solve a portswigger lab about brute-forcing password.
import requests
session = requests.Session()
def login():
url = "https://ac291fbf1e82ce2980c4012800f4005b.web-security-academy.net/login"
payload = {
'username': 'wiener',
'password': 'a'