Microsoft Java Developer Conference – Seriously!!

Microsoft Java Developer Conference, those are words that I never thought I would say or hear!!!

Microsoft is hosting a 3-day virtual conference for Java developers on October 27, 28 & 29, 2020. You can find out more information and sign up at the following web page: aka.ms/jdconf

aka.ms/jdconf

Regards,
Roger Lacroix
Capitalware Inc.

Education, Java, Linux, macOS (Mac OS X), Unix, Windows Comments Off on Microsoft Java Developer Conference – Seriously!!

Java Method to Output a Byte Array in HEX Dump Format

On StackOverflow, I posted code to output a byte array in a HEX dump format. I thought I should post the code here as a complete working sample.

You can download the source code from here.

You can copy the 2 methods (dumpBuffer & formatHex) to your general purpose toolkit and use them in any Java project you have. The code is pretty straightforward. The method dumpBuffer expects 2 parameters: the byte array and the width of the HEX dump. Most people like a size of 16. You can use any value that is a multiple of 16 (i.e. 32, 48, 64, etc.).

There are all kinds of reasons why you would want to dump a byte array as a HEX dump but the primary reason is probably because the byte array has binary data that when outputted with System.out.println is displayed as garbage.

/**
 * Program Name
 *  Test_HEX_Dump
 *
 * Description
 *  A simple program to demonstrate how to output a byte array as a HEX dump.
 *
 * @author Roger Lacroix
 * @version 1.0.0
 * @license Apache 2 License
 */
public class Test_HEX_Dump
{
   /**
    * The constructor
    */
   public Test_HEX_Dump()
   {
      super();
      String song = "Mary had a little lamb, Its fleece was white as snow, And every where that Mary went The lamb was sure to go; He followed her to school one day, That was against the rule, It made the children laugh and play, To see a lamb at school.";

      dumpBuffer(song.getBytes(), 16);
   }

   /**
    * Dump a byte array as a standard HEX dump output
    * @param data the entire byte array
    * @param widthSize width of the HEX dump. Must be in multiples of 16
    */
   public void dumpBuffer(byte[] data, int widthSize)
   {
      int      endPt = widthSize;
      int      len = data.length;
      byte[]   tempBuffer = new byte[widthSize];

      if ((widthSize % 16) != 0)
      {
         System.err.println("Error: widthSize value ["+widthSize+"] is not a multiple of 16.");
      }
      else
      {
         if (widthSize == 16)
         {
            System.out.println("Address  0 1 2 3  4 5 6 7  8 9 A B  C D E F  0123456789ABCDEF");
            System.out.println("------- -------- -------- -------- --------  ----------------");
         }
         else if (widthSize == 32)
         {
            System.out.println("Address  0 1 2 3  4 5 6 7  8 9 A B  C D E F  0 1 2 3  4 5 6 7  8 9 A B  C D E F  0123456789ABCDEF0123456789ABCDEF");
            System.out.println("------- -------- -------- -------- -------- -------- -------- -------- --------  --------------------------------");
         }

         for (int i=0; i < len; i+=widthSize)
         {
            if (i+widthSize >= len)
               endPt = len - i;

            for (int j=0; j < endPt; j++)
               tempBuffer[j] = data[i+j];

            System.out.println(formatHex(tempBuffer, (i+widthSize < len?widthSize:len-i), i, widthSize ));
         }
      }
   }

   /**
    * Format an array of bytes into a hex display
    * @param src a portion of the byte array
    * @param len length of this part of the byte array
    * @param index location of current position in data
    * @param width width of the HEX dump
    * @return
    */
   private String formatHex(byte[] src, int lenSrc, int index, int width)
   {
      int i, j;
      int g = width / 4; /* number of groups of 4 bytes */
      int d = g * 9;     /* hex display width */
      StringBuffer sb = new StringBuffer();

      if ( (src == null) ||
           (lenSrc < 1)  || (lenSrc > width) ||
           (index < 0)   ||
           (g % 4 != 0)  ||   /* only allow width of 16 / 32 / 48 etc. */
           (d < 36) )
      {
         return "";
      }

      String hdr = Integer.toHexString(index).toUpperCase();
      if (hdr.length() <= 6)
         sb.append("000000".substring(0, 6 - hdr.length()) + hdr + ": ");
      else
         sb.append(hdr + ": ");

      /* hex display 4 by 4 */
      for(i=0; i < lenSrc; i++)
      {
         sb.append(""+"0123456789ABCDEF".charAt((src[i]) >> 4) + "0123456789ABCDEF".charAt((src[i] & 0x0F)));

         if (((i+1) % 4) == 0)
            sb.append(" ");
      }

      /* blank fill hex area if we do not have "width" bytes */
      if (lenSrc < width)
      {
         j = d - (lenSrc*2) - (lenSrc / 4);
         for(i=0; i < j; i++)
            sb.append(" ");
      }

      /* character display */
      sb.append(" ");
      for (i=0; i < lenSrc; i++)
      {
         if(Character.isISOControl((char)src[i]))
            sb.append(".");
         else
            sb.append((char)src[i]);
      }

      /* blank fill character area if we do not have "width" bytes */
      if (lenSrc < width)
      {
         j = width - lenSrc;
         for(i=0; i < j; i++)
            sb.append(" ");
      }

      return sb.toString();
   }

   /**
    * Entry point to program
    * @param args
    */
   public static void main(String[] args)
   {
      new Test_HEX_Dump();
   }
}

Here’s what the output looks like from running this sample:

Address  0 1 2 3  4 5 6 7  8 9 A B  C D E F  0123456789ABCDEF
------- -------- -------- -------- --------  ----------------
000000: 4D617279 20686164 2061206C 6974746C  Mary had a littl
000010: 65206C61 6D622C20 49747320 666C6565  e lamb, Its flee
000020: 63652077 61732077 68697465 20617320  ce was white as
000030: 736E6F77 2C20416E 64206576 65727920  snow, And every
000040: 77686572 65207468 6174204D 61727920  where that Mary
000050: 77656E74 20546865 206C616D 62207761  went The lamb wa
000060: 73207375 72652074 6F20676F 3B204865  s sure to go; He
000070: 20666F6C 6C6F7765 64206865 7220746F   followed her to
000080: 20736368 6F6F6C20 6F6E6520 6461792C   school one day,
000090: 20546861 74207761 73206167 61696E73   That was agains
0000A0: 74207468 65207275 6C652C20 4974206D  t the rule, It m
0000B0: 61646520 74686520 6368696C 6472656E  ade the children
0000C0: 206C6175 67682061 6E642070 6C61792C   laugh and play,
0000D0: 20546F20 73656520 61206C61 6D622061   To see a lamb a
0000E0: 74207363 686F6F6C 2E                 t school.

Regards,
Roger Lacroix
Capitalware Inc.

HPE NonStop, IBM i (OS/400), Java, JMS, Linux, macOS (Mac OS X), Open Source, Programming, Raspberry Pi, Unix, Windows 2 Comments

IBM MQ Fix Pack 9.2.0.1 Released

IBM has just released Fix Pack 9.2.0.1 for IBM MQ V9.2 LTS:
https://www.ibm.com/support/pages/downloading-ibm-mq-version-9201

Regards,
Roger Lacroix
Capitalware Inc.

Fix Packs for MQ, IBM i (OS/400), IBM MQ, IBM MQ Appliance, Linux, Unix, Windows Comments Off on IBM MQ Fix Pack 9.2.0.1 Released

Time for a Bigger NAS

If you read my old blog posting, you know I like and use Buffalo TeraStation as my NAS (Network Attached Storage). It supports Windows and macOS (Mac OS X) without any issues.

My current Buffalo TeraStation III 4TB (Terabyte) has been nearly full for at least a year. I have been selectively deleting files and zipping/compressing directories to maximize what space I have left on it. I even switched to using 7z format rather than zip because 7z can give a better compression ratio than zip. But its like trying to stop water going over a waterfall. The data just keeps coming!!

So, I decided to take the plunge and purchase a new NAS. Since the current and previous Buffalo TeraStations have worked well for me, I decided to check out what Buffalo has for the current generation of TeraStations for SMB (small and midsize business). The Buffalo TeraStation 6000 Series looked like exactly what I needed. They offer it in 4 configurations:

Buffalo TeraStation 6400DN
 
 
 

  • 8TB using two 4TB HDDs (TS6400DN0802)
  • 16TB using two 8TB HDDs (TS6400DN1602)
  • 16TB using four 4TB HDDs (TS6400DN1604)
  • 32TB using four 8TB HDDs (TS6400DN3204)

I want a NAS with 4 HDDs, so that I can configure it to use Raid 5. I decided on the 16TB 4 drive configuration. I checked the prices on amazon.ca and bestbuy.ca (Canadian sites). BestBuy didn’t have it but Amazon did for $2100 CAD (roughly $1500 USD) which is comparable to amazon.com’s pricing. I thought, what the hell, I’ll check the price of the 32TB configuration. Amazon.ca had it for $3500 CAD (roughly $2700 USD) but the amazon.com had it for $1986 USD. The amazon.ca listing was through a 3rd party seller that was clearly overcharging for it.

So, I sent an email to Mega Computer (local small retailer) and asked for pricing for both the 16TB and 32TB configurations. They reply with a quote of 16TB (4x4TB) $2099.99 CAD (roughly $1500 USD) and 32TB (4x8TB) $2699.99 CAD (roughly $2000 USD). I thought “excellent” and ordered the 32TB configuration. It might be overkill now but I’ll (actually my data) will grow into it. 🙂
Mr Burns
It arrived yesterday (Sept. 29). I have set it up, added the UserIds, Groups and created the shares I want on it. Late last night, I started copying the backup files from the old NAS to the new NAS and it is still copying the files 12 hours later. Right now, it says just over 19 million files to go!! So, I think its going to take awhile!! 🙂

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, Linux, macOS (Mac OS X), Operating Systems, Windows Comments Off on Time for a Bigger NAS

Free ‘Intro to Linux’ Course Surpasses One Million Enrollments

The Linux Foundation has announced its ‘Introduction to Linux’ training course on the edX platform has surpassed one million enrollments.

So, if you are working from home, or even in the office, and want to learn a new skill for free then you should sign up and take the free ‘Introduction to Linux‘ training course.

The Linux Foundation, in partnership with edX, offers two dozen free training courses on open source projects including Linux, Kubernetes, Hyperledger, etc.

Regards,
Roger Lacroix
Capitalware Inc.

Education, Linux, Open Source, Operating Systems, Programming Comments Off on Free ‘Intro to Linux’ Course Surpasses One Million Enrollments

Web Server Hardware Getting Upgraded Tonight (Sept. 25)

This is take-two. The hardware upgrade was scheduled for Tuesday night but it was delayed about an hour before it was to happen.

HostGator, Capitalware’s web hosting company, will be upgrading our web server tonight with new hardware (new unit with new SSDs).

So, if you find there are issues with our web sites, blog, emails, etc. please be patient and hopefully everything will be resolved by morning.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware Comments Off on Web Server Hardware Getting Upgraded Tonight (Sept. 25)

Dropping LZ1 support from MQ Message Compression

I have been doing a lot of a testing of various messages types (i.e. Fixed-width, CSV, XML, JSON, PDF, PNG, JPG, etc.). I’ll post the results in the next blog posting. I have decided to drop support for LZ1 compression algorithm from MQ Message Compression (MQMC) for the following reasons:

  • LZ1 has the slowest compression speed, by a factor of 4, compared to the other 7 compression algorithms included in MQMC
  • LZ1 is not cross-platform aware. i.e. It does not understand Big Endian and Little Endian integer conversion.

Nobody will choose a super slow compression algorithm with average compression results. That is why I decided to drop support for it.

Therefore, MQ Message Compression will support the following 7 lossless compression algorithms going forward:

  • LZ4 – It is promoted as extremely fast (which it is).
  • LZW – I used Michael Dipperstein’s implementation of Lempel-Ziv-Welch.
  • LZMA Fast – I used the LZMA SDK from 7-Zip with a Level set to 4.
  • LZMA Best – I used the LZMA SDK from 7-Zip with a Level set to 5.
  • RLE – Run Length Encoding – I wrote the code from pseudo code – very basic stuff.
  • ZLIB Fast – I used Rich Geldreich’s miniz implementation of ZLIB with a Level of Z_BEST_SPEED.
  • ZLIB Best – I used Rich Geldreich’s miniz implementation of ZLIB with a Level of Z_BEST_COMPRESSION.

I plan on building MQMC for AIX, HP-UX, IBM i (OS/400), Linux (x86, x86_64, POWER & zSystem), Solaris (SPARC & x86_64) and Windows. MQMC will support IBM MQ v7.1, v7.5, v8.0, v9.0, v9.1 and v9.2.

Beta testing MQ Message Compression is absolutely free including support (no strings attached).

If you interesting in trying it out, please send an email to support@capitalware.com to request a trial of MQ Message Compression.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, Compression, IBM i (OS/400), IBM MQ, Linux, MQ Message Compression, Unix, Windows Comments Off on Dropping LZ1 support from MQ Message Compression

Microsoft Screwed Me Again

On Tuesday, Windows 10 Pro said that my current release of Windows 10 (I believe it was 1904) was going out of support and I needed to upgrade to release 2004. Against my better judgment, I allowed it to proceed when I went to bed Tuesday night then the problems started on Wednesday (yesterday).

What dumb-ass developer or team or management at Microsoft allows an update to go around deleting settings and breaking a user’s environment. Yes, Microsoft Windows people, I’m calling you all a bunch of dumb-asses.

So far, I have found that the Windows 10 update has broken or deleted the following:

(1) Broke MQ – I could no longer use amqmdain command. When I run it, I get the following error:

AMQ6509E: Unable to update registry value.

After some internet searches, I found that I needed to run the following command to fix the issue:

crtmqdir -f -a

(2) Deleted a registry entry that set my ALT-Tab to WinXT style ALT-Tab:

After some internet searches, I found I had to do the following

– Create a DWORD Value called AltTabSettings in HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer and set it to 1.

– Rebooted

(3) Broke connection to Buffalo TeraStation – it disabled SMB
After some internet searches, I found this page and did the following:

– Open Control Panel.
– Click on Programs & Features
– Click on Turn Windows features on or off.
– Expand the SMB 1.0/CIFS File Sharing Support option.
– Check/Select all 3 SMB 1.0/CIFS entries
– Click the OK button.

– Rebooted

Because of this, last nights backups ALL FAILED. What if I had an emergency because of some sort of issue or corruption or ransomware? I would be using 2 day old data!!! And not the previous day!!

(4) Broke 8GadgetPack
I had to perform a repair of the package and then it worked again.

This is what I have found and fixed so far. Microsoft, I don’t have time for your dumb-ass stupidity. What the hell is wrong with you people?!?! I’m in the middle of helping customers test a new product and I don’t have time for this shit!!!

There. I feel better after venting.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, IBM MQ, Windows Comments Off on Microsoft Screwed Me Again

How to (Properly) Setup ASUS AiMesh

One thing always leads to another!

In my house (and home office), I had an ASUS RT-AC68U router (on main floor) and a Tenda W150M router (in basement). Once in a while, someone would complain that the ‘internet is not working’ or ‘internet sucks’! Sometimes it would be as simple as being on the wrong router (i.e. being on the main floor but connected to Tenda in the basement). Other times, I would just reboot the router.

A couple of weeks ago, our neighbor, directly across from us, had their SUV stolen in the middle of the night. Cynthia (my wife) said she now wanted a camera in front to cover our drive. We have a Nest doorbell camera but it only shows the view down our side walk to the street.

Nest Doorbell
She found that Best Buy had a 2 pack of Google Nest WiFi outdoor 1080p cameras on sale. So, I went to Best Buy and purchased it. She also signed up for the Google Nest subscription to store the video in the cloud. The next day installed one on each side of the garage. Mounting them wasn’t to difficult but doing the WiFi setup is really slow. I guess it double and triple checks for WiFi signals which takes a very long time.

Driveway 1 Driveway 2

Kyle setup a PS4 and a 32” monitor on a tray in the family room, so that he could play Fall Guys using WiFi during intermission when we were watching NHL and NBA playoff games. After I added the cameras to the network, he complained that he was losing games because the router was dropping the PS4 connection. And my wife and other kids were complaining about a slow internet.

My ISP allows the customer to have 2 IP addresses. I have an extra router called: CradlePoint MBR95. So, I had the bright idea of putting the CradlePoint router at the front window and running a cable back to the modem and have the 2 Nest cameras and doorbell connect to the CradlePoint router. I offloaded the Nest traffic to a different router, problem solved, so I thought. But it didn’t seem to make a difference. When I logged into CradlePoint router, under WiFi connection, it was showing 50%-70% channel conflict. I tried to manually set the channel to reduce the conflict with the other routers but I could only get it down to 30%. People were still complaining about a slow internet plus the far Nest camera kept going online-offline-online-offline.

I got fed up with it and since I had noticed that ASUS supported a mesh network called AiMesh, I thought why not. I looked at the instructions and it seemed pretty straightforward. If you want an indepth review then read Dong Ngo’s AiMesh Review: Asus’s Ongoing Journey to Excellent Wi-Fi Coverage post.

I decided to use my existing ASUS RT-AC68U router as a node and purchase another ASUS RT-AC68U router to be used as another node. As the primary router, I decided to purchase ASUS RT-AC86U router.

I checked Amazon, Best Buy on pricing and sent an email to Mega Computer (local small retailer). Mega Computer didn’t have ASUS RT-AC86U in stock but had ASUS GT-AC2900 in stock. He offered $20 off to make it the same price as RT-AC86U for $249 CAD (roughly $190 USD) and ASUS RT-AC68U for $179 CAD (roughly $135 USD). So, I bought the items from Mega Computer.

I decided on the following setup: the primary router would be at the very front of the house (main floor), a node at the very back of the house (main floor) and a node in the basement. The ASUS AiMesh can use both wired and wireless for back-hauling. I have partially hard-wired my house with cat 6 Ethernet cable. I have cabling in my office to the server room in the basement and wired the kids game room in the basement. Hence, the node in the basement would use wired backhaul. For the node at the back of the house (kitchen), I decided to run cabling along the baseboards into the kitchen and up on top of the kitchen cabinets. The cabinets don’t go all the way to the ceiling, so I ran the cabling until I ran out of cabinets. The cabinets have a thick top molding, so all you see is 3 little antennas sticking up.

Next, I followed the instructions and upgrade the firmware on all 3 routers. On the primary router (ASUS GT-AC2900), setup the usual stuff: LAN IP address, DHCP server starting and ending range, SSID name for 2.4GHz and SSID name for 5GHz (I use different names i.e. Speedy_2.4 and Speedy_5.0). Make sure everything is setup regardless if you are using the AiMesh or not.

I followed the instructions for resetting the nodes but getting the nodes to be recognized by the primary for AiMesh was impossible. I tried over and over but wasted an hour of my time. I decided to do the setup manually. It is really easy if you have 2 PCs/laptops otherwise you will be doing a lot of cable swapping. Or download the ASUS Router app to your smart phone and use 1 PC.

Next, connect the node to the primary router. Plug the Ethernet cable into a LAN (Yellow or Black) port of the primary router and plug the other end of the cable into the WAN (Blue) port of the node. On your PC log into the node’s administration panel and then click Administration tab and then select AiMesh Node radio button.

You should see the following:
Node setup image 1

Click the Next button to proceed. And it will begin:

Node setup image 2
This will take several minutes to complete. You just have to wait it out. When it is done, you will see the following screen:

Node setup image 3

Now go to your primary router and do the following: click Network Map tab, next click the AiMesh Node icon then click the Search button:

Node setup image 4

It will popup a window of the found node, simply accept it and you are done. 🙂

The manual process may require 2 PCs/laptops or 1 PC and a smart phone but it is not complicated and works!! If you have more nodes to add, just repeat the process. As you can see, I have 2 nodes. If you click on a node in the list then you can change the name of it and see a list of connected users.

Node setup image 5

Now people in the house can wander from upstairs to main floor to the basement without switching their WiFi settings on their device. So far, I haven’t heard ‘internet is not working’ or ‘internet sucks’. 🙂

Finally, both the Tenda and CradlePoint routers have been disconnected and put away, as they are no longer needed. In the future, I may add a 3rd node in hallway upstairs but I’ll wait and see if there any complaints about reception in the bedrooms. 🙂

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, Education, Security Comments Off on How to (Properly) Setup ASUS AiMesh

Beta testers needed for MQ Message Compression

Capitalware is ready for beta testers for a new solution called: MQ Message Compression (MQMC). MQMC is an MQ API Exit.

Question: Would you trade a little CPU time to drastically reduce the disk I/O time?

I have written a long blog posting on the internals of queue manager logging (with help from Chris Frank) and why you might want to use message compression to speed up message processing time.

The MQMC supports the following 8 lossless compression algorithms:

  • LZ1 (aka LZ77) – I used Andy Herbert’s modified version with a pointer length bit-width of 5.
  • LZ4 – It is promoted as extremely fast (which it is).
  • LZW – I used Michael Dipperstein’s implementation of Lempel-Ziv-Welch.
  • LZMA Fast – I used the LZMA SDK from 7-Zip with a Level set to 4.
  • LZMA Best – I used the LZMA SDK from 7-Zip with a Level set to 5.
  • RLE – Run Length Encoding – I wrote the code from pseudo code – very basic stuff.
  • ZLIB Fast – I used Rich Geldreich’s miniz implementation of ZLIB with a Level of Z_BEST_SPEED.
  • ZLIB Best – I used Rich Geldreich’s miniz implementation of ZLIB with a Level of Z_BEST_COMPRESSION.

I plan on building MQMC for AIX, HP-UX, IBM i (OS/400), Linux (x86, x86_64, POWER & zSystem), Solaris (SPARC & x86_64) and Windows. MQMC will support IBM MQ v7.1, v7.5, v8.0, v9.0, v9.1 and v9.2.

Beta testing MQ Message Compression is absolutely free including support (no strings attached).

If you interesting in trying it out, please send an email to support@capitalware.com to request a trial of MQ Message Compression.

Regards,
Roger Lacroix
Capitalware Inc.

Capitalware, Compression, IBM i (OS/400), IBM MQ, Linux, MQ Message Compression, Unix, Windows Comments Off on Beta testers needed for MQ Message Compression