Skip to content

Instantly share code, notes, and snippets.

View alopresto's full-sized avatar
🔏
Focusing on NiFi security...

Andy LoPresto alopresto

🔏
Focusing on NiFi security...
View GitHub Profile
@alopresto
alopresto / gpg_git_signing.md
Last active July 1, 2025 15:59
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@alopresto
alopresto / GroovyProcessor.groovy
Created August 27, 2019 20:15
Sample Apache NiFi custom processor written in Groovy.
class GroovyProcessor implements Processor {
def REL_SUCCESS = new Relationship.Builder().name("success")
.description("FlowFiles that were successfully processed").build()
def ProcessorLog log
@Override
void initialize(ProcessorInitializationContext context) {
log = context.getLogger()
}
@alopresto
alopresto / wwc_resources.md
Last active March 17, 2025 23:19
Women Who Code Resources

Contact me

Strategies

  • YAGNI vs. DRY
  • SOLID Principles
  • Ask clear questions -- explain what you have tried and what is not working
  • Don't reinvent the wheel -- evaluate best practices & existing solutions before attempting something novel
  • Follow conventions -- having the computer understand your code is easy; having other people understand your code is harder
  • Document & explain your decisions & understanding (even options you explored and did not select)
# 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
#
# Unless required by applicable law or agreed to in writing, software
@alopresto
alopresto / routehl7.xml
Created April 6, 2017 18:47
An Apache NiFi template which generates HL7 data and routes it based on a simple comparison.
<?xml version="1.0" ?>
<template encoding-version="1.1">
<description></description>
<groupId>3b737254-015b-1000-aee2-fe3d19b02179</groupId>
<name>RouteHL7</name>
<snippet>
<connections>
<id>015b1002-e563-1455-0000-000000000000</id>
<parentGroupId>3b737254-015b-1000-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
@alopresto
alopresto / Merging PR for 2 branches
Last active May 15, 2024 15:16
Instructions to merge pull requests for multiple branches (master, support, etc.)
#Steps to merge/close pull requests with two main branches
As NiFi now has a 1.0 (master) and 0.x (support) branch, pull requests (PR) must be applied to both. Here is a step-by-step guide for committers to ensure this occurs for all PRs.
1. Check out the latest master
``` $ git checkout master
$ git pull upstream master
```
2. Check out the PR (example #327). This will be in `detached-HEAD` state. (Note: You may need to edit the `.git/config` file to add the `fetch` lines [below](#fetch))
@alopresto
alopresto / cert_commands.md
Created November 23, 2016 03:23
Commonly used certificate and keystore commands for verifying Apache NiFi API/UI TLS MA connections.

Certificate and key commands

1. Verify connection:

$ openssl s_client -connect <host:port> -debug -state -cert <path_to_your_cert.pem> -key <path_to_your_key.pem> -CAfile <path_to_your_CA_cert.pem>

2. Export client cert from PKCS12 keystore to PEM:

@alopresto
alopresto / nifi-checkstyle.xml
Last active November 10, 2021 20:15
NiFi checkstyle rules for IntelliJ IDEA.
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8" />
<property name="severity" value="warning" />
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
@alopresto
alopresto / flow.xml
Created February 2, 2018 15:56
Simple flow to publish and consume JMS messages from an ActiveMQ queue.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flowController encoding-version="1.3">
<maxTimerDrivenThreadCount>10</maxTimerDrivenThreadCount>
<maxEventDrivenThreadCount>5</maxEventDrivenThreadCount>
<registries/>
<rootGroup>
<id>1f73b0f0-0161-1000-fe9c-2d7ad542217c</id>
<name>NiFi Flow</name>
<position x="0.0" y="0.0"/>
<comment/>
nifi (1785 s)
Run clean install on 2020/02/21 20:45:19 with parameters: {profile=true, surefire.skipAfterFailureCount=1}
nifi-standard-processors (357.6 s)
Plugin execution Duration
org.apache.maven.plugins:maven-surefire-plugin:2.22.0:test {execution: default-test} 334.5 s
org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check {execution: check-style} 10.36 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile {execution: default-compile} 4.118 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile {execution: default-testCompile} 3.878 s
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile {execution: groovy-tests} 2.314 s