Skip to content

Instantly share code, notes, and snippets.

View fbricon's full-sized avatar
🖖

Fred Bricon fbricon

🖖
View GitHub Profile
// this adds a "truncate(#)" method to String
// see http://www.vertigrated.com/blog/2009/11/how-to-add-a-truncateint-len-method-to-stringgstring-in-groovy/
String.metaClass.truncate = { len ->
if (delegate == null) {return''}
if (delegate.length() > len) {return delegate[0..(len - 2)] + "\u2026"}
return delegate
}
def query= "hibernate"
int size = 20
@fbricon
fbricon / POC.java
Last active August 29, 2015 14:15
Clone remote repo, fetch specific folder from tag into a separate directory
package gitwalker;
import java.io.File;
import java.io.FileOutputStream;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.jgit.api.CloneCommand;
@fbricon
fbricon / useful aliases
Created December 2, 2014 18:19
useful aliases
alias quick-verify='mvn clean verify -DskipTest'
alias remindme='history | grep'
upversion() {mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$@;}
@fbricon
fbricon / Error
Created July 1, 2014 16:17
m2e leaking classloader?
java.lang.ExceptionInInitializerError
at de.schlichtherle.io.ArchiveControllers.<clinit>(ArchiveControllers.java:67)
at de.schlichtherle.io.File.umount(File.java:1099)
at org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil.umount(TrueZipUtil.java:160)
at org.jboss.ide.eclipse.as.wtp.core.server.publish.LocalZippedModulePublishRunner.fullPublish(LocalZippedModulePublishRunner.java:173)
at org.jboss.ide.eclipse.as.wtp.core.server.publish.LocalZippedModulePublishRunner.fullPublishModule(LocalZippedModulePublishRunner.java:93)
at org.jboss.tools.as.core.server.controllable.subsystems.internal.ManagementPublishController.zipLocally(ManagementPublishController.java:280)
at org.jboss.tools.as.core.server.controllable.subsystems.internal.ManagementPublishController.publishModule(ManagementPublishController.java:214)
at org.jboss.ide.eclipse.as.wtp.core.server.behavior.ControllableServerBehavior.publishModule(ControllableServerBehavior.java:134)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.pu
@fbricon
fbricon / gist:c3038d1e1438d808ee93
Created June 20, 2014 13:47
Forge2 in Eclipse : crazy amount of threads
C:\Users\Fred Bricon>jps
4536 org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
10768 org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
8404 Jps
C:\Users\Fred Bricon>jstack 4536
2014-06-20 15:41:46
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.0-b70 mixed mode):
"ModalContext" #285 prio=6 os_prio=0 tid=0x000000005f41f800 nid=0xeb4 runnable [0x00000000689bd000]
@fbricon
fbricon / gist:10366564
Created April 10, 2014 10:36
trying to run a verticle at the root of a volume
D:\temp>d:\Dev\vertx\vert.x-2.1RC3\bin\vertx.bat run server.js -cp "d:\"
"D:\Dev\Java\jdk1.8.0/bin/java.exe" -Djava.util.logging.config.file="d:\Dev\vertx\vert.x-2.1RC3\bin\..\conf\logging.properties" -Dvertx.home="d:\Dev\vertx\
vert.x-2.1RC3\bin\.." -Dvertx.clusterManagerFactory="org.vertx.java.spi.cluster.impl.hazelcast.HazelcastClusterManagerFactory" -classpath ".;C:\Program Files (x
86)\Java\jre7\lib\ext\QTJava.zip;d:\Dev\vertx\vert.x-2.1RC3\bin\..\conf;d:\Dev\vertx\vert.x-2.1RC3\bin\..\lib\*" org.vertx.java.platform.impl.cli.Starter run se
rver.js -cp "d:\"
Failed in deploying verticle
org.mozilla.javascript.JavaScriptException: Error: Module "server.js" not found.
at org.mozilla.javascript.ScriptRuntime.throwError(ScriptRuntime.java:3980)
at org.mozilla.javascript.commonjs.module.Require.requireMain(Require.java:154)
at org.vertx.java.platform.impl.RhinoVerticleFactory$RhinoVerticle.start(RhinoVerticleFactory.java:229)
["D:\Dev\Java\jdk1.7.0_45\bin\javaw.exe", -Dfile.encoding=Cp1252, -classpath, "D:\Dev\vertx\vert.x-2.1RC3\lib\*;D:\Dev\vertx\vert.x-2.1RC3\conf\*;d:\vertx\\", org.vertx.java.platform.impl.cli.Starter, "-Dvertx.home=D:\Dev\vertx\vert.x-2.1RC3\\", "-Djava.util.logging.config.file=D:\Dev\vertx\vert.x-2.1RC3\conf\logging.properties", -Dvertx.clusterManagerFactory=org.vertx.java.spi.cluster.impl.hazelcast.HazelcastClusterManagerFactory, run, server.groovy]
# JBoss, Home of Professional Open Source
# Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual
# contributors by the @authors tag. See the copyright.txt in the
# distribution for a full listing of individual contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
@fbricon
fbricon / gist:9913842
Created April 1, 2014 13:20
traceme.war.dodeploy accesses
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"15:09:31,0442720","javaw.exe","8160","QueryOpen","D:\Dev\servers\wildfly-8.0.0.Final\standalone\deployments\traceme.war.dodeploy","NAME NOT FOUND",""
"15:09:31,0443390","javaw.exe","8160","CreateFile","D:\Dev\servers\wildfly-8.0.0.Final\standalone\deployments\traceme.war.dodeploy","SUCCESS","Desired Access: Generic Read/Write, Disposition: Create, Options: Synchronous IO Non-Alert, Non-Directory File, Open Reparse Point, Attributes: N, ShareMode: Read, Write, AllocationSize: 0, OpenResult: Created"
"15:09:31,0445904","javaw.exe","8160","CloseFile","D:\Dev\servers\wildfly-8.0.0.Final\standalone\deployments\traceme.war.dodeploy","SUCCESS",""
"15:09:32,1046704","explorer.exe","8312","QueryDirectory","D:\Dev\servers\wildfly-8.0.0.Final\standalone\deployments\traceme.war.dodeploy","SUCCESS","Filter: traceme.war.dodeploy, 1: traceme.war.dodeploy"
"15:09:32,1053710","explorer.exe","3640","QueryDirectory","D:\Dev\servers\wildfly-8.0.0.Final\stan
@fbricon
fbricon / gist:9912548
Created April 1, 2014 11:59
deploy/undeploy on WF
13:56:51,198 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "fbricon-win:MANAGEMENT" task-15) Chosen version 0x00
13:56:51,198 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "fbricon-win:MANAGEMENT" task-15) Client version 2.0.0.Final
13:56:51,249 DEBUG [org.jboss.remotingjmx.DelegatingRemotingConnectorServer] (Remoting "fbricon-win:MANAGEMENT" task-16) Chosen version 0x02
13:56:51,258 DEBUG [org.jboss.remotingjmx.protocol.v2.ParameterProxy] (Remoting "fbricon-win:MANAGEMENT" task-16) Created connection - ID to be established after parameter negotiation.
13:56:51,275 DEBUG [org.jboss.remotingjmx.protocol.v2.ServerProxy] (pool-2-thread-1) Created connectionID 1111f6b1-4a4b-4f6e-a335-2b42879a1175
13:56:51,276 DEBUG [org.jboss.remotingjmx.RemotingConnectorServer] (pool-2-thread-1) Connection '1111f6b1-4a4b-4f6e-a335-2b42879a1175' now opened.
13:56:53,847 DEBUG [org.jboss.ejb.client.txn] (Periodic Recovery) Send recover request for transaction origin node iden