Skip to content

Instantly share code, notes, and snippets.

View d0p3t's full-sized avatar
❤️
be nice

Remco d0p3t

❤️
be nice
View GitHub Profile
@nathanctech
nathanctech / proxy-nginx-fxserver.md
Created May 1, 2020 14:23
FXServer Reverse Proxy

Proxying FiveM Connections using Nginx

As of server version 2377, support was added to FiveM to run a custom streaming proxy similar to cfx.re, but proxying the data connection (UDP) as well. This can be accomplished very easily with nginx acting as a proxy, and you can combine the caching proxy with it.

Requirements

  • Nginx 1.17+ (1.16 absolute minimum, guide tested on 1.17)
  • Server with reasonable network bandwidth (500mbps uplink strongly suggested)
  • FXserver version 2377 or later
  • SSL certificate for the domain you're using (highly recommended)
@nbrochu
nbrochu / browser.py
Last active June 9, 2019 17:13
Python Pseudo-Electron Boilerplate (Windows)
import os
import sys
import math
import time
import threading
import webbrowser # To launch the remote debugging page
import win32api #
import win32con # pip install pywin32
import win32gui #
@throwarray
throwarray / mugroom.lua
Created July 21, 2018 19:09
mugroom.lua
local function CreateNamedRenderTargetForModel(name, model)
local handle = 0
if not IsNamedRendertargetRegistered(name) then
RegisterNamedRendertarget(name, 0)
end
if not IsNamedRendertargetLinked(model) then
LinkNamedRendertarget(model)
end
if IsNamedRendertargetRegistered(name) then
handle = GetNamedRendertargetRenderId(name)
@manchot0
manchot0 / gist:354c2df17ec4afd1ffae9642bf2273cc
Last active February 1, 2024 18:08
DDOS protection with iptable
IPtables DDOS protection :
In my config i assume the server is not a router and already profit from some filtering by the hosting company on shitty
networks.
I have tested this on ubuntu server 18.04 with the kernel 4.15.0-36-generic.
Protect from malformed packet, ACK FIN RST attack and SYN-flood.
Flood which profit of TCP-KEEPALIVE (so there a no SYN packet) should be handled by the web server (rate-limit in nginx for
exemple). Connlimit can also be helpfull to limit the number of connexion per ip.

Scaleform: mp_car_stats_01

Scale

Citizen.CreateThread(function()
    function Initialize(scaleform)
        scaleform = RequestScaleformMovie(scaleform)
        while not HasScaleformMovieLoaded(scaleform) do
            Citizen.Wait(0)
        end
        PushScaleformMovieFunction(scaleform, "SET_VEHICLE_INFOR_AND_STATS")
@IS4Code
IS4Code / entityiter.lua
Created July 14, 2017 12:47
FiveM entity iterators
--[[The MIT License (MIT)
Copyright (c) 2017 IllidanS4
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
@bom-d-van
bom-d-van / ddos.txt
Created February 12, 2017 11:46
Detecting and Mitigating DDOS Attacks
Detecting and Mitigating DDOS Attacks
#List all Finish (FIN) packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 1 != 0'
#List all SYN and SYN-ACK packets
machine1 : sudo /usr/sbin/tcpdump -Nnn -i any -s0 'tcp[13] & 2 != 0'
@ravibhure
ravibhure / git_rebase.md
Last active April 3, 2024 08:38
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files: