Skip to content

Instantly share code, notes, and snippets.

@D4edalus
D4edalus / limit status queries
Last active March 8, 2019 15:36
limit status queries for cod4 servers
iptables -N GETSTATUS_CHECK
iptables -A INPUT -p udp -m length --length 42 -j GETSTATUS_CHECK
iptables -A GETSTATUS_CHECK -m recent --name longudp --rcheck --rsource --hitcount 20 -j DROP
iptables -A GETSTATUS_CHECK -m recent --name longudp --rsource --set -j RETURN
cat nginx-access.log | grep pingback | sed -r s/\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\)\\s-\\s-\\s\\[\(.*\)\\]\\s.*/\\1/g | sort | uniq -c | sort -n
@D4edalus
D4edalus / .bashrc
Created December 20, 2017 20:43
keeagent to bash for windows
#### keeagent
export KEEAGENT_SOCK="/mnt/c/Users/dom/keeagent_msys.socket"
ssh_auth_tmpdir=`mktemp --tmpdir --directory keeagent-ssh.XXXXXXXXXX`
export SSH_AUTH_SOCK="${ssh_auth_tmpdir}/agent.$$"
PIDFILE="${ssh_auth_tmpdir}/pid.$$"
echo $PIDFILE
echo $KEEAGENT_SOCK
echo $SSH_AUTH_SOCK
// Pingwatcher
// Author: D4edalus
// Date: 09/12/17
// Kicks player with sucky pings, players get only kicked if server is 80% full. Only kicks one player every 10 seconds
// Used metric is average + stddev (yeah I know that is statistical nonesense, but hey it works quite well)
#include maps\mp\gametypes\eventhandler; // the eventhandler from the duffman scripts thats floating around in the ether
init()
{
init()
{
if(getdvar("scr_showspawns") == "")
setdvar("scr_showspawns", "0");
precacheItem("defaultweapon_mp");
thread addTestClients();
@D4edalus
D4edalus / gist:92c2d87903e7589db1ad1a8ddf36574d
Last active August 29, 2016 14:25
team balance via script command
findPlayerByNumber( entityNumber )
{
foundPlayer = undefined;
// Search for the player
for ( index = 0; index < level.players.size; index++ )
{
player = level.players[index];
// Check if this the player we are looking for