OpenBSD v6.8 Released

Theo de Raadt has just released OpenBSD v6.8.
http://www.openbsd.org/67.html

The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography.

Regards,
Roger Lacroix
Capitalware Inc.

Open Source, Operating Systems Comments Off on OpenBSD v6.8 Released

IBM MQ on Raspberry Pi

Max Kahan has posted a blog posting detailing how to get up and running with IBM MQ on Raspberry Pi.

IBM MQ on Raspberry Pi – our tastiest developer edition yet!

Regards,
Roger Lacroix
Capitalware Inc.

IBM MQ, Raspberry Pi Comments Off on IBM MQ on Raspberry Pi

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