Skip to content

Instantly share code, notes, and snippets.

@yshadow
yshadow / randomurl.go
Created Sep 6, 2017
Get random number from random.org
View randomurl.go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
@yshadow
yshadow / logstash_cleaner.py
Created Jul 27, 2017
Delete old logstash storages
View logstash_cleaner.py
import urllib.request
from datetime import datetime, timedelta
import sys
server = ''
def delete_one(what):
"""Deletes one logstash storage"""
@yshadow
yshadow / MQTTConsumer.java
Last active Nov 29, 2016
MQTT Sender/Consumer
View MQTTConsumer.java
import org.eclipse.paho.client.mqttv3.*;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class MQTTConsumer {
public static void main(String[] args) {
String topic = "sah/+/#";
@yshadow
yshadow / Main.java
Last active Nov 2, 2016
KTable - KTable problem
View Main.java
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.ByteArraySerializer;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.kafka.streams.KafkaStreams;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KStreamBuilder;
import org.apache.kafka.streams.kstream.KTable;
You can’t perform that action at this time.