Action | Command |
---|---|
START ZOOKEEPER AND KAFKA BROKER | ./bin/kafka-server-start.sh -daemon ./config/server.properties ./bin/zookeeper-server-start.sh --deamon ./config/zookeeper.properties |
CREATE NEW TOPIC | ./bin/kafka-topics.sh --create --topic test --partitions 3 --bootstrap-server localhost:9092 |
GET TOPIC INFO | ./bin/kafka-topics.sh --list --bootstrap-server localhost:9092 ./bin/kafka-topics.sh --describe --bootstrap-server localhost:9092 |
GET LIST OF CONSUMER GROUPS | ./bin/kafka-consumer-groups.sh --list --bootstrap-server localhost:9092 |
GET CONSUMER GROUP INFORMATION (second example is for Azure Event Hub): | ./bin/kafka-consumer-groups.bat --bootstrap-server localhost:9092 --group test --describe ./bin/kafka-consumer-groups.sh --command-config config/consumer.properties --bootstrap-server mynamespace.servicebus.windows.net:9093 --describe --grou |
This file contains hidden or 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
/** | |
* Prgram to test async.queue usage | |
* - gerenates tasks at the rate of "taskGenRate" | |
* - tasks are proocessed at the rate of "taskProcessRate" | |
* - process is paused when queue size reaches "maxQueueSize" | |
*/ | |
const async = require('async'); | |
let i = 0; |
This file contains hidden or 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
/** | |
* Prgram to test async.queue usage | |
* - gerenates tasks at the rate of "taskGenRate" | |
* - tasks are proocessed at the rate of "taskProcessRate" | |
* - process is paused when queue size reaches "maxQueueSize" | |
*/ | |
const async = require('async'); | |
let i = 0; |
This file contains hidden or 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
node_modules |
This file contains hidden or 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
var express = require('express'); | |
var router = express.Router(); | |
var babel = require("babel-core"); | |
var React = require('react'); | |
// Get ReactDOMServer for server side rendering | |
var ReactDOMServer = require('react-dom/server'); | |
// Compile code transformed by babel.transformFileSysnc | |
module._compile(babel.transformFileSync('./public/js/components/header.js').code); | |
// Save it to a accessible header before moudle.exports gets replaaced |
Contained here are trival stuffs. Like with all trival stuffs, its inevitably bound to be forgotten.
Description | Command |
---|---|
List only directories | ls -l | grep ^d |
Count number of files & directories | ls -l | tail +2 | wc -l |
Command prompt coloring__ (Add to ~/.bash_profile) \n Color reference here | export PS1="\e[36;1m[\W] \e[0m" |
Colorizing terminal (Add to ~/.bash_profile) | export CLICOLOR=1 \n export LSCOLORS=gacadxFxCxDxBxegedabagace |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<style type="text/css"> | |
html { height: 100% } | |
body { height: 100%; margin: 0; padding: 0 } | |
#map_canvas { | |
position: absolute; | |
width: 100%; |
This file contains hidden or 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
#include <SoftwareSerial.h> | |
SoftwareSerial mySerial = SoftwareSerial(10, 11);; // RX, TX | |
void setup() { | |
pinMode(10,INPUT); | |
pinMode(11,OUTPIT); | |
mySerial.begin(19200);// this connects to the other USART device | |
Serial.begin(19200); // this one connects to a computer via USB | |
while (!Serial) { |
This file contains hidden or 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
javascript:(function(){%20window.open('http://talkgadget.google.com/talkgadget/popout','myWindow',%20'status=1,%20height=600,width=400,resizable%20=%200,location=0');%20})(); |
NewerOlder