Skip to content

Instantly share code, notes, and snippets.

View aelkz's full-sized avatar
👽
working hard

Raphael Abreu aelkz

👽
working hard
View GitHub Profile
@aelkz
aelkz / upgrade-postgres-9.4-to-9.5.md
Created September 23, 2017 17:01 — forked from Komzpa/upgrade-postgres-9.4-to-9.5-to-9.6-to-10.md
Upgrading PostgreSQL from 9.4 to 9.5 when upgrading Ubuntu 14.10 to 16.04

TL;DR

sudo pg_dropcluster 9.5 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
@aelkz
aelkz / instal-tilix.sh
Created September 30, 2017 15:01
tilix terminal (manual install)
#!/bin/bash
cd /home/student
# download tilix from official repo
wget https://github.com/gnunn1/tilix/releases/download/1.6.4/tilix.zip
sudo unzip tilix.zip -d /
cd /
@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 / keystore-vault.sh
Last active May 15, 2018 13:40
JBoss EAP / Wildfly: keystore creation to store sensitive data.
#!/bin/bash
export PW='12p@R3dH4t123!'
# -------------------------------------------------------------------------------------
# JBoss (Wildfly) vault keystore creation for use with encrypted passwords
# -------------------------------------------------------------------------------------
# docs: https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/keytool.html
# https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6.3/html/security_guide/create_a_java_keystore_to_store_sensitive_strings
# http://www.ensor.cc/2014/02/aes-256-encryption-with-java-and-jceks.html
@aelkz
aelkz / self-signed.sh
Created October 28, 2017 15:19
JBoss EAP / Wildfly: self-signed certificate creation to enable security connection.
#!/bin/bash
export PW='98p@R3dH4t777'
# -------------------------------------------------------------------------------------
# JBoss (Wildfly) RSA self-signed certificate for using with secure connections
# -------------------------------------------------------------------------------------
# docs: https://docs.oracle.com/javase/7/docs/technotes/tools/solaris/keytool.html
# https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6/html/administration_and_configuration_guide/generate_a_ssl_encryption_key_and_certificate
# https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html-single/how_to_configure_server_security/
@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 -->