Skip to content

Instantly share code, notes, and snippets.

View conikeec's full-sized avatar

Chetan Conikee conikeec

View GitHub Profile
@conikeec
conikeec / searchjars
Created January 6, 2020 02:17 — forked from cpeisert/searchjars
Bash script to search Jar files. Each archived file is searched for the specified string.
#!/bin/bash
#Suggested file name: searchjars
if [[ $1 = "-h" || $1 = "--help" ]]
then
echo "Usage: $0 [STRING] [DIRECTORY]..."
echo "Search DIRECTORY(s) for Jar files. For each Jar, search the archived"
echo "files for STRING."
echo ""
echo "Default directory path is the current directory. Multiple directory "
@conikeec
conikeec / README.md
Created August 1, 2017 06:43 — forked from denji/README.md
Remove/Backup – settings & cli for macOS (OS X) – DataGrip, AppCode, CLion, Gogland, IntelliJ, PhpStorm, PyCharm, Rider, RubyMine, WebStorm
@conikeec
conikeec / macosx_remove_java9.sh
Created June 28, 2017 14:36 — forked from schnell18/macosx_remove_java9.sh
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
find . | grep "Cargo.toml$" | # Find all cargo.toml files \
sed 's#/[^/]*$##' | # Remove the filename leaving us with the directories containing cargo.toml files \
xargs -L1 printf "cd \"%s\"; cargo clean; cd -\n" | # Print "cd path/to/crate; cargo clean; cd -" \
bash # Execute
@conikeec
conikeec / Dockerfile
Created December 1, 2013 09:59 — forked from smly/Dockerfile
FROM ubuntu:precise
MAINTAINER Kohei Ozaki <i@ho.lc>
ADD kafka-install.sh /kafka-install.sh
RUN /bin/bash /kafka-install.sh
EXPOSE 2888 3888 2181 9092
# CMD /bin/bash /opt/kafka/run
@conikeec
conikeec / Dockerfile
Created December 1, 2013 09:58 — forked from smly/Dockerfile
FROM ubuntu
ADD influxdb-install.sh /influxdb-install.sh
RUN /bin/bash /influxdb-install.sh
EXPOSE 8083 8086
CMD /opt/influxdb/run
@conikeec
conikeec / kafka.md
Created October 23, 2013 06:34 — forked from ashrithr/kafka.md

Introduction to Kafka

Kafka acts as a kind of write-ahead log (WAL) that records messages to a persistent store (disk) and allows subscribers to read and apply these changes to their own stores in a system appropriate time-frame.

Terminology:

  • Producers send messages to brokers
  • Consumers read messages from brokers
  • Messages are sent to a topic
!/bin/bash
cd /home/hadoop/
sudo apt-get install git
git clone https://github.com/amplab/shark.git -b branch-0.7 shark
#wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/hive-0.9-bin.tgz
#wget http://elasticmapreduce.s3.amazonaws.com/samples/spark/0.7/shark-0.3-bin.tgz

Introduction to Kafka

Installing Kafka:

  1. Download and package:

    git clone https://git-wip-us.apache.org/repos/asf/kafka.git
    cd kafka
    
import java.util.Properties
import kafka.server.KafkaServer
import kafka.server.KafkaConfig
import kafka.producer.ProducerConfig
import kafka.producer.Producer
import kafka.message.Message
import kafka.producer.ProducerData
import kafka.consumer.ConsumerConfig
import kafka.consumer.Consumer
import kafka.utils.Utils