Skip to content

Instantly share code, notes, and snippets.

Robin Moffatt rmoff

Block or report user

Report or block rmoff

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rmoff /
Last active Mar 14, 2020
cx_Oracle install on MacOS
  1. Download Instant Client:
  1. Unzip and move to /opt

  2. Create symlink

rmoff /
Last active Feb 11, 2020
Calling OBIEE SOAP Web Service from Python using SUDS
# RNM 20140124
# --------------------
# Required
from suds.client import Client
client = Client('http://obiee-server:9704/analytics-ws/saw.dll/wsdl/v7')
# Logon
sessionid = client.service['SAWSessionService'].logon('weblogic','Password01')
View live-coding-ksql.adoc

Live Coding a KSQL Application


rmoff /
Last active Jan 28, 2020
How to view Kafka Connect offsets
$ ./bin/kafka-console-consumer \
  --bootstrap-server localhost:9092 \
  --from-beginning \
  --property print.key=true \
  --topic connect-offsets
["jdbc_source_mysql_foobar_01",{"table":"foobar"}]      {"timestamp_nanos":0,"timestamp":1501796305000}
["jdbc_source_mysql_smt_foobar_02",{"table":"wibble"}]	{"timestamp_nanos":0,"timestamp":1501800342000}
["jdbc_source_mysql_smt_foobar_02",{"table":"wibble"}]	{"timestamp_nanos":0,"timestamp":1501800707000}
rmoff /
Created Jan 24, 2020
Kafka Connect - IllegalArgumentException: Invalid decimal scale: 127

From Mayank Patel on


org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handler
	at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(
	at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(
	at org.apache.kafka.connect.runtime.WorkerSourceTask.convertTransformedRecord(
	at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(
rmoff / gist:cfa93f2d8b722f4e6bf96aedec5074ef
Created Jan 22, 2020
InfluxDB Sink connector example
View gist:cfa93f2d8b722f4e6bf96aedec5074ef
kafkacat -b localhost:9092 -P -t testdata-json4 <<EOF
{ "schema": { "type": "struct", "fields": [ { "type": "map", "keys": { "type": "string", "optional": false }, "values": { "type": "string", "optional": false }, "optional": false, "field": "tags" }, { "field": "sn", "optional": false, "type": "string" }, { "field": "value", "optional": false, "type": "float" } ], "optional": false, "version": 1 }, "payload": { "tags": { "tagnum": "5" }, "sn": "FOO", "value": 500.0 } }
curl -i -X PUT -H "Accept:application/json" \
-H "Content-Type:application/json" http://localhost:8083/connectors/SINK_INFLUX_01/config \
-d '{
"connector.class" : "io.confluent.influxdb.InfluxDBSinkConnector",
"value.converter": "org.apache.kafka.connect.json.JsonConverter",
"value.converter.schemas.enable": "true",
View foo.adoc

Asciidoc code formatting

Example 01

-- SQL Code block
rmoff / kafkacat.adoc
Last active Jan 17, 2020
Show last three messages from a Kafka topic with kafkacat
View kafkacat.adoc
kafkacat -b localhost:9092 \
         -t _kafka-connect-group-01-status \
         -C \
         -o-3 \
         -c3 \
         -f 'Topic %t / Partition %p / Offset: %o / Timestamp: %T\nHeaders: %h\nKey (%K bytes): %k\nPayload (%S bytes): %s\n--\n'
rmoff /
Last active Jan 15, 2020
RMarkdown - repeating child block with changing variable value

When you use knit_expand it appears that the inclusion of the Rmd is done on the first pass, and then the complete document evaluated. This means that a Rmd block referenced in loop with knit_expand will only evaluate changing variables at their last value.

This can be worked around by passing the literal value of the variable at the time of the knit_expand with {{var}} syntax.

This is documented in the knitr_expand docs, but less clear (to an R noob like me) for embedded documents rather than strings.

You can’t perform that action at this time.