To generate graphs with Terraform
- Open a terminal window in the Terraform script directory
- Execute the command
terraform graph | dot -Tsvg > graph.svg
Knowledge Base for IT Professionals, Teachers and Astronauts
To generate graphs with Terraform
terraform graph | dot -Tsvg > graph.svg
In an enterprise environment, the company usually operates its own DNS servers.
When a Linux instance launches in AWS, the DNS settings only contain the AWS DNS server. If the company DNS server settings are applied with Chef, during the first Chef Client run those settings do not take effect.
When we reference an internal DNS entry during the first Chef Client run we get the error message:
SocketError: Error connecting to https://INTERNAL_ADDRESS.net/… – Failed to open TCP connection to INTERNAL_ADDRESS.net:443 (getaddrinfo: Name or service not known)
The “chocolatey_package” Chef resource can install NuGet packages from Artifactory.
Artifactory is inconsistent in case sensitivity when an application is searching for a NuGet package. When we specify the package ID only, the search is not case sensitive. If the package is called “GoogleChrome” and we search for “googlechrome” the NuGet package is found in Artifactory.
chocolatey_package 'googlechrome' do source 'devops-chocolatey' options "--allow-empty-checksums --ignore-package-exit-codes" end
When we specify the version of the package, the search becomes case sensitive in Artifactory. The “chocolatey_package” Chef resource automatically converts the package IDs to lowercase, even if we spell the package ID the same as it is in Artifactory, so “GoogleChrome” can never be found in Artifactory when we specify the NuGet package version.
chocolatey_package 'GoogleChrome' do version '66.0.3359.18100' source 'devops-chocolatey' options "--allow-empty-checksums --ignore-package-exit-codes" end
The following error message is misleading. In this case, the version was in Artifactory, but the spelling of the package ID is not all lower case in Artifactory.
googlechrome not installed. The package was not found with the source(s) listed.
If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
Version: “66.0.3359.18100”
Source(s): “http://artifactory….”
When we internalize the “googlechrome” Chocolatey package, the package ID in the NuGet package will be spelled as “GoogleChrome”. The “internalize” process downloads the NuGet package from the Chocolatey server, downloads the necessary installer files from the source URL specified in the NuGet package, and creates a new NuGet package that contains all necessary files for the software installation. To have access to these packages any time, even when the Chocolatey package is no longer available at Chocolatey.org, we can upload them to Artifactory or other NuGet repository.
To solve the case sensitivity issue, currently, the only solution is to unzip the package, change the spelling of the ID to lower case and re-create the package again.
choco download googlechrome --internalize
<id>googlechrome</id>
When we insert a video clip into our timeline that has the same height, but different width than our project, Adobe Premiere CC distorts the inserted clip.
My project is 1920 x 1080, the inserted clip is 1440 x 1080. When I insert the narrower clip into my timeline, Adobe Premiere stretches the inserted clip horizontally.
To set the correct aspect ratio
To display the Linux operating system version execute the command
cat /etc/*release* uname -a
There are many tools to copy files between Windows and Linux computers, I have found this method the simplest.
It does not require any software installation on the Windows machine, and only one package installation on the Linux machine.
Share a folder on the Windows machine and allow access to it for a user. If the Windows computer is in the Windows domain, the domain user does not have to be a member of any security group on the Windows machine.
If you copy files from Windows to Linux, make the folder read-only for the user. If you copy files to the Windows machine, allow write access to the folder for the user.
sudo yum install cifs-utils
sudo apt-get install cifs-utils
mkdir /tmp/windows
sudo mount.cifs '\\WINDOWS_SERVER_IP\attachments' /tmp/windows -o domain=MY_DOMAIN,username=MY_USERNAME,password=MY_PASSWORD,vers=1.0
First, you will be asked for the root password on the Linux machine.
If you do not specify your password in the line above, you will be also asked to enter your password on the Windows machine.
cd /tmp/windows
ls -al
If you get the error message when you issue the mount command
mount error(16): Device or resource busy
try to unmount (umount !) the share first and try the mount again
umount /tmp/windows
The user-specific settings in the Windows registry are stored under the HKEY_CURRENT_USER key. If you open the Regedit.exe application the HKEY_CURRENT_USER key contains the settings for your user account.
To access the registry keys of another user we need to
Another Security ID list location:
The partial list of the Security IDs is also available at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList
Not all user profiles are listed here.
Click the Security ID folders on the left to see the username in the ProfileImagePath.
AWS changed how Windows Server EC2 instances send messages during boot.
Windows Server 2012 R2 AWS EC2 instances sent the “Windows is ready” message every time those became available after boot.
When a Windows Server 2016 AWS EC2 instance launches, it only sends the “Windows is ready” message during the first boot. If you create your custom AMI with Packer, the first boot happens during the Packer AMI creation, so Chef Test Kitchen does not receive the expected message and the process times out with the message
>>>>>> Ran out of time waiting for the server with id [i-… to become ready, attempting to destroy it
EC2 instance <i-…> destroyed.
To configure Windows Server 2016 instances to send the expected “Windows is ready” message during every boot, add a PowerShell line to your Packer template that creates your custom AMI:
{ "type": "powershell", "pause_before":"2s", "elevated_user": "MY_ADMIN_USER", "elevated_password": "MY_ADMIN_PASSWORD", "inline": [ "C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SendWindowsIsReady.ps1 -Schedule" ] },
This code creates a scheduled task to execute the configuration script on the instance.
More information is at https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html#ec2launch-sendwinisready
When you use a virtual machine to write your Chef cookbooks you may want to test them locally with Vagrant.
This nested virtual machine cannot use a 64 bit operating system, because to run a 64 bit virtual machine, the host computer’s CPU has to provide the CPU Extensions. Currently only physical CPUs can provide the CPU Extensions, no virtualization software can do that.
The Chef Test Kitchen uses Vagrant to launch test instances. In the background Vagrant uses the VirtualBox engine, so your virtual workstation needs to have Vagrant and VirtualBox installed.
To make sure TestKitchen uses the 32 bit operating system first we will set up the 32 bit virtual machine in Vagrant.
vagrant init hashicorp/precise32
vagrant halt
vagrant global-status
The result looks like this:
id name provider state directory ---------------------------------------------------------------------------------------------------------------------------- 21590cd default virtualbox running C:/Users/interview/Documents
vagrant halt 21590cd
driver: name: vagrant network: - ["forwarded_port", {guest: 2200, host: 2222}] - ["private_network", {ip: "127.0.0.1"}] platforms: - name: hashicorp/precise32
kitchen converge hashicorp-precise32
There can be reasons when we want to run a VirtualBox virtual machine on another VirtualBox virtual machine.
I am setting up a Windows virtual machine to interview job candidates and want to run a small Ubuntu virtual machine on the Windows virtual machine. It is not recommended for performance reasons, but I want to set up a base interview machine that I can wipe and recreate any time for the next candidate.
Besides the performance hit there is one more rule: the nested guest operating system needs to be 32 bit.
Even if you have a 64 bit workstation, and run a 64 bit guest operating system on it, the VirtualBox on the guest operating system can only host 32 bit guest-guest operating systems, because for a 64 bit operating system to run, the host machine needs to have the CPU Extension feature turned on. Currently only physical CPUs have the CPU Extension feature, so even a 64 bit guest virtual machine cannot provide it.