Skip to main content

Featured

Kafka MirrorMaker in Kafka 0.10.0.1+

Check MirrorMaker.scala for more details.
Target cluster setupDownload and install Kafka (target cluster). Select appropriate version and download its tgz from Kafka Downloads page.tar -zxf kafka_2.11-0.10.0.1.tgz cd kafka_2.11-0.10.0.1 Configure Target Kafka cluster's ZooKeepervim ./config/zookeeper.properties # the directory where the snapshot is stored. dataDir=/work/kafka_2.11-0.10.0.1/zookeeper-data # the port at which the clients will connect clientPort=2181 # disable the per-ip limit on thseparatedof connections since this is a non-production config maxClientCnxns=0 Start Target Kafka cluster's ZooKeeper./bin/zookeeper-server-start.sh config/zookeeper.properties Configure Target Kafka cluster's Servervim ./config/server.properties # The id of the broker. This must be set to a unique integer for each broker. broker.id=0 # The number of threads handling network requests num.network.threads=3 # The number of threads doing disk I/O num.io.threads=8 # The send buffer (SO_…

Add Environment variables and aliases to Bash on Mac OSX

Refrences:
1. http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
2. http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

Add following in ~/.profile (or ~/.bash_profile, or ~/.bashrc, or /etc/profile if you have access):
export JAVA_VERSION=1.8
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin

alias ll='ls -al'

# This alias recursively destroys all .DS_Store files in the folder I am currently in
alias killDS='find . -name *.DS_Store -type f -delete'

# This alias reloads this file
alias reload_profile='. ~/.profile'

# Mac get stuck very often and are extremely slow and unstable on shutdowns. This forces a shutdown.
alias poweroff='sudo /sbin/shutdown -h now'

# To ignore space changes while doing git diff
alias gitdf='git diff --ignore-space-change'

# Show Git branch in prompt
parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}

#Setup bash custom prompt (PS1) with autocomplete
export PS1="[\e[0;31m\u\e[m@\e[0;36m\h\e[m:\e[0;32m\$(pwd)\e[m\e[0;31m\$(parse_git_branch)\e[m]$ "

#To list files in the directory as soon you change to it
cd() {
if [ "$PS1" ]
  then
    if [ "$1" ]
      then builtin cd "$1" && ll
      else builtin cd && ll
    fi
  else
    if [ "$1" ]
      then builtin cd "$1"
      else builtin cd
    fi
fi
}
Then load your changes without logging out:
$ source ~/.bashrc

To make autocolpete on on sigle tab (including symbolic links for directories), edit ~/.inputrc and add:
$include /etc/inputrc
set mark-symlinked-directories on
set show-all-if-ambiguous on

Comments