Skip to content

Instantly share code, notes, and snippets.

Gerard Kanters gerard-kanters

View GitHub Profile
@gerard-kanters
gerard-kanters / spamhaus-fwd-ipset.txt
Last active Nov 11, 2018
Spamhaus with firewalld and ipset
View spamhaus-fwd-ipset.txt
#!/bin/bash
# Script downloads monthly spammers, max 2 per day and adds them via ipset to firewalld
#Choose the number of days your would like to download, choices are 1,30,90,180,365
DAYS="30"
# list of known spammers
URL="www.stopforumspam.com/downloads/listed_ip_${DAYS}.zip";
# save local copy here
@gerard-kanters
gerard-kanters / xenserver-centos7
Last active Aug 6, 2018
Increase disk on Xenserver with Centos 7
View xenserver-centos7
Bring down the VM with XenCenter
Go to storage and change storage size of the VM in properties. In this case 160GB
Boot VM with XenCenter or #reboot
Change the run level to single user mode
#init 1
Show partitions
#fdisk -l
@gerard-kanters
gerard-kanters / rd-clean.sh
Last active Dec 12, 2016 — forked from imatpro/rd-clean.sh
Shell script to purge Rundeck execution history
View rd-clean.sh
#!/bin/sh
# keep last 6000 executions for each job, about 1 week if running minute jobs
KEEP=6000
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
@gerard-kanters
gerard-kanters / Mautic code
Last active Dec 11, 2015
Mautic code for MyVox (you need to extend head in an existing plugin or creat a new plugin)
View Mautic code
//Mautic programmatic marketing
$page_url = 'http://' . $_SERVER[HTTP_HOST] . $_SERVER['REQUEST_URI'];
$page_title = urlencode($title);
if(myvox_is_logged_in()) {
$muser = myvox_get_logged_in_user_entity();
$email = urlencode($muser->email);
} else {
$email = "";
}
$src= "http://mautic.netcare.nl/mtracking.gif?page_url='$page_url'&page_title='$page_title'&email='$email'";
@gerard-kanters
gerard-kanters / inactivity.js
Last active May 20, 2020
Inactivity timeout javascript
View inactivity.js
<script type="text/javascript">
function idleTimer() {
var t;
//window.onload = resetTimer;
window.onmousemove = resetTimer; // catches mouse movements
window.onmousedown = resetTimer; // catches mouse movements
window.onclick = resetTimer; // catches mouse clicks
window.onscroll = resetTimer; // catches scrolling
window.onkeypress = resetTimer; //catches keyboard actions
@gerard-kanters
gerard-kanters / solr
Created Oct 15, 2014
/etc/init.d/solr
View solr
#!/bin/bash
# Script for running solr as a service under initd.
#
# Requires solr.conf and solr.start
# Usage: service solr {start|stop|restart|status}"
#
#-----------------------------------------------------
### BEGIN INIT INFO
# Provides: solr
# Required-Start:
@gerard-kanters
gerard-kanters / solr.conf
Last active Aug 29, 2015
/etc/solr.conf
View solr.conf
#-----------------------------------------------------
# solr-initd v0.5.1
#-----------------------------------------------------
# Configuration for solr.init. Copy this to:
#
# /etc/solr.conf
#
# NOTE: if you are installing this somewhere else then
# you need to alter solr.start and solr.initd.
#
@gerard-kanters
gerard-kanters / solr.start
Created Oct 15, 2014
solr.start (put in /var/lib/)
View solr.start
#!/bin/bash
#-----------------------------------------------------
# solr-initd v0.5.1
#-----------------------------------------------------
# Starts solr and writes a pid file. Meant
# to be used with the initd script but this
# can be used on it's own
#
# Requires /etc/solr.conf
# Usage: ./solr.start
@gerard-kanters
gerard-kanters / server.ini
Last active Sep 18, 2016
HHVM server ini
View server.ini
;extension = /usr/lib64/php/modules/geoip.so
hhvm.pid_file = "/var/run/hhvm/hhvm.pid"
hhvm.server.port = 9000
hhvm.server.fix_path_info = true
hhvm.server.type = fastcgi
hhvm.server.enable_magic_quotes_gpc = false
hhvm.server.enable_keep_alive = true
hhvm.server.enable_ssl = true
hhvm.log.access_log_default_format = "%h %l %u %t \"%r\" %>s %b"
@gerard-kanters
gerard-kanters / hhvm
Last active Jan 26, 2017
HHVM init script
View hhvm
#!/bin/bash
#
# hhvm Startup script for the HipHop Server
#
# chkconfig: - 85 15
# description: HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP
# processname: hhvm
# config: /etc/php.ini
# config: /etc/hhvm/server.ini
# pidfile: /var/run/hhvm/hhvm.pid
You can’t perform that action at this time.