Skip to content

Instantly share code, notes, and snippets.

View smiklosovic's full-sized avatar

Štefan Miklošovič smiklosovic

View GitHub Profile

Cassandra and Kafka workshop demo instructions

We recommend doing all the hands-on work including registering for Instaclustr account from Ubuntu VM image that was provided to you.

If you still do not have this image, then ask and we will provide the OVA image file to you.

Opening Instaclustr console website in VM makes it easy to copy connection credentials when connecting to Cassandra or Kafka clusters.

@smiklosovic
smiklosovic / ssl-certs.md
Created April 15, 2019 04:15 — forked from Eng-Fouad/ssl-certs.md
Generate self-signed PKCS#12 SSL certificate and export its keys using Java keytool and openssl.

Steps to generate self-signed PKCS#12 SSL certificate and export its keys:

1- Create PKCS#12 keystore (.p12 or .pfx file)

keytool -genkeypair -keystore myKeystore.p12 -storetype PKCS12 -storepass MY_PASSWORD -alias KEYSTORE_ENTRY -keyalg RSA -keysize 2048 -validity 99999 -dname "CN=My SSL Certificate, OU=My Team, O=My Company, L=My City, ST=My State, C=SA" -ext san=dns:mydomain.com,dns:localhost,ip:127.0.0.1
  • myKeystore.p12 = keystore filename. It can with .pfx extension as well.
  • MY_PASSWORD = password used for the keystore and the private key as well.
  • CN = commonName, it will be shown as certiciate name in certificates list.
  • OU = organizationUnit, department name for example.
@smiklosovic
smiklosovic / classify.py
Created July 25, 2017 10:05 — forked from bwbaugh/classify.py
Detecting a Specific Watermark in a Photo with Python Get example training and testing images here: <http://bwbaugh.com/stack-overflow/16222178_watermark.tar> Stack Overflow question: <http://stackoverflow.com/questions/16222178/detecting-a-specific-watermark-in-a-photo-with-python-without-scipy>
# Copyright (C) 2013 Wesley Baugh
"""Tools for text classification.
Extracted from the [infer](https://github.com/bwbaugh/infer) library.
"""
from __future__ import division
import math
from collections import defaultdict, namedtuple, Counter
from fractions import Fraction
@smiklosovic
smiklosovic / CassandraPaging
Created March 9, 2017 14:34 — forked from stevesun21/CassandraPaging
Cassandra Java Drive Pagination
import com.datastax.driver.core.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* This is a helper class for implementing a pagination function based on Cassandra Java Driver (http://datastax.github.io/java-driver/)
*
* The solution of skipping rows is that use page state rather than iterator rows one by one.
package net.miklosovic.qa;
import static net.miklosovic.qa.Annotations.Architecture.PPC;
import static net.miklosovic.qa.Annotations.JavaVendor.IBM;
import static net.miklosovic.qa.Annotations.JavaVersion.VERSION_1_8;
import net.miklosovic.qa.Annotations.OperatingSystem.Mac;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Test;
package net.miklosovic.qa;
import static net.miklosovic.qa.Annotations.Architecture.PPC;
import static net.miklosovic.qa.Annotations.JavaVendor.IBM;
import static net.miklosovic.qa.Annotations.JavaVersion.VERSION_1_8;
import net.miklosovic.qa.Annotations.OperatingSystem.Mac;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Test;
package net.miklosovic.qa;
import static net.miklosovic.qa.Annotations.Architecture.PPC;
import static net.miklosovic.qa.Annotations.JavaVendor.IBM;
import static net.miklosovic.qa.Annotations.JavaVersion.VERSION_1_8;
import net.miklosovic.qa.Annotations.OperatingSystem.Mac;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Test;
package net.miklosovic.qa;
import static net.miklosovic.qa.Annotations.Architecture.PPC;
import static net.miklosovic.qa.Annotations.JavaVendor.IBM;
import static net.miklosovic.qa.Annotations.JavaVersion.VERSION_1_8;
import static net.miklosovic.qa.Annotations.OperatingSystem.MAC;
import org.apache.commons.lang3.SystemUtils;
import org.junit.Test;
/*
* Added additional null checks when closing the ResultSet and Statements.
*
* Thanks to pihug12 and Grzegorz Oledzki at stackoverflow.com
* http://stackoverflow.com/questions/5332149/jdbc-scriptrunner-java-lang-nullpointerexception?tab=active#tab-top
*/
/*
* Modified: Use logWriter in print(Object), JavaDoc comments, correct Typo.
*/
/*
@smiklosovic
smiklosovic / DockerManager.java
Last active January 15, 2016 23:44
Arquillian Cube outside of Arquillian
package docker.manager;
import org.arquillian.cube.spi.Cube;
import org.arquillian.cube.spi.CubeRegistry;
import org.arquillian.cube.spi.event.CreateCube;
import org.arquillian.cube.spi.event.DestroyCube;
import org.arquillian.cube.spi.event.StartCube;
import org.arquillian.cube.spi.event.StopCube;
import org.jboss.arquillian.core.impl.loadable.LoadableExtensionLoader;
import org.jboss.arquillian.core.spi.Manager;