Download and install crash via rpm
rpm -Uvh http://dl.bintray.com/content/hgomez/devops-incubator-rpm/crash-1.2.0.cr7-1.noarch.rpm
Start crash
crash.sh
______
.~ ~. |`````````, .'. ..'''' | |
package net.gageot; | |
import org.junit.Test; | |
import static org.fest.assertions.Assertions.assertThat; | |
public class CodeStoryStatusTest extends PhantomJsTest { | |
@Override | |
public String defaultUrl() { | |
return "http://status.code-story.net"; |
# Building JBoss AS 7.2.0.Final | |
wget https://github.com/jbossas/jboss-as/archive/7.2.0.Final.tar.gz | |
tar -xvf 7.2.0.Final.tar.gz | |
cd jboss-as-7.2.0.Final | |
./build.sh -DskipTests -Drelease=true # -Drelease=true creates the distribution archives | |
# Copy the binaries | |
cp -R build/target/jboss-as-7.2.0.Final /opt/java/ | |
# Copy the archive | |
cp dist/target/jboss-as-7.2.0.Final.zip ~/archives/ |
Download and install crash via rpm
rpm -Uvh http://dl.bintray.com/content/hgomez/devops-incubator-rpm/crash-1.2.0.cr7-1.noarch.rpm
Start crash
crash.sh
______
.~ ~. |`````````, .'. ..'''' | |
// Class based commands using annotations | |
class dir { | |
@Usage("show the current directory") | |
@Command | |
void main(@Usage("the dir to list") @Argument String path) { | |
File dir = path != null ? new File(path) : new File("."); | |
def files = dir.listFiles(); | |
files.each { file -> | |
context.provide(NAME:file.name,LENGTH:file.length(),DATE:new Date(file.lastModified())) | |
} |
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7') | |
import groovyx.net.http.RESTClient | |
import static groovyx.net.http.ContentType.* | |
import org.crsh.text.ui.UIBuilder | |
UIBuilder ui = new UIBuilder(); | |
def http = new RESTClient( 'http://localhost:8080/pentaho/' ) | |
def resp = http.get( path: 'content/ws-run/soapConnectionService/getConnections', query: [userid: 'admin', password: 'password'] ) |
package test; | |
import java.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.util.Arrays; | |
import java.util.function.Function; | |
import static java.util.stream.Stream.of; | |
public class FindParametersTypes { |
package avaj.lang.invoke; | |
import java.io.*; | |
import java.lang.invoke.SerializedLambda; | |
import static java.nio.charset.StandardCharsets.ISO_8859_1; | |
public class FindParametersTypes { | |
public static void main(String[] args) throws Exception { | |
System.out.println(getMethodSignature((String s) -> s)); |
plugins { | |
id 'java' | |
id 'eclipse' | |
id 'idea' | |
id 'com.github.johnrengelman.shadow' version '1.2.1' | |
} | |
repositories { | |
mavenLocal() | |
mavenCentral() |
public static class SimpleEntityCodecFactoryTest { | |
private Map<@JSON Integer,Map<@Frozen Integer,@Enumerated(value = Enumerated.Encoding.NAME, test = "123") String>> map; | |
} | |
final TypeElement typeElement = elementUtils.getTypeElement(SimpleEntityCodecFactoryTest.class.getCanonicalName()); | |
final List<VariableElement> els = ElementFilter.fieldsIn(typeElement.getEnclosedElements()); | |
final VariableElement mapElt = els.stream().filter(x -> x.getSimpleName().contentEquals("map")).findFirst().get(); | |
final com.sun.tools.javac.util.List<Attribute.TypeCompound> typeAttributes = ((Symbol.VarSymbol) mapElt).getMetadata().getTypeAttributes(); |