Skip to content

Instantly share code, notes, and snippets.

@oleksandriegorov
oleksandriegorov / lb-manager-client.sh
Last active April 24, 2020 20:45 — forked from thomasdarimont/lb-manager-client.sh
Shell script to configure load- balancing with mod-proxy-balancer
#! /bin/sh
# Set up a default search path
PATH="/usr/bin:/bin"
CURL=`which curl`
if [ -z "$CURL" ]; then
echo "curl not found"
exit 1
fi
@oleksandriegorov
oleksandriegorov / rsyslog.docker.centos7.conf.patch
Last active August 8, 2023 07:12
Rsyslogd configuration changes to enable local logging for CentOS7 in docker
--- /etc/rsyslog.conf 2019-10-18 15:48:29.000000000 +0000
+++ /root/rsyslog.docker.centos7.conf 2020-03-12 10:47:58.365192000 +0000
@@ -4,10 +4,13 @@
# If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html
#### MODULES ####
+module(load="imuxsock")
+module(load="omstdout")
+*.* :omstdout:
@oleksandriegorov
oleksandriegorov / datascrape.py
Created April 15, 2020 08:13
scrape data from certain website using lxml
from lxml import html
import requests
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('company', help='company name')
args = parser.parse_args()
company=args.company
page = requests.get("https://lei.info/fullsearch?for={}".format(company))
# -*- mode: ruby -*-
# vi: set ft=ruby et sw=2 ts=2 ai :
Vagrant.configure("2") do |config|
GL_MEM_MBytes = 1024
ESD_MEM_MBytes = 2048
ESM_MEM_MBytes = 2048
ES_NODE_COUNT=2
ESM_NODE_COUNT=2
config.vm.box = "bento/centos-7"
@oleksandriegorov
oleksandriegorov / graylog_repo_download.py
Last active June 23, 2020 13:14
Download RPMs from graylog repo
#!/usr/bin/env python3
# Simple downloader for RPMs from Graylog repository
from html.parser import HTMLParser
from urllib.request import urlopen,urlretrieve
from os.path import isfile,isdir
from re import compile
import argparse
from sys import exit
from subprocess import call
@oleksandriegorov
oleksandriegorov / postfix
Last active December 1, 2020 14:16
postfix grok patterns for graylog 3.x
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/(%{DATA:instance}\/)?%{COMPONENT:component}(?:\[%{NUMBER:pid}\])?
POSTFIX (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{COMPID}:
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}