Skip to content

Instantly share code, notes, and snippets.

@jetztgradnet
jetztgradnet / beanstalk-hostmanager-files.txt
Created January 22, 2011 12:53
Files of Amazon Elastic Beanstalk HostManager
/opt/elasticbeanstalk/srv/hostmanager
/opt/elasticbeanstalk/srv/hostmanager/lib
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/daemon
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/daemon/logmonitor.rb
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/daemon/logdirectorymonitor.rb
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/daemon/catalinalogmonitor.rb
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/utils.rb
/opt/elasticbeanstalk/srv/hostmanager/lib/elasticbeanstalk/hostmanager/tasks
@jetztgradnet
jetztgradnet / osgi-service-access.groovy
Created January 18, 2011 09:58
Accessing a OSGi service from Groovy
import org.osgi.framework.BundleContext
def results = bundleContext.findServices(MyService).withEachService() { MyService srv ->
srv.doSomething()
}
@jetztgradnet
jetztgradnet / osgi-service-access.java
Created January 18, 2011 09:57
Accessing a OSGi service from Java
import java.util.ArrayList;
import java.util.List
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
List<String> results = new ArrayList<String>();
ServiceReference[] references = context.getServiceReferences(MyService.class.getName(), null);
for (int r = 0; r < references.length; r++) {
ServiceReference reference = references[r];
@jetztgradnet
jetztgradnet / osgi-webconsole.groovy
Created January 18, 2011 09:48
provision OSGi environment including Apache Felix WebConsole on port 8081
// these are necessary for current version (3.6.1) of Equinox
@GrabResolver(name='ebrRelease', root='http://repository.springsource.com/maven/bundles/release')
@GrabResolver(name='ebrExternal', root='http://repository.springsource.com/maven/bundles/external')
@GrabResolver(name='githubJetztgradNet', root='https://github.com/jetztgradnet/repository/raw/master')
@Grapes([
@GrabConfig(systemClassLoader=true),
@Grab(group='groovyx.osgi', module='groovyx.osgi.runtime', version='0.1'),
@Grab(group='org.eclipse.osgi', module='org.eclipse.osgi', version='3.6.1.R36x_v20100806'),
@Grab(group='org.apache.commons', module='com.springsource.org.apache.commons.logging', version='1.1.1')
])
@jetztgradnet
jetztgradnet / dependencies-using-grape.groovy
Created January 18, 2011 09:41
Define all dependencies for groovyx.osgi.runtime using Grape
// these are necessary for current version (3.6.1) of Equinox
@GrabResolver(name='ebrRelease', root='http://repository.springsource.com/maven/bundles/release')
@GrabResolver(name='ebrExternal', root='http://repository.springsource.com/maven/bundles/external')
@GrabResolver(name='githubJetztgradNet', root='https://github.com/jetztgradnet/repository/raw/master')
@Grapes([
@GrabConfig(systemClassLoader=true),
@Grab(group='groovyx.osgi', module='groovyx.osgi.runtime', version='0.1'),
@Grab(group='org.eclipse.osgi', module='org.eclipse.osgi', version='3.6.1.R36x_v20100806'),
@Grab(group='org.apache.commons', module='com.springsource.org.apache.commons.logging', version='1.1.1')
])
@jetztgradnet
jetztgradnet / osgienv.groovy
Created January 18, 2011 09:39
Create a simple OSGi environment using groovyx.osgi.runtime module
// these are necessary for current version (3.6.1) of Equinox
@GrabResolver(name='ebrRelease', root='http://repository.springsource.com/maven/bundles/release')
@GrabResolver(name='ebrExternal', root='http://repository.springsource.com/maven/bundles/external')
@GrabResolver(name='githubJetztgradNet', root='https://github.com/jetztgradnet/repository/raw/master')
@Grapes([
@GrabConfig(systemClassLoader=true),
@Grab(group='groovyx.osgi', module='groovyx.osgi.runtime', version='0.1'),
@Grab(group='org.eclipse.osgi', module='org.eclipse.osgi', version='3.6.1.R36x_v20100806'),
@Grab(group='org.apache.commons', module='com.springsource.org.apache.commons.logging', version='1.1.1')
])
@jetztgradnet
jetztgradnet / simpleosgi.groovy
Created December 15, 2010 23:40
Run an OSGi framework using the Groovy DSL provided by the groovyx.osgi.runtime module
import grooxy.osgi.runtime.OsgiRuntimeBuilder
OsgiRuntimeBuilder.run {
framework 'equinox'
bundle 'mvn:org.apache.felix:org.apache.felix.configadmin:1.2.4'
bundle 'mvn:org.apache.felix:org.apache.felix.fileinstall:3.0.2'
console(8023)
@jetztgradnet
jetztgradnet / osgic
Created February 14, 2010 10:00
osgic: Scriptable Equinox console
#!/bin/sh
# osgic: Scriptable Equinox console
# see osgic -h for help
# connects by default to localhost:8023
SCRIPTNAME=`basename $0`
PORT=
HOST=
@jetztgradnet
jetztgradnet / Grails Bash completion (tested on OSX, Grails 1.2)
Created January 6, 2010 11:17
Grails Bash completion (tested on OSX, Grails 1.2)
#export GRAILS_VERSION="$(ls -lhr $HOME/.grails | egrep -i '1\.' | head -1 | gawk '{print $9 }')"
export GRAILS_VERSION=`cat $GRAILS_HOME/build.properties | grep "^grails.version=" | awk -F= '{ print $2 }' | tr -d '\r' | tr -d '\n'`
_get_domain_classes(){
find ./grails-app/domain -iname *.groovy 2> /dev/null | tr \\n ' ' | sed 's/\.groovy//g' | sed 's/\.\/grails-app\/domain\///g' | tr '/' \.
}
_get_tests(){
find ./test -iname *.groovy 2> /dev/null | sed 's/\.\/test\/integration\///g' | sed 's/\Tests.groovy//g' | tr '/' \.
}
@jetztgradnet
jetztgradnet / jinspect
Created January 4, 2010 11:39
inspect jar and war files, Grails applications and plugins
#!/bin/sh
# needs bash >= 3.2 for regex
jarfile=
file=
fileList=
verbose=0
extract=0
list=0