Skip to content

Instantly share code, notes, and snippets.

@forestjohnsonpeoplenet
forestjohnsonpeoplenet / gist:f0aa7a807f0f1735ea02279338cdeaf1
Created April 18, 2017 00:00
Kapacitor UDF to make measurement name available to lambdas
package main
import (
"bytes"
"encoding/gob"
"errors"
"log"
"os"
"github.com/influxdata/kapacitor/udf"
@forestjohnsonpeoplenet
forestjohnsonpeoplenet / main.go
Created July 19, 2017 15:40
createTagFromMeasurementName UDF
package main
import (
"errors"
"log"
"os"
"github.com/influxdata/kapacitor/udf/agent"
)
type createTagFromMeasurementNameHandler struct {
@forestjohnsonpeoplenet
forestjohnsonpeoplenet / topic-last-messages.sh
Last active December 14, 2018 21:03
Consume Last N messages from a kafka topic on the command line
#!/bin/bash
if [ -z "$1" ]
then
echo "Missing first argument, zookeeper host port like: my-zookeeper-hostname:2181"
echo "Usage Example: ./topic-last-messages.sh my-zookeeper-hostname:2181 MY_TOPIC_NAME 10 America/Chicago"
exit 1
fi
if [ -z "$2" ]
fjohnson@fjohnson-Latitude-E6540:~/Desktop/test$ ~/Desktop/programs/terraform init
Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
- Downloading plugin for provider "aws" (1.2.0)...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function ipStringToNumber(str) {
var arr = str.split(".");
if(arr.length != 4) {
return null;
}
var hexString = "";
for(var i = 0; i < arr.length; i++) {