Hello, I have also published a book of all the Gof Design Patterns implemented in Python.

Image for post
Image for post
Common GOF (Gang of Four) Design Patterns implemented in Python

I’ve revisited and rewritten all of the 23 GoF design patterns and compiled them into a book with conceptual and use case code examples and discussions.

Please check it out at Amazon ASIN : B08XLJ8Z2J

US : https://www.amazon.com/dp/B08XLJ8Z2J
UK : https://www.amazon.co.uk/dp/B08XLJ8Z2J
DE : https://www.amazon.de/dp/B08XLJ8Z2J
FR : https://www.amazon.fr/dp/B08XLJ8Z2J
ES : https://www.amazon.es/dp/B08XLJ8Z2J
IT : https://www.amazon.it/dp/B08XLJ8Z2J
JP : https://www.amazon.co.jp/dp/B08XLJ8Z2J
CA : https://www.amazon.ca/dp/B08XLJ8Z2J

Design patterns will give you a useful and common vocabulary for when designing, documenting, analyzing restructuring new and existing software development projects now and into the future.

Sean


Image for post
Image for post
Photo by Lacie Slezak on Unsplash

What does that even mean?

It is the difference between using Module Specifiers Versus Relative Import References in your client side JavaScript ES6 imports.

The error typically happens when using Module Specifiers in your client side import statements. The browser does not understand Module Specifiers by default.

The error you see in the console describes “relative references”. It is expecting a URL.

In this article, I outline the differences of using Relative Import References versus Module Specifiers.

I will use Threejs ES6 module references in the example code.

eg, using Module Specifiers

import * as THREE from 'three'
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'

Versus…


You may already know how to bind SSL to port 443 on your apache webserver in Ubuntu 20.04,

But in case you don’t know, here is a clue.

The not so complicated approach is to create a new VirtualHost record that the Apache server will load when restarted.

You could create a new file in the /etc/apache2/sites-enabled/ folder named something like your-domain-name.tld.conf

sudo nano /etc/apache2/sites-enabled/my-domain-name.com.conf

And in that file you would have something similar to

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName my-domain-name.com
ServerAlias *
DocumentRoot /var/www/html
SSLEngine On
SSLCertificateFile /path-to-certificate/fullchain.pem
SSLCertificateKeyFile /path-to-certificate-key/privkey.pem
</VirtualHost>
</IfModule>

Of course, your domain name would be…


This is a small example demonstrating how to set up an Elasticsearch Cluster mirrored across several geographic locations.

Image for post
Image for post

I will create 3 identical Ubuntu 20.04 servers in different regions of the world.

I will install Elasticsearch and Metricbeat on the servers and configure them with identical settings. Note that I am using Metricbeat as an example collector. You can install other beats, such as Filebeat and other collectors instead or in addition to Metricbeat. There are many possibilities.

My servers will from Digital Ocean.

I will select the basic droplets being $10 a month — Ubuntu 20.04, 2GB Ram, 1…


Image for post
Image for post
Photo by Matteo Vistocco on Unsplash

Now that we have a Loki data source setup we can query it with the LogQL query language.

In this article we will try out many LogQL queries in the systemd-journal stream selector that we just set up in my previous articles.

There are two types of LogQL queries:

  • Log queries returning the contents of log lines as streams.
  • Metric queries that convert logs into value matrixes.

A LogQL query consists of,

  • The log stream selector
  • Filter expression

We can use operations on both the log stream selectors and filter expressions to refine them.

Log Stream Selectors

Operators

  • = : equals
  • != : not…


Image for post
Image for post

Now I'm going to show you a slightly more advanced item to monitor, and this one is specific to windows, and that is the Security Event ID 4625, also known as “Failed Logon”.

Monitoring this event id can be used as an early warning indicator that your server is under attack, or even someone just forgot there password and you can jump up, bounce over to there desk, and proudly offer assistance before they even ask. Or you could look across the office and say, “Hey Bartholomew, may I assist you with a password reset?”

What ever your reason is…


We can create custom MySQL time series queries that read data from our custom tables in our custom MySQL databases and reformat the result sets in a way that Grafana can use in visualisations.

In my previous article, Install a MySQL Dashboard and Collector in Grafana, I installed a scheduled task on my MySQL server that queries the global status every 10 minutes along with several other things.

mysql> show global status

The response from the query is saved into a custom table named my2.status as time series data. …


Image for post
Image for post
Install MySQL Dashboard and Collector in Grafana

Now that we have a MySQL Data Source created in the last article at Create a Grafana MySQL Data Source, we will install a dashboard for it.

The dashboard will be the popular 2MySQL Simple Dashboard you can download from https://grafana.com/grafana/dashboards?dataSource=mysql

Before installing the dashboard, we need to set up a collector on our MySQL server.

The collector script is downloaded from https://github.com/meob/my2Collector

There are 2 sql scripts in this repository. You will only need the one relevant for your version of MySQL.

To find out which version of SQL you have, SSH onto your server and enter

mysql -V


Image for post
Image for post
The Grafana MySQL Data Source Configuration Screen

Grafana doesn’t exist by itself. It needs data, and it gets its data through data sources.

In this quick article I will show you how to create a new MySQL Data Source in Grafana.

I also demonstrate how to install a MySQL database server in case you don’t have one. You will need a database server.

I install the MySQL database on my existing Grafana Server to make it easier to follow this example.

If you don’t have a Grafana server already setup then see my beginners article on how to Install and Start Grafana.

You can install MySQL on…


Image for post
Image for post

The proxy design pattern is a class functioning as an interface to another class or object.

A proxy could be for anything, such as a network connection, an object in memory, a file, or anything else you need to provide an abstraction between.

It is a wrapper called by a client to access the real underlying object.

Additional functionality can be provided at in the proxy abstraction if required. eg, caching, authorization, validation, lazy initialization, logging.

The proxy should implement the subject interface as much as practicable so that the proxy and subject appear identical to the client.

The Proxy…

Sean Bradley

Developer of real time, low latency, high availability, asynchronous, multi threaded, remotely managed, fully automated and monitored solutions.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store