[SOLVED] Deleting remote git branch; By default, deleting the current branch is denied, because the next remote: ‘git clone’ won’t result in any file checked out, causing confusion

This is a common error encountered where you are renaming your default branch for the repository. If you have a repo hosted on GitHub or some other third-party service, there is likely some way in the GUI to change the default branch for a repo.

If you are hosting your own internal git repository you will need to SSH to that server and “checkout” a different branch from the one that you are trying to delete. In reality, the remote → Continue reading “[SOLVED] Deleting remote git branch; By default, deleting the current branch is denied, because the next remote: ‘git clone’ won’t result in any file checked out, causing confusion”

[SOLVED] Upgrading Apache Kafka 2.7 to Java 11 Changes authenticationID sent to ZooKeeper Enabling Only 1 Kafka Broker to r/w znodes

The title of this post is a bit of mouthful and requires a bit more explanation.

I am running a pure open-source version of Kafka (currently running 2.7) and am using SASL/GSSAPI connections between all of the brokers and ZooKeeper. Currently, the whole system, including ZooKeeper, is running Java 8 and it is long-overdue to be upgraded to Java 11.

Upgrading Kafka to Java 11 causes the server to send an incorrect authenticationID String to ZooKeeper which results in the → Continue reading “[SOLVED] Upgrading Apache Kafka 2.7 to Java 11 Changes authenticationID sent to ZooKeeper Enabling Only 1 Kafka Broker to r/w znodes”

Crock Pot Black Bean Soup

Prep: 20 minutes; Cook: 2 hours; Total: 2 hours 20 minutes; 8 Servings

Ingredients

  • 3 15oz. cans black beans drained and rinsed
  • 1 4 oz. can green chilis
  • 1 cup chunky salsa
  • 1 cup vegetable broth
  • 1/2 medium white onion, finely minced
  • 3 tablespoons minced garlic
  • 2 tablespoons cumin
  • 1.5 tablespoons chili powder
  • 1 teaspoon paprika
  • 1/4 teaspoon salt
  • 1/4 teaspoon pepper

Instructions

  1. Place everything in a slow cooker, mix well, and cover.
  2. Cook on high for 2 hours, stirring
Continue reading “Crock Pot Black Bean Soup”

Thai Curry Tofu

Curried tofu made with coconut milk.

  • 1 tablespoon canola oil
  • 1 (12 ounce) package extra-firm tofu, drained and cubed
  • 1 tablespoon seasoned salt, or to taste
  • 1 tablespoon butter or margarine
  • 1 small onion, chopped
  • 3 cloves garlic, minced
  • 1 (10 ounce) can coconut milk
  • 2 teaspoons curry powder
  • ½ teaspoon salt
  • ¼ teaspoon ground black pepper
  • ¼ cup chopped fresh cilantro
  1. Heat oil in a large skillet over medium-high heat. Add tofu cubes, season with seasoned salt and
Continue reading “Thai Curry Tofu”

Baseline Settings for a VirtualBox Instance for a GUI under Debian 10

The following is a list of the basic VirtualBox settings to start with when using a VM with a GUI. Make sure to install the Guest Additions on the VM as well.

  • System
    • Motherboard
      • 4+GB of RAM, or whatever you have available
    • Processor
      • 2+ CPU (if you have the available cores/threads)
  • Display
    • As much Video Memory as you can spare
    • Graphics Controller: VBoxVGA

Continue reading “Baseline Settings for a VirtualBox Instance for a GUI under Debian 10”

Mousse au Chocolat or Chocolate Mousse Recipe

Serves 8 to 10

  • 4 x 1 ounce-squares unsweetened chocolate
  • 3/4 cup sugar
  • 1/4 cup water
  • 6 eggs, separated
  • 2 tablespoons dark rum
  1. In top of double saucepan combine chocolate, sugar and water. Cook over hot water, stirring occasionally, until chocolate is melted.
  2. Add egg yolks, one at a time, beating well after each addition. Remove from heat; cool.
  3. Meanwhile, in mixing bowl beat egg whites until stiff but not dry.
  4. Stir rum into chocolate mixture; pour over egg whites.
Continue reading “Mousse au Chocolat or Chocolate Mousse Recipe”

message=class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext When Mocking Static Methods in Class

When mocking static classes with Junit4, Mockito and PowerMock, you may see the following log messages after annotating your test class if the code that you are testing is making HTTP connections:

message=class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext

Your annotations for the class (or method) typically include the following:

@RunWith(PowerMockRunner.class)
@PrepareForTest({ SomeClassYouWantToMock.class })

This may cause some confusion, especially if whatever other code that you may have ONLY uses HTTP. Add the following to your annotations to tell → Continue reading “message=class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext When Mocking Static Methods in Class”

Creating a Counter or Progress Bar for a Python Program

I’ve written a number of Python apps where I would like it to print some sort of counter or progress bar to STDOUT to let me know that it is still running instead of locked up or died somehow without me being able to see it.

I had tried using a couple of different existing progress bar related modules but none of them really worked except in a very specific use case.

So, after a bit of futzing around I → Continue reading “Creating a Counter or Progress Bar for a Python Program”

How To Spy and Verify a Static Void Method in Java

The Mockito and PowerMockito libraries for JUnit4 are not always the most intuitive.

Following is an example of how to spy and verify a static void method.

    @Test
    public void testAdd() {

        // Prepare the Utils class to be spied.
        PowerMockito.spy(Utils.class);

        // Run the test and get the actual value from the OUT
        int actualValue = App.add("Test1", 1, 1);

        /*
         * To verify the number of times that we called Utils.doSomething we
         * first need to tell the PowerMockito library 
Continue reading “How To Spy and Verify a Static Void Method in Java”

Using sed with regex capture groups

There are many times when you have a file from which you want to extract specific strings based on a regex and using a capture group is a very efficient way to parse multiple strings from the same line.

I have found that sed is the easiest way to do so on the Linux command line.

Given the following input file:

This is a line of text with a year=2020 month=12 in it
This line of text does not have 
Continue reading “Using sed with regex capture groups”