Skip to content

Instantly share code, notes, and snippets.

View ianibo's full-sized avatar

Ian Ibbotson ianibo

View GitHub Profile
import groovy.grape.Grape
Grape.addResolver(name:'mvnRepository', root:'http://central.maven.org/maven2/')
Grape.addResolver(name:'kint', root:'http://nexus.k-int.com/content/repositories/releases')
Grape.grab(group:'org.apache.lucene', module:'lucene-queryparser', version:'8.4.0')
import org.apache.lucene.search.Query;
import org.apache.lucene.queryparser.classic.QueryParser;
@ianibo
ianibo / rrule.groovh
Created September 19, 2019 08:33
groovysh that uses RRule
import groovy.grape.Grape
Grape.addResolver(name:'mvnRepository', root:'http://central.maven.org/maven2/')
Grape.addResolver(name:'kint', root:'http://nexus.k-int.com/content/repositories/releases')
Grape.grab(group:'org.scala-saddle', module:'google-rfc-2445',version:'20110304')
import com.google.ical.iter.RecurrenceIterator;
import com.google.ical.iter.RecurrenceIteratorFactory;
import com.google.ical.values.DateTimeValueImpl;
import com.google.ical.values.DateValue;
@ianibo
ianibo / gist:fdc719f8c9f09d9c924daa47c6ddf95f
Created June 26, 2019 15:36
Script in jenkins to deploy via ssh
Set up credentials, then use jenkins bindings/SSH User Key File and put SSHKEYFILE in env var
echo BUILD STEP
export HOST_IP=`/sbin/ip route|awk '/default/ { print $3 }'`
echo SSH KEYFILE is "$SSHKEYFILE"
/sbin/ip route
@ianibo
ianibo / README-tomcat-as-systemd-service.md
Created April 13, 2019 11:56 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service:

version: "2.0"
volumes:
mysqldata:
esdata:
services:
mysql:
container_name: mysql
image: mariadb:latest
See https://plugins.gradle.org/plugin/com.palantir.docker
and
https://spring.io/guides/gs/spring-boot-docker/
Add to build.gradle
buildscript {
application.yaml
param1: This is param1
BootStrap.groovy
def init = { servletContext ->
log.debug("test value:\"${grailsApplication.config.param1}\"");
}
version: "2.0"
volumes:
pgdata:
mysqldata:
esdata:
virtuoso:
services:
#
@ianibo
ianibo / GOKb CLA.txt
Last active January 24, 2018 11:26
GOKb Contributor License Agreement
** Placeholder **
@ianibo
ianibo / sign.groovy
Created October 4, 2017 16:00
Sign and validate some bytes using public and private key strings read from ~/.ssh
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Signature;
import java.io.*;
import java.nio.*;
import java.security.*;
import java.security.spec.*;
import java.nio.file.Files;