Skip to content

Instantly share code, notes, and snippets.

@ern
ern / clean-code.sh
Created April 1, 2019 18:03
Sakai Tomcat Scripts
#!/usr/local/bin/zsh
source bin/common.sh
if [ -n "$(ls -A $COMPONENTS)" ]; then
echo "Removing $COMPONENTS"
rm -rf $COMPONENTS/*
fi
if [ -n "$(ls -A $LIB)" ]; then
#!/bin/bash
##############################################################################
# This script output what paths have changed using a SHA Range
#
# Example usage:
#
# Author: Earle Nietzel
# Date: 8/21/2019
# License: http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
##############################################################################
@ern
ern / gist:34e44b9933a3ff6f31088a91a578ae9f
Created October 5, 2017 20:26
Simulate a slow resource
private void traceSimulateDelay(long delay) {
// log the caller
String thisClassName = this.getClass().getName();
StackTraceElement[] ste = Thread.currentThread().getStackTrace();
StringBuilder callee = new StringBuilder("PERFORMANCE[-{}] called by ");
for (int i = 2; i <= ste.length; i++) {
// 0 is Thread.getStackTrace()
// 1 is this method
String className = ste[i].getClassName();
String shortClassName = className.substring(className.lastIndexOf(".") + 1);
@ern
ern / cron.html
Last active June 17, 2016 21:40
Cron Triggers
<h1>CronTrigger Tutorial</h1>
<h2>Introduction</h2>
<p><tt>cron</tt> is a UNIX tool that has been around for a long time, so its scheduling capabilities are powerful
and proven. The <tt>CronTrigger</tt> class is based on the scheduling capabilities of cron.</p>
<p><tt>CronTrigger</tt> uses “cron expressions”, which are able to create firing schedules such as: “At 8:00am every
Monday through Friday” or “At 1:30am every last Friday of the month”.</p>
@ern
ern / SakaiSessionEstimator
Created April 6, 2016 14:49
Estimates the size of attributes in the session
diff --git a/kernel/kernel-impl/pom.xml b/kernel/kernel-impl/pom.xml
index f5e5a64..b0b1d65 100644
--- a/kernel/kernel-impl/pom.xml
+++ b/kernel/kernel-impl/pom.xml
@@ -312,6 +312,11 @@
<scope>compile</scope>
</dependency>
-->
+ <dependency>
+ <groupId>com.carrotsearch</groupId>
#!/bin/sh
exec scala "$0" "$@"
!#
import scala.xml.{Elem,XML}
class SoapClient {
private def error(msg: String) = {
println("SoapClient error: " + msg)
}
@ern
ern / pom.xml
Created September 14, 2015 20:43
Sakai RPM
<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>master</artifactId>
<groupId>org.sakaiproject</groupId>
<version>10.4</version>
<relativePath>master/pom.xml</relativePath>
</parent>
@ern
ern / WS stack
Created September 10, 2015 20:00
2015-09-10 15:42:50,169 WARN http-nio-8080-exec-8 org.apache.cxf.phase.PhaseInterceptorChain - Application {http://webservices.sakaiproject.org/}SakaiLoginService#{http://webservices.sakaiproject.org/}lo
gin has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unable to login
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:213)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:68)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
@ern
ern / git-mv-with-history
Last active September 1, 2015 13:27 — forked from emiller/git-mv-with-history
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@ern
ern / pom.xml
Created July 23, 2015 19:45
Tomcat Executable War sample POM
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.rsmart</groupId>
<artifactId>dashboard</artifactId>
<version>1.9.3-SNAPSHOT</version>
<packaging>war</packaging>
<name>rSmart Client Dashboard</name>
<dependencies>
<dependency>