Skip to content

Instantly share code, notes, and snippets.

@skizzerz
skizzerz / irc_log.json
Created September 9, 2021 21:12
ElasticSearch ingest pipeline for ZNC logs (via filebeat)
{
"irc_log" : {
"description" : "Pipeline for parsing ZNC logs.",
"processors" : [
{
"grok" : {
"field" : "log.file.path",
"patterns" : [
"/var/log/znc/%{DATA:host.user.name}/%{DATA:irc.server}/%{DATA:irc.channel}/%{DATEFMT:date1}.log"
],
# querynotif: Create system notifications for new query windows
# Requires Python 3.6+, tested on Python 3.6
# Copyright (c) 2021 Ryan Schmidt <skizzerz@skizzerz.net>
# 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
#include "ipmask.h"
#include "siphash.h"
#include <errno.h>
#include <string.h>
#include <arpa/inet.h>
union any_addr {
struct in_addr i4;
struct in6_addr i6;
};
import functools
import random
# percentage of time the machine runs (1 = 100%)
dutyCycle = 1
# base amount of pollution generated per second while machine is running
basePollution = 102400
# pollution reduction of muffler hatch
import random
import re
import threading
from typing import Optional, Iterable
from src import config, status, channels, cats, locks
from src.dispatcher import MessageDispatcher
from src.events import event_listener, Event, EventListener
from src.functions import get_all_players, change_role, get_all_roles, get_main_role, get_players, get_target
from src.gamemodes import GameMode
local version = "1.3.2"
hexchat.register("snotices", version, "Handle server notices")
-- Adjust to your preference.
-- The first column is either a tab name or a list of tabs.
-- "" means printing to the front tab.
local notice_tabs =
{
{"(snotices-bans)", "^%*%*%* Notice %-%- .* added temporary .* min%. D%-Line for .*"},
{"(snotices-conn)", "^%*%*%* Notice %-%- Client connecting: .*"},
from typing import Optional
import argparse
import re
from xml.etree import ElementTree
import mwparserfromhell
from dataclasses import dataclass
@dataclass
class Check:
pass
from src.gamestate import GameState
from src.containers import DefaultUserDict
from src.users import User
from src.events import Event, event_listener
ADDON_ROLES: DefaultUserDict[User, set[str]] = DefaultUserDict(set)
@event_listener("start_game")
def on_start_game(evt, var, name, mode):
default_chances = mode.TOTEM_CHANCES