Skip to content

Instantly share code, notes, and snippets.

View stephen-masters's full-sized avatar

Stephen Masters stephen-masters

View GitHub Profile
bea_home=/path/to/bea
java_home=/path/to/bea/jdk160_18
domain_template=/path/to/bea/weblogic11/common/templates/domains/wls.jar
admin_server_name=my_admin_server
admin_url=t3\://myserver\:7001
admin_user=weblogic
admin_password=w3blogicpwd
admin_port=7001
@stephen-masters
stephen-masters / gist:767740
Created January 6, 2011 10:28
WebLogic - Get connection pool sizes
# --------------------------------------------------
# Use WLST to connect to running WebLogic application servers and
# output a list of database connection pools and their sizes.
#
# This can be used for health monitoring and to support tuning.
# --------------------------------------------------
import java.lang.Thread
def get_connection_pool_sizes():
@stephen-masters
stephen-masters / gist:767747
Created January 6, 2011 10:36
WebLogic - Get JMS server stats
# ----------------------------------------------------------------------
# Example of connecting to a running JMS server and getting stats.
# ----------------------------------------------------------------------
import java.lang.Thread
def get_messaging_stats():
print 'Searching for JMS connections...'
# Hard-codes the JMS server name. You will probably want to parameterize this.
Search through the file system and list files in size reverse order.
du -akd /a/root/dir | sort -nr | less
VirtualBox Config
Set up NAT port forwarding from host port 8000 to guest port 80.
VBoxManage modifyvm "MyGuest" --natpf1 "www,tcp,,8080,,80"
@stephen-masters
stephen-masters / get_latest_snapshot.rb
Created February 17, 2012 09:22
Get latest snapshot artifact from Sonatype Nexus
#---------------------------------------------------------------------
#
# Parse the response from Sonatype Nexus in order to determine the
# correct URI for the most recent snapshot of an artifact.
#
# Usage:
# ruby get_latest_snapshot.rb \
# -n http://localhost:8080/nexus \
# -g uk.co.scattercode \
# -a my-artifact \
@stephen-masters
stephen-masters / maven-jar-plugin-example.xml
Created September 3, 2012 13:12
Maven Jar plugin example
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<executions>
<execution>
<id>factmodel</id>
<!--
Use the Jar plugin to produce a reduced JAR containing only those model classes
to be used as facts in Drools/Guvnor.
@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 / BigDecimalAccumulator.java
Created November 16, 2012 16:39
Drools BigDecimal accumulator
package uk.co.scattercode.drools.accumulators;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.math.BigDecimal;
import org.drools.runtime.rule.TypedAccumulateFunction;
@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;
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="webspheremq:ANY.OPERATION.REQUEST" />
<choice>
<when>
<xpath>/REQUEST/HEADER[@OperationName='Old.Request']</xpath>
<to uri="activemq:OLD.REQUEST" />
</when>
<when>
<xpath>/REQUEST/HEADER[@OperationName='New.Request']</xpath>