Skip to content

Instantly share code, notes, and snippets.

View spacemud's full-sized avatar
👨‍⚕️

spacemud

👨‍⚕️
View GitHub Profile
@spacemud
spacemud / .gitlab-ci.yml
Created January 12, 2019 21:19 — forked from Southclaws/.gitlab-ci.yml
sampctl+gitlab=ci/cd 🎉
build:
image:
name: southclaws/sampctl:latest
entrypoint: [""]
tags: [pawn]
artifacts:
paths:
- gamemodes/barp.amx
cache:
paths:
@spacemud
spacemud / uncrustify.cfg
Created January 12, 2019 21:42 — forked from Southclaws/uncrustify.cfg
Uncrustify configuration for the Pawn language.
# Uncrustify-0.68-59-5813ad32
#
# General options
#
# The type of line endings.
#
# Default: auto
newlines = auto # lf/crlf/cr/auto
@spacemud
spacemud / sa_grass.pwn
Created January 30, 2019 20:56 — forked from IS4Code/sa_grass.pwn
Foliage and other procedurally generated objects for SA-MP
This file has been truncated, but you can view the full file.
/*
Mozilla Public License Version 2.0
Copyright (c) 2018 IllidanS4
This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/.
*/
@spacemud
spacemud / bipltool-batch.py
Created January 30, 2019 21:22 — forked from Vince0789/bipltool-batch.py
An IPL decompiler for binary IPL data files for gta:sa.
## Benjamin Williams
## <eeu222@bangor.ac.uk>
## --
## bipltool.py/pyc
import os
import sys
import struct
import math
#define INVALID_DIALOG_ID (cellmin)
static stock
gPrev[MAX_PLAYERS] = { INVALID_DIALOG_ID, ... },
gCur[MAX_PLAYERS] = { INVALID_DIALOG_ID, ... },
bool:gOPDR = true;
hook function ShowPlayerDialog(playerid, dialogid, style, const caption[], const info[], const button1[], const button2[])
{
gCur[playerid] = dialogid;
@spacemud
spacemud / qrcodesamp.js
Created October 26, 2020 11:03 — forked from AmyrAhmady/qrcodesamp.js
a simple js code for samp-node
import qrcode from "qrcode-generator";
async function generateQRCodeForSamp(context) {
let typeNumber = 4;
let errorCorrectionLevel = 'L';
let qr = qrcode(typeNumber, errorCorrectionLevel);
qr.addData(context);
qr.make();
let newQRCode = "";
#include <a_samp>
#include <rotations.inc>
main() {}
// for debug
static PlayerText:MessageTextdraw[MAX_PLAYERS];
static bool:AP = false;
static TargetAlt = 1000; // 1000ft - low altitude cruise
# create a new chain
iptables -N SAMPQUERY
# check that incomming packet is a samp query packet and divert to the new chain
# this inserts the rule as the first in the chain, but should probably be a bit further down (e.g. after checking lo interface)
iptables -I INPUT -p udp \! -f -m udp --dport 7777 -m conntrack --ctstate NEW,ESTABLISHED -m u32 --u32 "0x0>>0x16&0x3c@0x8=0x53414d50" -j SAMPQUERY
# only allow connection from ephemeral source ports
# connection attempts from ports outside this range are likely rogue clients
iptables -A SAMPQUERY -p udp --sport 49152:65535 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
@spacemud
spacemud / rules.v4
Created January 11, 2022 01:59 — forked from Vince0789/rules.v4
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# 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 Software is