Thursday, February 15, 2018

VMWare, vRealize and Docker

here some statements about vRealize Automarion (VRA)

This is the homepage:

You can quickly open a free account and start an online lab (again, FREE) of vRealize Automation

Hands-on Lab manual is available here

I have done the "HOL-1821-01-CMP vRealize Automation 7 - Getting Started"

There is even a course "HOL-1830-02-CNA vSphere Integrated Containers - Getting Started" available at

This PDF is about VIC containers

Monday, February 12, 2018

Oracle XE DB running as Docker Container, and a freaky Docker error

docker run -d -p 8080:8080 -p 1521:1521 sath89/oracle-xe-11g

Error response from daemon: updating the store state of sandbox failed: failed to update store for object type *libnetwork.sbState: json: cannot unmarshal string into Go struct field sbState.ExtDNS of type libnetwork.extDNSEntry.

it seems that the only way to solve it is:

sudo rm -rf /var/lib/docker

then reboot

I did so and it worked (but of course I have lost all my images and containers).


Friday, February 9, 2018

screen : how to run long running linux commands who survive also a VDI crash


CTRL-A c (create new window)
CTRL-A c (create new window)
CTRL-A n (next window)
You are now back in “top”

Restart VDI

Login again

screen –r (reattach)

With screen you can also open several terminal sessions from the same login, and tab through them with CTRL-A n

Monday, February 5, 2018

Maven version sorting with Java 8

You can easily sort versions in Maven using org.apache.maven.artifact.versioning.ComparableVersion :


<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

package mavensort;

import org.apache.maven.artifact.versioning.ComparableVersion;

public class Artifact implements Comparable<Artifact> {
 int id;
 String version;
 public int getId() {
  return id;
 public void setId(int id) { = id;
 public String getVersion() {
  return version;
 public void setVersion(String version) {
  this.version = version;
 public Artifact(int id, String version) {
  super(); = id;
  this.version = version;

 public int compareTo(Artifact o) {
  ComparableVersion cv1 = new ComparableVersion(version);
  ComparableVersion cv2 = new ComparableVersion(o.getVersion());
  int compareTo = cv1.compareTo(cv2);
  System.out.println("compareTo " + version + " " + o.getVersion() + " " + compareTo);
  return compareTo;


package mavensort;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;

import org.apache.maven.artifact.versioning.ComparableVersion;
import org.junit.Test;

public class ArtifactTest {

 public void testSort() {
  String version1 = "1.2";
  ComparableVersion cv1 = new ComparableVersion(version1);
  String version2 = "1.12";
  ComparableVersion cv2 = new ComparableVersion(version2);
  assert(cv1.compareTo(cv2) < 0);

 public void testSortCollection() {
  Artifact a1 = new Artifact(1, "1.2");
  Artifact a2 = new Artifact(2, "1.12");
  Artifact a3 = new Artifact(3, "0.12");
  List<Artifact> list = Arrays.asList(a1, a2, a3);
  Supplier<List<Artifact>> supplier = () -> new ArrayList<Artifact>();
  List<Artifact> sortedList =;
  sortedList.forEach(item -> System.out.println(item.version));


The use of streams and Supplier just to sort a collection is voodoistic. One can simply code this:

list.forEach(item -> System.out.println(item.version));

You can use also an external comparator:

 public void testSortCollectionExternalComparator() {
  Artifact a1 = new Artifact(1, "1.2");
  Artifact a2 = new Artifact(2, "1.12");
  Artifact a3 = new Artifact(3, "0.12");
  List<Artifact> list = Arrays.asList(a1, a2, a3);
  list.sort(new ArtifactComparator());
  list.forEach(item -> System.out.println(item.version));

public class ArtifactComparator implements Comparator<Artifact> {

 public int compare(Artifact o1, Artifact o2) {
  ComparableVersion cv1 = new ComparableVersion(o1.getVersion());
  ComparableVersion cv2 = new ComparableVersion(o2.getVersion());
  int compareTo = cv1.compareTo(cv2);
  System.out.println("C2 compareTo " + o1.getVersion() + " " + o2.getVersion() + " " + compareTo);
  return compareTo;


The external dependency is not necessary, you can simply copy the class into your project, luckily it has no other dependencies to other classes in the same package

Ref: for comparators

Friday, February 2, 2018


KDC = Key Distribution Center

TGT = Ticket-Getting Ticket

AS = Authorization Server

ST = Service Ticket

TGS = Ticket Granting Service

SPN = Service Principal Name

1) AS-REQ / AS-REP : user logs in, using key in keytab file he authenticates in AS/KDC. AS/KDC checks if user exists in its DB. User gets a TGT (time limited)
2) user

Kerberos uses a keytab file