Skip to content

Instantly share code, notes, and snippets.

View SaeedDev94's full-sized avatar

Saeed SaeedDev94

View GitHub Profile
@SaeedDev94
SaeedDev94 / .bashrc
Created October 3, 2024 18:26
My debian root user .bashrc
color_prompt=yes
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PROMPT_COMMAND='echo -ne "\033]0;root@${HOSTNAME}: ${PWD}\007"'
export LS_OPTIONS='--color=auto'
eval "$(dircolors)"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#!/bin/bash
if [ "$EUID" -ne 0 ]; then echo "Please run as root"; exit; fi
REMOTE_SERVER="x.x.x.x"
INBOUND_ADDR="127.0.0.1"
INBOUND_PORT="10808"
TPROXY_CHAIN="XRAY_TPROXY"
GATEWAY_CHAIN="XRAY_GATEWAY"
@SaeedDev94
SaeedDev94 / #tunnel-xray
Last active December 22, 2024 01:20
Asuswrt-Merlin: Tunnel clients with XTLS/Xray-core
#!/bin/sh
REMOTE_SERVER="x.x.x.x"
INBOUND_ADDR="127.0.0.1"
INBOUND_PORT="10888"
TPROXY_CHAIN="XRAY_TPROXY"
GATEWAY_CHAIN="XRAY_GATEWAY"
EXCLUDE_MARK="5"
@SaeedDev94
SaeedDev94 / xray2vpn.sh
Last active November 11, 2024 19:29
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 October 3, 2024 16:10
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 November 17, 2024 18:48
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"