Friday, 19 July 2019

Verify SSL certificate chain

openssl s_client -showcerts -connect server.company.ch:443 -servername server.company.ch

Monday, 24 April 2017

Maven plugin


  1. Define one mojo per plugin goal
  2. Include components.xml to define a lifecycle
  3. Use defaults in mojo
  4. Add a parent POM for common configuration
  5. Define  main artifact with:

    @Parameter(defaultValue = "${project}", readonly = true, required = true)
    private MavenProject project;...project.getArtifact().setFile(xyz);
    ...
  6. Add the following in components.xml:

    <component>
      <role>org.codehaus.plexus.archiver.UnArchiver</role>
      <role-hint>xyz</role-hint>
      <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver</implementation>
      <instantiation-strategy>per-lookup</instantiation-strategy>
    </component>
  7. Add the following (plugin level!) dependency in projects using unpack-dependencies:


    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <version>2.9</version>
      <dependencies>
        <dependency>
          <groupId>com.mycompany.myteam</groupId>
          <artifactId>xyz-maven-plugin</artifactId>
          <version>1.0.0-SNAPSHOT</version>
        </dependency>
      </dependencies>
    </plugin>

Tuesday, 15 March 2016

Start/stop Tomcat as Windows service


  • bin\Tomcat7.exe update --JvmMx=1024 & bin\Tomcat7.exe start
  • bin\Tomcat7.exe stop

Thursday, 21 January 2016

Maven Release

Best practices:
  • do not use Eclipse
  • rename mvn.cmd mvn.bat
  • pass the -B option (batch) to avoid confirmation of svn tag versions ...
  • in case of "CHECKOUT can only be performed on a version resource": perform a SVN clean
  • in case of: "The authenticity of host XXX can't be established" - run "deploy" and accept

Friday, 19 December 2014

Mirth Appliance Clustering Notes


  • Load balancing can be used to stop clustering and retain a virtual IP
  • Channels are synchronized after their initial state is changed to PAUSED
  • Channel DEPLOY triggers synchronization via Appliance Plugin on active node:
    • A deploy event is fired off - log entry:
    • com.mirth.connect.plugins.appliance.Appliance
      onDeploy() called, waking up MirthConnectSync
  • Channel REMOVE does not trigger synchronization
  • Configuration is retrieved through:
    • http://standby/cp/api/mirthconnect/config
      ... which is forwarded on standby node to:
    • http://localhost:8027/api/configuration

Tuesday, 9 December 2014

Deployit Tricks


  1. Use udm for script rules to avoid creation of unwanted steps
  2. Use generic otherwise: this will create create/destroy steps and make templating in properties available
  3. Use dictionaries and moustaches for package parameters to change checksum and force update
  4. Use container properties for script parameters that do not require update when they change
  5. Never use file.File but rather generic.File

Thursday, 7 August 2014

WSO2 STS RequestSecurityToken Example

      <wsse:Security soap:mustUnderstand="true">
         <wsu:Timestamp wsu:Id="Timestamp-62">
            <wsu:Created>2014-07-22T08:34:17Z</wsu:Created>
            <wsu:Expires>2014-07-22T08:34:18Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken wsu:Id="UsernameToken-61">
            <wsse:Username>admin</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
            <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">4TFLJ3AAewWtCkolCRvYbQ==</wsse:Nonce>
            <wsu:Created>2014-07-22T08:34:17.806Z</wsu:Created>
         </wsse:UsernameToken>
      </wsse:Security>
      <wsa:MessageID>uuid:d54cb478-fdd1-4495-84df-2fde515a4591</wsa:MessageID>
      <wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
   </soap:Header>
   <soap:Body>
      <wst:RequestSecurityToken>
         <wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
         <wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType>
         <wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/Bearer</wst:KeyType>
         <wst:Claims wsp:Dialect="http://wso2.org" xmlns:wsp="http://schemas.xmlsoap.org/ws/2005/02/trust">
            <wsid:ClaimType Uri="http://wso2.org/claims/givenname"/>
            <wsid:ClaimType Uri="http://wso2.org/claims/emailaddress"/>
         </wst:Claims>
      </wst:RequestSecurityToken>
   </soap:Body>
</soap:Envelope>