Sunday, October 10, 2021

PageKite, an Open Source Alternative to Ngrok

I love ngrok and I've gladly paid the fees necessary to gain access to the commercial add-ons to their insanely robust and dependable solution to gain remote access to locally run services on many kinds of machines (Mac, Win, Linux).

However, when you have whole fleets of machines to run and especially in development mode when you need to be able to enable ad-hoc remote access (read ssh) to machines in the field, ngrok can become expensive as your go-to solution. While an excellent choice in many cases, if you need to be able to run your own public proxy and enable your own levels of scalability, ngrok's commercial offerings, while they are capable, make things difficult.

 Enter Pagekite (https://pagekite.net/) - functionally similar in many ways to ngrok, it offers an open source alternative that you can make your own. 

 Weirdly enough the team does not seem to be believe in the value they bring of being able to host your own proxy on the internet and make the feature a poorly documented afterthought. But if you can work out the relatively simple issues in terms of getting it all to work then they have a lightweight alternative to ngrok that can provide 90% of ngrok's features out of the box.

They offer their own hosted proxy service and if you're ok with that you'll find it simple enough to use. If you're looking to host your own and having trouble - feel free to write to me for tips


Friday, October 2, 2020

Docker Fails to Install: Ubuntu Xenial - 16.04

 Something that impressed me from the get-go about Docker was how simple it turns out to be to install and get the engine running on most platforms.

 Then the other day I got stuck trying follow their simple instructions to install it on Ubuntu 16.04 Xenial and if you have faced this - you would have tried all manner of things with package repositories, etc as well. 

 The following is an example of the related discussions which could solve your problem: 

  • https://askubuntu.com/questions/1030179/package-docker-ce-has-no-installation-candidate-in-18-04
  • https://unix.stackexchange.com/questions/363048/unable-to-locate-package-docker-ce-on-a-64bit-ubuntu 
  • https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04
  • https://medium.com/@randima.somathilaka/docker-engine-install-fails-in-ubuntu-3e70762c2187
  • https://www.liquidweb.com/kb/install-docker-ubuntu-16-04/

 

However - note that my problem was actually a simple but subtle one. and none of the above worked for me until I chanced upon this post: 

https://forums.docker.com/t/installation-failure-ubuntu-16-04-lts/43667

Thanks to madsivas! I had been trying to install on the i386 version - once I switched to the amd64 one, everything just worked.

Tuesday, March 10, 2020

PLC4X and MODBUS

I found an excellent resource to solve my MODBUS connectivity needs recently: PLC4x
The one thing that made the experience better than normal was the documentation - which was excellent.

However, weirdly enough the only problem I had using the library was also related to the documentation. If you're trying to follow the current documentation and failing to read MODBUS values 

The documentation specifies the addressing scheme as follows:




However, I kept having PlcFieldInvalidExceptions with the above format.
Eventually I had to go through the source to find that the patterns in use are actually like the following:
Holding Registers for Read -  readholdingregisters:{start-number}

Friday, December 13, 2019

Keycloak SMTP setup using AWS SES

Having problems setting up Keycloak SMTP with AWS SES?
Well I was too, for version 7.0.1

However, just make sure that you keep in mind that the following points:



  • The "Test Connection" button does not seem to be working. Clicking it throws up an error message - but actually things did get saved 
  • For AWS SES you need to use port 585
  • Disable SSL
  • Enable StartTLS

Thursday, November 21, 2019

Running KeyCloak behind Nginx rever-proxy

I have had some issues running KeyCloak 7.x in a docker container behind an Nginx reverse-proxy. Most of the standard stuff available as documentation for the various platforms works as-is. However, I could only get my configuration to work once I correctly used the KEYCLOAK_FRONTEND_URL environment variable. Essentially I had to set it as follows:

 KEYCLOAK_FRONTEND_URL: 'https://:{public-ip-address}:{public-https-port}'

Note: The important bit was writing the base url exactly as above. Ending it with a slash caused the prefixing to fail!

Sunday, June 30, 2019

Problems Giving SSH Access to Your Linux Instances?

I have a number of projects running under Google Cloud with some projects having Linux instances that collaborators from outside of my organization need ssh access to.

Google's systems have excellent documentation, but Google themselves created a little bit of nightmare working out exactly what I needed to do by making all notes, discussions on the solution accessible through their search system. The problem is that search results typically do not come with an expiry date and it was a good few hours of work to work my way through each of the options offered before realizing that they had been superseded.

To make this easier let me first provide some background for my need:
  • I have a technical collaborator who has a standard Google account 
  • The person is NOT in my organization (see Google documentation on what is meant by an organization) 
  • I also have Linux instances in projects under my organization this collaborator needs occasional command line access to 
  • I want to use the standard Google IAM access control mechanism rather than messing around with manual key based access control
  • I also wanted to give this person access to SSH over the browser because this makes things super easy for access from things like chrome books
If you needs are exactly as above firstly try Google - currently valid material is available at Google: https://cloud.google.com/compute/docs/instances/managing-instance-access#configure_users 

If this does not work for you try my steps (as of 30June2019):

Within 'IAM & admin' - Allow external logins at the Organization level


 

Within 'IAM & admin' - Add your users to your project as service account users:

Within 'Compute Engine-VM Instances' add the following permissions in your target VM for your external users