Sunday 17 April 2016

Docker memo

Install Docker on Ubuntu 14.04 LTS


First update your packages:
> apt-get update

@Deprecated
Install docker-io package:
> apt-get -y install docker.io
> ln -sf /usr/bin/docker.io /usr/local/bin/docker

Configure the Docker service to run when the OS boots:
> update-rc.d docker.io defaults

You're done !
You can alternativly use Vagrant Docker provisionner.
Now you can install Docker-compose
 
> sudo apt-get -y install python-pip
> sudo pip install docker-compose
 

Remove old containers:

> docker ps -a | grep 'weeks ago' | awk '{print $1}' \
        | xargs --no-run-if-empty docker rm 
 

Add an insecure docker registry:

add the following line to /etc/default/docker:
DOCKER_OPTS="--insecure-registry  dregistry.myinsecreg.com"

Thursday 19 November 2015

Spring Vs Vanilla JEE (e.g. Wildfly)

A good "battle" around this topic:
https://news.ycombinator.com/item?id=9519773

Wednesday 7 October 2015

JBoss port conflict

Running more than one JBoss instance in the same machine leads to port conflict. You can solve this problem by running the second instance by adding this parameter :
-Djboss.service.binding.set=ports-01

See more: http://www.eeblog.org/index.php/jboss-run-2-instances-in-the-same-environment-and-avoid-port-conflicts/

Tuesday 4 August 2015

How to encrypt your Maven password (for Nexus access)

http://www.objis.com/formation-java/tutoriel-maven-securite-login-mot-de-passe-security-settings-xml.html

Wednesday 14 January 2015

Java Memo

Initialise a list:

Immutable

List<String> people = Arrays.asList("me", "you");
 

Mutable

ArrayList<String> people = new ArrayList<>(Arrays.asList("me", "you"));

or use the double brace initialization:
 
ArrayList<String> people = new ArrayList<String>() {{
    add("Me");
    add("You");
}}