Skip to content

Instantly share code, notes, and snippets.

@conorfennell
conorfennell / gist:fba07e5918449bf46878875927fb36eb
Created December 13, 2018 11:31
console producer kafka create key value records
kafka-console-producer --topic conor-topic --broker-list kafka-0:9092 --property "parse.key=true" --property "key.separator=:"
1:{"product_id":"1","type":"jam"}
2:{"product_id":"2","type":"joe"}
3:{"product_id":"3","type":"hey"}
4:{"product_id":"4","type":"ram"}
5:{"product_id":"5","type":"goo"}
6:{"product_id":"6","type":"dam"}
@conorfennell
conorfennell / metadata.md
Created September 4, 2018 10:18
aws metadata

169.254.169.254

@conorfennell
conorfennell / consume.sh
Created June 27, 2018 20:13
consume private __consumer_offsets
echo "exclude.internal.topics=false" > /tmp/consumer.config
#Only consume the latest consumer offsets
./kafka-console-consumer.sh --consumer.config /tmp/consumer.config \
--formatter "kafka.coordinator.group.GroupMetadataManager\$OffsetsMessageFormatter" \
--bootstrap-server ${BOOTSTRAP_SERVER} --topic __consumer_offsets
@conorfennell
conorfennell / install-curl.sh
Created June 3, 2018 11:14
install curl on debian
pt-get -qq update
apt-get remove apt-listchanges
apt-get install curl
@conorfennell
conorfennell / go.sh
Created May 13, 2018 16:41
installing GO with environment variables to set
# Install go/golang with homebrew
brew install go --cross-compile-common
# Set following env variables in ~/.bashrc or ~/.zshrc
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOROOT/bin
@conorfennell
conorfennell / .inputrc
Created May 7, 2018 14:27
allows you to skip words in iterm2
"\e\e[C": forward-word
"\e\e[D": backward-word
realm=Sonatype Nexus
host=127.0.0.1
user=admin
password=admin123
@conorfennell
conorfennell / funspec.scala
Created January 24, 2016 19:38
scalatest FunSpec
import org.scalatest.FunSpec
import scala.collection.mutable.Stack
class ExampleSpec extends FunSpec {
describe("A Stack") {
it("should pop values in last-in-first-out order") {
val stack = new Stack[Int]
stack.push(1)
@conorfennell
conorfennell / .scala
Created January 24, 2016 12:44
inferring schema with dataframes
val sc: SparkContext // An existing SparkContext.
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
// Create the DataFrame
val df = sqlContext.read.json("examples/src/main/resources/people.json")
// Show the content of the DataFrame
df.show()
// age name
// null Michael

Keybase proof

I hereby claim:

  • I am conorfennell on github.
  • I am conorfennell (https://keybase.io/conorfennell) on keybase.
  • I have a public key whose fingerprint is BEC2 979F 714E 8062 9451 FFC7 EC51 456C AFF9 3BBC

To claim this, I am signing this object: