FROM ubuntu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y cmatrix && \
rm -rf /var/lib/apt/lists/*
CMD ["cmatrix"]
Derived from:
- Redpanda on Google Cloud (w/ Helm & Kubernetes) https://www.youtube.com/watch?v=DbmbXZVL7lw
- Redpanda docs: https://docs.redpanda.com/current/deploy/deployment-option/self-hosted/kubernetes/gke-guide
$ helm repo add redpanda https://charts.redpanda.com
https://www.moosejs.com/ Docs: https://docs.moosejs.com/
The create-moose-app is a NodeJS script that creates (seeds) the a moosejs application.
Issuing the following command creates an initial project folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
""" | |
Solution Notes: | |
- The code shown here is larger than necessary. I think it's easier to discuss the code solution before it's optimized. | |
- There are also number of helper functions / features which I could have delete. | |
- One of my early design decisions was to go with immutable states. That allows me to playback moves as I spent time learning the rules of the game. | |
- This also proved to be an important decision when it came to my own testing and validation. | |
- Since I chose to use immutable states I also decided to go with a State Space Search Tree. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker stop hydra-router | |
docker stop redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOSTIP=`echo "show State:/Network/Global/IPv4" | scutil | grep PrimaryInterface | awk '{print $3}' | xargs ifconfig | grep inet | grep -v inet6 | awk '{print $2}'` | |
echo "Host IP: ${HOSTIP}" | |
docker run -d -p 6379:6379 --rm --name redis redis:6.0.6 | |
sleep 5 | |
docker run -d -p 5353:5353 --add-host host:${HOSTIP} --rm --name hydra-router pnxtech/hydra-router:1.7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Project on Github: https://github.com/cjus/brainlights | |
#include <Arduino.h> | |
#include <string.h> | |
#include <math.h> | |
#include <Wire.h> | |
#include <Adafruit_NeoPixel.h> | |
#define DEBUG | |
#define LEDPIN 4 | |
#define BUTTONPIN 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const redis = require('redis'); | |
const moment = require('moment'); | |
class JobQueue { | |
constructor() { | |
this.config = null; | |
this.redisdb = null; | |
this.redisKey; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async checkForTasks(callback) { | |
let message; | |
try { | |
message = await this.hydra.getQueuedMessage(this.serviceName); | |
} catch (e) { | |
this.logger('fatal', e); | |
return; | |
} | |
// message processing code lines deleted here... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async queueAggregatorJob(jobID, status, statusMessage) { | |
return hydra.queueMessage(hydra.createUMFMessage({ | |
to: 'aggregator-svcs:/', | |
frm: 'segment-transfer-svcs', | |
typ: 'process', | |
bdy: { | |
jobID, | |
status, | |
statusMessage | |
} |
NewerOlder