#Using wireshark to sniff kafka messages
sudo add-apt-repository ppa:wireshark-dev/stable
sudo apt-get update
sudo apt-get install wireshark
| # https://unix.stackexchange.com/a/10065 | |
| # if stdout is a terminal | |
| if test -t 1; then | |
| # see if it supports colors | |
| ncolors=$(tput colors) | |
| if test -n "$ncolors" && test $ncolors -ge 8; then | |
| bold="$(tput bold)" | |
| underline="$(tput smul)" | |
| standout="$(tput smso)" | |
| normal="$(tput sgr0)" |
| Producer | |
| Setup | |
| bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-one --partitions 6 --replication-factor 1 | |
| bin/kafka-topics.sh --zookeeper localhost:2181/kafka-local --create --topic test-rep-two --partitions 6 --replication-factor 3 | |
| Single thread, no replication | |
| bin/kafka-run-class.sh org.apache.kafka.tools.ProducerPerformance --print-metrics --topic test-rep-one --num-records 6000000 --throughput 100000 --record-size 100 --producer-props bootstrap.servers=kafka_host:9092 buffer.memory=67108864 batch.size=8196 | |
| Single-thread, async 3x replication |
| /* The MIT License (MIT) | |
| * Copyright (c) 2012 Carl Eriksson | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaininga | |
| * copy of this software and associated documentation files (the "Software"), | |
| * to deal in the Software without restriction,including without limitation | |
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| * and/or sell copies of the Software, and to permit persons to whom the Software | |
| * is furnished to do so, subject to the following conditions: | |
| * |
| -- Adapted from these sources: | |
| -- http://peterdowns.com/posts/open-iterm-finder-service.html | |
| -- https://gist.github.com/cowboy/905546 | |
| -- | |
| -- Modified to work with files as well, cd-ing to their container folder | |
| -- Modified to work with iTerm 2 night builds https://iterm2.com/applescript.html | |
| on run {input, parameters} | |
| tell application "Finder" | |
| set my_file to first item of input | |
| set filetype to (kind of (info for my_file)) |
| #!/bin/bash | |
| while : | |
| do | |
| clear | |
| git --no-pager log --graph --pretty=oneline --abbrev-commit --decorate --all $* | |
| sleep 1 | |
| done |
| .PHONY: compile | |
| time=/usr/bin/time | |
| compile: dart typescript coffeescript haxe jsx | |
| dart: | |
| $(time) dart2js -ooutput/dart.js source/simple.dart | |
| typescript: |
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |