Skip to content

Instantly share code, notes, and snippets.

View packer-'s full-sized avatar

packer-

  • https://gitlab.com/u/packer
View GitHub Profile
#!/bin/bash
set -eu pipefail
# --------------------------------------------------------------------------------------------------
# ffmpeg functions
# https://trac.ffmpeg.org/wiki/Create%20a%20mosaic%20out%20of%20several%20input%20videos
# 2 games...
#!/bin/bash
set -ex
demotcpl=$HOME/xonotic/game/git/misc/tools/demotc.pl
userdir="$HOME/xonotic-video/userdir"
sourcedir="$userdir/data/topfrags"
frags="$sourcedir/frags.txt"
watermark="$HOME/xonotic/game/git/misc/logos/icons_png/xonotic_64.png"
#!/bin/bash
sed 's/"\([0-9]*\),\([0-9]*\)"/\1\.\2/g' demolist_sorted.csv > /tmp/fewqfhre
while read line; do
echo $line | grep ^sv_autodemos &>/dev/null || continue
demo="$(echo $line | grep -Eo '[^/]*\.dem')"
output="$(echo $line | cut -d, -f5,6,7 | tr ',' '-')"
pos="$(echo $line | cut -d, -f7)"
starttime="$(echo $line | cut -d, -f10)"
duration="$(echo $line | cut -d, -f11)"
@packer-
packer- / gist:077be0c50709b7395b4a622c45fd43d1
Created February 25, 2018 14:10
parse demos and xonotic logs
#!/bin/bash
cutlog=./cutlog
demo_csv=./demolist.csv
# delete useless demo files
for demo in $(find sv_autodemos/ -type f -name '*.dem'); do
grep '\^1Server is restarting\.\.\.' "$demo" &>/dev/null || rm -vf "$demo" # does not contain a full game
grep ' \^7wins\.' "$demo" &>/dev/null || rm -vf "$demo" # does not contain a winner
done
//
// Warmup Limiter & Notifier
// -------------------------
// version: 0.45
// by packer - April 29th 2017
//
// This scripts notifies clients about warmup mode and
// calls restart if soft or hard time limit is reached.
//
// No client is connected (soft limit):