Configuring and Using GitHub Readme Instant Preview
GitHub will render project README
and other markdown files to HTML
when displaying projects on its website. Those files must be commited and
pushed before the developer can see the results which can result in
extraneous and unwanted commits. This post discusses installing and using
the GitHub Readme Instant Preview (GRIP) tool for previewing
GitHub-flavored Markdown locally.
Ganymede Kernel 1.1.0.20210614 Released
Ganymede Kernel 1.1.0.20210614 is released.
The Ganymede Kernel is a Jupyter Notebook Java kernel based on JShell combined with an integrated Apache Maven-like POM, support for JVM languages such as Groovy, Javascript, and Kotlin, and support for Apache Spark and Scala binary distributions.
Spring Boot Part 7: Spring Security, Basic Authentication and Form Login, and Oauth2
This article explores integrating Spring Security into a Spring Boot application. Specifically, it will examine:
-
Managing users’ credentials (IDs and passwords) and granted authorities
-
Creating a Spring MVC Controller with Spring Method Security and Thymeleaf (to provide features such as customized menus corresponding to a user’s grants)
-
Creating a REST controller with Basic Authentication and Spring Method Security
java.util.concurrent.ForkJoinPool Example
The combination of RecursiveTask
implementations running
in a ForkJoinPool
allows tasks to be defined that may
spawn subtasks that in turn may run asynchronously. The ForkJoinPool
manages efficient processing of those tasks.
This article presents a simple calculator application to evaluate a formula
defined as a List
presents a single-threaded recursive solution,
and then converts that solution to use RecursiveTasks
executed in a ForkJoinPool
.
Spring Boot Part 6: Auto Configuration and Starters
Spring Boot allows for the creation of “starters:” Convenient dependency
descriptors that often provide some specific but complex functionality.
Examples from Spring Boot discussed in this series of articles include
spring-boot-starter-web
,
spring-boot-starter-thymeleaf
, and spring-boot-starter-actuator
.
This article describes some reusable code targeted for development and
testing (a REST controller @ /jig/bean/{name}.json
and
/jig/bean/{name}.xml
) and the steps necessary to create a Spring Boot
starter. It also describes a starter for the embedded MySQL server process
described in
“Spring Embedded MySQL Server”.
Java Multi-Release JARs
“Adding Support to Java InvocationHandler Implementations for Interface Default Methods”
describes how to implement an InvocationHandler
to
invoke default
interface methods. This mechanism is critical to the
FluentNode
implementation described in
“Java Interface Facades”.
The first article also notes that the
MethodHandles.Lookup
method used with Java 8
would not work with Java 9 which means the whole API will not work on
Java 9 and subsequent JVMs.
This article describes the Java 9-specific solution, refactoring the
InvocationHandler
implementation to separate and
compartmentalize the Java 8 and Java 9-specific solution logic, and
introduces “JEP 238: Multi-Release JAR Files” to deliver a
Java 8 and Java 9 (and later) solutions simultaneously in the same JAR.
Spring Boot Part 5: voyeur, A Non-Trivial Application
This
series
of
articles examines Spring Boot
features. This fifth article in the series presents a non-trivial
application which probes local hosts (with the help of the nmap
command) to assist in developing UPNP and SSDP applications.
Java Stream Tree Walker
This article discusses walking a tree or graph of nodes with a
Java 8 Stream
implementation. The implementation is
codified in a Spliterator
The strategy described herein can
be a useful alternative to implementing a class-hierarchy specific visitor
because only a single per-type method need be defined (often as a Java
lambda).
AWS VPC Set-Up with Ansible
A critical first step to creating an Amazon Web Services (AWS) AWS Elastic Compute Cloud (EC2) configuration is to configure a Virtual Private Cloud (VPC) Often, the default configuration is sufficient for most administrators’ needs but some solutions require an IP address space different than the Amazon default. This article presents the Ansible boilerplate for configuring an alternative IP address space specified by a minimum of parameters: region, VPC CIDR block (e.g., 10.1.0.0/16) and subnet mask size (e.g., 20). The boilerplate calculates subnet CIDR blocks (e.g., 10.1.0.0/20, 10.1.16.0/20, etc…) for each availability zone within the region.
CentOS In-Place Upgrade
CentOS 8.0 was released on September 24th, 2019 and 8.1 on January 15, 2020. This article describes how a CentOS 7 may be upgraded in place.
Spring Boot Part 4: Spring MVC with Thymeleaf
This series of articles will examine Spring Boot features. This fourth
installment discusses Spring MVC, templating in Spring, and creates a
simple internationalized clock application as an example. The clock
application will allow the user to select Locale
and
TimeZone
.
Spring Boot Part 3: Dependency Injection and @RestController
This series of articles will examine Spring Boot features. This third
article builds on the series by demonstrating the basics of Spring
Dependency Injection. To create demonstrable code the example also
creates a @RestController
implementation, a simple
shared property server where clients may put and get property values.
Spring Boot Part 2: Static Resources
This series of articles will examine
Spring Boot
features. This second article builds on the
first article
by demonstrating how to serve static resources from the classpath
and
WebJars.
Spring Boot Part 1: Minimum Web Server, Devtools, and Actuator
This series of articles will examine Spring Boot features. This first article will look at the minimum Spring Boot application, Spring Boot Devtools, and the Spring Boot Actuator. There are already a wealth of resources for Spring Boot including the Spring Initializr; these articles do not intend to replace these resources but instead provide a collection of skeletal projects which may be quickly and easily used to experiment with specific Spring Boot features.
Java Enums as Predicates
This article examines extending Java Enum
s used as property values
within JavaBeans combined with the Java Stream API to create and extend
fluent interfaces. From
Wikipedia:
Spring Embedded MySQL Server
This article describes a method to create a mysqld
Process
managed by the Spring Boot Application conditioned on the definition of an
application.properties
property, ${mysqld.home}
.
Maven toolchains.xml Script
Apache Maven has introduced Maven Toolchains to ease configuring plug-ins
and to avoid specifying any JDK location in the project POMs. Available
JDKs are configured in ${HOME}/.m2/toolchains.xml
. This article
introduces a script to automate the generation of the toolchains.xml
file, toolchains.xml.bash
.
FiveThirtyEight "What’s Your Best Scrabble String?" Solution
FiveThirtyEight presented a challenge to order Scrabble tiles to generate the largest score.
Spring PasswordEncoder Implementation
Spring Security provides multiple PasswordEncoder
implementations with BCRYPT
as the recommended implementation.
However, the use-case of sharing an authentication database with an external
application, Dovecot, is examined in this article.
Java Interface Facades
This article discusses extending final implementation classes through the
use of Proxy
InvocationHandler
s and
Default Interface Methods introduced in Java 8. The specific use case
described here is to add fluent methods to Document Object Model (DOM) to
enable Javadoc implementations to provide snippets of well-formed
HTML/XML.
Java Streams and Spliterators
This article discusses implementing Java 8 Stream
s and
the underlying Spliterator
implementation. The nontrivial
implementations described here are Permutations
and
Combinations
streams, both of which provide a stream of
List<T>
instances representing the combinations of the argument
Collection<T>
.
Adding Support to Java InvocationHandler Implementations for Interface Default Methods
Java 8 introduced default methods to interfaces. Existing
InvocationHandler
implementations will not invoke
default interface methods. This short article documents the necessary
changes.
A java.net.ResponseCache Implementation
The Java URLConnection
mechanism may be configured to use
a ResponseCache
. This article describes a
ResponseCache
implementation.
Google Cloud Platform App Engine Deployment Experience
This article describes some of the challenges and pecularities of deploying
an annotated
@SpringBootApplication
application to Google Cloud Platform.
AWS EC2 User Data Shell Script
Creators of Amazon Elastic Compute Cloud (EC2) instances may stuff a script into the “user data” which will be executed on the instance’s initial boot. This script may be useful to mount Elastic Block Store (EBS) volumes as file systems since those volumes cannot be attached to the instance until after the instance has been created and started.
This article presents a script which leverages the functions provided in the
aws.rc
script described in a previous
article.
automount/autofs Executable Map for Amazon EBS Volumes
Amazon Web Services (AWS) provides their Elastic Block Store (EBS) service for persistent block storage for Amazon Elastic Compute Cloud (EC2) instances in the AWS cloud. Linux/UNIX file systems may be created on these volumes and then attached to an instance and subsequently mounted as a file system. However, the EC2 instance must be started before the volume can be attached which may lead to significant challenges in architecture design as both the numbers of instances and volumes increase.
This article presents an implementation of an executable automount map which may be leveraged to attach and mount EBS volumes on demand. The implementation includes a mechanism for detaching unmounted EBS volumes so they me be attached to different instances in the future.
Ghost Theme and Site Development
This is the inaugural post to this blog. Specifically, this post documents setting up this blog.