Spaghetti Squash, Spinach and Turkey Sausage Lasagna

Ingredients

  • 2 small or 1 large spaghetti squash
  • 4 TB olive oil
  • 4 garlic cloves, minced
  • 1 cup onions, diced
  • 1 cup red peppers, diced
  • 8 oz fresh spinach
  • 1/2 cup part-skim ricotta cheese
  • 1 cup shredded mozzarella cheese, divided
  • 1 lb. ground mild Italian turkey sausage, or vegetarian sausage
  • 2 cups marinara sauce
  • Red pepper flakes, use amount based on desired spice/heat level
  • 1/4 cup parmesan cheese

Instructions

  1. Preheat oven to 425° and line a large baking sheet with aluminum foil and spray with non stick cooking spray. Scrub the squash clean and dry thoroughly. In a separate microwavable safe dish, place the whole squash and microwave on high for 5 minutes to make it easier to cut (do not microwave whole squash for more than 5 minutes). Carefully cut the squash in half lengthwise (stem to bottom end). Scoop out the seeds and discard. Drizzle the inside of the squash with 3 TB olive oil using your hands to coat the entire surface of the squash. Sprinkle with salt and pepper to taste and place cut-side down on the lined baking sheet. Place squash in the oven and bake for 45 minutes to 1 hour or until squash is tender when pierced with a fork. Remove from oven and let cool. Use a fork to scrape the squash strands from inside. Place strands in a large bowl, set aside.
  2. Heat a large skillet over medium-high heat. Add 1 TB oil to pan; add minced garlic; cook 30 seconds. Add spinach; cook 1 minute or until spinach wilts. Remove from heat and add to the bow! of squash strands, toss to combine. Add 1/2 cup ricotta cheese, 1/4 tsp salt & black pepper, and 1/2 cup mozzarella cheese, to the mixture and toss to combine.
  3. Return same skillet to medium-high heat. Add ground turkey sausage to pan; Cook 8 minutes or until browned, stirring to crumble. Add diced onions and cook for another 5 minutes. Add diced peppers and cook for 3 minutes. Add 2 cups marinara sauce and red pepper flakes for you desired spice/heat preference; reduce heat to medium, and simmer 4 minutes.
  4. Spray a 9 x 12 baking dish with cooking spray. Spread turkey/marina sauce mixture evenly into the bottom of the pan. Top with squash/ spinach/cheese mixture. Sprinkle with remaining 1/2 cup mozzarella cheese and 1/4 cup Parmesan cheese
  5. Bake at 425° for 30-30 minutes until cooked through and cheese is golden brown and bubbly. Remove from oven, let stand 10 min before serving.

Pepperoni Pizza Twist

Ingredients

  • 1 package (3.5 ounces) pepperoni slices, diced
  • 1 can (3.24 ounces) pitted, ripe olives, drained and chopped
  • 2 tablespoons snipped fresh parsley
  • 1/2 cup shredded mozzarella cheese
  • 2 tablespoons all-purpose flour
  • 1 garlic clove, pressed
  • 2 packages (11 ounces each) refrigerated French bread dough
  • 1 egg
  • 1 teaspoon Italian seasoning mix
  • 2 tablespoons grated fresh Parmesan cheese
  • 1 can (15 ounces) pizza sauce

Instructions

  1. Preheat oven to 3750 F
  2. Dice pepperoni and chop olives and prep the parsley
  3. Combine pepperoni. olives, parsley, mozzarella cheese, flour, pressed garlic and mix well
  4. Place bread dough, seam sides up, on smooth side of a large cutting board. Using a serrated bread knife, slice each loaf length-wise, end to end, cutting halfway through to center of loaf, and spread open flat.
  5. Lightly sprinkle additional flour evenly over dough .Roll dough crosswise to a 4-inch width, creating a well down the center of each loaf.
  6. Spoon half of the pepperoni mixture down center of each loaf. Gather up edges over filling, pinching firmly to seal.
  7. Place loaves seam sides down, in an V pattern on rectangle baking stone and crisscross ends of dough to form a large figure 8 keeping end of dough 1 inch from edge of stone and leaving two 1 1/2 inch openings in center of the twist
  8. Separate egg and discard yolk. Beat egg while and seasoning mix and brush over the twist with a pastry brush. Cut a slit in each of the top sections of the twist to reveal filling
  9. Sprinkle grated Parmesan cheese over loaf
  10. Bake about 30 minutes or until deep golden brown
  11. Remove from oven and place on cooling rack and cook for about 10 minues
  12. Cut into slices and serve.

Dumplings

A simple recipe for classic dumplings that can be added to any stew or soup that you would like.

Ingredients

  • 2 cups flour
  • 4 teaspoons baking powder
  • 3/4 cup milk
  • 4 tablespoons vegetable oil

Instructions

  1. Sift flour
  2. Mix together dry ingredients
  3. Mix milk and oil into dry ingredients just enough for them to be combined. Over mixing will make the dumplings dense and tough
  4. Drop tablespoons worth of dough into simmering soup or stew and cook covered for about 10 or 15 minutes

Baked Tofu Cubes

This is a recipe for preparing tofu cubes for a number of different dishes. The result is cooked tofu cubes with a great texture that hold together well when added to other dishes.

Ingredients

  • N number of packages of extra firm tofu
  • Seasonings of your choice
  • A couple of teaspoons of vegetable oil

Instructions

  1. Preheat oven or toaster oven to 375 F.
  2. Drain and remove the tofu from its packaging and wrap in a clean kitchen towel. Place under a cutting board to remove as much moisture as possible. Let sit for about 10 minutes. Change towels, if so desired. The dryer the tofu is to start the less time it will take to cook.
  3. Put a thin coat of vegetable oil on a baking sheet or broiler pan.
  4. Cut the tofu into about 3/4 inch cubes.
  5. Put the tofu on the baking pan and season.
  6. Cook for about 20 – 25 minutes stirring about every 10 minutes until tofu is golden brown.
  7. Remove from the oven and scrape off pan into a dish.

Snickerdoodle Cookies

My wife made these cookies and they were, by far, the best snickerdoodle cookies I’ve every had. The original recipe can be found here.

Ingredients

  • 1 cup Unsalted Butter (softened)
  • 1 1/2 cups Sugar
  • 2 large Eggs
  • 2 teaspoons Vanilla
  • 2 3/4 cup Flour
  • 1 1/2 teaspoon Cream of Tartar
  • 1/2 teaspoon Baking Soda
  • 1 teaspoon Salt

Cinnamon-Sugar Mixture

  • 1/4 cup Sugar
  • 1 1/2 Tablespoons Cinnamon

Instructions

  1. Preheat oven to 350 degrees.
  2. In a large mixing bowl, cream butter and sugar for 4-5 minutes until light and fluffy. Scrape the sides of the bowl and add the eggs and vanilla. Cream for 1-2 minutes longer.
  3. Stir in flour, cream of tartar, baking soda, and salt, just until combined.
  4. In a small bowl, stir together sugar and cinnamon.
  5. If time allows, wrap the dough and let refrigerate for 20-30 minutes. Roll into small balls until round and smooth. Drop into the cinnamon-sugar mixture and coat well. Using a spoon, coat for a second time, ensuring the cookie balls are completely covered.
  6. Place on a parchment paper-lined baking sheet. Bake for 9-11 minutes. Let cool for several minutes on baking sheet before removing from the pan.

Running GUI apps locally as root in a non-root session

There are instances when you need to run an X Window application. For me this is often running a terminator instance as root so that I can create tabs and split the window as still be root in each of those terminals.

In order for the root user to be able to connect to the X server you need to provide it with “credentials”. In this case it is on the same box and not over the network so the use of cookie authentication is acceptable.

As the user that is already authenticated to the X server run the following command to get the cookie used to connect to the the current $DISPLAY

rchapin@leviathan:~$ xauth list $DISPLAY
leviathan/unix:0  MIT-MAGIC-COOKIE-1  5fb2c0e68f4618ee4fa2202e1e4ae937

su to root and then run the following to add that cookie to roots authorization file

root@leviathan:~# xauth add leviathan/unix:0 MIT-MAGIC-COOKIE-1 5fb2c0e68f4618ee4fa2202e1e4ae937

You should now be able to run X windows applications from that root terminal.

VS Code “Test result not found for:” When Running Tests for a Python Project [SOLVED]

I finally was able to get Visual Studio Code set-up correctly to run and debug unit and integration tests for a Python 3.8 project that I am working on (I’ll add a link to that post here once it is up).

After making some changes to the code and adding a test I got the following error when trying to debug the test:

Test result not found for: ./mylibs/integration_tests/myclient_integration_test.py::MyClientIntegrationTest::test_happy_path

? An odd error message, to be sure.

After a little while I figured out that when this happens it is ultimately the result of some syntax, interpretation error that occurs at runtime that the IDE may not flag as a problem for you.

Check the Output panel and click on the drop-down and select Python Test Log to see the stack trace of the error to see where you have a typo.

List the Roles for a User or Service Account in a Specific GCP Project

If you do not have web console permissions to do so, but have the ability to activate a service account that has the viewer permissions or IAM permissons to list IAM roles in a given project, the following is how you can list the roles for a given user or service account.

gcloud projects get-iam-policy <gcp-project> \
--filter="bindings.members:<email-address>" \
--flatten="bindings[].members" --format="table(bindings.role)"

Compiling Python Under Linux

The following should work with just about any version of Python. I am using it to compile, currently 3.10.x, on distros where those packages are not readily available for installation. The following is a quick how to on getting it compiled under both RedHat/CentOS/Almalinux and Debian based systems.

Download the Tarball for the Version You Want To Install

Download the tar.gz archive for the version that you want to install from here. Verify the download and then save the path to this file for later.

Install Dependencies

This assumes that you already have the “build-essentials” and kernel headers installed on the box, which is an exercise for the reader.

RedHat/CentOS/Almalinux

yum install -y bzip2-devel expat-devel gdbm-devel ncurses-devel openssl-devel readline-devel wget sqlite-devel tk-devel xz-devel zlib-devel libffi-devel gmp-devel libmpc-devel mpfr-devel openssl-devel liblzma-devel

Debian

apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev

Compile Python

The following enables a non-root user to unpack, compile, and install it into their home directory. Copy this file to /var/tmp/compile-python.sh and then run as follows

/var/tmp/compile-python.sh <path-to-tarball>
#!/bin/bash

set -u
set -e

# The path to the downloaded tarball
py_tarball=$1

export PY_DIR=$(echo $py_tarball | awk -F/ '{ print $NF }' | sed 's/.tgz//')
export PY_PREFIX=$(echo ~/usr/local/$PY_DIR | tr [:upper:] [:lower:])

mkdir -p ~/usr/local/src ~/usr/local/bin ~/usr/local/include $PY_PREFIX
rm -rf $PY_PREFIX
tar -xzf $py_tarball -C ~/usr/local/src/
cd ~/usr/local/src/$PY_DIR
./configure --prefix=$PY_PREFIX --exec-prefix=$PY_PREFIX
make && make install

Add the following to your PATH in ~/.bash_profile

PYTHON_HOME=~/usr/local/python-<version>

export PATH=$PATH:$PYTHON_HOME/bin

Using fc to Edit and Re-execute Bash Commands

I recently learned about the Bash built-in fc. It is a great tool that enables you to edit and re-execute commands from your bash history.

Oftentimes there is a command in your history that instead of just grepping through the history and then re-executing as-is you’ll want to make a modification or two. With fc you can first edit it in your favorite editor and then when closing the editor fc will execute the command.

For me, vim is my editor of choice. Add the following to your .bashrc and fc will automatically open vim for you.

export FCEDIT=vim

Then, simply run fc passing it the id of the command in your history that you want to edit and then execute.

fc 1234