Skip to content

Instantly share code, notes, and snippets.

@ssummer3
ssummer3 / JythonJsonToJsonExample.xml
Last active February 6, 2017 04:38 — forked from mattyb149/JythonJsonToJsonExample.xml
An Apache NiFi template that uses ExecuteScript (with Jython) to perform JSON-to-JSON conversion
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><template><description></description><name>JythonJsonToJsonExample</name><snippet><connections><id>02d12142-26da-459b-938c-427d4f2e44cc</id><parentGroupId>68f8be3e-335a-457d-b83f-96ddaae929e6</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPressureObjectThreshold><destination><groupId>68f8be3e-335a-457d-b83f-96ddaae929e6</groupId><id>60403007-026d-40fe-ba2e-d3f48b6d235f</id><type>PROCESSOR</type></destination><flowFileExpiration>0 sec</flowFileExpiration><labelIndex>1</labelIndex><name></name><selectedRelationships>success</selectedRelationships><source><groupId>68f8be3e-335a-457d-b83f-96ddaae929e6</groupId><id>45c28ea4-b46f-46d3-93f2-3dac1ffadcff</id><type>PROCESSOR</type></source><zIndex>0</zIndex></connections><connections><id>3aa46389-b79d-42b4-93f3-d494ce7338da</id><parentGroupId>68f8be3e-335a-457d-b83f-96ddaae929e6</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDa
@ssummer3
ssummer3 / read-flowfile-contents.py
Last active February 1, 2017 13:14 — forked from ijokarumawak/read-flowfile-contents.py
Example Python script to use from NiFi ExecuteScript processor which reads the first line from an incoming flow file.
from org.python.core.util.FileUtil import wrap
from org.apache.nifi.processors.script import ExecuteScript
first_line = None
flow_file = session.get()
def read_first_line(input):
@ssummer3
ssummer3 / upgradeServicefolderByGit.sh
Last active February 22, 2016 21:32 — forked from monksy/upgradeServicefolderByGit.sh
This gist is responsible for upgrading a system service (systemd) and going into the folder by it's specified user and performing a git pull. After the pull occures bring the service back up.
#! /bin/bash
set -o nounset
set -o errexit
if [[ $# -lt 3 ]]; then
echo "No arguments supplied."
echo " Example: upgradeFoldByBash: [Service name] [service account] [folder]"
exit 1
fi