Skip to content

Instantly share code, notes, and snippets.

Avatar

Pierluigi Vernetto vernetto

View GitHub Profile
View gist:630a10420c28034eaad7a5fc05f5aff0
FROM jboss/wildfly
#WildFly administration port
EXPOSE 9990
#Copy the WAR to be deployed during container startup
ADD /opt/jboss/wildfly/standalone/deployments sample.war
#Add admin user
RUN /opt/jboss/wildfly/bin/add-user.sh admin admin --silent
View gist:6ca14374e059cca1b0503cc8f8dd6ea4
[centos@localhost ~]$ wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.rpm"
--2017-11-25 02:08:00-- http://download.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.rpm
Resolving download.oracle.com (download.oracle.com)... 2.20.189.226, 2.20.190.214
Connecting to download.oracle.com (download.oracle.com)|2.20.189.226|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.rpm [following]
--2017-11-25 02:08:01-- https://edelivery.oracle.com/otn-pub/java/jdk/9.0.1+11/jdk-9.0.1_linux-x64_bin.rpm
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.108.49.101, 2a02:26f0:ad:292::2d3e, 2a02:26f0:ad:299::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.108.49.101|:443... connected.
HTTP request sen
@vernetto
vernetto / web.xml
Created Dec 2, 2017
web.xml for Primefaces
View web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
@vernetto
vernetto / pom.xml
Created Dec 2, 2017
pom.xml netbeans primefaces
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>AnApp</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>AnApp</name>
@vernetto
vernetto / pom.xml
Last active Dec 5, 2017
sample pom for javaee
View pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.pierre</groupId>
<artifactId>pvabwebsockets</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
View gist:d85c8e96437a4e7236af011d11384904
System.out.println("parsing JSON file ");
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource("bikes.json").getFile());
ObjectMapper objectMapper = new ObjectMapper();
JsonNode jsonNode = objectMapper.readTree(file);
System.out.println(jsonNode);
Properties props = new Properties();
props.setProperty("resource.loader", "file");
//props.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
View gist:8d33fac76433e1aae4a7ee461b92d3aa
https://github.com/sass/node-sass/issues/2455
[centos@localhost bin]$ find / -name node-sass 2> /dev/null
/home/centos/.npm/registry.npmjs.org/node-sass
/home/centos/.npm/node-sass
/home/centos/node-v0.10.30/node_modules/node-sass
/home/centos/node-v0.10.30/node_modules/node-sass/bin/node-sass
/home/centos/node-v0.10.30/node_modules/.bin/node-sass
/home/centos/node_modules/.bin/node-sass
/home/centos/node_modules/node-sass
@vernetto
vernetto / gist:a6c144fc01242978b174b2fecdae526b
Created Dec 20, 2018
Nexus Swagger code to search components etc
View gist:a6c144fc01242978b174b2fecdae526b
package com.juliusbaer.nexus.nexusswaggerclient;
import java.util.List;
import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.api.AssetsApi;
import io.swagger.client.api.ComponentsApi;
import io.swagger.client.api.SearchApi;
import io.swagger.client.model.AssetXO;
View gist:970665371b0ab556dcc16be60d3861e3
package org.pierre.java11tests;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringJoiner;
public class ProcessTest {
public static void main(String[] args) throws IOException {
ProcessBuilder pb = new ProcessBuilder("cmd","/C", "dir d:\\temp");
View gist:283abc56a725c003e7422a8a3f67c744
package org.pierre.streams;
import org.junit.jupiter.api.Test;
import java.io.BufferedReader;
import java.io.FileReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;