go: cannot find main module; see ‘go help modules’

I was working on building a Docker image containing a go application when i ran in to the following error when running go tidy as a build step:
“go: cannot find main module; see ‘go help modules'”

The reason for this was that i had forgotten to specify a workdir in my Dockerimage (Alternatively, specified a go dir). Thus a fail safe error is triggered, as go simply gets confused over finding a go.mod in the gopath root folder, which is supposed to be within your source folder. [source]

The fix? Specify a WORKDIR in your Dockerfile.


Java + LetsEncrypt certificate giving SunCertPathBuilderException

During testing some java code i have for doing a check against i got an exception is have not seen before:

PKIX path building failed: unable to find valid certification path to requested target

After digging around i realised that the site in question has started using certificates from Lets Encrypt.

Java keeps their known certificate providers bundled with the installation, so if your JRE/JDK installation is not quite up to date, it will be as simple as to simply upgrade to the latest release. (Anything >= Oracle Java 8u101 has Lets Encrypt root cert bundled)

PHP Ubuntu

Adding SSH support to PHP on Ubuntu

I have previously written a post on how to add SSH support to PHP, but that post is old, and it has now become even easier to get it up and running. And therefore making it much easier to auto upgrade WordPress via SSH. (automatic, yay!)

As root, do the following:

1: apt-get install libssh2-1-dev libssh2-php

2: Check that is installed: php -m |grep ssh2

3: Restart apache: service apache2 restart

And you should now have SSH support in PHP.

Development Java

Java: How to get access to ClassLoader from static function

If you need access to the ClassLoader from a static function, for example in order to access a file inside your jar. You can get hold of it simply bu calling “YourClassname.class.getClassLoader()” 🙂

Development Java

GWT: Getting rid of iframe borders in IE8

IE8 defaults to displaying a frame border on iframes, this can be overridden by using the IFrameElement class.