postfix


DNS


Using my domain, riowing.net, on DNS domains.google.com as example.

Here are some output of nslookup:

nslookup.exe tech.riowing.net
Server: resolver1.opendns.com. DNS used since we didn’t explicitly say which one to use
“Non-authoritative answer” because tech.riowing.net is not directly on this server
Address: 52.8.195.114 this is the IP returned for tech.riowing.net
To get rid of the word “Non-authoritative”, we do:
nslookup.exe tech.riowing.net ns-cloud-c1.googledomains.com

nslookup.exe -qt=mx riowing.net
riowing.net MX preference = 10, mail exchanger = riowing.net
Therefore, emails to me@riowing.net go to host riowing.net, which is also my email server name.

“Registered hosts” or “glue records” is to avoid loop when name server used is subdomain, e.g. dns.riowing.net. I don’t need this since I use Google Domains nameservers instead of my own, e.g. ns-cloud-c1.googledomains.com

remote kafka


The official demo, kafka.apache.org/quickstart, shows how to run kafka with everything on localhost.
Here are the steps to run kafka server remotely.
tech.riowing.net is the server, which runs kafka zookeeper and brokers on ubuntu in aws
WSL, a windows desktop, runs kafka producer and consumer on WSL ubuntu on local windows

On both AWS and WSL:
download kafka tar ball and extract:
http://apache.claz.org/kafka/2.3.0/kafka_2.12-2.3.0.tgz 57M
extract to: /mnt/ebs/rio/opensrc/kafka/kafka_2.12-2.3.0
install java. I got OpenJDK 64-Bit Server VM build 11

On AWS, server side:
export KAFKA_OPTS=”-Djava.net.preferIPv4Stack=True”
otherwise it’s IPV6
edit server.properties so that:
advertised.listeners=PLAINTEXT://tech.riowing.net:9092
otherwise client report error: Connection to node 0 (localhost/127.0.0.1:9092)
start zookeepter:
bin/zookeeper-server-start.sh config/zookeeper.properties
start server:
bin/kafka-server-start.sh config/server.properties

On WSL, client side:
Send message:
bin/kafka-console-producer.sh –broker-list tech.riowing.net:9092 –topic test
type some text, ctrlD to exit
Check message received:
bin/kafka-console-consumer.sh –bootstrap-server tech.riowing.net:9092 –topic test –from-beginning
ctrlC to exit

Roku ECP


Roku TV can be controlled by ECP External Control Protocol.
For example, by running a curl command, a channel can be started or switch to playing another video.
Here are two sample commands:
1. start channel and playing the gym video:
Cmd: curl -d ” ‘http://10.15.26.39:8060/launch/dev?contentID=Gym&mediaType=movie’
“contentID=Gym” is to tell channel which piece of video to play once started.
2. while channel is already running, switch to another video, which is dance party.
curl -d ” ‘http://10.15.26.39:8060/input?contentID=Party&mediaType=movie’

How it is done:
Firmware interpret “launch/dev” as launching the channel whose channel ID is “dev”
Firmware passes {contentId: Gym, type: mp4} to channel entry function Main(args) so that channel knows what to do, e.g. what video to play.
Firmware interpret “input?contentID=Party” as sending {contentID: Party} to the current running channel so that channel, through roInput, knows what to do, e.g. in this case, switching to video called Party.

EcpThe channel source code: http://riowing.net/p/deepLinkDstPost.zip
The screen recording: http://riowing.net/p/Ecp.mp4, which show the TV on left, and my linux box on the right.