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
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
If the Gateway Address does not belong to the IP address range of the subnet
Confirm that the latest version of EC2Config (Windows Server 2012R2 and earlier) or EC2Launch (Windows Server 2016 or later) is installed on the instance.
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):
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:
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
Change the RDS instance to multi-AZ
Click the Modify button and change the instance to multi-AZ
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.
Reboot with failover to the secondary instance to make it the primary instance in the new availability zone
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
...
)
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.
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 multiple Python versions side-by-side
Pyenv
Pyenv is a Python version manager. It is recommended, because it does not depend on Python, (written in Bash) and using it we can install and utilize multiple Python versions without affecting the Python version used by MacOS.
Open a new terminal window fo these configuration changes to take effect
python --version
Use virtual environments
Anaconda
Anaconda (conda) can create a python bubble for you with no preinstalled packages. You can create a Python virtual environment for each of your projects to isolate them and only install the required packages.
If you use Pyenv to install multiple Python versions side-by-side and installed Anaconda to create virtual environments for each of your projects, install pyenv-virtualenv to integrate them.
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
Set case-insensitive tab completion. This is the default, not necessary.
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
“Solarized” color scheme is already installed, these steps are not necessary anymore
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
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
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:
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.
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.
Igazi békebeli fonott császárzsemle receptet találtunk Gábornál.
Hozzávalók
TangZhong (előtészta) 260 ml tej 40 g liszt összemelegítve.
Az élesztőhöz 230-250 ml tejben 24 g élesztő egy csipet cukorral felfuttatjuk
A tésztához 650 g finom liszt 10- 12 g só 12 g cukor 35 g vaj
Előkészítés
Felfuttatjuk az élesztőt
Előtészta: Mielőtt forrni kezdene a tej, lecsökkentjük a hőmérsékletet és gyors keverés mellett lassan beleöntjük a lisztet. Összemelegítjük a lisztet a tejjel, a video szerint, lefedjük, lehűtjük.
Dagasztás
Átszitáljuk a lisztet a dagasztó tálba hozzáadjuk az előtésztát A sót, cukrot, A felfuttatott élesztőt Jól kidagasztjuk Amikor a tészta szépen felvette a lisztet és összeállt, hozzáadjuk a vajat Ha a tészta elkészült, áttesszük egy kiolajozott kelesztő tálba. A tészta érés ideje a tálban 45 perc
Kivesszük a tésztát és elosztjuk 12-13 db, kb . 95 gr-os darabra Gömbölyítjük a tésztákat, nem lisztezzük a deszkát Letakarva 5-10 percet pihentetjük
Megformázzuk a tésztát
Hajtogatjuk, hurkákat készítünk, mint a kalács fonásnál Kinyújtjuk a hurkákat 40-45 cm hosszúra Vékonyan belisztezzük a deszka hátsó részét fonás előtt meghempergetjük a tésztát, hogy ne tapadjon össze Hurkot kötünk, hogy megformázzuk a császárzsemlét Sütőpapírral bélelt tepsire tesszük a felét, egy másik tepsire a másik felét Leterítjük egy konyharuhával és egy műanyag fóliát (zacskót) teszünk rá Kelesztés 50-70 perc
Sütés
A sütőt előmelegítjük 230 C °-ra, alsó-felső sütésre, az aljába vizet teszünk egy edényben.
Sütés előtt, mielőtt a sütőbe tesszük, a tésztákat vízzel átspricceljük. Betesszük a tepsit a sütőbe, 210 C°-ra csökkentjük a hőmérsékletet, 16-20 percig sütjük, a vizet 12 perc után eltávolítjuk. Ha a zsemlék alja nem sült meg eléggé, a zsemléket letakarhatjuk alufóliával, esetleg lejjebb tesszük a tepsit, így sütjük 4-8 percig ( 16-20 perc összesen )
Sütés után ismét vízzel lespricceljük.
Gábor web oldalalán minden receptjét megtaláljátok: gaborahazipek.hu