Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio drio

🐢
I don't know
View GitHub Profile
from confluent_kafka import Producer
class SimpleProducer:
def __init__(self, brokers: str):
config = {'bootstrap.servers': brokers, 'queue.buffering.max.ms': 1,
'message.send.max.retries': 5, 'retry.backoff.ms': 200,
'message.max.bytes': 104857600,
'default.topic.config': {'request.required.acks': 'all'}}
from confluent_kafka import Consumer, KafkaError, OFFSET_BEGINNING
class SimpleConsumer:
def __init__(self, brokers: str, topic: str, consumer_group: str):
self.topic = topic
self.config = {
'bootstrap.servers': brokers,
'group.id': consumer_group,
#!./.venv/bin/python3
from confluent_kafka import Consumer, KafkaException
import sys
import getopt
import json
import logging
from pprint import pformat
config = {
BASEDIR=$(shell basename $(PWD))
PRJ_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SSH_HOST=h4
GROUP=ss1
OFFSET=0
KB=
ifeq '$(shell hostname -s)' 'hadoop-prod-04'
KB=@docker run -it -v "/home/driode01/kafka-area/":/stuff/ --network=host confluentinc/cp-kafka
@drio
drio / Makefile
Last active February 17, 2022 20:15
BASEDIR=$(shell basename $(PWD))
PRJ_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
SSH_HOST=h4
GROUP=ss1
OFFSET=0
KB=""
ifeq '$(shell hostname -s)' 'hadoop-prod-04'
KB=@docker run -it -v "/home/driode01/kafka-area/":/stuff/ --network=host confluentinc/cp-kafka
@drio
drio / Makefile
Last active December 17, 2021 19:53
log4j bug checker
BIN_DIR=./bin
L4J_ID=CVE-2021-44228
# To make sure some binaries exists in path
BINARIES = curl sh python3
K := $(foreach exec,$(BINARIES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
define PARSE
import json
BIN_DIR=./bin
# To make sure some binaries exists in path
BINARIES = curl sh python3
K := $(foreach exec,$(BINARIES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
all: as_root deps root_grype.json output.txt
output.txt: ./parser.py
@drio
drio / s31.txt
Created December 16, 2021 13:27
esphome s31 sonoff
INFO Successfully compiled program.
Found multiple options, please choose one:
[1] /dev/cu.usbmodem101NTLE2B8162 (USB Controls)
[2] /dev/cu.usbserial-13410 (USB2.0-Ser!)
[3] /dev/cu.usbserial-ABSCDZBH (FT232R USB UART)
[4] Over The Air (sonoff_s31.local)
(number): 3
esptool.py v3.2
Serial port /dev/cu.usbserial-ABSCDZBH
Connecting....
Hi,
This is actually populating a view in the DW, not sure what format it’s expecting. Question for Mike or Larry perhaps? I don’t think anything fails until Tableau tries to create the extract, so it’s not the DW getting angry about the format, it’s Tableau.
SQL below:
create or replace view vaccine_vw
(email, vax1, vax_dt1, vax_dt2, response_date, emplid, utln, last_name, first_name, pref_phone, tufts_email, person_type, campus, employee_home_dept_ld, school, academic_career, risk, deptid, supervisor_name, employee_jobtitle, hire_dt, type_of_entry, date_approved, vax_source)
as
with
@drio
drio / links.py
Created December 7, 2021 20:43
table column names to csv header names