Friday, 30 November 2018

IBM InfoSphere Information Server - Passwords

Following on from an earlier few posts about IIS, I hit an issue yesterday, where a client was trying, and failing, to connect the IIS tool ( istool.sh ) to their IIS environment, with a strange exception.

I suspected that the issue was their nice n' strong n' proper password, which contained special characters such as pling ( ! ).

Therefore, istool was seeing the password as an extension of the command, and parsing it accordingly.

Thankfully, there's an answer ( kindly provided by a colleague ) - wrap the complex password e.g.

Qp4$$w0rd!! 

in single quotes like this: -

'Qp4$$w0rd!!'

Once we did that, we were golden :-)

Wednesday, 28 November 2018

IBM Notes on macOS - Aiding my memory ....

So one of my colleagues asked about this earlier ….

He was writing a memo, a nice long memo, and then, alas, Notes crashed …..

And he lost the draft memo ….

And he didn't know that Notes has autosave which, of course, is NOT on by default :-(

For reference, it's a Preference on macOS - use the [Cmd] [,] to bring up the pane: -


and/or read this: -


In addition, whilst I'm here, if ever you're looking for the macOS equivalent to notes.ini, it is here: -

/Users/davidhay/Library/Preferences/com.ibm.Notes.plist

Some other useful reading: -


This session will begin with a comparison of Mac OS and Windows and continue with the process of installing & uninstalling Notes on Mac. The team will dive into known issues and must gather information when contacting Support. Notes supportability/limitations on Mac will also be included and we'll of course leave time for your questions!

plus this about where temporary files go to ( my lovely )

The answer can always be found from Terminal using a magic invocation such as this: -

sudo ls -R /private/var/folders | grep TemporaryItems | grep notes

….
/private/var/folders/rv/164kz_s90tl_pfy7bz251lhw0000gn/T/TemporaryItems/notes:
/private/var/folders/rv/164kz_s90tl_pfy7bz251lhw0000gn/T/TemporaryItems/notes/ac789564.TMP:
/private/var/folders/rv/164kz_s90tl_pfy7bz251lhw0000gn/T/TemporaryItems/notes/ac789564.TMP/META-INF:


which is always useful if you choose to edit an attached document within the context of a Memo and then forget to actually save the edited version somewhere other than Notes' temp folder ( which gets cleared when you restart the client ).

Wednesday, 21 November 2018

Maven and Spring and Liberty - Broken, now fixed

Having followed this Spring / JPA tutorial : -

and having deployed the resulting WAR file to WebSphere Liberty Profile: -

~/wlp/bin/server version

WebSphere Application Server 18.0.0.3 (1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)

I saw this in my logs: -

...
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/Guestbook/
[AUDIT   ] CWWKZ0001I: Application Guestbook started in 0.932 seconds.
[ERROR   ] SRVE8052E: Logging ClassNotFoundException
org.springframework.web.servlet.DispatcherServlet
[ERROR   ] SRVE0276E: Error while initializing Servlet [spring]: javax.servlet.UnavailableException: SRVE0200E: Servlet [org.springframework.web.servlet.DispatcherServlet]: Could not find required class - org.springframework.web.servlet.DispatcherServlet
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1548)
at [internal classes]
...

This had the answer: -




and now we're golden.

...
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/api/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/serverConfig-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/explore-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/adminCenter/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/Guestbook/
[AUDIT   ] CWWKZ0001I: Application Guestbook started in 2.992 seconds.
[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, restConnector-2.0, webProfile-8.0, adminCenter-1.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.

...


:-) 

Goops, I broke WebSphere Liberty ....

Having started a Liberty instance, I was seeing errors : -

cat ~/wlp/usr/servers/foobar/logs/console.log

Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[ERROR   ] CWWKE0702E: Could not resolve module: com.ibm.ws.ui [426]
  Unresolved requirement: Import-Package: org.apache.commons.io; packageType="was_internal"; version="1.4.0"

[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, restConnector-2.0, webProfile-8.0, adminCenter-1.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/explore-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/api/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/serverConfig-1.0/


for no apparent reason.

BUT I KNOW WHAT'S CHANGED :-)

I'd installed WLP 18.0.0.3 over 17.0.0.3, which is almost certainly the fault i.e. I merely unzipped one version over the other ….

I tried cleaning the server: -

~/wlp/bin/server start foobar --clean

but to no avail.

So it's nuking time …..

( THIS IS MY TEST ENVIRONMENT - DON'T TRY THIS ON A PRODUCTION SYSTEM !! )

Backup existing server.xml

cp ~/wlp/usr/servers/foobar/server.xml /tmp

Nuke existing installation

rm -Rf ~/wlp

Install WLP 18.0.0.3

unzip ~/Downloads/wlp-javaee8-18.0.0.3.zip 

Create a new server

~/wlp/bin/server create foobar

...
Server foobar created.


Create a SSL keystore

~/wlp/bin/securityUtility createSSLCertificate --server=foobar --password=passw0rd --validity=365

...
Creating keystore /Users/davidhay/wlp/usr/servers/foobar/resources/security/key.jks

Created SSL certificate for server foobar. The certificate is created with CN=10.128.1.1,OU=foobar,O=ibm,C=us as the SubjectDN.

Add the following lines to the server.xml to enable SSL:

    <featureManager>
        <feature>ssl-1.0</feature>
    </featureManager>
    <keyStore id="defaultKeyStore" password="{xor}Lz4sLChvLTs=" />



Restore previously backed-up  server.xml

cp /tmp/server.xml ~/wlp/usr/servers/foobar/server.xml 

For the record, this is what I have: -

<server description="new server">

    <featureManager>
        <feature>javaee-8.0</feature>
        <feature>localConnector-1.0</feature>
        <feature>adminCenter-1.0</feature>
        <feature>transportSecurity-1.0</feature>
    </featureManager>

    <keyStore id="defaultKeyStore" password="{xor}Lz4sLChvLTs="/>
    
    <httpEndpoint host="*" httpsPort="9443" id="defaultHttpEndpoint"/>
                  
    <applicationManager autoExpand="true"/>

    <applicationMonitor updateTrigger="mbean"/>

    <basicRegistry id="basic" realm="BasicRealm">
        <user name="wasadmin" password="{xor}Lz4sLChvLTs="/>
    </basicRegistry>

    <administrator-role>
        <user>wasadmin</user>
    </administrator-role>

    <remoteFileAccess>
        <writeDir>${server.config.dir}</writeDir>
    </remoteFileAccess>
</server>


Start server

~/wlp/bin/server start foobar

...
Starting server foobar.
Server foobar started with process ID 64926.


Check logs

cat ~/wlp/usr/servers/foobar/logs/console.log

...
Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  admincenter-1.0 feature.  Try running the command, bin/installUtility install admincenter-1.0,  to install the feature. Alternatively, you can run the command, bin/installUtility install foobar,  to install all features that are referenced by this configuration.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKS4104A: LTPA keys created in 0.444 seconds. LTPA key file: /Users/davidhay/wlp/usr/servers/foobar/resources/security/ltpa.keys
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, webProfile-8.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.


noting that I'm missing adminCenter-1.0

Stop server

~/wlp/bin/server stop foobar

Install missing feature(s)

~/wlp/bin/installUtility install foobar

Checking for missing features required by the server ...
The server requires the following additional features: admincenter-1.0.  Installing features from the repository ...
Establishing a connection to the configured repositories ...
This process might take several minutes to complete.

Successfully connected to all configured repositories.

Preparing assets for installation. This process might take several minutes to complete.

Additional Liberty features must be installed for this server.

To install the additional features, review and accept the feature license agreement:
Select [1] I Agree, or [2] I do not Agree:  1

Step 1 of 20: Downloading servlet-3.0 ...
Step 2 of 20: Installing servlet-3.0 ...
Step 3 of 20: Downloading restConnector-1.0 ...
Step 4 of 20: Installing restConnector-1.0 ...
Step 5 of 20: Downloading jsp-2.2 ...
Step 6 of 20: Installing jsp-2.2 ...
Step 7 of 20: Downloading adminCenter-1.0 ...
Step 8 of 20: Installing adminCenter-1.0 ...
Step 9 of 20: Downloading cdi-1.2 ...
Step 10 of 20: Installing cdi-1.2 ...
Step 11 of 20: Downloading jaxrs-1.1 ...
Step 12 of 20: Installing jaxrs-1.1 ...
Step 13 of 20: Downloading servlet-3.1 ...
Step 14 of 20: Installing servlet-3.1 ...
Step 15 of 20: Downloading jaxrsClient-2.0 ...
Step 16 of 20: Installing jaxrsClient-2.0 ...
Step 17 of 20: Downloading jaxrs-2.0 ...
Step 18 of 20: Installing jaxrs-2.0 ...
Step 19 of 20: Validating installed fixes ...
Step 20 of 20: Cleaning up temporary files ...


All assets were successfully installed.

Start product validation...
Product validation completed successfully.

Start server

~/wlp/bin/server start foobar

Check logs

cat ~/wlp/usr/servers/foobar/logs/console.log

...
Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, restConnector-2.0, webProfile-8.0, adminCenter-1.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/api/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/explore-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/serverConfig-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/adminCenter/

...

Good to go …..

Tuesday, 20 November 2018

macOS - Finding and nuking processes by listening port

When I'm trying to find/kill a process on a Linux box, I tend to use my muscle memory of: -

netstat -aonp|grep 9043

(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp6       0      0 :::9043                 :::*                    LISTEN      52647/java           off (0.00/0/0)


Note that, even though I'm not running as root, I can still see the process ID ( PID ).

However, on macOS Mojave, this is subtly different: -

netstat -an|grep 8080

tcp6       0      0  ::1.8080               ::1.56360              FIN_WAIT_2 
tcp6       0      0  ::1.8080               ::1.56359              FIN_WAIT_2 
tcp6       0      0  ::1.56360              ::1.8080               CLOSE_WAIT 
tcp6       0      0  ::1.56359              ::1.8080               CLOSE_WAIT 
tcp46      0      0  *.8080                 *.*                    LISTEN     

which doesn't show the PID.

Thankfully, this had the answer: -


On macOS High Sierra, use this command:

lsof -nP -i4TCP:$PORT | grep LISTEN

So, for me, the command translates as: -

lsof -nP -i4tcp:8080 | grep LISTEN

java    60700 davidhay   65u  IPv6 0x628378e95c8f30d1      0t0  TCP *:8080 (LISTEN)

which then allowed me to kill the process ( a JVM "owned" by Apache Tomcat ) : -

kill -9 60700

meaning that : -

netstat -an|grep 8080

and: -

lsof -nP -i4tcp:8080 | grep LISTEN

now return nothing :-)

Thursday, 15 November 2018

Git - Learning to fiddle with it properly

I've been using Git on and off for about two years, but have mostly been lazy and depended upon the Github Desktop: -


especially for commits and pushes.

I'm using an Enterprise Github instance, as hosted by IBM - which is nice.

However, of course, I still have a set of local GIt repositories, native to my Mac, as per this example: -

/Users/davidhay/Git/WASScripts

So, in the interest of self-enablement, I dug further into using the command-line interface.

The first trick was to create a Personal Access Token: -


which I could use in lieu of a password, when connecting from the command-line to Git.

Having generated a token, I then did some tinkering: -

Change to my local Git repository, for WebSphere Application Server (WAS) scripts

cd ~/Git/WASScripts

Create a file

touch snafu.txt

Add the file to the local Git repo

git add snafu.txt

Commit the changes to  Enterprise Github

git commit

[master 92f77cd] Adding snafu.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 snafu.txt


This brings up vi and requires me to add some comments; I then save these using :wf or [Escape][z][z] 

Push the changes to Enterprise Github

git push

Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 281 bytes | 281.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.ibm.com/ukiccte/WASScripts.git
   64af5d4..92f77cd  master -> master


Validate that the file now appears in Github Enterprise


Remove the file locally

git rm snafu.txt

rm 'snafu.txt'

Commit the changes to Enterprise Github

git commit

[master 4773e77] Removing snafu.txt
 1 file changed, 0 insertions(+), 0 deletions(-)
 delete mode 100644 snafu.txt


Push the changes to Enterprise Github

git push

Counting objects: 2, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 236 bytes | 236.00 KiB/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.ibm.com/ukiccte/WASScripts.git
   92f77cd..4773e77  master -> master


Validate that we're in sync

git commit

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean


Validate that the file has now been removed from Github Enterprise


Nice !

Amongst many other fine sources, I did find this to be immensely useful: -


from the awesome Julia Evans ( https://twitter.com/b0rk )


Wednesday, 14 November 2018

Apache Derby - Networking Notworking

Following my earlier post: -

I've been fiddling with the Apache Derby Network Server

Having unpacked the appropriate derbyrun.jar from the downloaded Derby bundle: -

unzip -j ~/Downloads/db-derby-10.10.2.0-lib.zip "db-derby-10.10.2.0-lib/lib/derbyrun.jar"

I started the server: -

java -jar derbyrun.jar server start

...
Wed Nov 14 16:45:47 GMT 2018 : Security manager installed using the Basic server security policy.
Wed Nov 14 16:45:48 GMT 2018 : Apache Derby Network Server - 10.14.2.0 - (1828579) started and ready to accept connections on port 1527
...

and then tried to connect to the HelloWorld DB using the IJ tool, as before: -

java -cp derbylient.jar:derbytools.jar org.apache.derby.tools.ij


ERROR 08001: No suitable driver found for jdbc:derby://localhost:1527/HelloWorld

I spent many a happy hour digging into this, before I found the solution …..

Yes, PEBCAK aka User Error

I should've started the IJ tool differently: -

java -jar derbyrun.jar ij

select * from names;

...
NUM        |NAME                                    
----------------------------------------------------
1          |Marge Simpson                           
2          |Homer Simpson                           
3          |Lisa Simpson                            
4          |Maggie Simpson                          
5          |Bart Simpson                            
6          |Grandpa Simpson                         

6 rows selected

...

So it's as always, a problem with the class path

So, even though the IJ tool IS available within derbytools.jar it's a different bloomin' version, with the same signature :-)

PS During my investigations, I also upgraded to the most recent version of Derby, albeit to no avail.

-rw-r--r--@ 1 davidhay  staff  12921688 14 Nov 16:14 /Users/davidhay/Downloads/db-derby-10.14.2.0-lib.zip

unzip -j ~/Downloads/db-derby-10.14.2.0-lib.zip "db-derby-10.14.2.0-lib/lib/derby.jar"
unzip -j ~/Downloads/db-derby-10.14.2.0-lib.zip "db-derby-10.14.2.0-lib/lib/derbytools.jar"
unzip -j ~/Downloads/db-derby-10.14.2.0-lib.zip "db-derby-10.14.2.0-lib/lib/derbynet.jar"
unzip -j ~/Downloads/db-derby-10.14.2.0-lib.zip "db-derby-10.14.2.0-lib/lib/derbyrun.jar"
unzip -j ~/Downloads/db-derby-10.14.2.0-lib.zip "db-derby-10.14.2.0-lib/lib/derbyclient.jar"


java -cp derby.jar org.apache.derby.tools.sysinfo

------------------ Java Information ------------------
Java Version:    1.8.0_181
Java Vendor:     Oracle Corporation
Java home:       /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
Java classpath:  derby.jar
OS name:         Mac OS X
OS architecture: x86_64
OS version:      10.14.1
Java user name:  davidhay
Java user home:  /Users/davidhay
Java user dir:   /Users/davidhay/ApacheDerby
java.specification.name: Java Platform API Specification
java.specification.version: 1.8
java.runtime.version: 1.8.0_181-b13
--------- Derby Information --------
[/Users/davidhay/ApacheDerby/derby.jar] 10.14.2.0 - (1828579)
------------------------------------------------------
----------------- Locale Information -----------------
------------------------------------------------------
------------------------------------------------------

This was definitely of use in my PD



Apache Derby - It's almost like my first time

Back with Apache Derby, after quite a long while ( it was IBM Cloudscape back in the day, and it's a core part of a lot of IBM products ), I wanted to create a simple DB to test my Java Persistence Architecture (JPA) skills against.

Using these sources: -




mkdir ApacheDerby
cd ApacheDerby/
unzip -j ~/Downloads/db-derby-10.10.2.0-lib.zip "db-derby-10.10.2.0-lib/lib/derby.jar"

...
Archive:  /Users/davidhay/Downloads/db-derby-10.10.2.0-lib.zip
  inflating: derby.jar               

...

unzip -j ~/Downloads/db-derby-10.10.2.0-lib.zip "db-derby-10.10.2.0-lib/lib/derbytools.jar"

...

Archive:  /Users/davidhay/Downloads/db-derby-10.10.2.0-lib.zip
  inflating: derbytools.jar          


ls -al

...
total 5976
drwxr-xr-x   4 davidhay  staff      128 14 Nov 14:21 .
drwxr-xr-x+ 75 davidhay  staff     2400 14 Nov 14:09 ..
-rw-r--r--@  1 davidhay  staff  2838580 27 Mar  2014 derby.jar
-rw-r--r--@  1 davidhay  staff   214415 27 Mar  2014 derbytools.jar
...

java -cp derby.jar org.apache.derby.tools.sysinfo

...
------------------ Java Information ------------------
Java Version:    1.8.0_181
Java Vendor:     Oracle Corporation
Java home:       /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre
Java classpath:  derby.jar
OS name:         Mac OS X
OS architecture: x86_64
OS version:      10.14.1
Java user name:  davidhay
Java user home:  /Users/davidhay
Java user dir:   /Users/davidhay/ApacheDerby
java.specification.name: Java Platform API Specification
java.specification.version: 1.8
java.runtime.version: 1.8.0_181-b13
--------- Derby Information --------
[/Users/davidhay/ApacheDerby/derby.jar] 10.10.2.0 - (1582446)
------------------------------------------------------
----------------- Locale Information -----------------
------------------------------------------------------
------------------------------------------------------

...

java -cp derby.jar:derbytools.jar org.apache.derby.tools.ij

...
ij version 10.10
ij>

...

connect 'jdbc:derby:HelloWorld;create=true';
exit;

ls -al

...
total 5984
drwxr-xr-x   6 davidhay  staff      192 14 Nov 14:23 .
drwxr-xr-x+ 75 davidhay  staff     2400 14 Nov 14:09 ..
drwxr-xr-x   6 davidhay  staff      192 14 Nov 14:23 HelloWorld
-rw-r--r--@  1 davidhay  staff  2838580 27 Mar  2014 derby.jar
-rw-r--r--   1 davidhay  staff     1113 14 Nov 14:23 derby.log
-rw-r--r--@  1 davidhay  staff   214415 27 Mar  2014 derbytools.jar

...

java -cp derby.jar:derbytools.jar org.apache.derby.tools.ij

connect 'jdbc:derby:HelloWorld';

create table names(num int, name varchar(40));

...
0 rows inserted/updated/deleted
...

insert into names values (1,'Marge Simpson');

...
1 row inserted/updated/deleted
...

insert into names values (2,'Homer Simpson');

...
1 row inserted/updated/deleted
...

insert into names values (3,'Lisa Simpson');

...
1 row inserted/updated/deleted
...

insert into names values (4,'Maggie Simpson');

...
1 row inserted/updated/deleted
...

insert into names values (5,'Bart Simpson');

...
1 row inserted/updated/deleted
...

insert into names values (6,'Grandpa Simpson');

...
1 row inserted/updated/deleted
...

select * from names;

...
NUM        |NAME                                    
----------------------------------------------------
1          |Marge Simpson
2          |Homer Simpson
3          |Lisa Simpson
4          |Maggie Simpson
5          |Bart Simpson
6          |Grandpa Simpson

6 rows selected

...

exit;


WAS on Docker - Dockerfiles for WebSphere Application Server traditional

Saw this yesterday: -

Dockerfiles for WebSphere Application Server traditional


The files in this directory are used to build the ibmcom/websphere-traditional images on Docker Hub. These images contain the ILAN licensed IBM WebSphere Application Server traditional. If you wish to build these yourself just follow these instructions, otherwise please see below on how to extend our pre-built image with your application and configuration!


Building an application image

The Docker Hub image contains a tradittional WebSphere Application Server v9 instance with no applications or configuration applied to it.

Tuesday, 13 November 2018

macOS Mojave and Git - Borked No More

I was trying to clone a repository: -

but got this: -

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Thankfully an easy solution: -

xcode-select —install

xcode-select: note: install requested for command line developer tools

Now it's a-workin' 

Cloning into 'java-helloworld'...
remote: Enumerating objects: 121, done.
remote: Total 121 (delta 0), reused 0 (delta 0), pack-reused 121
Receiving objects: 100% (121/121), 61.47 KiB | 340.00 KiB/s, done.
Resolving deltas: 100% (46/46), done.


cd java-helloworld/

ls

CONTRIBUTING.md LICENSE README.md manifest.yml pom.xml src target

mvn clean install

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------< net.wasdev.wlp.sample:JavaHelloWorldApp >---------------
[INFO] Building Liberty Profile Sample - Servlet 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ JavaHelloWorldApp ---
[INFO] Deleting /Users/davidhay/java-helloworld/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.0:enforce (default) @ JavaHelloWorldApp ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.1:process (default) @ JavaHelloWorldApp ---
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ JavaHelloWorldApp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidhay/java-helloworld/src/main/resources
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ JavaHelloWorldApp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/davidhay/java-helloworld/target/classes
[WARNING] bootstrap class path not set in conjunction with -source 1.7
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ JavaHelloWorldApp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidhay/java-helloworld/src/test/resources
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ JavaHelloWorldApp ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ JavaHelloWorldApp ---
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ JavaHelloWorldApp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [JavaHelloWorldApp] in [/Users/davidhay/java-helloworld/target/JavaHelloWorldApp-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/davidhay/java-helloworld/src/main/webapp]
[INFO] Webapp assembled in [25 msecs]
[INFO] Building war: /Users/davidhay/java-helloworld/target/JavaHelloWorldApp.war
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ JavaHelloWorldApp ---
[INFO] Installing /Users/davidhay/java-helloworld/target/JavaHelloWorldApp.war to /Users/davidhay/.m2/repository/net/wasdev/wlp/sample/JavaHelloWorldApp/1.0-SNAPSHOT/JavaHelloWorldApp-1.0-SNAPSHOT.war
[INFO] Installing /Users/davidhay/java-helloworld/pom.xml to /Users/davidhay/.m2/repository/net/wasdev/wlp/sample/JavaHelloWorldApp/1.0-SNAPSHOT/JavaHelloWorldApp-1.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.032 s
[INFO] Finished at: 2018-11-13T16:04:07Z
[INFO] ————————————————————————————————————


mvn liberty:run-server

[INFO] Scanning for projects...
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.pom (4.4 kB at 18 kB/s)
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/net/wasdev/wlp/maven/liberty-maven/1.2.1/liberty-maven-1.2.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/liberty-maven/1.2.1/liberty-maven-1.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/liberty-maven/1.2.1/liberty-maven-1.2.1.pom (2.0 kB at 53 kB/s)
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/maven/plugins/liberty-maven-plugin/1.2.1/liberty-maven-plugin-1.2.1.jar (109 kB at 1.3 MB/s)
[INFO] 
[INFO] --------------< net.wasdev.wlp.sample:JavaHelloWorldApp >---------------
[INFO] Building Liberty Profile Sample - Servlet 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO] 
[INFO] --- liberty-maven-plugin:1.2.1:run-server (default-cli) @ JavaHelloWorldApp ---
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.pom (5.2 kB at 141 kB/s)
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.jar
Downloading from ibm-maven-repo: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar (169 kB at 1.1 MB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/net/wasdev/wlp/ant/wlp-anttasks/1.2.1/wlp-anttasks-1.2.1.jar (85 kB at 513 kB/s)
[INFO] CWWKM2102I: Using installDirectory : /Users/davidhay/java-helloworld/target/liberty/wlp.
[INFO] CWWKM2102I: Using serverName : defaultServer.
[INFO] CWWKM2102I: Using serverDirectory : /Users/davidhay/java-helloworld/target/liberty/wlp/usr/servers/defaultServer.
[INFO] Getting: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml
[INFO] To: /Users/davidhay/.m2/repository/wlp-cache/index.yml
[INFO] Getting: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/18.0.0.3/wlp-webProfile7-18.0.0.3.zip
[INFO] To: /Users/davidhay/.m2/repository/wlp-cache/18.0.0_03/wlp-webProfile7-18.0.0.3.zip
[INFO] Copying 1 file to /Users/davidhay/java-helloworld/target/liberty/wlp/usr/servers/defaultServer
[INFO] CWWKM2144I: Update server configuration file server.xml from /Users/davidhay/java-helloworld/src/main/wlp/server.xml.
[INFO] CWWKM2144I: Update server configuration file bootstrap.properties from inlined configuration.
[INFO] CWWKM2001I: server.config.dir is /Users/davidhay/java-helloworld/target/liberty/wlp/usr/servers/defaultServer.
[INFO] CWWKM2001I: server.output.dir is /Users/davidhay/java-helloworld/target/liberty/wlp/usr/servers/defaultServer.
[INFO] CWWKM2001I: Invoke command is [/Users/davidhay/java-helloworld/target/liberty/wlp/bin/server, run, defaultServer].
[INFO] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[INFO] Launching defaultServer (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[INFO] [AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[INFO] [AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[INFO] [AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[INFO] [ERROR   ] CWWKO0221E: TCP Channel defaultHttpEndpoint initialization did not succeed.  The socket bind did not succeed for host * and port 9080.  The port might already be in use.
[INFO] [AUDIT   ] CWWKZ0001I: Application JavaHelloWorldApp started in 0.231 seconds.
[INFO] [AUDIT   ] CWWKF0012I: The server installed the following features: [servlet-3.1].
[INFO] [AUDIT   ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.

Reminder - pulling a single file from a ZIP archive

I am following this tutorial: -


which requires one to download Apache Derby from here: -


specifically the LIB distribution ( which just provides the Apache runtime in a Java JAR file, rather than the full set of binaries ).

Having downloaded the required ZIP file: -


I wanted to simply extract the derby.jar file to my WebSphere Liberty Profile environment.

I navigated to the appropriate directory on the file-system: -

cd /Users/davidhay/wlp/usr/shared/resources

and then listed the contents of the downloaded ZIP fie: -

unzip -l ~/Downloads/db-derby-10.10.2.0-lib.zip

Archive:  /Users/davidhay/Downloads/db-derby-10.10.2.0-lib.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  03-27-2014 12:21   db-derby-10.10.2.0-lib/
    39891  03-27-2014 12:21   db-derby-10.10.2.0-lib/KEYS
    11560  03-27-2014 12:21   db-derby-10.10.2.0-lib/LICENSE
     7323  03-27-2014 12:21   db-derby-10.10.2.0-lib/NOTICE
    49122  03-27-2014 12:21   db-derby-10.10.2.0-lib/RELEASE-NOTES.html
        0  03-27-2014 12:21   db-derby-10.10.2.0-lib/lib/
  2838580  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derby.jar
     1476  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derby.war
    92470  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_cs.jar
   104596  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_de_DE.jar
    98708  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_es.jar
   104718  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_fr.jar
    93172  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_hu.jar
    98556  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_it.jar
   115193  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_ja_JP.jar
   109610  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_ko_KR.jar
    91165  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_pl.jar
    88405  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_pt_BR.jar
   119017  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_ru.jar
   101533  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_zh_CN.jar
   103118  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyLocale_zh_TW.jar
   586237  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyclient.jar
   252393  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbynet.jar
     7143  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbyrun.jar
   214415  03-27-2014 12:15   db-derby-10.10.2.0-lib/lib/derbytools.jar
        0  03-27-2014 12:21   db-derby-10.10.2.0-lib/test/
  7654758  03-27-2014 12:15   db-derby-10.10.2.0-lib/test/derbyTesting.jar
    81105  03-27-2014 09:35   db-derby-10.10.2.0-lib/test/README.htm
    65261  03-27-2014 09:31   db-derby-10.10.2.0-lib/test/jakarta-oro-2.0.8.jar
---------                     -------
 13129525                     29 files


( note that I've highlighted the JAR file that I actually want )

and then extracted JUSt that JAR file: -

unzip ~/Downloads/db-derby-10.10.2.0-lib.zip "db-derby-10.10.2.0-lib/lib/derby.jar""

Note that I've specifically referenced the full path of the compressed JAR file: -

db-derby-10.10.2.0-lib/lib/derby.jar

and wrapped it in double-quotes.

However, this retains the original path, so I end up with this: -

ls -R /Users/davidhay/wlp/usr/shared/resources

db-derby-10.10.2.0-lib

/Users/davidhay/wlp/usr/shared/resources/db-derby-10.10.2.0-lib:
lib

/Users/davidhay/wlp/usr/shared/resources/db-derby-10.10.2.0-lib/lib:
derby.jar

Thankfully, the unzip command allows me to "junk" that path: -

man unzip

       -j     junk paths.  The archive's directory structure is not recreated; all files are deposited in the extraction directory (by default, the current one).

so, having cleared up the directory: -

rm -Rf /Users/davidhay/wlp/usr/shared/resources/*

I then re-ran the unzip command: -

unzip -j ~/Downloads/db-derby-10.10.2.0-lib.zip "db-derby-10.10.2.0-lib/lib/derby.jar"

Archive:  /Users/davidhay/Downloads/db-derby-10.10.2.0-lib.zip
  inflating: derby.jar             

leaving me with this: -

ls -R /Users/davidhay/wlp/usr/shared/resources

derby.jar

Nice !

Friday, 9 November 2018

How many open files ? "Too many open files"

I saw this today: -

[09/11/18 11:18:19:403 GMT] 00000176 FileDocument  E   ADMR0104E: The system is unable to read document /opt/ibm/WebSphere/AppServer/profiles/Dmgr01/config/temp/download/cells/odm892Cell01/cell.xml: java.io.IOException: Too many open files

during an IBM ODM Rules build.

This was a new RHEL 7.6 VM.

Guess what I'd forgotten ?

Yep, my ulimits etc.

<snip>
Set Ulimits etc.

vi /etc/security/limits.d/20-nproc.conf

# - nofile - max number of open files
wasadmin   soft    nofile  65536
wasadmin   hard    nofile  65536

# - nproc - max number of processes
wasadmin   soft    nproc   16384
wasadmin   hard    nproc   16384


vi /etc/security/limits.conf

* hard nofile 10240
* soft nofile 10240


vi /etc/sysctl.conf

fs.file-max = 524288
</snip>

A few vi commands and a reboot later, and we're good to go.

Thursday, 8 November 2018

Ubuntu 18.04 - Changing the hostname

So I did not realise that it's now so hard to change a hostname in Ubuntu, I've obviously been spoilt in the past.

I assumed that it was a case of: -

sudo hostname hostname.domain.com
sudo vi /etc/hostname
sudo vi /etc/hosts
sudo reboot

but, alas, no longer - it's now more like: -

sudo hostnamectl set-hostname icpboot.uk.ibm.com
sudo vi /etc/cloud/cloud.cfg
sudo vi /etc/hosts
sudo reboot

Whilst I'm on a rant n' roll, the mechanism for changing an IP address has also changed ….

Now it's more like this: -

sudo vi /etc/netplan/50-cloud-init.yaml 

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            addresses:
            - 192.168.1.200/24
            gateway4: 192.168.1.1

            nameservers:
                addresses:
                - 9.9.9.9
                - 8.8.8.8
                - 1.1.1.1
                search: []
            optional: true
    version: 2


which is nice.

Thursday, 1 November 2018

Apple TV Screensavers - On the Mac !

I've had this installed for a while, but noticed that it was a little more clunky since I had upgraded to macOS Mojave 10.14.1.

Thankfully, the oh-so-excellent author, John Coates, has updated it :-)

Aerial is a Mac screensaver based on the new Apple TV screensaver that displays the Aerial movies Apple shot over New York, San Francisco, Hawaii, China, etc. Starting with version 1.4, this also includes the new ISS videos available in tvOS 12!

Aerial is completely open source, so feel free to contribute to its development.




Docker CE on Ubuntu 18.10

That'll teach me to use the latest n' greatest Ubuntu 18.10 ( aka Cosmic ): -

sudo add-apt-repository \
>    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
>    $(lsb_release -cs) \
>    stable"


Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                                  
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                            
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease          
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.99 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.


sudo apt-get update

Get:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Hit:2 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease                                              
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                                                          
Hit:4 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                              
Ign:5 https://download.docker.com/linux/ubuntu cosmic InRelease
Err:6 https://download.docker.com/linux/ubuntu cosmic Release
  404  Not Found [IP: 13.35.198.85 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu cosmic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user configuration details.

Note that the add-apt command uses this: -

lsb_release -cs

which returns: -

cosmic

I checked this: -





which explains it - there's no stable release.

Easily hacked :-)

sudo add-apt-repository    "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   bionic \
   stable"


Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]
Get:3 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]                                                                         
Hit:5 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease           
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [2,414 B]
Fetched 231 kB in 1s (405 kB/s)
Reading package lists... Done

which pulls the stable release from the bionic ( Ubuntu 18.04 ) release instead.

sudo apt-get update

Hit:1 http://gb.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic-updates InRelease [83.2 kB]                              
Hit:3 http://gb.archive.ubuntu.com/ubuntu cosmic-backports InRelease                                                                                        
Hit:4 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                         
Get:5 http://security.ubuntu.com/ubuntu cosmic-security InRelease [80.5 kB]
Fetched 164 kB in 1s (322 kB/s)                                
Reading package lists… Done


sudo apt-get install docker-ce

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  wmdocker
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  aufs-tools cgroupfs-mount git git-man liberror-perl pigz
Suggested packages:
  git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed
  aufs-tools cgroupfs-mount docker-ce git git-man liberror-perl pigz
0 to upgrade, 7 to newly install, 0 to remove and 5 not to upgrade.
Need to get 44.8 MB of archives.
After this operation, 230 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 pigz amd64 2.4-1 [57.4 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 aufs-tools amd64 1:4.9+20170918-2 [104 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu cosmic/universe amd64 cgroupfs-mount all 1.4 [6,320 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 liberror-perl all 0.17026-1 [26.6 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic/stable amd64 docker-ce amd64 18.06.1~ce~3-0~ubuntu [40.2 MB]
Get:6 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git-man all 1:2.19.1-1ubuntu1 [822 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 git amd64 1:2.19.1-1ubuntu1 [3,529 kB]
Fetched 44.8 MB in 42s (1,064 kB/s)                                                                                                                         
Selecting previously unselected package pigz.
(Reading database ... 133402 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.4-1_amd64.deb ...
Unpacking pigz (2.4-1) ...
Selecting previously unselected package aufs-tools.
Preparing to unpack .../1-aufs-tools_1%3a4.9+20170918-2_amd64.deb ...
Unpacking aufs-tools (1:4.9+20170918-2) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../2-cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../3-docker-ce_18.06.1~ce~3-0~ubuntu_amd64.deb ...
Unpacking docker-ce (18.06.1~ce~3-0~ubuntu) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../4-liberror-perl_0.17026-1_all.deb ...
Unpacking liberror-perl (0.17026-1) ...
Selecting previously unselected package git-man.
Preparing to unpack .../5-git-man_1%3a2.19.1-1ubuntu1_all.deb ...
Unpacking git-man (1:2.19.1-1ubuntu1) ...
Selecting previously unselected package git.
Preparing to unpack .../6-git_1%3a2.19.1-1ubuntu1_amd64.deb ...
Unpacking git (1:2.19.1-1ubuntu1) ...
Setting up aufs-tools (1:4.9+20170918-2) ...
Setting up docker-ce (18.06.1~ce~3-0~ubuntu) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Setting up git-man (1:2.19.1-1ubuntu1) ...
Setting up liberror-perl (0.17026-1) ...
Setting up cgroupfs-mount (1.4) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...
Processing triggers for systemd (239-7ubuntu10) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up pigz (2.4-1) ...
Setting up git (1:2.19.1-1ubuntu1) …

sudo docker version

Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:24:51 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:23:15 2018
  OS/Arch:          linux/amd64
  Experimental:     false

I am living in the past - missing ifconfig on Ubuntu

I've just rolled a new VM comprising Ubuntu 18.10, ready to build a Docker/Jenkins/Maven/Git/Liberty PoC environment.

First thing I did was to check my IP address: -

ifconfig

Command 'ifconfig' not found, but can be installed with:

sudo apt install net-tools


Ewwwww :-(

This helped: -



so I tried that: -

ip address show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:2a:65:d1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.153.131/24 brd 192.168.153.255 scope global dynamic noprefixroute ens33
       valid_lft 1793sec preferred_lft 1793sec
    inet6 fe80::a101:3792:6392:ec9c/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever


I then dived back into the past: -

sudo apt install net-tools

[sudo] password for hayd: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  net-tools
0 to upgrade, 1 to newly install, 0 to remove and 5 not to upgrade.
Need to get 197 kB of archives.
After this operation, 811 kB of additional disk space will be used.
Get:1 http://gb.archive.ubuntu.com/ubuntu cosmic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-2ubuntu1 [197 kB]
Fetched 197 kB in 0s (1,454 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 133345 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-2ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up net-tools (1.60+git20161116.90da8a0-2ubuntu1) ...

and now I'm back there: -

ifconfig -a

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.153.131  netmask 255.255.255.0  broadcast 192.168.153.255
        inet6 fe80::a101:3792:6392:ec9c  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:2a:65:d1  txqueuelen 1000  (Ethernet)
        RX packets 5522  bytes 6355504 (6.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2406  bytes 252125 (252.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 328  bytes 24805 (24.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 328  bytes 24805 (24.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Good to be back !!!

Setting Authorization Headers in IBM API Connect Test and Monitor

I've recently started exploring the IBM API Connect Test and Monitor  tool on IBM Cloud here: - https://www.ibm.com/cloud/api-connect/...