Skip to content

Instantly share code, notes, and snippets.

View xtrsyz's full-sized avatar

Satria Adhi xtrsyz

View GitHub Profile
@xtrsyz
xtrsyz / ddos.conf
Created July 25, 2023 07:51 — forked from mattia-beta/ddos.conf
IPtables DDoS Protection for VPS
### 1: Drop invalid packets ###
/sbin/iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP
### 2: Drop TCP packets that are new and are not SYN ###
/sbin/iptables -t mangle -A PREROUTING -p tcp ! --syn -m conntrack --ctstate NEW -j DROP
### 3: Drop SYN packets with suspicious MSS value ###
/sbin/iptables -t mangle -A PREROUTING -p tcp -m conntrack --ctstate NEW -m tcpmss ! --mss 536:65535 -j DROP
### 4: Block packets with bogus TCP flags ###
function getIdentifier(playerId)
return GetPlayerIdentifiers(playerId)[1]
end
function logChat( playerId, name, message )
MySQL.Async.execute('INSERT INTO `log_chat` (identifier, name, message) VALUES (@identifier, @name, @message)', {
['@identifier'] = getIdentifier(playerId),
['@name'] = name,
['@message'] = message
}, function(rowsChanged)
@xtrsyz
xtrsyz / fivem-proxy
Created August 13, 2021 07:26
upstream fivem multi ips
#sudo apt-get install nginx-extras
upstream dejavu {
server 128.99.8.144:30120;
}
proxy_cache_path /nginx/cache/dejavu levels=1:2 keys_zone=dejavu:10m max_size=20g inactive=2h;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;