Skip to content

Instantly share code, notes, and snippets.

Umberto Nicoletti unicolet

Block or report user

Report or block unicolet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
unicolet /
Created Dec 13, 2015
salt-cloud linode patch
--- /usr/lib/python2.7/site-packages/salt/cloud/clouds/ 2015-12-12 16:32:49.860428104 +0100
+++ /usr/lib/python2.7/site-packages/salt/cloud/clouds/ 2015-12-12 17:09:37.384331055 +0100
@@ -537,6 +537,18 @@
'disk_size', vm_, __opts__, default=disksize - swap
+ def get_data_disk_size(vm_, size, swap):
+ '''
+ Return the size of of the data disk in MB
+ '''
unicolet / gist:1ffae057003c1c0e0cef
Created Jun 25, 2015
camel-elasticsearch error in osgi
View gist:1ffae057003c1c0e0cef
opennms> features:install opennms-elasticsearch-event-forwarder
ERROR: Bundle org.opennms.features.elasticsearch.event-forwarder [184] EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/lucene/store/IndexInput)
java.lang.NoClassDefFoundError: org/apache/lucene/store/IndexInput
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(
at org.apache.felix.framework.BundleWiringImpl.access$400(
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
View RepeatingActivity.drl
package org.opennms.netmgt.correlation.drools;
import java.util.Date;
import java.util.Calendar;
import org.opennms.netmgt.correlation.drools.DroolsCorrelationEngine;
import org.opennms.netmgt.xml.event.Event;
import org.opennms.netmgt.xml.event.Parms;
import org.opennms.netmgt.xml.event.Parm;
import org.opennms.netmgt.xml.event.Value;
unicolet /
Created Apr 8, 2015
Shell script to purge Rundeck execution history
# setup ~/.pgpass to allow passwordless connection to postgres
# keep last 30 executions for each job
cd /var/lib/rundeck/logs/rundeck
JOBS=`find . -maxdepth 3 -path "*/job/*" -type d`
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import org.jasig.cas.CentralAuthenticationService;
import org.jasig.cas.Message;
import org.jasig.cas.authentication.AuthenticationException;
View camel_elastisearch_mapping.xml
starts first, then stops. All other routes start after this one has completed
Same as: curl -XPUT http://localhost:9200/_template/opennms -d @elmapping.json
<route id="elastisearchTemplateMapping" autoStartup="true" startupOrder="1">
<from uri="timer://runOnce?repeatCount=1&amp;delay=0"/>
<setHeader headerName="CamelHttpMethod">
<setHeader headerName="CamelContentType">
unicolet / logstash.conf
Last active Aug 29, 2015
logstash conf for apache log files
View logstash.conf
input {
file {
type => "accesslog"
path => [ "/var/log/access_logs/access_log" ]
filter {
grok {
match => { "message" => "%{EXTENDEDAPACHELOG}" }
unicolet / el_template.json
Created Sep 11, 2014
Elastisearch template for apache extended log format
View el_template.json
unicolet / copy_extract.awk
Last active Aug 29, 2015
Extract copy instructions from a postgres dump in SQL format.
View copy_extract.awk
BEGIN {start=0}
/^COPY "/ { if(index($0,TBL)!=0) { start=1; } }
// {if(start==1) print $0;}
/\\\./ {start=0;}
View constructor_code.js
function assembleLayer(conf) {
var constructorr=window, path=conf.provider.split(".");
// get a reference to the constructor, by walking the provider path
for(var i=0,l=path.length;i<l;i++) { constructorr=constructorr[path[i]]; }
// following constructor code from:
// now invoke it
function F() {
return constructorr.apply(this, conf.args);
You can’t perform that action at this time.