Send Alt-Control-Delete to a Windows server via Remote Desktop

When you log into a Windows server via the Remote Desktop Protocol (RDP) in some cases you need to send the Alt-Control-Delete ( in other notations Alt-Ctrl-Del, Control-Alt-Delete, Ctrl-Alt-Del ) key combination to the remote server.

From a Macintosh laptop

On a Macintosh laptop press the fn+control+option+delete keys to send Alt-Control-Delete to the server.

From a Windows workstation

If the Remote Desktop window is not in full-screen mode, Alt+Control+Delete will control your own Windows workstation.

On a Windows workstation press the Alt+Control+End keys to send Alt-Control-Delete to the remote server.

 

Splunk App for AWS

To collect data from AWS install the Splunk App for AWS plugin.

The app currently can collect information from

  • AWS Config,
  • Config Rules,
  • CloudTrail,
  • Inspector,
  • CloudWatch,
  • CloudWatch Logs,
  • Billing,
  • S3,
  • Kinesis,
  • Metadata.

New data source

To set up a new data source, click the Set up button

Already set up data source

To add a new input to the data source, click the New Input button

To view the list of existing inputs, click the link in the section

To view the settings of an existing input, click the name of the input, to add a new input, click the Add Input button. There is no way to edit the settings of existing inputs, to make changes, create a new input. There is also no method to disable an existing input, to stop the data collection, delete the input in the Action column.

S3

To read and process files from S3, select the S3 data source.

To select the Source Type click the Source Type field. If the source type is in the list, select it.

To add a source type, not in the list, enter the name into the text box, and click the generated link under the text box.

To collect the data more frequently than the default 30-minute interval, click the Advanced Settings link and enter the interval in seconds.

 

Skip steps in an InSpec integration test based on Chef attribute values

To speed up the test of some complex recipes, I use an attribute to skip certain long-running installations when I only need to test the rest of the recipe.

We will pass Chef Attribute values into an InSpec test using environment variables.

Declare an attribute in the atrributes.rb file with a safe default value, to allow the execution of all steps if the value is not overridden

# Set this to true in the .kitchen.yml file to skip long-running tasks during local test
default['quick_launch_for_test'] = false

Set the value in the suites: section of the kitchen.yml file to true to skip the long-running installations

  attributes:
    quick_launch_for_test: true

Save the attribute value in an environment variable in the recipe to pass it to InSpec

# Store the value in an environment variable for the integration test
env 'quick_launch_for_test' do
  value "#{node['quick_launch_for_test']}"
end

Make a decision in the recipe based on the value of the attribute

if ( node['quick_launch_for_test'] != true )
  #########################################
  #Microsoft Visual Studio Community 2017 #
  #########################################
  ...
end

Read the value of the environment variable into a local variable in the InSpec test file. If the environment variable does not exist, or the value is not “true”, the value of the local_execution variable will be “false”.

local_execution = ( os_env('quick_launch_for_test').content() == 'true')

Use the if statement to make the decision in your InSpec test file

if !local_execution
  describe package('Microsoft Visual Studio Community 2017') do
    it { should be_installed }
  end
end

 

Git Bash and Command Prompt cannot see the VirtualBox shared folder on Windows 10 guest

When you start a Windows 10 guest machine in VirtualBox on your workstation, you can set up shared folders to seamlessly copy files between your workstation and the Windows 10 guest machine.

The shared folder appears in Windows Explorer as a mapped network location.

For more on this see Configure the Windows virtual machine in VirtualBox

On a Windows 7 guest machine the Git Bash, Command Prompt, and PowerShell windows all can see the mapped E: network drive, so you can change the working directory with

cd E:

and execute commands in the shared folders.

On a Windows 10 guest machine, only the PowerShell window can see the shared folder as a mapped network drive, E:


Command prompt will display the error message

The system cannot find the drive specified

When you try to start the Git Bash window with Git Bash Here, nothing happens.

If you start Git Bash from the menu and try to change the working directory to the E: drive, you get the error message

bash: cd: /e: No such file or directory


If you need to use the Command prompt, you can temporarily map the shared folder

  1. Open the Command Prompt on the Windows 10 guest machine
  2. Execute the command
net use x: \\vboxsvr\Users

Refresh the environment variables in the Windows Command Prompt and PowerShell window

When the Windows Command Prompt and PowerShell windows open, they read the environment variables from the registry. If another process changes the value of an environment variable or creates a new one, the already open windows don’t reflect those changes. To reload the environment variables into open Command Prompt and PowerShell windows execute

refreshenv

Install Git on Windows

If you use two-factor authentication see Create a Personal Access Token to use it as password in the command line tools at Switching to 2-factor authentication in GitHub

  1. Navigate to https://git-scm.com/download/win to download Git for Windows. The page automatically downloads the installer for the operating system you use.
  2. Install the application
  3. Accept the default values, including these:
    1. Make sure the Windows Explorer integration for Git Bash is checked.
    2. Enable the Git tools in the command prompt too
    3. HTTPS transport backend. For large corporations with internal root certificates and  Windows Active Directory, the second option may be a better choice,
    4. Line endings for Windows computers
    5. Terminal emulator
    6. Caching
    7. Finish the installation.

Configure Git for Windows

Enable Page Up and Page Down

  1. In Windows Explorer right click in the white area and select Git Bash Here,

  2. Stretch the Bash window to the full width of the page to have more room to work later,
  3. Right-click the Bash window and select Options…,
  4. On the Window tab,
    1. Click the Current size button to save the size,
    2. Select PgUp and PgDn scroll without modifier to be able to scroll quickly up and down in the window with the Page up and Page down buttons.

Set up Git Bash to always run as Administrator

Certain commands need elevated rights to run, so we will set up the Bash window to run as administrator.

  1. Click the Windows Start button and type bash
  2. Right-click the found link and select Open file location

  3. Right-click the menu shortcut and select Properties
  4. On the Compatibility tab select Run this program as administrator

Using the Bash window

  • When you will start the Git Bash window you will always get the confirmation popup.

You can start the Git Bash window from the Windows Explorer

  1. Right-click a white area in Windows Explorer and select Git Bash Here. This does not work in the shared folders of Windows 10 virtual machines.

Configure the Git command line tool

To configure Git see Git configuration.

Install Chocolatey

The Chocolatey home page is at https://chocolatey.org/

Install Chocolatey

Navigate to the Chocolatey website at https://chocolatey.org/ and follow the latest instructions. At the time of writing the instructions were

Using the Command prompt

  1. Open a command prompt as Administrator,
  2. Install Chocolatey with the command
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Using PowerShell

  1. Open a PowerShell window as Administrator,
  2. Check the execution policy for your computer
    Get-ExecutionPolicy
    1. If the command returns Restricted, enable PowerScript execution with
      Set-ExecutionPolicy Bypass -Scope Process
    2. Answer Y to the question,
  3. Install Chocolatey with
    Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Apply the Chocolatey license

  1. If the C:\ProgramData\chocolatey\license directory does not exist, create it,
  2. To place the Chocolatey license file, chocolatey.license.xml into C:\ProgramData\chocolatey\license folder follow the recommendations at …refers to a location that is unavailable
  3. Install the Chocolatey extensions
    choco upgrade chocolatey.extension -y

Ignore the error:

Error when attempting to load chocolatey licensed assembly. Ensure
that chocolatey.licensed.dll exists at
‘C:\ProgramData\chocolatey\extensions\chocolatey\chocolatey.licensed.dll’.
Install with `choco install chocolatey.extension`.
The error message itself may be helpful as well:
The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

Determine the Windows PowerShell version

To reliably display the version of the Windows PowerShell engine

  1. Open a PowerShell command window,
  2. Execute the command,
    $PSVersionTable.PSVersion

    PS C:\WINDOWS\system32> $PSVersionTable.PSVersion

    Major Minor Build   Revision
    —–   —–   ——-  ——-
    5       1        16299  64

  3. If no value is displayed, the version is 1.0, as it does not have the referenced variable.

How to create a Docker repository in Artifactory

Artifactory supports multiple repository types, Docker is one of them. To create a new Docker repository in Artifactory

Set the Custom Base URL of the Artifactory server

From the Artifactory documentation at https://www.jfrog.com/confluence/display/RTF/Configuring+NGINX

“When using an HTTP proxy, the links produced by Artifactory, as well as certain redirects contain the wrong port and use the http instead of https”

  1. On the left side select Admin,
  2. Under Configuration on the General page enter the actual URL you use to access the Artifactory server and click the Save button.

Create one virtual Docker repository for all of your Docker repositories

As recommended by the Artifactory documentation at https://www.jfrog.com/confluence/display/RTF/Configuring+a+Reverse+Proxy#ConfiguringaReverseProxy-DockerReverseProxySettings
create one virtual Docker repository to aggregate all other Docker repositories, so only this repository has to be set up on the reverse proxy server.

  1. On the left side select Admin,
  2. In the Repositories section on the Virtual page click New,
  3. Select the Docker package type,
  4. Enter a name for the repository,
  5. Command-click (CTRL-click on Windows) the configure reverse proxy link to open it in a new tab and generate the script to set up the reverse proxy server,

Create the reverse proxy script

  1. In the Configuration section on the Reverse Proxy page fill out the form. If the reverse proxy server will be installed on the Artifactory server, write localhost in the Internal Hostname field.

    If you use a load balancer in front of the Artifactory server that also contains the SSL certificate you don’t need to enable the HTTPS protocol. If you use wildcard certificate you can select the Sub Domain reverse proxy method.

Save the Virtual repository

  1. On the New Virtual repository tab click Next at the bottom of the page,
  2. The Advanced tab shows the name of the Docker Registry
  3. Click the Save & Finish button to create the repository.

Create the Docker local repository

The local Docker repository will store the Docker images

  1. On the left side select Admin,
  2. In the Repositories section on the Local page click New,
  3. Select the Docker package type,
  4. Enter a name for the repository and click Next,
  5. The Advanced tab shows the address of the repository using the reverse proxy,
  6. Click the Save & Finish button to create the repository.