Skip to content

Instantly share code, notes, and snippets.

Data Ingestion with Apache Nifi

The goal is to design simple flows that can be used to ingest data from files by copying and moving files as well as using brokers to send file contents.

Setup

Apache Nifi

You can download Apache Nifi and install it into your machine. Note that the current Apache Nifi needs Java 8. Check the document to see if a minimum configuration should be made for your installation.

Start Nifi server

@hungneox
hungneox / php_upgrade_to_71.sh
Created March 8, 2018 20:33 — forked from pixeline/php_upgrade_to_71.sh
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@hungneox
hungneox / note.desktop
Created November 13, 2017 03:46 — forked from mariocesar/note.desktop
Simple note taking app made with Gtk3 and Python for ElementaryOS. Screenshot: http://i.imgur.com/FIwyvpG.jpg
; Don't forget to change the Icon and Exec path to your needs
; And save this file into the ~/.local/share/applications/ directory
[Desktop Entry]
Version=1.0
Type=Application
Name=Notes
Icon=/home/mariocesar/bin/notes.png
Exec=/home/mariocesar/bin/notes.py
Categories=Accessories;
I just finally had my mind snap into place with understanding of the Y Combinator. Most explanations I read, even the ones using JS, didn't make much sense and were overly long so here follows my own, much simpler explanation. I will be using JS.
We have fibonacci to start with, very simple recursive function.
It's fixed points are 0 and 1, fib(0) = 0, and fib(1) = 1
That's all a fix point means, when the f(x) == x
They are important because they are the only values at which recursion can cease.
Our Fibonacci Function
======================
@hungneox
hungneox / compress.go
Created October 21, 2017 22:50 — forked from bussiere/compress.go
compress uncompress a string in golang
package main
import (
"bytes"
"compress/gzip"
"fmt"
"encoding/base64"
"io/ioutil"
)
@hungneox
hungneox / elasticsearch.md
Created September 5, 2017 11:38 — forked from nicolashery/elasticsearch.md
Elasticsearch: updating the mappings and settings of an existing index

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,
@hungneox
hungneox / tests_for_toptal_on_codility.py
Created April 14, 2017 22:44 — forked from 1st/tests_for_toptal_on_codility.py
My answers for tests on http://codility.com that I passed for company http://toptal.com I use Python language to solve problems.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test that I passed on codility.com for TopTal company
#
# Task #1
def binary_gap(N):
@hungneox
hungneox / IndexingExample.java
Created March 26, 2017 19:46 — forked from mocobeta/IndexingExample.java
Hello Lucene! (6.0.0)
package example;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.*;
import org.apache.lucene.index.*;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.*;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
@hungneox
hungneox / Hackerrank.scala
Last active February 20, 2017 06:06 — forked from cngdean/gist:3702b7be4b6d298dd69c
scala hackerrank i/o stdin stdout
object hackerrank {
object Solution {
def main(args: Array[String]) {
def fact(n: Int): Int = if (n == 1) 1 else n * fact(n - 1)
for (n <- io.Source.stdin.getLines) {
print(fact(Integer.parseInt(n.toString)) + "\n")
}
}
}
@hungneox
hungneox / android-react-native.md
Last active February 9, 2017 17:13 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.

Disclaimer: The instructions are the collective efforts from a few places online. Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.

First off, bundle.

  1. cd to the project directory
  2. Start the react-native packager if not started
  3. Download the bundle to the asset folder: curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"