Skip to content

Instantly share code, notes, and snippets.

try{
KeyStore keyStore = KeyStore.getInstance("JKS");
keyStore.load(null,null);
keyStore.store(new FileOutputStream("mytestkey.jks"), "password".toCharArray());
}catch(Exception ex){
ex.printStackTrace();
}
package nl.ncim.example;
import java.security.cert.X509Certificate;
import sun.security.tools.keytool.CertAndKeyGen;
import sun.security.x509.X500Name;
public class CertificateGeneration {
public static void main(String[] args){
try{
@rvanrijn
rvanrijn / kafkaTest.java
Created September 25, 2015 11:55
sample code
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Date;
import java.util.Properties;
import java.util.Set;
import kafka.javaapi.producer.Producer;
import kafka.producer.KeyedMessage;
import kafka.producer.ProducerConfig;
export SPARK_HOME=/root/spark-1.1.0
export SCALA_HOME=/usr/local/src/scala/scala-2.10.4
export PATH=$SCALA_HOME/bin:$SPARK_HOME/bin:$PATH

Keybase proof

I hereby claim:

  • I am rvanrijn on github.
  • I am robertvanrijn (https://keybase.io/robertvanrijn) on keybase.
  • I have a public key whose fingerprint is 289A EC82 3E68 3A04 75C0 4761 7EE3 13EA A6A0 C886

To claim this, I am signing this object:

@rvanrijn
rvanrijn / PatternMatchingExample
Created October 12, 2014 09:14
pattern matching example with Scala
case class Person(firstname: String, surname: String)
object PatternMatchingExample extends App {
def wildcardMatching(x: Int): String = x match {
case 1 => "one"
case 2 => "two"
case _ => "many"
}
println(wildcardMatching(3))
@rvanrijn
rvanrijn / 0_reuse_code.js
Created June 7, 2014 14:57
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console