Skip to content

Instantly share code, notes, and snippets.

View apiri's full-sized avatar
😲
😱

Aldrin Piri apiri

😲
😱
View GitHub Profile
@apiri
apiri / add_contrib.sh
Created February 19, 2020 19:17
Adds a user with the specified username to the contributor role for all projects in the NiFi ecosystem
#!/bin/sh -e
# Inspired by https://community.atlassian.com/t5/Jira-questions/How-to-add-user-to-project-role-using-jira-rest-api-and-json/qaq-p/593827#M197010
# instance properties
jira_instance='https://issues.apache.org/jira/rest/api/2'
username='YOUR JIRA USERNAME'
password='YOUR JIRA PASSWORD'
user_to_add=$1
@apiri
apiri / nifi-gitbox-migration.md
Last active March 23, 2021 14:00
Apache NiFi Gitbox Migration

(quick note: a markdown formatted version of this content is available at [3])

All,

There was a flurry of messages as we sought to get some quick details out about our migration to the ASF Gitbox system and I wanted to take this message to consolidate those items into a comprehensive and less hastily composed message.

There are a few different paths to consider and I will try to enumerate those with the associated steps, so please choose your own adventure. Please note that this change does affect ALL repositories in the NiFi community and all references to NiFi refer to our efforts as a whole.

You have one or more repositories checked out. These repositories are either from GitHub (in the case of NiFi, https://github.com/apache/nifi) or git-wip (in the case of NiFi, http://git-wip-us.apache.org/repos/asf/nifi.git). Each of the repositories will need to be handled based on your role in the community and desired functionality.

@apiri
apiri / .tmux.conf
Created March 11, 2020 03:46 — forked from rodricels/.tmux.conf
tmux configuration, mouse copy & paste added
# My tmux configuration, partly based on https://github.com/wbkang/wbk-stow/blob/master/tmux-config/.tmux.conf
# Scroll History
set -g history-limit 50000
# show messages for 4 seconds instead
set -g display-time 4000
# set first window to index 1 (not 0) to map more to the keyboard layout
set-option -g renumber-windows on
@apiri
apiri / nar_listing
Last active August 21, 2019 18:35
Largest NARs in NiFi omitting framework and standard
$ ls -lSh *.nar | head -n 50 | grep -v standard | grep -v framework | awk {'print $5"\t"$9'}
96M nifi-hive-nar-1.10.0-SNAPSHOT.nar
78M nifi-scripting-nar-1.10.0-SNAPSHOT.nar
63M nifi-media-nar-1.10.0-SNAPSHOT.nar
43M nifi-druid-controller-service-api-nar-1.10.0-SNAPSHOT.nar
40M nifi-hbase_2-client-service-nar-1.10.0-SNAPSHOT.nar
40M nifi-other-graph-services-nar-1.10.0-SNAPSHOT.nar
36M nifi-hadoop-libraries-nar-1.10.0-SNAPSHOT.nar
33M nifi-elasticsearch-client-service-nar-1.10.0-SNAPSHOT.nar
32M nifi-flume-nar-1.10.0-SNAPSHOT.nar
@apiri
apiri / Select_and_Count_JSON_Array.xml
Created May 13, 2016 01:00
Generates a sample JSON flowfile which then has: 1) An array of values extracted to an attribute 2) Using the 'Advanced' menu of UpdateAttributes, determines if the result IDs are non-empty and then performs a count using allDelinatedValues to create an id.count attribute with the count of records, otherwise sets id.count to 0 3) Logs the associ…
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><template><description>Generates a sample JSON flowfile which then has: 1) An array of values extracted to an attribute
2) Using the 'Advanced' menu of UpdateAttributes, determines if the result IDs are non-empty and then performs a count using allDelinatedValues to create an id.count attribute with the count of records, otherwise sets id.count to 0
3) Logs the associated variables for convenience</description><name>Select and Count JSON Array</name><snippet><processGroups><id>12bd754b-fddc-4580-bee6-45031fe5a464</id><parentGroupId>0b2d2e0f-8169-43d4-ad17-3a4f5bd90370</parentGroupId><position><x>2977.214817733394</x><y>791.6384429684335</y></position><activeRemotePortCount>0</activeRemotePortCount><comments></comments><contents><connections><id>2036f074-9464-4c92-bb8d-3f3f4f3e00c3</id><parentGroupId>12bd754b-fddc-4580-bee6-45031fe5a464</parentGroupId><backPressureDataSizeThreshold>0 MB</backPressureDataSizeThreshold><backPressureObjectThreshold>0</backPre
@apiri
apiri / alias_dns.py
Created October 28, 2017 16:50 — forked from patrickfuller/alias_dns.py
Enables local DNS resolution of Unifi aliases
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
[core]
excludesfile = /Users/apiri/.gitignore_global
attributesfile = /Users/apiri/.gitattributes
[diff "zip"]
textconv = unzip -p
binary = true
[diff "gz"]
textconv = gzcat
binary = true
[diff "bz2"]
@apiri
apiri / Makefile
Created April 27, 2018 16:17 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@apiri
apiri / config.yml
Created August 21, 2017 19:08
MiNiFi Flow to generate and sink flowfiles
MiNiFi Config Version: 3
Flow Controller:
name: Lots of Logs
comment: ''
Core Properties:
flow controller graceful shutdown period: 10 sec
flow service write delay interval: 500 ms
administrative yield duration: 30 sec
bored yield duration: 10 millis
max concurrent threads: 1
@apiri
apiri / disable_controller_service.sh
Created April 11, 2016 21:15
Apache NiFi: Snippet to stop/disable a controller service's references and then disable the controller service a la curl
#!/bin/sh -e
# Requires jq
base_api_url=http://localhost:8080/nifi-api/controller
cs_uid=934ca9d6-9885-4a40-a347-911d42d00a8f
# Handle CS references by stopping and then disabling
curl -X PUT \
-d "version=$(curl -s ${base_api_url}/revision | jq .revision.version)" \