Skip to content

Instantly share code, notes, and snippets.

@ottobackwards
ottobackwards / nifi-ca.sh
Created September 20, 2023 10:54 — forked from hawko2600/nifi-ca.sh
Java keytool based CA and certificate signer for Apache NiFi
#!/bin/bash
CANAME=${CANAME:-rootCA}
CA2NAME=${CA2NAME:-intermediateCA}
NIFI_SERVER=${NIFI_SERVER:-nifi01}
DOMAIN=${DOMAIN:-localdomain}
IP_ADDRESS=${IP_ADDRESS:-127.0.0.1}
EMAIL="${EMAIL:-nifi@${NIFI_SERVER}.${DOMAIN}}"
EXT="SAN=IP:127.0.0.1,IP:${IP_ADDRESS},DNS:${NIFI_SERVER}.${DOMAIN},DNS:${NIFI_SERVER},DNS:localhost,EMAIL:${EMAIL}"
EXT2="KeyUsage=digitalSignature,keyEncipherment,nonRepudiation,dataEncipherment,keyAgreement,keyCertSign,cRLSign"
@ottobackwards
ottobackwards / nifi-ca.sh
Created September 20, 2023 10:54 — forked from hawko2600/nifi-ca.sh
Java keytool based CA and certificate signer for Apache NiFi
#!/bin/bash
CANAME=${CANAME:-rootCA}
CA2NAME=${CA2NAME:-intermediateCA}
NIFI_SERVER=${NIFI_SERVER:-nifi01}
DOMAIN=${DOMAIN:-localdomain}
IP_ADDRESS=${IP_ADDRESS:-127.0.0.1}
EMAIL="${EMAIL:-nifi@${NIFI_SERVER}.${DOMAIN}}"
EXT="SAN=IP:127.0.0.1,IP:${IP_ADDRESS},DNS:${NIFI_SERVER}.${DOMAIN},DNS:${NIFI_SERVER},DNS:localhost,EMAIL:${EMAIL}"
EXT2="KeyUsage=digitalSignature,keyEncipherment,nonRepudiation,dataEncipherment,keyAgreement,keyCertSign,cRLSign"
@ottobackwards
ottobackwards / Links.txt
Created August 30, 2023 01:17
Lunar vim links
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@ottobackwards
ottobackwards / code-python-setup.fish
Created September 2, 2021 20:18 — forked from schwa/code-python-setup.fish
Fish script for setting up a python project with poetry, pyenv, visual code, etc…
#!/usr/bin/env fish
### Fish function for setting up a Visual Studio Code python project using Poetry and Pyenv
### How to install: copy this into your ~/.config/fish/functions directory
### How to use: mkdir a project direct, cd into it, and run the code-python-setup function
### This function will:
### * install dependencies
### * select and/or install if necessary a particular python version (using pyenv)
### * set up a poetry virtual environment
### * configure the vscode project settings with the correct interpreter
import json
import xmltodict
import nipyapi
from requests import Response
with open("Acqusition_and_Processing.xml", "r") as template_file:
data = template_file.read()
# in order to get the TemplateEntity we need to
@ottobackwards
ottobackwards / test.py
Created October 25, 2020 18:27
Open exported nifi template with nipyapi
import json
import xmltodict
import nipyapi
class PhonyResponse(object):
"""
Phony Response object since nipyapi assumes it is working with network replies at the top level
"""
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.plc4x:plc4j-utils-pcap-replay:jar:0.7.0
[WARNING] 'build.plugins.plugin.version' for org.sonarsource.scanner.maven:sonar-maven-plugin is missing. @ line 86, column 15
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.plc4x:plc4j-utils-pcap-shared:jar:0.7.0
[WARNING] 'build.plugins.plugin.version' for org.sonarsource.scanner.maven:sonar-maven-plugin is missing. @ line 71, column 15
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.plc4x:plc4j-utils-raw-sockets:jar:0.7.0
[WARNING] 'build.plugins.plugin.version' for org.sonarsource.scanner.maven:sonar-maven-plugin is missing. @ line 97, column 15
@ottobackwards
ottobackwards / gist:3f7e646ae1bb490540ce8619a8b2ddd0
Created April 30, 2020 04:24
InvokeHTTP multipart Template
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.3">
<description></description>
<groupId>c76d1cdc-0171-1000-a033-d73b22d78059</groupId>
<name>InvokeHttpMultipart</name>
<snippet>
<connections>
<id>65a21a20-eb2a-34d4-0000-000000000000</id>
<parentGroupId>d8cc0c68-76d5-3362-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>
@ottobackwards
ottobackwards / nifi-app.log
Created April 30, 2020 03:37
snippet of the nifi-app.log with HandleHttpRequest output for multipart/form data sent form InvokeHTTP
2020-04-29 23:32:29,851 INFO [Timer-Driven Process Thread-10] o.a.n.processors.standard.LogAttribute LogAttribute[id=c7858726-0171-1000-55d6-6372712a7baa] logging for flow file StandardFlowFileRecord[uuid=9e8bdfd8-41e8-4901-99e3-63cab3803031,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1588190727403-1, container=default, section=1], offset=188090, length=18],offset=0,name=9e8bdfd8-41e8-4901-99e3-63cab3803031,size=18]
--------------------------------------------------
Standard FlowFile Attributes
Key: 'entryDate'
Value: 'Wed Apr 29 23:32:29 EDT 2020'
Key: 'lineageStartDate'
Value: 'Wed Apr 29 23:32:29 EDT 2020'
Key: 'fileSize'
Value: '18'
FlowFile Attribute Map Content