Skip to content

Instantly share code, notes, and snippets.

View kouzouigh's full-sized avatar

Ouzouigh Kamel kouzouigh

View GitHub Profile
@kouzouigh
kouzouigh / read-certificate-with-ssl.groovy
Created November 24, 2020 08:44
Read x509 certificate by using OpenSSL with Groovy
def cert = "-----BEGIN CERTIFICATE-----\n" +
"MIIDojCCAoqgAwIBAgIUE6k0hxK8Iy2XJYZK8fVJaQGLIHIwDQYJKoZIhvcNAQEL\n" +
"BQAwUDELMAkGA1UEBhMCRlIxGTAXBgNVBAgMEMODwo5sZS1kZS1GcmFuY2UxDjAM\n" +
"BgNVBAcMBVBhcmlzMRYwFAYDVQQKDA1NeSBDb21wYW55IEluMB4XDTIwMTEyNDA4\n" +
"NDMwMloXDTIxMTEyNDA4NDMwMlowUDELMAkGA1UEBhMCRlIxGTAXBgNVBAgMEMOD\n" +
"wo5sZS1kZS1GcmFuY2UxDjAMBgNVBAcMBVBhcmlzMRYwFAYDVQQKDA1NeSBDb21w\n" +
"YW55IEluMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArZng3abWPwQp\n" +
"EB7u3qFhVctDhdY2eo1PxNZ0rbc7SSOUEBsoZTZHmO/tExmHx8FOtRthFa1RTjYH\n" +
"SNBR6pYiOUiSE7xDrkvNSNdtQWbP8fpK53m0eWqtjXoyl7nbJ+r5tQaFmisuGlBe\n" +
"3AVQvs9nxRtHQ7iTZD0sG0BSyh0lLRDKbLP9C88sIh0jO8PtqAzSMKERts4bj7OZ\n" +
@lievendoclo
lievendoclo / presenter.kt
Last active October 27, 2023 18:21
Presenter in Clean Architecture
// shared datastructures
data class ResponseModel(val value: String)
data class JsonResponse(val jsonValue: String)
// example 1
interface FooUseCase {
fun <T> T doSomething(presenter: (ResponseModel -> T))
}
@kouzouigh
kouzouigh / get_keycloak_access_token.sh
Created June 16, 2018 23:34 — forked from adixchen/get_keycloak_access_token.sh
Get Keycloak access token via curl and pretty print it with python
curl \
-d 'client_id=YOUR_KEYCLOAK_CLIENT' \
-d 'username=YOUR_USERNAME' \
-d 'password=YOUR_PASSWORD' \
-d 'grant_type=password' \
'https://YOUR_KEYCLOAK_SERVER_HOST/auth/realms/YOUR_REALM/protocol/openid-connect/token' \
| python -m json.tool
@brunosimioni
brunosimioni / docker-compose.yml
Created February 27, 2018 17:46
Docker Compose to Prometheus, PushGateway and Grafana setup
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}
@adixchen
adixchen / get_keycloak_access_token.sh
Last active August 31, 2021 14:14
Get Keycloak access token via curl and pretty print it with python
curl \
-d 'client_id=YOUR_KEYCLOAK_CLIENT' \
-d 'username=YOUR_USERNAME' \
-d 'password=YOUR_PASSWORD' \
-d 'grant_type=password' \
'https://YOUR_KEYCLOAK_SERVER_HOST/auth/realms/YOUR_REALM/protocol/openid-connect/token' \
| python -m json.tool
@lemiorhan
lemiorhan / ReleaseViaJGitFlow.md
Last active October 21, 2023 03:57
How to make a release with Git and Maven via JGitFlow

How to make a release with Git and Maven via JGitFlow

Imagine that you are versioning your sourcecode in git and building your code via maven. You need to make releases before deploying to production regularly. What should be the strategy we need to follow for releasing?

I've used maven-release-plugin for years to make releases. It worked perfectly with maven and svn, but we started to face problems when we migrated our code to git and to make releases on git.

After checking the literature, we decided to use JGit-Flow which is a maven plugin based on and is a replacement for the maven-release-plugin enabling support for git-flow style releases via maven.

I do not want to explain the details much because there are many great posts explaining all.