Skip to content

Instantly share code, notes, and snippets.

View SaeedDev94's full-sized avatar

Saeed SaeedDev94

View GitHub Profile
@SaeedDev94
SaeedDev94 / xray2vpn.sh
Last active May 12, 2024 06:12
Linux xray tun2socks routing helper
#!/bin/bash
if [ "$EUID" -ne 0 ]; then echo "Please run as root"; exit; fi
GATEWAY=$(ip route | awk '/default/ {print $3}')
GATEWAY_V6=$(ip -6 route | awk '/default/ {print $3}')
INTERFACE=$(ip route | awk '/default/ {print $5}')
XRAY_EXE="/opt/xray/xray"
XRAY_CONFIG="/path/to/config.json"
@SaeedDev94
SaeedDev94 / nvidia-driver.sh
Last active May 7, 2024 03:43
Manual nvidia driver installation on Ubuntu desktop 24.04 LTS
# Guide ref
# https://www.if-not-true-then-false.com/2021/debian-ubuntu-linux-mint-nvidia-guide
# This is not a real script !!
# Do not run it !!
# Check if secure boot disabled
mokutil --sb-state
# Get GPU model
lspci | grep "VGA"
@SaeedDev94
SaeedDev94 / refresh-reality.sh
Created November 24, 2023 19:13
Refresh reality params
#!/bin/bash
XRAY="/usr/local/bin/xray"
SERVER="/usr/local/etc/xray/config.json"
BUFFER=$(mktemp)
UUID=$($XRAY uuid)
KEYS=$($XRAY x25519)
SHORT=$(openssl rand -hex 8)
@SaeedDev94
SaeedDev94 / haproxy.cfg
Created July 28, 2023 07:27 — forked from cmer/haproxy.cfg
Simple, no bullshit TCP port forwarding using HAProxy
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443
@SaeedDev94
SaeedDev94 / socks2vpn.bat
Last active March 23, 2024 10:49
Windows tun2socks routing helper
@echo off
SET "SCRIPT=%0"
SET "ARG=%1"
SET "GATEWAY=192.168.1.1"
SET "SERVER_ADDRESS=x.x.x.x"
SET "SOCKS_SCHEME=socks5"
SET "SOCKS_ADDRESS=127.0.0.1"
@SaeedDev94
SaeedDev94 / port-forward.sh
Last active April 30, 2023 08:55
TCP/UDP simple port-forward
#!/bin/bash
FROM="1024"
TO="443"
DEST="x.x.x.x"
# Flush nat rules
iptables -t nat --flush
# Exclude localhost
@SaeedDev94
SaeedDev94 / socks2vpn.sh
Last active April 18, 2024 18:50
Linux tun2socks routing helper
#!/bin/bash
if [ "$EUID" -ne 0 ]; then echo "Please run as root"; exit; fi
GATEWAY=$(ip route | awk '/default/ {print $3}')
INTERFACE=$(ip route | awk '/default/ {print $5}')
RESOLVE_CONF=$(cat /etc/resolv.conf)
SOCKS_SCHEME="socks5"
SOCKS_ADDRESS="127.0.0.1"