Skip to content

Instantly share code, notes, and snippets.

View fhanik's full-sized avatar

Filip Hanik fhanik

  • Working at VMware Inc, Contributing to Apache Software Foundation
  • Vancouver, WA, USA
View GitHub Profile
@fhanik
fhanik / XReflectionIntrospectionUtils.java
Created January 4, 2022 16:43
Auto generated code for tomcat-embed-programmatic that removes known reflection
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@fhanik
fhanik / Apache Tomcat - Sample ServerXml.java
Last active February 10, 2023 03:54
Apache Tomcat - Sample Configuration Code Generation
package catalina;
public class ServerXml implements org.apache.catalina.startup.Catalina.ServerXml {
public void load(org.apache.catalina.startup.Catalina tc_Catalina_0) {
org.apache.catalina.core.StandardServer tc_StandardServer_1 = new org.apache.catalina.core.StandardServer();
tc_StandardServer_1.setPort(Integer.valueOf("-1"));
tc_StandardServer_1.setShutdown("SHUTDOWN");
org.apache.catalina.startup.VersionLoggerListener tc_VersionLoggerListener_2 = new org.apache.catalina.startup.VersionLoggerListener();
@fhanik
fhanik / SAML Configuration 4x.yml
Created February 11, 2020 22:09
SAML Configuration for Spring Security SAML
spring:
security:
saml2:
relyingparty:
registration:
simplesamlphp:
signing: &signing_ref
credentials:
- private-key-location: "classpath:credentials/rp-private.key"
certificate-location: "classpath:credentials/rp-certificate.crt"
@fhanik
fhanik / gist:cbd64114984175e39a9c16e49c3e64a5
Last active February 10, 2020 16:59
spring-graal-native-feb-7-2020
11:43:38.326 [main] DEBUG io.netty.buffer.ByteBufUtil - -Dio.netty.maxThreadLocalCharBufferSize: 16384
Feb 07, 2020 11:43:38 AM com.example.ProtoApplication start
INFO: Server started, listening on 50051
FAILURE: the output of the application does not contain the expected output
Graal: GraalVM Version 19.3.1 CE
Date Sample Build Time (s) Build Mem (GB) RSS Mem (M) Image Size (M) Startup Time (s) JVM Uptime (s)
20200207-1111 spring-petclinic-jpa 276.1 - 269.4 147.5 0.181 0.185
20200207-1113 springmvc-tomcat 88.9 - 78.3 55.4 0.083 0.087
20200207-1115 vanilla-thymeleaf 114.0 - 80.7 63.4 0.052 0.054
20200207-1115 jafu 31.2 - 13.3 14.9 0.007 0.008
@fhanik
fhanik / idp-certificate.crt
Created January 1, 2020 23:59
spring-security-saml2-login.yml
-----BEGIN CERTIFICATE-----
MIIEEzCCAvugAwIBAgIJAIc1qzLrv+5nMA0GCSqGSIb3DQEBCwUAMIGfMQswCQYD
VQQGEwJVUzELMAkGA1UECAwCQ08xFDASBgNVBAcMC0Nhc3RsZSBSb2NrMRwwGgYD
VQQKDBNTYW1sIFRlc3RpbmcgU2VydmVyMQswCQYDVQQLDAJJVDEgMB4GA1UEAwwX
c2ltcGxlc2FtbHBocC5jZmFwcHMuaW8xIDAeBgkqhkiG9w0BCQEWEWZoYW5pa0Bw
aXZvdGFsLmlvMB4XDTE1MDIyMzIyNDUwM1oXDTI1MDIyMjIyNDUwM1owgZ8xCzAJ
BgNVBAYTAlVTMQswCQYDVQQIDAJDTzEUMBIGA1UEBwwLQ2FzdGxlIFJvY2sxHDAa
BgNVBAoME1NhbWwgVGVzdGluZyBTZXJ2ZXIxCzAJBgNVBAsMAklUMSAwHgYDVQQD
DBdzaW1wbGVzYW1scGhwLmNmYXBwcy5pbzEgMB4GCSqGSIb3DQEJARYRZmhhbmlr
QHBpdm90YWwuaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4cn62
@fhanik
fhanik / xml
Created September 23, 2018 05:05
response.xml
<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response Destination="http://localhost:9091/demo-sp/saml/sp/SSO/alias/demo-sp"
ID="36bddec8-a061-4a64-9d0f-11ba02fd876a" IssueInstant="2018-09-23T04:25:28.882Z" Version="2.0"
xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol">
<saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">http://localhost:9092/demo-idp</saml2:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference URI="#36bddec8-a061-4a64-9d0f-11ba02fd876a">
@fhanik
fhanik / test.java
Created April 25, 2018 20:55
Subclass in super class
public class Test {
public static void main(String... args) throws Exception {
C c1 = new C()
.<C>something()
.<C>somethingElse()
.<C>anotherSet();
C c2 = new C()
.<C>anotherSet()
.<C>something()
@fhanik
fhanik / .java
Last active April 25, 2018 20:35
Java Generics Question
public class A {
public T setSomething() {
return this;
}
}
public class B {
public T setSomethingElse() {
return this;
}
{
"timestamp": 1484242542.5184896,
"message": "Request failed: 400: {\"code\"=>170001, \"description\"=>\"Staging error: no available stagers\", \"error_code\"=>\"CF-StagingError\", \"backtrace\"=>[\"/var/vcap/data/packages/cloud_controller_ng/af2626cc79fbb1e3da1883ad80587ff3e6668531.1-ea40931b776aa00ff4cc426bd879d6f37396295b/cloud_controller_ng/lib/cloud_controller/dea/app_stager_task.rb:27:in `stage'\", \"/var/vcap/data/packages/cloud_controller_ng/af2626cc79fbb1e3da1883ad80587ff3e6668531.1-ea40931b776aa00ff4cc426bd879d6f37396295b/cloud_controller_ng/lib/cloud_controller/dea/stager.rb:15:in `stage'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/app/actions/droplet_create.rb:55:in `create_and_stage'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/app/actions/droplet_create.rb:62:in `create_and_stage_without_event'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/app/actions/v2/app_stage.rb:19:in `stage'\", \"/var/vcap/packages/cloud_controller_ng/cloud_cont
[2016-11-22 13:51:52.060] - ???? [http-nio-8080-exec-2] .... DEBUG --- SessionResetFilter: Evaluating user-id for session reset:3d165412-27e2-4e29-882f-35de364b6c11
[2016-11-22 13:51:52.063] - ???? [http-nio-8080-exec-2] .... DEBUG --- SessionResetFilter: Resetting user session for user ID: 3d165412-27e2-4e29-882f-35de364b6c11 Auth Time: 1479851511183 Password Change Time: 1479851512000