Skip to content

Instantly share code, notes, and snippets.

View malys's full-sized avatar

Malys malys

View GitHub Profile
@malys
malys / keycloak_aws_deployment.md
Last active April 18, 2019 11:21 — forked from pgchamberlin/keycloak_aws_deployment.md
Deploying Keycloak to AWS using a Ubuntu AMI

Deploying Keycloak to AWS Ligthsail

The objective of this guide is to deploy Keycloak to AWS in a minimally complex way for testing and discovery purposes. This means using the standalone build of Keycloak backed with Hibernate H2. The result is not a production ready system. It won't scale, it won't survive significant load, it can't be clustered.

Steps

  • Spin up and configure a Ubuntu
  • Install and configure Keycloak with an SSL cert

Spin up a Ubuntu and configure it

@malys
malys / compare.groovy
Last active August 6, 2019 08:32
[Properties] Compare #properties
Properties props = new Properties();
props.load(new FileInputStream("D:\\Developpement\\archi\\idm\\rh-sso-theme-lyra\\src\\main\\resources\\theme\\lyra\\login\\messages\\messages_en.properties"))
// from now you have Properties object with your data.
// since properties extends Hashtable the task is done.
// if you still need keys in list, say
List<Object> keys = new ArrayList<Object>(props.keySet())
keys=keys.toSorted()
//println keys.join("\n")
@malys
malys / hsm.sh
Last active October 16, 2018 07:12
[HSM] Utilities #hsm#c2p#bull#cryptography
#!/usr/bin/env bash
# C2P Bull Wrapper
shopt -s extglob
usage() {
{
echo -e "
usage:
@malys
malys / certificate_chain
Last active September 28, 2018 13:37
[Crypto] Private/public keys #java #cryptography #keys
CONNECTED(00000003)
depth=1 /C=US/CN=YaST Default CA (dlopEldap)/emailAddress=postmaster@site
verify error:num=19:self signed certificate in certificate chain
verify return:0
---
Certificate chain
0 s:/C=US/CN=dlopldap.site/emailAddress=postmaster@site
i:/C=US/CN=YaST Default CA (dlopldap)/emailAddress=postmaster@site
-----BEGIN CERTIFICATE-----
MIIEUTCCAzmgAwIBAgIBATANBgkqhkiG9w0BAQUFADBSMQswCQYDVQQGEwJVUzEj
@malys
malys / diffFormat.cmd
Last active June 6, 2018 08:20
[Kdiff3 smart] #kdiff3 #diff
@ECHO OFF
rem ECHO filedrive=%%~di
rem ECHO filepath=%%~pi
rem ECHO filename=%%~ni
rem ECHO fileextension=%%~xi
set from=%1
set from1=%2
set diff=false
set xml=false
set XML_EXE="D:\util\Vagrant\embedded\mingw64\bin\xmllint.exe "
@malys
malys / CompareConfiguration.groovy
Created May 29, 2018 13:02
[Wildfly] Compare context #wildlfy #cli
package scripts
import org.jboss.as.cli.scriptsupport.CLI
import org.jboss.dmr.ModelNode
import org.jboss.dmr.Property
import java.security.KeyManagementException
import java.security.NoSuchAlgorithmException
import static groovy.json.JsonOutput.prettyPrint
@malys
malys / rhsso.js
Created May 28, 2018 14:26
[RH-SSO automatic download] automatic download on Redhat Portal#keycloak #rh-sso #download
// npm i -g casperjs
// casperjs.cmd --ssl-protocol=any D:\Developpement\old\autologon\rhsso.js smalnuit %PW% %VERSION% %PATCH% %EXPORT%\t.zip
var fs = require('fs');
var casper = require("casper").create({
verbose: false,
logLevel: "warning",
waitTimeout: 60000,
pageSettings: {
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:23.0) Gecko/20130404 Firefox/23.0"
}
@malys
malys / Performance.java
Last active January 19, 2021 16:13
[Btrace] dynamic trace #java #trace #btrace #wildfly #jbeap #jboss #measure
import org.openjdk.btrace.core.annotations.BTrace;
import org.openjdk.btrace.core.annotations.Duration;
import org.openjdk.btrace.core.annotations.Kind;
import org.openjdk.btrace.core.annotations.Location;
import org.openjdk.btrace.core.annotations.OnMethod;
import org.openjdk.btrace.core.annotations.ProbeClassName;
import org.openjdk.btrace.core.annotations.ProbeMethodName;
import org.openjdk.btrace.core.annotations.Where;
import static org.openjdk.btrace.core.BTraceUtils.*;
@malys
malys / googlepay.sh
Created May 22, 2018 12:26
[OpenSSL] useful openssl command #openssl #googlepay
# Life span certificate
export DAYS=365
# Issuer
export WHO=COMPANY
# CSR file name (Copy CSR from Keystore to $CSR)
export CSR=sample.csr
echo "Reading CSR"
openssl req -in $CSR -noout -text
@malys
malys / color.js
Created May 3, 2018 06:52
[JiraPlantUMLGantt] Gantt generator for JIRA #javascript #jira
module.exports = {
//Background/contour
'In Progress': {b:'#d9d9d9',c:'#d9d9d9'},
'To Review': {b:'#cccccc',c:'#cccccc'},
'To Validate': {b:'#bfbfbf',c:'#bfbfbf'},
'Done': {b:'#999999',c:'#999999'},
'Urgent': {b:'ff3333',c:'#ff3333'}
}