Monday, August 28, 2017

Wildfly quickstarts

Wildfly Example galore here: https://github.com/wildfly/quickstart

JBOss EAP example galore here https://github.com/jboss-developer/jboss-eap-quickstarts

Latest Wildfly documentation https://docs.jboss.org/author/display/WFLY/Documentation. Wildfly can be downloaded here http://wildfly.org/downloads/



Excellent book here



with associated code https://github.com/packt-wildfly/packt-java-ee-7-code-samples

This book can be useful: Advanced Java EE Development with WildFly



For Eclipse Oxygen, you might want to install (EClipse Marketplace) the JBoss Tools https://tools.jboss.org/

https://developer.jboss.org/wiki/MavenRepository

Interesting book Wildfly cookbook https://www.packtpub.com/networking-and-servers/wildfly-cookbook





Saturday, August 26, 2017

Getting started with OpenShift

you can try installing on your local machine: install Vagrant https://www.vagrantup.com/downloads.html

install virtualbox https://www.virtualbox.org/wiki/Downloads

clone this github repo https://github.com/openshift/origin and vagrant up... good luck! On Windows the clone fails because of a filename too long issue (hello Microsoft????  ) .

Another way is to test directly on AWS:

https://aws.amazon.com/about-aws/whats-new/2016/06/red-hat-openshift-on-the-aws-cloud-quick-start-reference-deployment/ , go through the AWS guide "red-hat-openshift-on-the-aws-cloud" https://s3.amazonaws.com/quickstart-reference/openshift/doc/red-hat-openshift-on-the-aws-cloud.pdf and discover that this quickstart is no longer available (hello, Amazon??? Why don't you tell it on the home page?? ).

Check out on https://aws.amazon.com/quickstart/ for available quickstarts - there is no Openshift quickstart! This world is a chaos, a Cambrian explosion of products which end up in a total mess, fish with wings and trunks like elephants, and survive only one generation or the space of a few months.


About AWS, I discover another document https://access.redhat.com/documentation/en-us/reference_architectures/2017/html/deploying_openshift_container_platform_3.5_on_amazon_web_services/ but it's a bit long reading...

Anyway in the meantime I discover that the Vagrantfile VirtualBox approach has been DROPPED https://blog.openshift.com/goodbye-openshift-all-in-one-vm-hello-minishift/ in favour of Minishift (one more extinct species, whose fossil debris still clutter the digital space...)... too bad that the online book "OpenShift for developers" has not been updated, and I have wasted 3 hours of my life to discover that the "all in one" approach is dead...Grant Shipley and Graham Dumpleton, how about taking care of your creation?



Wednesday, August 23, 2017

DevOps with OpenShift

reblogging the from the excellent friend and mentor Jan:
https://jvzoggel.com/2017/08/23/free-ebook-devops-with-openshift/



Also interesting the OpenShift for Developers:



The price of changing job

I have recently changed company. I had the opportunity to stay as permanent, moving to another department with people I already knew, but I wanted to explore new worlds and also make some more money.

The change has been devastating, essentially for social reasons.

Humans are tribal animals, and to be happy they must build a web of trust and friendship around them.

Trust can be built only in action. You work with the guy, you know that he is responsible, helpful, skilled, he stops doing his work to come to your rescue. Only then you trust him and like him.

I don't trust someone for his smiles and handshakes and how are you. I trust someone because I know he will do his best to help me. The first thing I tell a new joiner is "whatever problem you have, please don't hesitate to contact me at any time". And if he has a problem that I can't solve, then I ask around until I find someone who can help. By no means a new joiner should be left alone with a problem.

IT industry is not a happy state of nature, where people spend maybe 5 hours a day chasing food, then the rest of the day socializing and having fun. This is a tough world, with tight deadlines, rough competition, people are always under pressure to get things done and acquire new skills. It's a permanent state of semi-war, unfortunately sometimes also internal to the same team. Sadly, some people will rejoice at your failure. Being able to build a team where everyone is really sympathetic to each other, is a real miracle that happens very rarely.

Don't expect a warm welcome. Don't expect to be helped. Most of the time you are absolutely on your own, in a new environment that you don't know. Getting to know the new environment (the 1000 "how to" that are different from company to company) is alone a huuuuge stress and drain on your energies, because you must constantly ask for help and expose you as a "weak" individual. Not everybody understand that it's absolutely normal that they have to invest some of their time to make you comfortable. Many people will consider you only a nuisance and a handicap. It's painful, very painful.



So, changing job is a jump in the dark. And don't believe to those who tell you "don't worry, everything will be fine". Sorry, this is not a Disney movie, this is Planet Earth, not all will be fine, there will be a lot of terrible stress, of shocks, of pain.

So, are you really really sure you want to change job? If you feel bored at work, or you feel that your skills are not improving, start your own project in the evening and weekends. Get certified on something. If you need extra money, you can join Toptal and get an extra part-time job.

But, think twice before you leave a company where you are trusted and you know the internal process. I did, and I am suffering A LOT.



Tuesday, August 22, 2017

Imperative vs Functional programming, a simple example

Today a colleague was asking me the difference between functional and traditional programming in Java... I made a simple example to show how a FUNCTION can be used as a parameter, and the importance of Streams.... of course, in this example the traditional programming is much simpler and readable! Often functional programs can be really hard to decipher!


import java.util.Arrays;

public class HelloWorld
{
  static String[] theStrings = new String[] {"Pippo", "Pluto", "Paperino"};

  public static void main(String[] args) {
    theTraditionalWay();
    theFunctionalWay();  
  }

  static void theTraditionalWay() {
    for (int i = 0; i < theStrings.length; i++) System.out.println(theStrings[i].toUpperCase());
  }

  static void theFunctionalWay() {
    Arrays.stream(theStrings).map(String::toUpperCase).forEach(System.out::println);
  }
}

You can run it here https://www.compilejava.net/

Sunday, August 20, 2017

Book: Peopleware



Where it's proven - with actual statistical facts, not only theories - that in IT - like elsewhere - PEOPLE and not TECHNOLOGIES are the key to success.... and that people are most productive when they are FREE to communicate and cooperate, and HAPPY and in a natural environment and without management pressure and coercion.

Quod Erat Demonstrandum.



Docker training

Excellent training available at https://www.udemy.com/docker-tutorial-for-devops-run-docker-containers/

associated github repo https://github.com/jleetutorial/dockerapp

Awesome tool to play with Docker without having to install it locally http://training.play-with-docker.com/helloworld/

Docker install on Windows https://docs.docker.com/docker-for-windows/install/

Docker hub https://hub.docker.com/ and https://hub.docker.com/explore/

The Tomcat Docker Hub page https://hub.docker.com/r/_/tomcat/

Docker-friendly CI host https://circleci.com



OpenShift, Minishift, VirtualBox

Excellent VERY quick introduction to OpenShift:



I am following this nice introduction to OpenShift https://www.udemy.com/openshift-developers-workshop/ with github https://github.com/drizzleconsulting

Download and install VirtualBox https://www.virtualbox.org/wiki/Downloads

Install Docker https://docs.docker.com/docker-for-windows/

Download and unzip Minishift https://github.com/minishift/minishift/releases

If you get this error

.\minishift.exe start
-- Installing default add-ons ... OK
-- Checking if Hyper-V driver is configured ... FAIL
   Hyper-V virtual switch is not set


it means that maybe Docker is not installed

When I try to install Docker, it tells me "HyperV is not available on Home editions, please use Docker Toolbox" - which uses Oracle VirtualBox instead of HyperV

Since I have Windows 10 Home and I don't want to waste 170 USD to buy Windows Enterprise, I am installing Docker Toolbox https://docs.docker.com/toolbox/overview/#whats-in-the-box but it still doesn't work... it seems that really only the Windows 10 PRO using Hyper-V works.... what a waste of time to try to make stuff work on Windows...



Thursday, August 17, 2017

Book: Humans need not apply



Excellent book about the impact that AI will have on our lives - at the same level as "the rise of the Robots". Read it!

Sunday, August 13, 2017

Intellij and Git

Basic introduction here, very nice:



Incidentally, at first I could not find the "New/Ignore file" menu, so I have manually created a New File .gitignore, and Idea magically prompted me to install the Gitignore plugin, which I did with great satisfaction.

I kept getting

2017-08-12 12:03:55,303 [2262815]   INFO -  #git4idea.commands.GitHandler - 
remote: Permission to pvmarmotta/pv01.git denied to vernetto. 
2017-08-12 12:03:55,303 [2262815]   INFO -  #git4idea.commands.GitHandler - 
fatal: unable to access 'https://github.com/pvmarmotta/pv01.git/': The requested URL returned error: 403 



until in .git/config I changed the URL to https://pvmarmotta:mypassword@github.com/pvmarmotta/pv01.git/

it's tragic that such basic things entail manual hacks... this is the state of IT in 2017... I hope driverless cars will be better engineered otherwise we are toast (we are in any case thanks to AGW)

More interesting stuff on Git:

the infamous "DETACHED HEAD" message: http://gitolite.com/detached-head.html

The "git concepts simplified" http://gitolite.com/gcs.html in gitolite by Sitaram Chamarty

charismatic Jessica Kerr "Git Happens" presentation



Great presentation site Think like a Git http://think-like-a-git.net/

Michael Schwern famous "Git For Ages 4 and up"



Interesting articles on branching and workflow:

http://www.creativebloq.com/web-design/choose-right-git-branching-strategy-121518344

https://www.atlassian.com/git/tutorials/comparing-workflows



Saturday, August 12, 2017

Poll result on Global Warming



it seems that the audience is equally represented by catastrophists and "deniers/optimists"... I am afraid 10 years from now we will have MANY more catastrophists around. It's also true that IT people tend to be a bit disconnected from reality...

Friday, August 11, 2017

Spring boot Rest controller with Embedded Tomcat



really simple, and the code is available here

https://github.com/vernetto/restapi

I just realize that I had already done this exercise here http://www.javamonamour.org/2017/03/spring-boot-starter-web-app.html , even better explained!

Wednesday, August 9, 2017

Sire Reliability Engineering at Google



I have immensely enjoyed reading this book, some sections are highly technical - frankly beyond my level - some other anecdotal and more narrative. Particularly interesting is how Google trains his Site Reliability Engineers, reading the Post-mortem reports and making crash simulations to brainstorm the trainees.



Sunday, August 6, 2017

Kotlin essentials presentation



My first impression is that with Kotlin you can write more readable code than in Java. I am not sure how stable, refactorable and debuggable it is... surely it looks nice.



IntelliJ is really awesome

You can learn how to make the best of the IDE from this 1 hour video (if you can stand the speaker)



more tips available here:



but of course the official help https://www.jetbrains.com/help/idea/meet-intellij-idea.html contains all that info

and the product blog of course https://blog.jetbrains.com/idea/

Also, after you read this https://dzone.com/articles/why-idea-better-eclipse you definitely want to ditch Eclipse forever.

Very useful the https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf keymap reference (menu Help/Keymap...)



Tuesday, August 1, 2017

Book review: Production-Ready Microservices, by Susan Fowler



This is a short book who covers the essential points about service availability in production, and how to prepare for a smooth operational setup.

It's a useful book but lacking "real life" stories and technical details, most of the stuff is quite common-sense.

I am looking forward to reading "Betsy Beyer, Chris Jones, Jennifer Petoff & Niall Richard Murphy: Site Reliability Engineering", who allegedly is much more "technical"