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
rmoff / foo.md
Last active Mar 14, 2020
cx_Oracle install on MacOS
View foo.md
  1. Download Instant Client:
  • instantclient-basic-macos.x64-11.2.0.4.0.zip
  • instantclient-sdk-macos.x64-11.2.0.4.0.zip
  • instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
  1. Unzip and move to /opt

  2. Create symlink

@rmoff
rmoff / obiee_soap.py
Last active Feb 11, 2020
Calling OBIEE SOAP Web Service from Python using SUDS
View obiee_soap.py
# RNM 20140124
#
# https://twitter.com/rmoff/
# --------------------
# 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

Introduction

View OGG_Swingbench_Extract.md
@rmoff
rmoff / connect-offsets.md
Last active Jan 28, 2020
How to view Kafka Connect offsets
View connect-offsets.md
$ ./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
rmoff / smt.md
Created Jan 24, 2020
Kafka Connect - IllegalArgumentException: Invalid decimal scale: 127
View smt.md

From Mayank Patel on http://cnfl.io/slack

Problem:

org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handler
	at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)
	at org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)
	at org.apache.kafka.connect.runtime.WorkerSourceTask.convertTransformedRecord(WorkerSourceTask.java:284)
	at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:309)
@rmoff
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 } }
EOF
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
SELECT SOME_FIELD FROM FOO;
@rmoff
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
rmoff / 00.README.md
Last active Jan 15, 2020
RMarkdown - repeating child block with changing variable value
View 00.README.md

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.