Author Archives: nigel

Liquibase + Hibernate 5 + Envers + Spring Boot Naming Conventions

Starting with a project using Spring Boot 1.5.8 and Hibernate 5.2.12 I implemented Liquibase to handle database schema changes. This is all straight forward enough, with plenty of other tutorials of how to setup the runtime side. The schema diff … Continue reading

Posted in Gradle, java, JPA | Leave a comment

Telegram notification from Jenkins

The following Groovy PostBuild script can be used to send build notification to Telegram via a Telegram bot account. Note, that this is just using the HTTP POST API, meaning that you can’t interact with Jenkins via Telegram. The message … Continue reading

Posted in Uncategorized | Leave a comment

Gradle version in Jenkins build

Out of the box Jenkins can extract the metadata from Maven build for use as environment variables in the build steps, but it doesn’t have the same support for Gradle. This can be achieved using the EnvInject plugin, and a … Continue reading

Posted in programming | Leave a comment

The strange beast of PyTZ and datetime

The crux of this post is, make sure to never use datetime.replace(tzinfo=…) when working with PyTZ, use tz.localize(…) instead, otherwise you’ll end up with some very strange times. The PyTZ docs do mention this helper method as a way to … Continue reading

Posted in programming, python | Leave a comment

Null and JPA2 Native Query in MSSQL

This post involves a slightly edge case scenario that I encountered a couple of months ago, so hopefully I get all the details right the first time. Essentially, I had a JPA2 project using Hibernate 3.6.10 as the ORM. This … Continue reading

Posted in java | Leave a comment

Saltstack: Passing objects to templates

Quick one. When you pass a variable like this to a template through the context/default parameter it is iterpreted as a literal string: server_xml: file: – managed – name: /opt/tomcat/conf/server.xml – template: jinja – source: salt://tomcat/files/server.xml.tmpl – context: deploy_conf: deploy_conf … Continue reading

Posted in saltstack, technology | Leave a comment

Using MapMessage with ActiveMQ with a Python consumer

Out of the box a STOMP consumer on an ActiveMQ broker will be able to receive TextMessages, but MapMessages will arrive without content. This is because we need to specify a converter to ActiveMQ(?) which we can do in the … Continue reading

Posted in python, Uncategorized | Leave a comment

Simple type checking using property()

Python usually relies of duck typing for type safety, but from time to time it can be handy to enforce some type checking, particularly when new users are going to be using your objects. The following are three utility methods … Continue reading

Posted in programming, python | Leave a comment

Active Directory on EC2/VPC – Using Elastic IP in DNS

The basic use case is this: we want an Active Directory server running in an AWS VPC that can serve machine within the VPC, and in other locations. The AD DC has an Elastic IP to allow external entities to … Continue reading

Posted in AWS | Tagged | Leave a comment

Reloading Tiles2 Config in Spring 3.x

When you are using Tiles for layout composition with Spring you configure it as a view resolver by adding something like this to the applicationContext.xml     <!– Configure the Tiles templates –>     <bean id=”tilesConfigurer”         class=”org.springframework.web.servlet.view.tiles2.TilesConfigurer”>        … Continue reading

Posted in Spring | 1 Comment