Quiet down the low frequency vibration of the LRDCS2603S bottom freezer LG refrigerator

LG uses a piston-type compressor in its new refrigerators. The company offers 10-year warranty on the new design, but the new compressor generates a very strong 60 Hz vibration. You can hear it as a low-frequency hum and shakes the entire house.

The guitar tuner app detects it in the living room far away from the kitchen as a strong and steady 60 Hz sound between B and B flat.

We love the features of the new refrigerator, but the vibration really bothered us. We could not reduce the noise in the kitchen, but we were able to significantly reduce the transfer of the vibration to the floor that shook the house.

We have purchased a few items at Home Depot and placed the refrigerator on a soft padded surface. You need:

  • 1 pack of Everbuilt Furniture Cups 2-1/4″ (4 pack). Item number 745 892
  • 2 packs of Everbuilt Felt Sliders 3-1/2″ diameter (4 pack). Item number 218 925

Build four towers with one Furniture Cup and two Felt Sliders for each, using the adhesive on the sliders to hold them together.

Empty the refrigerator and place the towers under the rollers.

The refrigerator rollers sit perfectly in the dents of the Furniture Cups, and the sliders adequately dampen the low-frequency vibration. The white felt at the bottom allows you to slide the refrigerator on the hard surface, but keeps it in place when you open and close the doors.

If two Felt Sliders don’t provide enough dampening, you can add a third one to provide better insulation.

Failed to install cookbooks from lockfile

During Chef cookbook testing with Test Kitchen only one “converge” action can update the Policyfile.lock.json at a time.

If you test multiple recipes in the same cookbook, wait for the “Updating policy lock using /usr/local/bin/chef-cli update” message before starting the next converge otherwise we get the error message:

STDOUT: Installing cookbooks from lock
STDERR: Error: Failed to install cookbooks from lockfile
Reason: (NoMethodError) undefined method `[]’ for nil:NilClass

Move AWS EC2 instance to another subnet or availability zone

When we move an EC2 instance from one subnet to another or to another availability zone the EC2 Metadata Service stops working on the instance. We get the error message:

Unable to get IAM security credentials from EC2 Instance Metadata Service.

To enable the EC2 Metadata Service again, we need to update the routing configuration on the instance. Follow the steps at

https://aws.amazon.com/premiumsupport/knowledge-center/waiting-for-metadata/

As a summary:

Check the Gateway Address matches the IP address range of the subnet. In a PowerShell window execute:

route print

Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
  169.254.169.254  255.255.255.255      10.254.79.1      15

It should belong to the IPv4 CIDR of the subnet

If the Gateway Address does not belong to the IP address range of the subnet

  1. Confirm that the latest version of EC2Config (Windows Server 2012R2 and earlier) or EC2Launch (Windows Server 2016 or later) is installed on the instance.
  2. To apply the route to the instance, restart the EC2Config service (on Windows Server 2012R2 and earlier), or run the following command from an elevated PowerShell session (on Windows Server 2016 or later):
Import-Module c:\ProgramData\Amazon\EC2-Windows\Launch\Module\Ec2Launch.psm1 ; Add-Routes

Cannot modify the instance class because there are no instances of the requested class available in the current instance’s availability zone

When you change the instance type of an AWS RDS instance, the availability zone of the instance has to have available capacity of the selected type.

Some older availability zones (us-east-1a) have more old instance types than new types available. If the instance type you selected is not available in the current zone of the instance you get the error message:

We’re sorry, your request to modify DB instance … has failed.

Cannot modify the instance class because there are no instances of the requested class available in the current instance’s availability zone. Please try your request again at a later time.

To upgrade an RDS instance to a new type that is not available in the current availability zone:

  1. Find an AZ that has the desired instance type
    • Try to launch an instance with the new instance type and see which zones have available capacity
  2. Change the RDS instance to multi-AZ
    • Click the Modify button and change the instance to multi-AZ
  3. If the secondary instance is not created in a zone that has available capacity of your desired instance type, change the instance back to single-AZ and return to step 2, to set it to multi-AZ again.
  4. Reboot with failover to the secondary instance to make it the primary instance in the new availability zone
    • Click the Actions button and select Reboot
    • Select Reboot with failover
  5. Change the instance back to single-AZ
  6. Upgrade the instance type

Exit from Bash script on error without closing the terminal window

To terminate the script in case of an error, we can use the “-e” option.

#!/bin/bash
set -e

or

#!/bin/bash -e

When a bash script is

  • “sourced”,
  • called from an alias with a leading dot like my-alias='. /my-script to execute in the same process, or
  • a function is executed from a terminal window

and the script exits on an error, it closes the terminal window.

To keep the terminal open, execute the script in a subprocess. It is easy to update existing scripts. Enclose the main part of the script in parentheses to open a new subprocess and add the “set -e” option to it. In case of an error the script terminates the subprocess and returns to the terminal session.

#!/bin/bash

my_function() {
  ...
}

(
  set -e
  ...
  my entry point to the script
  ...
)

Error: Failed to install cookbooks from lockfile

When the CI/CD pipeline loads dependency cookbooks from GitHub and the kitchen converge process throws the error:

Error: Failed to install cookbooks from lockfile
Reason: (CookbookOmnifetch::NotACookbook) The resource at ‘/…’ does not appear to be a valid cookbook. Does it have a metadata.rb?

make sure the remote revisions of the dependency cookbook match in the caller and the dependency cookbook’s Policy Lock files and both files are pushed to GitHub.

"scm_info": {
  "scm": "git",
  "remote": "https://github.com/.../....git",
  "revision": "22592d58489abb53316638ce9edfe5ee3742c5cc",

Install Python 3 on MacOS

The MacOS comes with an old version of Python 2. For new software development Python 3 is the recommended version. Replacing the original Python 2 with Python 3 can cause instability in the MacOS. There are multiple ways to install Python 3 and keep Python 2 pn the Mac. This is the most recommended process:

Use Pyenv

Pyenv is a Python version manager. It is recommended, because using it we can install and utilize multiple Python versions.

Install Pyenv

We will use Homebrew to install Pyenv

brew install pyenv

Install the latest stable version of Python with Pyenv

Check https://www.python.org/downloads/macos/ for the latest stable release.

pyenv install 3.9.6

Set the new Python version the default

pyenv global 3.9.6
# check if the change took effect
pyenv version

Configure your shell to use Pyenv for Python version management

Add these lines to your .bashrc, .zshrc or .bash_profile file

PATH=$(pyenv root)/shims:$PATH

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

Check the default Python version

Open a new terminal window fo these configuration changes to take effect

python --version

Troubleshooting

During the installation I have encountered the following error messages

Error: The following directories are not writable by your user:
/usr/local/bin

You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/bin

To set you as the owner of the /usr/local/bin directory execute

sudo chown -R $(whoami) /usr/local/bin

Error:
homebrew-core is a shallow clone.
To brew update, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch –unshallow

To update the shallow clone of the repository from GitHub execute

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

Error: The following formula cannot be installed from bottle and must be
built from source.
python@2
Install the Command Line Tools:
xcode-select –install

To install the xcode command line developer tools execute

xcode-select --install

Install and configure iTerm2

  1. Download iTerm2 from https://www.iterm2.com/downloads.html
  2. Double click the downloaded ZIP file to extract the application,
  3. Move the iTerm application to Applications.

iTerm2 configuration

Use .bashrc for configuration

When you start iTerm, it reads its own config file, ~/.zshrc To keep using the standard ~/.bashrc config file

  • Create the ~/.zshrc file and have only one line in it:source ~/.bashrc

Set case-insensitive tab completion

Add these lines to the ~/.zshrc file

# Set case insensitive comparison when lower case letters are typed.
# Upper case typed letters only match upper case file names
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
autoload -Uz compinit && compinit

Enable unlimited scroll back

  1. Start iTerm2 and open the preferences window by pressing ⌘, (command-comma)
  2. On the Profiles, Terminal tab click the Unlimited scrollback check box.

Set the highlight color

By default the highlighted text just a little different from the rest. When we search for something, it is hard to notice the found text.

To change the highlighted text color

  1. Start iTerm
  2. In the iTemr2 menu select Preferences…
  3. On the Profiles, Colors tab set the color of the Selection and Selected Text
     

Start iTerm2 from Finder

To be able to open iTerm2 in any folder from Finder follow the steps below based on https://gist.github.com/shuntaroy/e5ce3ad61c0deb7e27f0

  1. Start Automator,
  2. Select Quick Action and click Choose,
  3. On the top of the screen set Workflow receives selected to files and folders,
  4. Set in to Finder,
  5. On the second side bar from the left double click Run AppleScript to open the editor window,
  6. Paste the code from the website referenced above into the editor window replacing the sample script in the editor window,
  7. In the File menu save the script,
  8. Do not run it, it does not execute in the Automator.

To use it

  1. Open Finder and navigate to the location you want to work in,
  2. Right click a folder to work in that folder or a file to work in the current folder
  3. Select ServicesiTerm2 in Finder
 

“Solarized” color scheme

  1. Download the color scheme to the Desktop with the following Bash command:curl -o ~/Desktop/solarized.itermcolors https://raw.githubusercontent.com/altercation/solarized/master/iterm2-colors-solarized/Solarized%20Dark.itermcolors
  2. Import the color scheme to iTerm2
    • Press ⌘, (command-comma) to open the Preferences window
    • Select Profiles
    • In the lower right corner of the Colors tab click the Color Presets… drop down
    • Select Import
    • On the Desktop select the downloaded solarized.itermcolors file
    • In the  Color Presets… drop down select Solarized Dark

 Meslo Powerline font

  • Import the Meslo Powerline font with the following bash command:git clone https://github.com/powerline/fonts.git && cd fonts && ./install.sh
  • Select the font in iTerm2
    • Press ⌘, (command-comma) to open the Preferences window
    • Select Profiles
    • On the Font section of the Text tab click the Change Font button
    • Select the 12pt Meslo LG L Regular for Powerline

Make the prompt shorter

to remove your username@computername from the prompt

  • Edit the ~/.bashrc file
  • Add the following lineDEFAULT_USER=”YOUR_USER_NAME”

Colored prompt

To color the prompt:

  • Download the agnoster theme
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  • Edit the ~/.bashrc file and set the ZSH_THEME to ZSH_THEME=”agnoster”

More configuration suggestions are at

https://ruigomes.me/blog/perfect-iterm-osx-terminal-installation/
https://gist.github.com/kevin-smets/8568070

Information on how terminals read settings at https://shreevatsa.wordpress.com/2008/03/30/zshbash-startup-files-loading-order-bashrc-zshrc-etc/

chef push always regenerates the revision id and Policyfile.lock.json

If the chef update and chef push commands always regenerate the Policyfile.lock.json file and the revision_id in it, make sure the Chef cookbook contains the chefignore file and it also references all possible Policyfile lock files:

# Policyfile #
##############
Policyfile.rb
*.lock.json

If a cookbook file changes, a new Policyfile.lock.json is generated during chef push.

chef update and chef push always check the cookbook files not listed in the chefignore file, and if there is a change, regenerate the Policyfile.lock.json including the revision_id element in it.

Failed to complete #create action: [undefined method `[]’ for nil:NilClass] on …

When we launch a test instance with Chef Test Kitchen, we may get the error message:

—–> Starting Test Kitchen (…)
—–> Creating …
——Exception——-
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>> Failed to complete #create action: [undefined method `[]’ for nil:NilClass] on …
>>>>>> ———————-
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running kitchen diagnose --all for configuration

Missing AMI

This can be the result of a missing AWS AMI referenced in the kitchen.yml file. Check if the AMI is still available in the AWS account you are working in.