Skip to content

Instantly share code, notes, and snippets.

@Raffiki
Raffiki / docker-compose.yml
Last active April 1, 2024 09:41
nifi clustering
nifi1:
image: ixortalk/vc.nifi
container_name: nifi1
privileged: true
user: root
expose:
- 8080
- 8081
ports:
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
var server,
express = require('express'),
fs = require('fs'),
app = express(),
Busboy = require('busboy')
app.post('/files', function(req, res) {
var busboy = new Busboy({
headers: req.headers
});
@Raffiki
Raffiki / api
Created November 13, 2015 08:30
import { Schema, arrayOf, normalize } from 'normalizr';
import { camelizeKeys } from 'humps';
import 'isomorphic-fetch';
// Extracts the next page URL from Github API response.
function getNextPageUrl(response) {
const link = response.headers.get('link');
if (!link) {
return null;
}
input {
stdin {
type => "stdin-type"
}
filter {
json {
source => "message"
}
}
## /etc/collectd/collectd.conf generated for vps3.sparklingclouds.nl by Ansible
### Config Type: CollectD Client
Hostname $HOSTNAME
FQDNLookup false
Interval 30
ReadThreads 1
LoadPlugin syslog
@Raffiki
Raffiki / gist:9778679
Last active August 29, 2015 13:57
install Graphite Collectd on Ubuntu 13.10
#collectd
sudo apt-get install collectd
sudo vim /etc/collectd/collectd.conf
LoadPlugin "write_graphite"
<Plugin "write_graphite">
<Carbon>
Host "localhost"
Port "2003"
#!/usr/sbin/dtrace -s
syscall::unlink:entry
/copyinstr(arg0) == $$1/
{
printf("%s removed %s using %s at %Y\n", execname, $$1, probefunc, walltimestamp);
}
syscall::unlinkat:entry
/copyinstr(arg1) == $$1/
#!/usr/sbin/dtrace -s
syscall::unlink:entry
/copyinstr(arg0) == "foo"/
{
printf("%s removed foo using %s at %Y\n", execname, probefunc, walltimestamp);
}
syscall::unlinkat:entry
/copyinstr(arg1) == "foo"/
@Raffiki
Raffiki / gist:8039309
Last active December 31, 2015 20:19
js examples
//only functions create new scope
//beware of creating closures in a for loop since the scope doesn't change after an iteration of the loop
//the solution in such a case might be returning another closure
var arr = []
for (var i = 0 ; i < 10 ; i++) {
arr[i] = function () {
console.log(i)
}
}