18.02.2018

Firefox tab crashes by loading maps.google.com on ubuntu 16.04

On a ubuntu 16.04 system firefox crashes by loading maps.google.com:

"Der Tab ist gerade abgestürzt / This tab has crashed"
"Automatischen Absturzbericht an Mozilla senden"

 The only way to fix this was going to "about:config":

On this page search for "webgl.disabled" and change the value from false
to true:

After that, maps.google.com loads without any problem...

11.02.2018

Docker-Machine: how to create a docker vm on a remote virtualbox server

After doing some first steps with docker, i wanted to test docker-swarm. Because of the limited resources of my notebook, i was looking for a Linux with a minimal footprint. In the context of setting up VMs for docker-swarm i found a log of articles about doing that with the tool docker-machine.
It sounds like this tool can create VMs just with one command. (here the documentation).

So let's give it a try:
(You have to install docker-machine first, but you do not need to install docker itself)
~$ docker-machine create --driver virtualbox test
Creating CA: /home/schroff/.docker/machine/certs/ca.pem
Creating client certificate: /home/schroff/.docker/machine/certs/cert.pem
Running pre-create checks...
(test) Image cache directory does not exist, creating it at /home/schroff/.docker/machine/cache...
(test) No default Boot2Docker ISO found locally, downloading the latest release...
(test) Latest release for github.com/boot2docker/boot2docker is v17.11.0-ce
(test) Downloading /home/schroff/.docker/machine/cache/boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v17.11.0-ce/boot2docker.iso...
(test) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(test) Copying /home/schroff/.docker/machine/cache/boot2docker.iso to /home/schroff/.docker/machine/machines/test/boot2docker.iso...
(test) Creating VirtualBox VM...
(test) Creating SSH key...
(test) Starting the VM...
(test) Check network to re-create if needed...
(test) Found a new host-only adapter: "vboxnet0"
(test) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env test
Wow.
After this command inside my virtualbox a new machine shows up with 1GB RAM, 20 GB HDD (dynamic allocated), 2 network adapters (1x NAT, 1x host only).




But it is not possible to create VMs on a remote Virtualbox server. The CLI does not allow to give a remote server IP:

But for some other environments it is possible to deploy VMs on a remote site:

--vmwarevsphere-vcenter: IP/hostname for vCenter (or ESXi if connecting directly to a single host)
If your preferred virtualization engine supports remote servers, you can check here:

Nevertheless docker-machine is an excellent tool. If you are interested in creating a swarm, read this tutorial.
The homepage of the OS boot2docker can be found here.

07.02.2018

Talking about Microservices: A journey to Docker / Snap / CoreOS / Unbuntu Core / Docker-Swarm

A few months ago (13th august 2017) i started my personal journey into this new hype called microservices:

I thought the best way for me to get in touch was to begin with CoreOS. Within 2 weeks i got some first impressions:

But after these steps i realized, that next step on this road is kubernetes. It is clear that cluster scheduler like kubernetes can not be run on a single machine - so i tried to get another access to microservices: Snap and UbuntuCore:
In november 2017 it was clear, that both UbuntuCore and CoreOS are some building blocks for microservices, but i was not really on the right track.
Back to kubernetes? Kubernetes relies on containers. So i started with docker:
Nearly 3 months later i still did not get in touch with kubernetes - but i think docker swarm is a cluster scheduler, too. And it is really easy to run.

What will i do next? Some tests to failure/failover/failback scenarios. 

03.02.2018

Ubuntu 17.10: s2disk/hibernate broken with kernel 4.13.0-32

Last week my notebook refused to startup after s2disk/hibernate. The resume process started up to 100% and then the screen went black and everything stopped...

Hmm...
First idea: Something disappeared inside the grub configuration.

But this was okay.

After nearly one hour my last try was booting an old kernel. And with
schroff@zerberus:/boot$ uname -a
Linux zerberus 4.13.0-17-generic #20-Ubuntu SMP Mon Nov 6 10:04:08 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
s2disk and resume worked again...


27.01.2018

Bash: How to trim/truncate variables / get substrings

In a comment to one of the most useless commands postings was shown how to use the rev command to get the last component of  the path out of a log file:
cat log | grep pattern | rev | cut -d '/' -f 1 | rev
If you only have one variable filled with a path, you can get the last component very easy:
schroff@zerberus:~$ myvar=/ab/cd/ef/gh

schroff@zerberus:~$ echo ${myvar##*\/}
gh
?

## removes the longest matching string for the pattern "*\/" from the beginning (the slash has to be escaped with a backslash).

schroff@zerberus:~$ echo ${myvar#*\/}
ab/cd/ef/gh
# removes the shortest matching pattern. Here only the starting "/"

% and %% removes everything from the end up to the pattern:
schroff@zerberus:~$ echo ${myvar%\/*}
/ab/cd/ef
schroff@zerberus:~$ echo ${myvar%%\/*}
Here the content of the bash manpage:
       ${parameter#word}
       ${parameter##word}
Remove matching prefix pattern.  The word is expanded to produce a pattern just
as in pathname expansion.  If the pattern matches the beginning of the value of
parameter,  then the result of the expansion is the expanded value of parameter
with the shortest matching pattern (the ``#'' case)  or  the  longest  matching
pattern (the ``##'' case) deleted.  If parameter is @ or *, the pattern removal
operation is applied to each positional parameter in turn, and the expansion is
the resultant list.  If parameter is an array variable subscripted with @ or *,
the pattern removal operation is applied to each member of the array  in  turn,
and the expansion is the resultant list.

       ${parameter%word}
       ${parameter%%word}
Remove matching suffix pattern.  The word is expanded to produce a pattern just
as in pathname expansion.  If the pattern matches a  trailing  portion  of  the
expanded  value  of parameter, then the result of the expansion is the expanded
value of parameter with the shortest matching pattern (the ``%'' case)  or  the
longest  matching  pattern  (the ``%%'' case) deleted.  If parameter is @ or *,
the pattern removal operation is applied to each positional parameter in  turn,
and  the  expansion  is  the resultant list.  If parameter is an array variable
subscripted with @ or *, the pattern removal operation is applied to each  mem‐
ber of the array in turn, and the expansion is the resultant list.

25.01.2018

Java 9: JDK without subfolder JRE

In older JDK releases the directory structure was:
bin
db
include
jre
lib
With JEP 220 the jre folder was removed.


A JDK image no longer contains a jre subdirectory, as noted above. Existing code that assumes the existence of that directory might not work correctly.
But this does not mean that there is no JRE any more. You can still download the JRE. There are some minor changes to the JRE like:
The bin directory in a JRE image contains a few commands that were previously found only in JDK images, namely appletvieweridlj,jrunscript, and jstatd. As with the previous item, these changes are a consequence of the way in which components that contain both APIs and tools were modularized.
For both version the files rt.jar, tools.jar and dt.jar are removed:
JDK and JRE images no longer contain the files lib/rt.jar,lib/tools.jarlib/dt.jar, and other internal JAR files, as noted above. Existing code that assumes the existence of these files might not work correctly.
But this should not be a problem:
Class and resource files previously found in lib/dt.jar and visible only when that file was added to the class path are now visible via the bootstrap class loader and present in both the JRE and the JDK. 
Everyone who delivers Java applications should read  JEP 220 and check, what has to be changed...

22.01.2018

Oracle SOA Suite 12c: Configuring the SOA Suite Weblogic Server

After
 i had to run the
./config.sh
inside the home/oracle/Oracle/Middleware/Oracle_Home/oracle_common/common/bin

















And then after a
./startWeblogic.sh
inside /bin in the directory, which was configured in the first screenshot of the config.sh, i can open the console:


21.01.2018

Oracle SOA Suite: Installing the Fusion Middleware SOA Suite

After the installation of the Fusion Middleware Infrastructur the next step is to install the SOA Suite software.

The software can be found here:



The first try failed with this error:

java -d64 -jar fmw_12.2.1.3.0_soa_quickstart.jar
Launcher-Logdatei ist /tmp/OraInstall2017-10-07_11-47-20PM/launcher2017-10-07_11-47-20PM.log.
Nicht genügend freier Speicherplatz in /tmp/orcl3797124329273264119.tmp, um das Installationsprogramm zu extrahieren. Aktuell 2796 MB. Erforderlich 3532 MB.
Ok. Some cleanups inside /tmp and then:









Next step: Run the config.sh to create a SOA Suite Server....

14.01.2018

Docker-CE: How to modify containers with overlays / How to add directories to a standard docker image

After some experiments with docker i wanted to run a tomcat with my own configuration (e.g. memory settings, ports, ...).


My first idea was: Download tomcat, configure everything and then build an image.
BUT: After i learned how to use the -v (--volume) flag for adding some file via the docker command to an image i was wondering, wether creating a new image with only the additional files on top of standard tomcat docker image.

So first step is to take a look at all local images:
# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
558MB
friendlyhello       latest              976ee2bb47bf        3 days ago          148MB
tomcat              latest              11df4b40749f        8 days ago          558MB
I can use tomcat:latest. (if it is not there just pull it: docker pull tomcat)
Next step is to create a directory and add all the directories which you want to override.
For my example:
mkdir conftomcat
cd conftomcat
mkdir bin
Into the bin directory i put all the files from the tomcat standard container:
# ls bin
bootstrap.jar  catalina-tasks.xml  commons-daemon-native.tar.gz  daemon.sh  setclasspath.sh  startup.sh       tool-wrapper.sh
catalina.sh    commons-daemon.jar  configtest.sh                 digest.sh  shutdown.sh      tomcat-juli.jar  version.sh

Inside the catalina.sh i added -Xmx384M.
In conftomcat i created the following Dockerfile:
FROM tomcat:latest
WORKDIR /usr/local/tomcat/bin
ADD status /usr/local/tomcat/webapps/mystatus
ADD bin /usr/local/tomcat/bin
ENTRYPOINT [ "/usr/local/tomcat/bin/catalina.sh" ]
CMD [ "run"]
And as you can see i added my index.jsp which is inside status (s. this posting).
Ok. Let's see, if my plan works:
#docker build  -t  mytomcat .
ending build context to Docker daemon  375.8kB
Step 1/6 : FROM tomcat:latest
 ---> 11df4b40749f
Step 2/6 : WORKDIR /usr/local/tomcat/bin
 ---> Using cache
 ---> 5696a9ab99cb
Step 3/6 : ADD status /usr/local/tomcat/webapps/mystatus
 ---> 1bceea5af515
Step 4/6 : ADD bin /usr/local/tomcat/bin
 ---> e8d3a386a7f0
Step 5/6 : ENTRYPOINT [ "/usr/local/tomcat/bin/catalina.sh" ]
 ---> Running in a04038032bb7
Removing intermediate container a04038032bb7
 ---> 4c8fda05df18
Step 6/6 : CMD [ "run"]
 ---> Running in cce378648e7a
Removing intermediate container cce378648e7a
 ---> 72ecfe2aa4a7
Successfully built 72ecfe2aa4a7
Successfully tagged mytomcat:latest
and then start:
docker run -p 4001:8080 mytomcat
Let's check the memory settings:
$ ps aux|grep java
root      2313 20.7  8.0 2418472 81236 ?       Ssl  19:51   0:02 /docker-java-home/jre/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx394M -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
Yes - changed to 384M.
And check the jsp:



Yippie!
As you can see, i have the standard tomcat running with an override inside the configuration to 384M. So it should be easy to add certificates, WARs, ... to such a standard container.

13.01.2018

Ubuntu Intel Spectre/Meltdown update

One week after the rumors about Spectre and Meltdown (s. Project Zero Blog) my Ubuntu 17.10 got the Intel microcode patch:


root@zerberus:~# apt-get upgrade
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.      
Statusinformationen werden eingelesen.... Fertig
Paketaktualisierung (Upgrade) wird berechnet... Fertig
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
  linux-headers-4.13.0-17 linux-headers-4.13.0-17-generic
  linux-image-4.13.0-17-generic linux-image-extra-4.13.0-17-generic
Verwenden Sie »apt autoremove«, um sie zu entfernen.
Die folgenden Pakete sind zurückgehalten worden:
  linux-generic linux-headers-generic linux-image-generic
Die folgenden Pakete werden aktualisiert (Upgrade):
  gir1.2-javascriptcoregtk-4.0 gir1.2-poppler-0.18 gir1.2-webkit2-4.0
  intel-microcode libjavascriptcoregtk-4.0-18 libpoppler-glib8 libpoppler68
  libruby2.3 libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2 linux-libc-dev
  poppler-utils ruby2.3
13 aktualisiert, 0 neu installiert, 0 zu entfernen und 3 nicht aktualisiert.
Es müssen 30,5 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 321 kB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n]

Holen:1 http://de.archive.ubuntu.com/ubuntu artful-updates/universe amd64 libwebkit2gtk-4.0-37-gtk2 amd64 2.18.5-0ubuntu0.17.10.1 [9.026 kB]
Holen:2 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libwebkit2gtk-4.0-37 amd64 2.18.5-0ubuntu0.17.10.1 [11,2 MB]                                                      
Holen:3 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libjavascriptcoregtk-4.0-18 amd64 2.18.5-0ubuntu0.17.10.1 [4.052 kB]                                              
Holen:4 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-webkit2-4.0 amd64 2.18.5-0ubuntu0.17.10.1 [67,6 kB]                                                        
Holen:5 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-javascriptcoregtk-4.0 amd64 2.18.5-0ubuntu0.17.10.1 [21,0 kB]                                              
Holen:6 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 poppler-utils amd64 0.57.0-2ubuntu4.2 [141 kB]                                                                    
Holen:7 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libpoppler-glib8 amd64 0.57.0-2ubuntu4.2 [108 kB]                                                                 
Holen:8 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libpoppler68 amd64 0.57.0-2ubuntu4.2 [787 kB]                                                                     
Holen:9 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 gir1.2-poppler-0.18 amd64 0.57.0-2ubuntu4.2 [18,4 kB]                                                             
Holen:10 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 linux-libc-dev amd64 4.13.0-25.29 [963 kB]                                                                       
Holen:11 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 intel-microcode amd64 3.20180108.0~ubuntu17.10.1 [1.090 kB]                                                       Holen:12 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 libruby2.3 amd64 2.3.3-1ubuntu1.2 [2.972 kB]                                                                     
Holen:13 http://de.archive.ubuntu.com/ubuntu artful-updates/main amd64 ruby2.3 amd64 2.3.3-1ubuntu1.2 [41,0 kB]                                                                         
Es wurden 30,5 MB in 25 s geholt (1.186 kB/s).                                                                                                                                          
(Lese Datenbank ... 391417 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../00-libwebkit2gtk-4.0-37-gtk2_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
Entpacken von libwebkit2gtk-4.0-37-gtk2:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
Vorbereitung zum Entpacken von .../01-libwebkit2gtk-4.0-37_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
Entpacken von libwebkit2gtk-4.0-37:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
Vorbereitung zum Entpacken von .../02-libjavascriptcoregtk-4.0-18_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
Entpacken von libjavascriptcoregtk-4.0-18:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
Vorbereitung zum Entpacken von .../03-gir1.2-webkit2-4.0_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
Entpacken von gir1.2-webkit2-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
Vorbereitung zum Entpacken von .../04-gir1.2-javascriptcoregtk-4.0_2.18.5-0ubuntu0.17.10.1_amd64.deb ...
Entpacken von gir1.2-javascriptcoregtk-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) über (2.18.4-0ubuntu0.17.10.1) ...
Vorbereitung zum Entpacken von .../05-poppler-utils_0.57.0-2ubuntu4.2_amd64.deb ...
Entpacken von poppler-utils (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
Vorbereitung zum Entpacken von .../06-libpoppler-glib8_0.57.0-2ubuntu4.2_amd64.deb ...
Entpacken von libpoppler-glib8:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
Vorbereitung zum Entpacken von .../07-libpoppler68_0.57.0-2ubuntu4.2_amd64.deb ...
Entpacken von libpoppler68:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
Vorbereitung zum Entpacken von .../08-gir1.2-poppler-0.18_0.57.0-2ubuntu4.2_amd64.deb ...
Entpacken von gir1.2-poppler-0.18:amd64 (0.57.0-2ubuntu4.2) über (0.57.0-2ubuntu4.1) ...
Vorbereitung zum Entpacken von .../09-linux-libc-dev_4.13.0-25.29_amd64.deb ...
Entpacken von linux-libc-dev:amd64 (4.13.0-25.29) über (4.13.0-21.24) ...
Vorbereitung zum Entpacken von .../10-intel-microcode_3.20180108.0~ubuntu17.10.1_amd64.deb ...
Entpacken von intel-microcode (3.20180108.0~ubuntu17.10.1) über (3.20170707.1) ...
Vorbereitung zum Entpacken von .../11-libruby2.3_2.3.3-1ubuntu1.2_amd64.deb ...
Entpacken von libruby2.3:amd64 (2.3.3-1ubuntu1.2) über (2.3.3-1ubuntu1.1) ...
Vorbereitung zum Entpacken von .../12-ruby2.3_2.3.3-1ubuntu1.2_amd64.deb ...
Entpacken von ruby2.3 (2.3.3-1ubuntu1.2) über (2.3.3-1ubuntu1.1) ...
intel-microcode (3.20180108.0~ubuntu17.10.1) wird eingerichtet ...update-initramfs: deferring update (trigger activated)
intel-microcode: microcode will be updated at next boot
linux-libc-dev:amd64 (4.13.0-25.29) wird eingerichtet ...
gir1.2-javascriptcoregtk-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
Trigger für libc-bin (2.26-0ubuntu2) werden verarbeitet ...
Trigger für man-db (2.7.6.1-2) werden verarbeitet ...
libjavascriptcoregtk-4.0-18:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
libruby2.3:amd64 (2.3.3-1ubuntu1.2) wird eingerichtet ...
libpoppler68:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
libpoppler-glib8:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
poppler-utils (0.57.0-2ubuntu4.2) wird eingerichtet ...
libwebkit2gtk-4.0-37:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
libwebkit2gtk-4.0-37-gtk2:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
gir1.2-poppler-0.18:amd64 (0.57.0-2ubuntu4.2) wird eingerichtet ...
ruby2.3 (2.3.3-1ubuntu1.2) wird eingerichtet ...
gir1.2-webkit2-4.0:amd64 (2.18.5-0ubuntu0.17.10.1) wird eingerichtet ...
Trigger für initramfs-tools (0.125ubuntu12) werden verarbeitet ...
update-initramfs: Generating /boot/initrd.img-4.13.0-21-generic
Trigger für libc-bin (2.26-0ubuntu2) werden verarbeitet ...


So note the "intel-microcode" package, which states:
intel-microcode: microcode will be updated at next boot

And after the reboot:
schroff@zerberus:~$ dmesg | grep microcode
[    0.000000] microcode: microcode updated early to revision 0xc2, date = 2017-11-16
[    1.400728] microcode: sig=0x406e3, pf=0x40, revision=0xc2
[    1.401060] microcode: Microcode Update Driver: v2.2.

10.01.2018

Oracle SOA Suite: Installing the Fusion Middleware Infrastructure

After setting up the database (installation, instance setup) and the SOA Suite repository (via rcu) the next step is to install the Oracle Weblogic Infrastructure.

The software can be downloaded here:

(You have to choose "Fusion Middleware Infrastructure Installer)

The unzip the downloaded zip:
 fmw_12.2.1.3.0_infrastructure_Disk1_1of1.zip
and run it: 
java -d64 -jar fmw_12.2.1.3.0_infrastructure.jar
Because the Oracle documentation does not contain pictures of the installer, here the screenshots:










Next step is to run the config.sh to configure the Application server domain.
(Not really true: first the SOA Suite software has to be added to the middleware home.)