Skip to content

Instantly share code, notes, and snippets.

@neomelonas
neomelonas / log_sample.log
Created February 17, 2015 18:59
example log for use with meddamage.php
This file has been truncated, but you can view the full file.
L 02/16/2015 - 21:37:45: "oxinai<3><[U:1:28123709]><Red>" changed role to "heavyweapons"
L 02/16/2015 - 21:37:45: "Azy<4><[U:1:46506618]><Red>" changed role to "demoman"
L 02/16/2015 - 21:37:45: "-jdReamz<5><[U:1:87213832]><Red>" changed role to "soldier"
L 02/16/2015 - 21:37:45: "Fizzy.juan<6><[U:1:74981137]><Red>" changed role to "spy"
L 02/16/2015 - 21:37:45: "Pareidolia.juan<7><[U:1:86688465]><Red>" changed role to "engineer"
L 02/16/2015 - 21:37:45: "Linkzz<26><[U:1:50037221]><Red>" changed role to "pyro"
L 02/16/2015 - 21:37:45: "bob<9><[U:1:50662083]><Red>" changed role to "soldier"
L 02/16/2015 - 21:37:45: "dark richard lord of darkness<27><[U:1:82610956]><Red>" changed role to "sniper"
L 02/16/2015 - 21:37:45: "jünkyard<28><[U:1:43585345]><Blue>" changed role to "demoman"
L 02/16/2015 - 21:37:45: "Courier<29><[U:1:57919115]><Blue>" changed role to "spy"
@neomelonas
neomelonas / meddamage.php
Last active August 29, 2015 14:15
Damage dealt to medic in Competitive TF2 match.
<?php
$re = "/<(\\[\\w\\:\\d\\:\\d+\\])><(Red|Blue)>\\\" triggered \"damage\" against \\\".+<\\d+><(\\[\\w\\:\\d\\:\\d+\\])><(Red|Blue)>\"[a-z\\\"\\( ]+(\\d+)\\\"\\)/";
$log = file_get_contents('LOG.log');
preg_match_all($re, $log, $matches);
$cl = "/(\\[\\w\\:\\d\\:\\d+\\])\\>\\<(Red|Blue)\\>\\\" changed role to \\\"(\\w+)/";
preg_match_all($cl, $log, $classes);
@neomelonas
neomelonas / whitelist-checker.py
Created January 7, 2015 21:42
UGC Whitelist Checker - grab updates to whitelists!
#!/usr/bin/env python
import os, time, string, datetime, sys
from stat import * # ST_SIZE etc
import requests
cfgs = '/path/to/configs/'
# Make sure both arrays are the same length and in the same order.
ugc_links = [
@neomelonas
neomelonas / flippit.sh
Last active August 29, 2015 14:11
"Flop" a directory of images with ImageMagik
for file in /path/to/images/*.JPG; do
convert "$file" -flop "${file%.JPG}"_flopped.JPG
done

Keybase proof

I hereby claim:

  • I am neomelonas on github.
  • I am neomelonas (https://keybase.io/neomelonas) on keybase.
  • I have a public key whose fingerprint is 99B6 D232 EBC5 F5F3 040B 6AE0 6B8F 9AC5 57D9 B5AC

To claim this, I am signing this object:

@neomelonas
neomelonas / gist:d154c7c6ed0bee056a03
Last active December 28, 2018 21:59
Run Unreal Tournament 2004 Server on a Recent Ubuntu Server
Trying to get an Unreal Tournament 2004 server running on Ubuntu Server >= 10.10?
Download and unzip this wherever you want your server root: http://downloads.unrealadmin.org/UT2004/Server/dedicatedserver3339-bonuspack.zip
Download and unzip THIS wherever you just extracted the server files (this will upgrade you to version 3369):
Main: http://ut2004.ut-files.com/index.php?dir=Patches/Linux/&file=ut2004-lnxpatch3369.tar.bz2
Mirror1: https://boundarygamers.com/ut2004-lnxpatch3369.tar.bz2
Mirror2: https://a.vidga.me/jivpe.tar.bz2
Go here, and get a key: http://unreal.epicgames.com/ut2004server/cdkey.php
@neomelonas
neomelonas / demomover
Created September 11, 2013 14:49
Move demos from the directory the tf2 server creates them to somewhere accessible to the webserver
#!/bin/bash
# demomover - move demos from the directory the server creates them in
# to somewhere accessible to the webserver.
# edit these. fuser can be located in /sbin/ or /bin/
TF_PATH=/absolute/path/to/tf/demos
WWW_PATH=/path/to/webserver/demos/
FUSER_BIN=/bin/fuser
cd $TF_PATH