Skip to content

Instantly share code, notes, and snippets.

View bmanojlovic's full-sized avatar

Boris Manojlovic bmanojlovic

View GitHub Profile
@bmanojlovic
bmanojlovic / 002-freebsd_fix_sendfile.patch
Last active December 22, 2015 20:59
support for freebsd sendfile based on http://www.ioremap.net/node/192/ copy dnet_sendfile.m4 into ZoneMinder dir run autoreconf -i . run ./configure as usual
diff --git a/ac_check_sendfile.m4 b/ac_check_sendfile.m4
new file mode 100644
index 0000000..f2aac5a
--- /dev/null
+++ b/ac_check_sendfile.m4
@@ -0,0 +1,63 @@
+AC_DEFUN([AC_CHECK_SENDFILE],[
+AC_MSG_CHECKING([whether sendfile() is supported and what prototype it has])
+
+saved_CFLAGS="$CFLAGS"
@bmanojlovic
bmanojlovic / runme.zm
Last active December 22, 2015 23:59
selenium tricks
#!/bin/sh -x
export PATH=$PATH:phantomjs-?.?.?-linux-x86_64/bin
./zm.py
@bmanojlovic
bmanojlovic / server.drl
Last active August 29, 2015 13:56
drool rule for 0.20.x graylog2
import org.graylog2.plugin.Message
rule "Drop vmware guest crap"
when
m : Message( getField("message") matches "\\[ warning\\] \\[vmusr:vmusr\\] Error in the RPC receive loop: RpcIn.*" );
then
m.setFilterOut(true);
#System.out.println( "[DROOL] : " + m.toString() ); # too verbose crap...
end
<VirtualHost _default_:80>
ServerName graylog.company.com
Redirect permanent / https://graylog.company.com/
</VirtualHost>
##
## SSL Virtual Host Context
##
<IfDefine SSL>
<IfDefine !NOSSL>
import org.graylog2.plugin.Message
rule "Drop vmware guest crap"
when
m : Message( getField("full_message") matches "\\[ warning\\] \\[vmusr:vmusr\\] Error in the RPC receive loop: RpcIn(.|\r|\n)*" );
then
m.setFilterOut(true);
#System.out.println( "[DROOL] : " + m.toString() ); # too verbose crap...
end
#!/usr/bin/env python
import logging
import requests
import json
from pprint import pprint
session = requests.Session()
session.headers.update({'User-Agent': 'python/gl2syslog', 'Accept': 'application/json'})
@bmanojlovic
bmanojlovic / le-renew.sh
Last active June 15, 2017 02:59 — forked from erikaheidi/le-renew.sh
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@bmanojlovic
bmanojlovic / Dockerfile
Last active January 27, 2016 15:13
Dockerfile and script for testing zabbix3 in dockerized openSUSE Leap 42.1
FROM opensuse:42.1
MAINTAINER Boris Manojlovic "boris@steki.net"
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV TERM xterm
RUN zypper -n --gpg-auto-import-keys ref \
&& zypper ar http://download.opensuse.org/repositories/server:/monitoring:/zabbix/openSUSE_Leap_42.1/ zabbix \
@bmanojlovic
bmanojlovic / xip-io.py
Created November 20, 2017 09:25
Generate base36 encoded host names (xip.io)
#!/usr/bin/python3
import ipaddress
import sys
# SO one :)
def base36encode(number):
"""