Skip to content

Instantly share code, notes, and snippets.

View gist:db27b2d997960a59820287fc93d18deb
function ipStringToNumber(str) {
var arr = str.split(".");
if(arr.length != 4) {
return null;
}
var hexString = "";
for(var i = 0; i < arr.length; i++) {
View diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View shell history.txt
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.
@forestjohnsonpeoplenet
forestjohnsonpeoplenet / topic-last-messages.sh
Last active Dec 14, 2018
Consume Last N messages from a kafka topic on the command line
View topic-last-messages.sh
#!/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" ]
@forestjohnsonpeoplenet
forestjohnsonpeoplenet / main.go
Created Jul 19, 2017
createTagFromMeasurementName UDF
View main.go
package main
import (
"errors"
"log"
"os"
"github.com/influxdata/kapacitor/udf/agent"
)
type createTagFromMeasurementNameHandler struct {
@forestjohnsonpeoplenet
forestjohnsonpeoplenet / gist:f0aa7a807f0f1735ea02279338cdeaf1
Created Apr 18, 2017
Kapacitor UDF to make measurement name available to lambdas
View gist:f0aa7a807f0f1735ea02279338cdeaf1
package main
import (
"bytes"
"encoding/gob"
"errors"
"log"
"os"
"github.com/influxdata/kapacitor/udf"