Skip to content

Instantly share code, notes, and snippets.

Start Kafka service

The following commands will start a container with Kafka and Zookeeper running on mapped ports 2181 (Zookeeper) and 9092 (Kafka).

docker pull spotify/kafka
docker run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=kafka --env ADVERTISED_PORT=9092 --name kafka spotify/kafka

Why Spotify?

ADVERTISTED_HOST was set to kafka, which will allow other containers to be able to run Producers and Consumers.

@phipex
phipex / saltstack.sh
Created June 8, 2018 21:48 — forked from michaelkarrer81/saltstack.sh
[Saltstack Cheat Sheet] #saltstack
# ============
# COMMON TASKS
# ============
# Update Online Tools
salt -G "minion_roles:ONLINE" cmd.run 'cd /opt/online/online_tools;git pull'
salt -G "minion_roles:BACKUP" cmd.run 'cd /opt/online/online_tools;git pull'
# Check Release Tag of Online Core
salt -G "minion_roles:ONLINE" cmd.run 'git -C /opt/online/online_o8r166 describe --tags --exact-match --match o8r*'
@phipex
phipex / tutorialDockerCentos7.md
Created April 12, 2018 00:48 — forked from edgardo001/tutorialDockerCentos7.md
Tutorial realizado con Docker en Centos 7

Instalar docker en centos 7

$> sudo yum update -y
$> sudo yum install docker
$> sudo systemctl start docker

para que este disponible cuando se inicia la maquina

$> sudo systemctl enable docker
@phipex
phipex / lxde-rc.xml
Created March 21, 2018 15:21
openbox config tiling windows
.....
<keybind key="W-f">
<action name="UnmaximizeFull"/>
<action name="MoveResizeTo">
<x>0</x>
<y>0</y>
<width>100%</width>
<height>100%</height>
</action>
@phipex
phipex / AuthoritiesConstants
Created February 3, 2018 22:09
jhipster: Create new role (authoritie) #jhipster
public static final String COMERCIAL = "ROLE_EMPLOYEE";
@phipex
phipex / UserService.java
Created February 3, 2018 21:21
jhipster: create user from user managment #jhipster
//public User createUser(UserDTO userDTO) {
public User createUser(ManagedUserVM userDTO) {
User user = new User();
user.setLogin(userDTO.getLogin());
user.setFirstName(userDTO.getFirstName());
user.setLastName(userDTO.getLastName());
user.setEmail(userDTO.getEmail());
user.setImageUrl(userDTO.getImageUrl());
if (userDTO.getLangKey() == null) {
user.setLangKey(Constants.DEFAULT_LANGUAGE); // default language
@phipex
phipex / FriosCalientes.java
Last active January 26, 2018 20:49
Determina los numeros calientes y los numeros frios
final Map<Integer, Integer> integerIntegerMap = main.getFrecuencyOrderMap(lnumeros);
List<Integer> hot = main.hot(cantidad, integerIntegerMap);
System.out.println(hot);
List<Integer> cold = main.cold(cantidad, integerIntegerMap);
System.out.println(cold);
@phipex
phipex / node-and-npm-in-30-seconds.sh
Created September 18, 2017 20:47 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@phipex
phipex / .gitignore
Created August 22, 2016 15:17
gitignore para proyecto eclipse java ee con maven
####### source https://github.com/github/gitignore
############### eclipse conf
.metadata
bin/
tmp/
*.tmp
*.bak
@phipex
phipex / Modal para angular.md
Last active July 26, 2016 19:14
modal para angular