Skip to content

Instantly share code, notes, and snippets.

package main
import (
"errors"
"net/http"
"strings"
"sync"
"time"
"github.com/labstack/echo/v4"
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Christopher Stewart <stewpot64@gmail.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# frozen_string_literal: true
# Copyright (c) 2016 Christopher Stewart
#
# 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
# furnished to do so, subject to the following conditions:
@cstewart90
cstewart90 / server_monitor.py
Last active April 28, 2020 15:53
Queries local QL servers and restarts supervisor process if they are not responding
#!/usr/bin/env python3.5
from supervisor.xmlrpc import SupervisorTransport
import xmlrpc.client
import valve.source.a2s as a2s
import socket
import time
supervisor_socket = "unix:///tmp/supervisor.sock"
SERVERS = [{"port": 27960, "process": "qldf:qzeroded_qldf1", "name": "DE Race #1"},
#!/usr/bin/env python3.5
"""
Deletes all "minqlx:players:*:permission" keys.
"""
import redis
r = redis.StrictRedis(unix_socket_path='/var/run/redis/redis.sock')
for key in r.scan_iter("minqlx:players:*:permission"):
from enum import Enum
class VoteFlags(Enum):
map = 1
map_restart = 2
nextmap = 4
gametype = 8
kick = 16 # Also clientkick
timelimit = 32
fraglimit = 64
import minqlx
class allowkill(minqlx.Plugin):
def __init__(self):
self.add_hook("map", self.handle_map)
self.add_hook("game_start", self.handle_game_start)
self.add_hook("game_end", self.handle_game_start)
def handle_map(self, map_name, factory):
@cstewart90
cstewart90 / download_workshop.sh
Last active September 4, 2016 23:49
Downloads workshop items from workshop.txt
#!/bin/bash
# Modified version of https://github.com/tjone270/Quake-Live/blob/master/qlds-scripts/autodownload.sh
# Original created by Thomas Jones on 03/10/15.
# thomas@tomtecsolutions.com
#
# Uses for loop to iterate through workshop IDs.
# Works for workshop.txt in this format https://gist.github.com/cstewart90/4fdd04c5d826ad6b039a
qldsPath="$HOME/qlds"
steamcmdPath="$HOME/steamcmd"
@cstewart90
cstewart90 / factories.txt
Last active August 26, 2022 23:59
Default Quake Live Factories (formatted)
[{
"cvars": {
"timelimit": "5",
"fraglimit": "10",
"g_overtime": "0",
"g_training": "1",
"bot_dynamicSkill": "1",
"practiceflags": "0",
"bot_startingSkill": "2",
"g_allowkill": "0",
@cstewart90
cstewart90 / chill_servers.rb
Last active August 23, 2016 14:14
WeeChat script to show status of #ClanChill Quake Live servers.
# Copyright (c) 2016 Christopher Stewart
#
# 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
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all