Skip to content

Instantly share code, notes, and snippets.

View aelkz's full-sized avatar
👽
working hard

Raphael Alex aelkz

👽
working hard
View GitHub Profile
@aelkz
aelkz / wildfly-domain.cli
Created October 25, 2017 14:50 — forked from gtudan/wildfly-domain.cli
Wildfly Profile example
# change the provided default configuration for the ejb-multi-server quickstart
# stop the preconfigured server for the domain
batch
# first stop the default servers, block until the server is down
/host=master/server-config=server-one:stop(blocking=true)
/host=master/server-config=server-two:stop(blocking=true)
# remove the default server configuration and server-groups
@aelkz
aelkz / keytool
Created October 28, 2017 13:41 — forked from steppat/keytool
Gerenciando o certificado com o Java keytool:
Para gerar um certificado válido por 180 dias, usando algoritmo RSA::
keytool -genkey -keyalg RSA -alias livraria -keystore caelum_keystore.jks -storepass caelum -validity 180
Obs: Para usar com Tomcat usa a mesma senha para o keystore e para o certificado!
Para listar todo o conteudo do keystore:
@aelkz
aelkz / java keystores
Created October 28, 2017 13:43 — forked from nielsvanderbeke/java keystores
java keystore and certificate commands
What is in a keystore
=======================
keytool -list -v -keystore keystore-file.jks | less
=======================
show certificates website
=======================
openssl s_client -host internet.onprvp.fgov.be -port 443 -showcerts
=======================
@aelkz
aelkz / genca.sh
Created October 28, 2017 13:46 — forked from wsargent/genca.sh
Generate a certificate authority and trust anchor keystore, using only keytool
#!/bin/bash
export PW=`cat password`
# Create a self signed key pair root CA certificate.
keytool -genkeypair -v \
-alias exampleca \
-dname "CN=exampleCA, OU=Example Org, O=Example Company, L=San Francisco, ST=California, C=US" \
-keystore exampleca.jks \
-keypass:env PW \
@aelkz
aelkz / persistence.xml
Created October 31, 2017 16:34 — forked from mortezaadi/persistence.xml
persistence xml configurations for major databases and jpa providers
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<!-- derby -->
@aelkz
aelkz / gist:2889d4d97784eeb8f3604ac7d3e62059
Created October 31, 2017 16:41 — forked from aziz781/gist:1336488
Java sample persistence.xml with JNDI JTA Data source and Hibernate configuration
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="MyAppUnit" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/myAppDS</jta-data-source>
<!-- Package: uk.co.example.domain -->
@aelkz
aelkz / .git-commit-template.txt
Last active November 1, 2017 23:50 — forked from adeekshith/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<------------- Using a Maximum Of 50 Characters ------------>|
# Explain why this change is being made
# |<--- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant
# [jira | tickets | articles | other resources]
# Valid Example: Github issue #23
@aelkz
aelkz / TestSimpleProgramHotRodServer.java
Created November 22, 2017 14:33 — forked from n-dobryukha/TestSimpleProgramHotRodServer.java
Simple program hotrod server: issue with logger
package com.ndobryukha.tests.infinispan;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.commons.equivalence.ByteArrayEquivalence;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.infinispan.configuration.cache.Index;
import org.infinispan.configuration.global.GlobalConfiguration;
@aelkz
aelkz / RawInfinispanClusterTest.java
Created November 22, 2017 15:25
Creating caches programmatically using Infinispan 4.2.0.Final
package org.modeshape.connector.infinispan;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.apache.log4j.Logger;
import org.infinispan.Cache;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.junit.Test;