Skip to content

Instantly share code, notes, and snippets.

View stephen-masters's full-sized avatar

Stephen Masters stephen-masters

View GitHub Profile
@stephen-masters
stephen-masters / maven-shade-plugin-example.xml
Created September 3, 2012 13:15
Maven Shade Plugin example
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
@stephen-masters
stephen-masters / kie-workbench-rest-api-create-org.sh
Last active February 9, 2019 03:22
Example script to create an organisation, repository and project in KIE Workbench, via the REST API.
#!/bin/bash
# --------------------------------------------------------------------------------
#
# Script to demonstrate using the KIE (Drools) Workbench REST API to:
#
# create an organistion.
# create a repository associated with the organisation.
# create a project in the repository.
#
@stephen-masters
stephen-masters / ActiveDirectoryIdentityStore.java
Created January 16, 2013 09:47
This is a read-only Seam identity store implementation, which I knocked up to enable Drools Guvnor to authenticate users against Microsoft Active Directory. To use it, produce a .jar containing this class and put it in your Guvnor web application lib directory. I would recommend creating a .jar which only contains this class, as it is best to mi…
package uk.co.scattercode.security.seam;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
@stephen-masters
stephen-masters / seo-spam-template
Created October 16, 2014 09:32
SEO spam comment template received
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found
any interesting article like yours. {It's|It is} pretty worth enough for
me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website
owners|web owners} and bloggers made good content as you did, the {internet|net|web} will be
{much more|a lot more} useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally
well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch} your {rss|rss feed} as
I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or
spring:
datasource:
url: jdbc:mysql://localhost/foo_schema
username: root
password: d4t4b4s3sForLif3
driverClassName: com.mysql.jdbc.Driver
test-on-borrow: true
test-while-idle: true
validation-query: select 1;
maxActive: 1
package com.sctrcd.multidsdemo;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
package com.sctrcd.multidsdemo;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(
entityManagerFactoryRef = "barEntityManagerFactory",
transactionManagerRef = "barTransactionManager",
basePackages = { "com.sctrcd.multidsdemo.integration.repositories.bar" })
public class BarConfig {
@Autowired
JpaVendorAdapter jpaVendorAdapter;
@stephen-masters
stephen-masters / deploy-guvnor-was.sh
Last active December 15, 2015 04:59
Setting up Drools Guvnor on WebSphere Application Server Liberty Profile 8.5
# Run from a location where you want to download the application.
mkdir ~/downloads ; cd ~/downloads
curl -O -L http://download.jboss.org/drools/release/5.3.0.Final/guvnor-distribution-5.3.0.Final.zip
unzip guvnor-distribution-5.3.0.Final.zip
# Explode the Guvnor .war and copy to the WAS "apps" directory
unzip guvnor-distribution-5.3.0.Final/binaries/guvnor-5.3.0.Final-tomcat-6.0.war -d guvnor
cp guvnor /usr/share/was/wlp/usr/servers/guvnor/apps/
from("C:/router/export/csv/")
.unmarshal().csv()
.split().method("org.gratiartis.router.Splitter", "split")
.to("jms:DOCUMENT.METADATA.QUEUE");
from("jms:DOCUMENT.METADATA.QUEUE")
.processRef("org.gratiartis.router.Processor")
.to("C:/router/out/xml/");