Skip to content

Instantly share code, notes, and snippets.

@defanator
defanator / error.log
Created December 28, 2021 12:55
nginx/1.21.5 and ModSecurity-nginx built with PCRE1 - memory leaks
2021/12/28 12:47:31 [notice] 76906#76906: ModSecurity-nginx v1.0.2 (rules loaded inline/local/remote: 0/1818/0)
2021/12/28 12:47:31 [notice] 76906#76906: using the "epoll" event method
2021/12/28 12:47:31 [notice] 76906#76906: nginx/1.21.5
2021/12/28 12:47:31 [notice] 76906#76906: built by gcc 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
2021/12/28 12:47:31 [notice] 76906#76906: OS: Linux 5.4.0-91-generic
2021/12/28 12:47:31 [notice] 76906#76906: getrlimit(RLIMIT_NOFILE): 131072:131072
2021/12/28 12:47:31 [notice] 76907#76907: start worker processes
2021/12/28 12:47:31 [notice] 76907#76907: start worker process 76909
2021/12/28 12:50:53 [notice] 76907#76907: signal 1 (SIGHUP) received from 76927, reconfiguring
2021/12/28 12:50:53 [notice] 76907#76907: reconfiguring
@defanator
defanator / error.log
Created December 28, 2021 11:30
nginx/1.21.5 and ModSecurity-nginx built with PCRE2 - memory leaks
This file has been truncated, but you can view the full file.
2021/12/28 11:22:36 [notice] 25136#25136: ModSecurity-nginx v1.0.2 (rules loaded inline/local/remote: 0/1818/0)
2021/12/28 11:22:36 [notice] 25136#25136: using the "epoll" event method
2021/12/28 11:22:36 [notice] 25136#25136: nginx/1.21.5
2021/12/28 11:22:36 [notice] 25136#25136: built by gcc 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
2021/12/28 11:22:36 [notice] 25136#25136: OS: Linux 5.4.0-91-generic
2021/12/28 11:22:36 [notice] 25136#25136: getrlimit(RLIMIT_NOFILE): 131072:131072
2021/12/28 11:22:36 [notice] 25137#25137: start worker processes
2021/12/28 11:22:36 [notice] 25137#25137: start worker process 25139
2021/12/28 11:23:51 [notice] 25137#25137: signal 1 (SIGHUP) received from 25150, reconfiguring
2021/12/28 11:23:51 [notice] 25137#25137: reconfiguring
@defanator
defanator / Makefile.xpadneo-osmc-aarch64
Last active December 20, 2021 08:43
Building xpadneo kernel driver under OSMC on Raspberry Pi 4
#!/usr/bin/make -f
KERNEL_VERSION=$(shell uname -r)
KERNEL_HEADERS_DIR=/usr/src/rbp464-headers-$(KERNEL_VERSION)
KERNEL_SOURCES_DIR=/usr/src/rbp464-source-$(KERNEL_VERSION)
CHROOT_DIR=/opt/osmc-tc/aarch64-toolchain-osmc
ifeq ($(shell id -u), 0)
SUDO=
OUSER=$(SUDO_USER)
@defanator
defanator / generate-xml.sh
Created May 5, 2021 09:57
Generate valid XML with repeatable sequence of data
#!/bin/sh
NUMITER=1
if [ -n "$1" ]; then
NUMITER=$1
fi
cat <<EOF
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
#!/usr/bin/env python3
"""smtptest.py: command-line smtp test mail sender
https://github.com/turbodog/python-smtp-mail-sending-tester
Usage: python smtptest.py [options] fromaddress toaddress serveraddress
Examples:
python smtptest.py [email protected] [email protected] mail.example.com
python smtptest.py --debuglevel 1 --usetls -u bob -p xyzzy "Bob <[email protected]>" [email protected] mail.example.com
@defanator
defanator / flaskapp-jaeger.py
Created March 22, 2021 14:36
Sample app demonstrating nginx + opentracing with Flask
#!/usr/bin/env python3
import hashlib
import logging
from jaeger_client import Config
from flask_opentracing import FlaskTracing
from flask import Flask, request
from werkzeug.debug import get_current_traceback
@defanator
defanator / sentry-fake.py
Created March 2, 2021 08:48
fake wsgi app to act as a sentry API receiver to debug raven/sentry-sdk locally
#!/usr/bin/env python3
import ujson
import zlib
import gzip
SVCPORT = 9999
def application(environ, start_response):
environ_summary = "ENVIRON:\n\n" + "\n".join(["{0}: {1}".format(k, environ[k]) for k in sorted(environ.keys())]) + "\n"
@defanator
defanator / debchangelog2xml.py
Created September 3, 2020 10:31
Debian changelog to XML converter
#!/usr/bin/env python3.8
import sys
import argparse
from dateutil import parser
from datetime import datetime
argparser = argparse.ArgumentParser(description="convert debian-style changelog to XML")
argparser.add_argument('deb_changelog', type=str, help="existing deb changelog file")
argparser.add_argument('--pkgname', type=str, required=True, help="package name")
@defanator
defanator / cuetag.sh
Created July 4, 2019 17:20 — forked from lfilho/cuetag.sh
Split flac + cue + convert to something else (MP3, Alac)
#! /bin/sh
# cuetag.sh - tag files based on cue/toc file information
# uses cueprint output
# usage: cuetag.sh <cuefile|tocfile> [file]...
CUEPRINT=cueprint
cue_file=""
usage()
Welcome to minicom 2.7
OPTIONS: I18n
Compiled on Nov 15 2018, 20:18:47.
Port unix#/tmp/fedora29-amd64-packer.serial
Press CTRL-A Z for help on special keys
[ 5.082516] dracut-pre-udev[418]: modprobe: ERROR: could not insert 'sha256_mb': No such device
[ OK ] Mounted Kernel Configuration File System.