Skip to content

Instantly share code, notes, and snippets.

View nikos's full-sized avatar

Niko Schmuck nikos

View GitHub Profile
@nikos
nikos / GradleTaskTimer.gradle
Created October 23, 2012 15:22
Measure time for the execution of each gradle task executed
class TaskTimerListener implements TaskExecutionListener {
private Clock clock
@Override
void beforeExecute(Task task) {
clock = new org.gradle.util.Clock()
}
@Override
@nikos
nikos / build.gradle
Created December 17, 2012 17:30
Simple (aka minimal) Gradle script to create ZIP archive file and upload to nexus repository (as snapshot or if you modify the version to release)
apply plugin: 'maven'
group = 'de.sample'
version = '0.1-SNAPSHOT'
description = 'My cool tool ...'
task customZip(type: Zip) {
from ('.') {
@nikos
nikos / Dockerfile
Last active August 29, 2015 14:10
MarkLogic Server 8 EA Dockerfile
# Requirements:
# - download MarkLogic EA 8 (MarkLogic-8.0-20141124.x86_64.rpm) into
# same directory like this Dockerfile
#
# Build your own image:
# docker build -t centos-marklogic8 .
#
# Start a new container with this image:
# docker run -p 8000:8000 -p 8001:8001 centos-marklogic8
@nikos
nikos / pom.xml
Created December 12, 2014 17:50
Access MarkLogic 8 EA Java Client API via github's maven repository
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- ... your maven ceremony goes here ... --->
<dependencies>
<!-- MarkLogic Java Client API -->
<dependency>
<groupId>com.marklogic</groupId>
@nikos
nikos / MarkLogicAuthenticationProvider.java
Created January 28, 2015 15:01
Sample AuthenticationProvider for Spring using MarkLogic Server (version 7)
package de.nava.mlsample.security;
import de.nava.mlsample.service.MarkLogicConnections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider;
import org.springframework.security.core.AuthenticationException;
@nikos
nikos / Dockerfile
Created June 16, 2015 10:00
MarkLogic Server 8.0-3 prepared to run with on an CentOS 6.6 Linux server, after container is started, go to http://localhost:8001/ to finish installation
FROM centos:centos6.6
MAINTAINER Niko Schmuck <niko.auto@nava.de>
# Install MarkLogic
RUN yum -y update &&\
yum groupremove 'Additional Development' 'E-mail server' 'Graphical Administration Tools' 'Perl Support' &&\
curl -O https://developer.marklogic.com/download/binaries/8.0/MarkLogic-8.0-3.x86_64.rpm &&\
yum -y install MarkLogic-8.0-3.x86_64.rpm &&\
rm MarkLogic-8.0-3.x86_64.rpm &&\
yum clean all