Honey Lime Marinade

I have used this on chicken but it could probably used with pork or tofu. The following is for 4 chicken thighs; scale as required by the amount of and/or type of food you are cooking

Ingredients

  • 1/4 cup lime juice
  • 3 tbsp honey
  • 1 tbsp vegetable oil
  • 1 tsp garlic powder
  • 1 tsp paprika
  • 1 tsp ground cumin
  • 1/2 tsp chili powder
  • 1/2 tsp dried oregano
  • 1/2 tsp salt
  • 1/4 tsp black pepper
  • 2 tbsp fresh minced cilantro

Directions

  1. Mince garlic and cilantro
  2. Mix all ingredients together
  3. Pour over meat or tofu
    • If marinating meat, marinate for about 20 minutes to 2 hours. More than that can make the meat stringy and mushy

Setting up a Mac Laptop for a Software Engineer Coming from a Linux Desktop

I’ve recently started a new job and am setting up a MacBook Pro M4. I’ve been using either a native Linux Desktop, or a Linux Desktop as a VM on a Windows box for most of my career. There are a number things about the Mac that are different than Intel based machines running Linux following are the list of changes that I have made to make it usable as a development environment.

Show all files in an “Open” dialog box

Press Cmd + Shift + .

Set system time to UTC

sudo ln -sf /usr/share/zoneinfo/UTC /etc/localtime

To display time in seconds go to System Settings > Menu Bar > Clock and select “Display the time with seconds”

If you also want to display a clock that shows your local time install Clocker.

Disable the “Press and Hold” Feature

By default, holding down a given key will display a pop-up/tooltip that displays accented version of the given character. I use a Vim plugin with the IDEs that I use and when trying to navigate by holding down either the w or b chars the cursor only moves by one work and then shows an accented character. To disable it

  1. Run the following command in a terminal and then restarting applications. This turns off the feature that will show accented characters: defaults write -g ApplePressAndHoldEnabled -bool false
  2. Turn up the Key Repeat rate by going to System Setting > Keyboard and adjust the slider for the “Key repeat rate”. If this still feels too slow you can crank it up with the following terminal settings which enable values much lower than the UI allows to be set
# Sets a very short delay before repeating
defaults write -g InitialKeyRepeat -int 15 

# Sets a very fast repeat rate
defaults write -g KeyRepeat -int 2

Configuring Home and End Keys

  1. Create the following directory: mkdir -p ~/Library/KeyBindings
  2. Create and edit the binding file vi ~/Library/KeyBindings/DefaultKeyBinding.dict
  3. Paste the following content into it
{
    "\UF729" = "moveToBeginningOfLine:";
    "\UF72B" = "moveToEndOfLine:";
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";
}

Then save and close that file and restart applications and/or restart the Mac.

iTerm2 Specific Configurations

Configure Home and End keys to work properly

  1. Go to Settings > Profiles > Keys > Key Bindings and click the + at the bottom left.
  2. For the Home Key:
    • Keyboard Shortcut: Press your physical Home key.
    • Action: Select Send Hex Code.
    • Code: 0x01 (This is the hex for Ctrl+A).
  3. For the End Key:
    • Keyboard Shortcut: Press your physical End key.
    • Action: Select Send Hex Code.
    • Code: 0x05 (This is the hex for Ctrl+E).

Configure F-keys to work without pressing fn

  1. Open System Setting > Keyboard and click on Keyboard shortcuts
  2. Click on Function Keys in the left-hand nav
  3. Toggle the Use F1, F2, etc. keys as standard function keys

Getting Alt-Tab to Switch Applications

Download and install the AltTab application.

Configuring Primary Selection and Middle Click Paste

One of the things that I use all of the time under Linux is to select text and then middle-click to paste it. This is one of those Linux features that once you get used to, you just have to have.

Configure iTerm2

  1. Open iTerm2 settings
  2. Go to General > Selections
  3. Check the box “Applications in terminal may access clipboard”
  4. Check the box “Copy to clipboard on selection”
  5. Go to Pointer > Bindings
  6. If “Middle Button” is not there, click the “+” button at the bottom of the window
  7. Set the following
    • Button/Gesture: Middle Button
    • Click Type: Single Click
    • Action: Paste from Selection…: There are a whole host of additional options from there that you can choose from. I left the default settings.

Screenshots

Configure the OS to write screenshots to a specific directory

# Set the new location
mkdir -p $HOME/Pictures/Screenshots
defaults write com.apple.screencapture location $HOME/Pictures/Screenshots

# Apply the changes (restarts the UI server)
killall SystemUIServer

Additional brew Packages

  • watch

Helpful Keyboard Shortcuts

  • Enter a path to a file in a dialog box: By default, Mac makes you click everything. Many times you know exactly where the file is on the filesystem and you just want to type it in and hit Enter. To do so, you need to open the dialog box and then press Command + Shift + G and then you can enter the path to the file.
  • View hidden files and directories in a dialog box: By default, Mac always hides “dotfiles” and directories in a dialog box. To see them open the dialog box and then press Command + Shift + Period.

Development SDKs

Installing Go

Initially, I just went with brew install go, but this turned into a big mess. While working on a project where I was writing a K8s Custom Resource Definition I ran into a buzz saw of mismatched versions and edge cases with the Apple Silicon/ARM architectural problems with the go development toolchain.

Instead of using brew for the go SDK

  1. Download the .tar.gz file from https://go.dev/dl/ for your architecture
  2. Unpack it, rename the go directory go1.x.x and move the directory to /usr/local/
  3. Create a symlink, /usr/local/go to point to the version specific go directory
  4. Ensure that /usr/local/go/bin is in your PATH
  5. Install any other required go libraries with go install or by downloading the binaries and putting them in your $GOPATH
    • go install golang.org/x/tools/gopls@latest
    • go install github.com/go-delve/delve/cmd/dlv@latest

How to Install Windows 11 on a Dell Optiplex 990 (and perhaps other older hardware)

To perform a clean install

  1. Configure the BIOS
    • Set boot mode to UEFI
    • Set SATA configuration to AHCI
    • Enable Secure Boot/TPM
  2. Prepare a USB drive
    • Use Ventoy to create a USB drive
    • Copy the win11 ISO to the data partition of the drive
  3. Wipe the drive during the install process
    • Boot from the USB
    • When you see the “Where do you want to install Windows?” screen press Shift + F10 to open a command prompt
    • Then type the following commands, in this order
      • diskpart
      • list disk and choose the drive onto which you want to install. Most likely Disk 0
      • clean, this will remove all data from the drive
      • convert gpt, this is the command that will make the drive UEFI-compatible
      • exit
      • exit
  4. Continue with the installation. When it asks you where to install, select the drive you just wiped. It should list a large “Unallocated Space”.
  5. Select it and click Next
  6. It will then show a blue screen with “n% installing”
  7. Keep an eye on it and when it reboots, remove the installation USB
  8. You should see a “Getting Ready”, or “Installing 0%, Please keep your computer on” message. If you get there you on your way to installing Win 11 on your computer.

How to properly join threaded metal plumbing fittings

For a while I struggled with ensuring that a joint between two metal plumbing fittings did not leak. On my most recent project that required multiple threaded fittings I took some time, did my research, and finally sorted out the details.

There are four things to do that will ensure a water tight joint:

  1. Join like metals together: Use the same, or similar, metal types for both male and female fittings. If you have copper pipe, use a copper or brass fitting. When joining dissimilar types, the threads of the harder metal can distort or destroy those of the softer metal and will result in a leak.
  2. Use professional teflon tape: Do not use the cheapo, thin tape that you get at the commercial hardware store. Go to a professional plumbing supply store and get a thicker tape that is made for the type of metal you are using. Wrap it 3 or 4 times, and no more. Too much tape can cause it to bunch up and leak. Wrap it on the male threads, clockwise as you are looking directly at the male fitting with it pointed towards you so that when you screw it into the female fitting it continues wrapping the tape tight and not unwinding it. When applying it, unroll a bit of it and hold it to the male threads with your thumb, then wrap it around, pulling it tight into the valleys of the threads, but not too tight that it rips the tape. It is important that the tape is seated into the valleys of the threads.
  3. Use a good quality pipe dope, and less that you think: Once the tape is applied, coat it with pipe dope. Only fill the valleys of the threads so that the ridges of the threads are still visible.
  4. Tighten it to that “just right” torque: There is no universal torque spec for all plumbing fittings. Apply the same principle from automotive mechanics; ensure that you do not cross-thread the fitting and then tighten it until it starts to snug up and then tighten it “just a bit more” instead of “as tight as possible”. This is the most difficult part and does require some experience.

How to calibrate a Whirlpool WTW4816FW3, or similar, washing machine

There are many similar models of both Whirlpool, Amana, and Maytag washers to which this process applies. One of the first things to do with these machines if they are acting a bit wonky is to re-calibrate them.

The process is a bit esoteric and after finding a video of it online I wanted to write it down for future reference. In the following directions when it says “turn it R”, it means to turn the center control knob one “click” to the Right. “turn it L”, means one “click” to the Left.

  1. Turn the middle selector knob counter-clockwise, two “clicks” past Normal
  2. Turn it back to 12-o-clock, Normal
  3. Turn the knob, in the following sequence: L R R R L R. At this point, all of the indicator lights below the center knob should be blinking
  4. Turn the knob R until just the Done light is on
  5. Turn it R one click at a time until just the Rinse light is on
  6. Press the Start button
  7. It will run through the calibration process which takes about 1 to 2 minutes

Then run the washer as normal.

Mount External, Encrypted, LMV drives

First decrypt the drive. When I plugged it in GNOME displayed a dialog and asked for the key. I’m guessing that cryptsetup luksOpen /dev/device device_crypt would work as well.

Run lvdisplay to get the LV Path for the logical volume that you want to mount.

Then, activate the volumes , there is a way to activate a specific one volume, but the following activates them all.

vgchange -ay

Then mount it

mount <lv-path> /mnt

PDF Commands Cheat Sheet

Following are a number of common PDF processing commands on a Linux box

Convert a series of images to a PDF

convert image-1 image-2 ... images.pdf

convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF’ @ error/constitute.c/IsCoderAuthorized/426.

ImageMagick, specifically version 6 (im6), is preventing the conversion of PDF files due to a security policy. To address this

  1. As root, edit /etc/ImageMagick-6/policy.xml
  2. Search for the line <policy domain="coder" rights="none" pattern="PDF" />
  3. Update rights="none" to rights="read|write"
  4. Save the xml file

DID Motorcycle Chain Rivet Flare Specifications

I have decided to exclusively use DID chains where they make an applicable part. I have found that they last the longest and are not too much more expensive than competing products. I have also exclusively been using rivet master links as they are much more reliable than the clip types and the tools to properly rivet them are trivial to acquire.

Each time I replace a chain I have to go searching for the rivet flare dimensions, so I decided to just post them.

The following are specs from 2022. I am not sure if they have changed since.