This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableAutoConfiguration(exclude = { DataSourceAutoConfiguration.class, | |
HibernateJpaAutoConfiguration.class, | |
DataSourceTransactionManagerAutoConfiguration.class }) | |
@Configuration | |
@ComponentScan(basePackages = { "com.emc.tes" }) | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
λ cf create-security-group host-redis security-group.json | |
λ cf bind-security-group host-redis micropcf-org micropcf-space | |
λ cf restart redis-example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To override the entry point for any of the docker images. In the vertx image you can first avoid executing vertx and bash in to the container and then execute later | |
docker run -it --entrypoint=/bin/bash vertx/vertx3-exec | |
--rm removes the image as soon as you exit the container. Clean!!! | |
docker run -it --rm --entrypoint=/bin/bash vertx/vertx3-exec | |
View running processes | |
$ sudo docker ps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
broker.id={unique-number} | |
listeners=EXTERNAL://:9092,INTERNAL://:9093 | |
advertised.listeners=EXTERNAL://{ELB-CNAME}:9092,INTERNAL://{my-ip}:9093 | |
listener.security.protocol.map=INTERNAL:SASL_PLAINTEXT,EXTERNAL:SASL_PLAINTEXT | |
inter.broker.listener.name=INTERNAL | |
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer | |
sasl.mechanism.inter.broker.protocol=PLAIN | |
sasl.enabled.mechanisms=PLAIN | |
super.users=User:{admin-username} | |
zookeeper.connect={znode-a-ip}:2181,{znode-b-ip}:2181,{znode-c-ip}:2181 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KafkaServer { | |
com.company.CustomServerLoginModule required | |
username={username} | |
password={password} | |
user_{username}={password} | |
//Any additional users to configure | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.kafka.clients.CommonClientConfigs; | |
import org.apache.kafka.clients.producer.KafkaProducer; | |
import org.apache.kafka.clients.producer.Producer; | |
import org.apache.kafka.clients.producer.ProducerRecord; | |
import java.util.Properties; | |
import java.util.Random; | |
public class SampleProducer { | |
public static void main(String[] args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.kafka.clients.CommonClientConfigs; | |
import org.apache.kafka.clients.consumer.ConsumerRecord; | |
import org.apache.kafka.clients.consumer.ConsumerRecords; | |
import org.apache.kafka.clients.consumer.KafkaConsumer; | |
import java.util.Arrays; | |
import java.util.Properties; | |
public class SampleConsumer { | |
public static void main(String[] args) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KafkaClient { | |
com.company.CustomLoginModule required; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleProducer { | |
public static void main(String[] args) { | |
Properties props = new Properties(); | |
props.put("bootstrap.servers", "kafka-a.company.com:9092,kafka-b.company.com:9092,kafka-c.company.com:9092"); | |
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "SASL_SSL"); | |
props.put("sasl.mechanism", "PLAIN"); | |
//Few more props. Refer https://gist.github.com/pradp/a18312ab72e50117075131efc1a87629 | |
Producer<String, String> producer = new KafkaProducer<String, String>(props); | |
Random rand = new Random(); | |
for (int i = 0; i < 100; i++) |