Packet Radio on Debian 9 with Direwolf and ax25

I’ve played around with Packet and Direwolf on the Raspberry Pi quite a bit, but every time I try and getting it working on Linux on a desktop I run into some differences in the config. From past attempts, I followed most of the steps I had followed before here.

The following steps are with a USB Rigblaster Plug n Play, connected to the dataport on my Icom 880h radio .

I installed and compiled Direwolf from source as before, and started it up with:

$ direwolf -t 0 -p
Dire Wolf version 1.5
Reading config file direwolf.conf
Audio device for both receive and transmit: plughw:0,0 (channel 0)
Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, E+, 44100 sample rate.
Ready to accept AGW client application 0 on port 8000 …
Ready to accept KISS TCP client application 0 on port 8001 …
Virtual KISS TNC is available on /dev/pts/1
Created symlink /tmp/kisstnc -> /dev/pts/1

I installed the ax25 apps as in the previous article, and then added 1 line to /etc/ax25/ports:

1    KK6DCT-1    1200    255 2   2m packet

I then started kissattach:

$ sudo kissattach /dev/pts/1 1

/dev/pts/1 is the value from when Direwolf started, and port 1 is the line I added to the ports file.

From here I can connect to the local ag6qo-1 BBS, via the BERR37 node:

axcall 1 ag6qo-1 via berr37

Weblogic 12c (12.1.3) Datasource for MySQL 8.0.15 getting error: Unable to load authentication plugin ‘caching_sha2_password’

When creating a new Datasource on Weblogic 12.1.3 to MySQL 8.0.15, I got this error:

Unable to load authentication plugin 'caching_sha2_password'.
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)

A quick search found this question, and the solution is to switch the password encryption back to the approach used in prior MySQL versions with:

ALTER USER 'youruserid'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newpassword';

What defines ‘simple’ code?

Simple code is not complex code. Ok, well what does complex code looks like? We don’t like or want complex code because it is:

  • hard to read
  • hard to understand
  • difficult to update and maintain

Ok, so simple code therefore is:

  • easy to read
  • easy to understand
  • easy to update and maintain

As a result of the above, other benefits become more easily within reach. For example, simple code is easier to unit test.

What can we do to ensure we write simple code? Many of the commonly known (but not commonly applied) industry best practices lead to simpler code. For example:

  • Single Responsibility Principal: Bob Martin defines this as a ‘single reason to change‘. A class should have a single responsibility, one feature that it is responsible for. If there is more than one reason that would require changes to this class, it has more than one responsibility, and therefore is doing ‘too much’.
  • A class or a method should do one thing and do that one thing well. Not 10 things, not 5, just one thing. Limiting to just one thing reduces the opportunity for complexity to creep in (this is really the same idea as the Single Responsibility Principal).
  • A single method short be short enough that you can easily read it and grasp the whole intent. Too long is when you have to scroll page after page, and at that point, it’s difficult to grasp the entire purpose of the method, without scrolling around and re-reading. If it takes you too long to read to the end of a method, and by the time you get there you’ve already forgotten what it was doing at the start, and the start of the method is already several pages off the top of your screen, your method is too long.
  • Clearly named variables, methods and class names: a clear name that describes what the variable is for (it’s purpose, what does it represent), what a method does, what a class does, helps to convey it’s purpose and improve understanding. A method that does something else other that what it’s name describes it not simple and it not easy to understand. We don’t like surprises.
  • Clear documentation. In Java we use JavaDoc. Your JavaDoc should describe what the Class does, what each public (at least) method does. It should NOT state the obvious, it shouldn’t repeat what is already implied from your clear class and method names. If you’re just repeating what the method name says, you’re not aiding readability, you’re adding more content that I have to read, but for no gain. For example, this is not useful documentation, although many developers do this:
/**
* This method creates a new account.
*/
public Account createAccount(){
...
}

… I know it’s a method because I am a developer, you don’t need to tell me that. I know this method creates an account, because the method name says so. This JavaDoc adds no additional value, and if there’s no additional detail to be added, it would be best just left out.

If you set out from the start to create simple code, it’s more easily achievable than creating something too complex and then trying to simplify. Refactoring is your friend, and you should always invest time to refactor when you’ve finished your first iteration of getting your code working. However, by aiming to avoid complexity from the start you can make your job easier in the long run.

What does ES6’s spread operator (…) do and what can you use it for?

Some language features are easy to guess what they do even if you’re unfamiliar with them, but it’s not immediately obvious what the ES6 spread operator ‘…’ does.

Here’s a great article that gives some practical examples of how you can use the spread operator, for example, to:

  • insert one array into another
  • copy the contents of an array
  • convert a String into an array of chars