# consumer URL, should be in one line, for readability added new lines
kafka.url=kafka://
${kafka.topic}
?
brokers=${kafka.broker}&
&groupId=${kafka.groupId}
serializerClass=org.apache.kafka.common.serialization.StringSerializer&
keySerializerClass=org.apache.kafka.common.serialization.StringSerializer&| #!/bin/bash | |
| # Creates a timelapse video of today's photos | |
| # Author: Andre Jacobs | |
| # Overview: | |
| # I am using a Raspberry Pi Zero W with the Camera V2 module to take timelapse photography | |
| # The idea came from: | |
| # https://blog.alexellis.io/raspberry-pi-timelapse/ | |
| # https://github.com/alexellis/phototimer | |
| # Today's timelapse directory (e.g. 2019/7/12) |
| # Gawk version | |
| # Remote | |
| grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
| # Local | |
| grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
| # No Gawk | |
| # Local | |
| grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.
- List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describeNote the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.
- Reset the consumer offset for a topic (preview)
The >>> operator allows a sequence of values to be returned:
myMock.someCall() >>> ['first value', 'second value', 'third value', 'etc']This returns each string in turn. Behaviour (such as throwing exceptions) in closures cannot be used by this operator.
The >> operator allows value or behaviour (closures) to be returned
| #!/usr/bin/env python3 | |
| # A text filter for BBEdit. If it encounters a JSON error, it writes an error message | |
| # to stderr (appears in a new BBEdit window) and leaves the original text unaltered. | |
| # c.f. http://crisp.tumblr.com/post/2574967567/json-pretty-print-formatting-in-bbedit | |
| # c.f. http://blog.scottlowe.org/2013/11/11/making-json-output-more-readable-with-bbedit/ | |
| import json | |
| import sys | |
| def main(): |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
| ZigZag-Encoding | |
| --------------- | |
| Maps negative values to positive values while going back and | |
| forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
| (i >> bitlength-1) ^ (i << 1) | |
| with "i" being the number to be encoded, "^" being | |
| XOR-operation and ">>" would be arithemtic shifting-operation |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.