How to change a Git commit message after push

To change a Git commit message after the commit has been pushed Open a terminal in the repository folder Use the interactive rebase command to retrieve the specified number of recent commit messages The list of the recent commits appears in your default text editor Replace the word pick with reword in the lines you […]

Cannot connect to an AWS EC2 Windows instance with WINRM

When we launch an AWS EC2 instance with Windows 2012, Windows 2016, Windows 2019, the “Administrator” local account is automatically created and added to the Administrators group. We can decrypt the Administrator password using the private key of the key pair we used to launch the server. On Windows servers WINRM access is necessary during […]

An argument named “root_block_device” is not expected here. Did you mean to define a block of type “root_block_device”?

In the Terraform script to create an AWS EC2 instance, we can specify the volume sizes. Separate arguments describe the root and data volumes. This feature enables the script to create the volumes without specifying the connection attributes in another block. The Terraform documentation does not show the syntax, and the Terraform example at the […]

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 lockSTDERR: Error: Failed […]

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 […]

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 […]

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. 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 […]

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 lockfileReason: (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 […]