Skip to content

Instantly share code, notes, and snippets.

@jhines2k7
jhines2k7 / docker-services-running-in-host.txt
Created March 12, 2018 21:36
Schema registry and Kafka Rest services running in host
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
27230ebe5e00 confluentinc/cp-kafka-rest:4.0.0 "/etc/confluent/dock…" 57 seconds ago Up 55 seconds 8082/tcp kafka-rest.1.q4mh5q9y2u
3ckw93w2j83k7nh
d125612e2e3b confluentinc/cp-schema-registry:4.0.0 "/etc/confluent/dock…" 26 minutes ago Up 26 minutes 8081/tcp schema-registry.1.s1c8z
jyjnkr2i7g7n44txvr07
@jhines2k7
jhines2k7 / schema-registry-service-logs.txt
Created March 12, 2018 21:34
Schema registry service logs
schema-registry.1.s1c8zjyjnkr2@webtools | ===> ENV Variables ...
schema-registry.1.s1c8zjyjnkr2@webtools | ALLOW_UNSIGNED=false
schema-registry.1.s1c8zjyjnkr2@webtools | COMPONENT=schema-registry
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_DEB_VERSION=1
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_MAJOR_VERSION=4
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_MINOR_VERSION=0
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_MVN_LABEL=
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_PATCH_VERSION=0
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_PLATFORM_LABEL=
schema-registry.1.s1c8zjyjnkr2@webtools | CONFLUENT_VERSION=4.0.0
@jhines2k7
jhines2k7 / telnet-results.txt
Created March 12, 2018 21:33
Results of trying to communicate with containers in the network
root@da24191e1d3a:/# telnet zk1 22181
Trying 10.0.0.6...
Connected to zk1.
Escape character is '^]'.
stat
Zookeeper version: 3.4.10-39d3a4f269333c922ed3db283be479f9deacaa0f, built on 03/23/2017 10:13 GMT
Clients:
/10.0.0.45:50668[1](queued=0,recved=195,sent=196)
/10.0.0.18:41530[1](queued=0,recved=2009,sent=2009)
/10.0.0.48:58764[0](queued=0,recved=1,sent=0)
@jhines2k7
jhines2k7 / jhinesconsulting-post-bodies.json
Last active February 25, 2018 15:57
Example of post bodies used to create project and contact objects
{
"project_name": "Idea Foundry Data Integration",
"detail_image": "detail.jpg",
"home_image": "home.jpg",
"description": "It's all coming together now",
"solution": "This is the project solution, but it's not really working right now",
"client_name": "JHines Consulting",
"duration": "6 months",
"date": "2018",
"budget": "$6000"
@jhines2k7
jhines2k7 / jdbc_sink.txt
Last active February 23, 2018 15:31
Command for running jdbc sink app starter
java -jar jdbc-sink-kafka-10-1.3.1.RELEASE.jar --server.port=0 --spring.cloud.stream.bindings.input.destination=createproject --spring.cloud.stream.kafka.binder.zkNodes=${ZOOKEEPER_HOST} --spring.cloud.stream.kafka.binder.brokers=${KAFKA_HOST} --spring.datasource.url=jdbc:mysql://${PROJECTS_DB_HOST}:${PROJECTS_DB_PORT}/${PROJECTS_DB_NAME} --spring.datasource.username=${JHC_DB_USER} --spring.datasource.password=${JHC_DB_PASS} --spring.datasource.driver-class-name=org.mariadb.jdbc.Driver --jdbc.table-name=project --jdbc.columns=id,name,detail_image,home_image,description,solution,client_name,duration,date,budget
@jhines2k7
jhines2k7 / HttpSourceConfiguration.java
Last active February 7, 2018 23:57
Patched configuration class to add cors support
/*
* Copyright 2015-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jhines2k7
jhines2k7 / jdbc-sink-Dockerfile
Created February 6, 2018 12:45
Dockerfile for Spring Cloud Stream app starter JDBC sink
FROM java:8
VOLUME /tmp
ADD jdbc-sink-kafka-10-1.2.0.RELEASE.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar", "--server.host=0", "--spring.cloud.stream.bindings.input.destination=reconcileoccurrence", "--spring.cloud.stream.kafka.binder.zkNodes=${ZOOKEEPER_HOST}", "--spring.cloud.stream.kafka.binder.brokers=${KAFKA_HOST}", "--spring.datasource.url=jdbc:mysql://${DB_HOST}:${IF_DB_PORT}/ideafoundry?user=ideafoundry", "--spring.datasource.password=${IF_DB_PASSWORD}", "--spring.datasource.driver-class-name=org.mariadb.jdbc.Driver", "--jdbc.table-name=reconcile_occurrence", "--jdbc.columns=id,record_id,starts_at"]
@jhines2k7
jhines2k7 / typewriter-effect.js
Created January 29, 2018 10:45
Typewritter effect for text using javascript
var TxtType = function(el, toRotate, period) {
this.toRotate = toRotate;
this.el = el;
this.loopNum = 0;
this.period = parseInt(period, 10) || 2000;
this.txt = '';
this.tick();
this.isDeleting = false;
};
author: {
id: 1
firstName: "",
lastName: "",
bio: "",
books: [1,2,3,4],
active: true
}
user: {
@jhines2k7
jhines2k7 / pipp.sh
Created November 28, 2017 18:03
bash script demonstrating how to parse commandline variables
#!/bin/bash
package="" # Default to empty package
target="" # Default to empty target
# Parse options to the `pip` command
while getopts ":h" opt; do
case ${opt} in
h )
echo "Usage:"