Setting up a new Windows Laptop with DevOps tools.

About

This guide is meant as a general guide to set up a Windows machine with a suite of DevOps tools. This guide assumes the user has a working knowledge of these tools. It is not meant for a novice.

This setup is being performed on a brand new Windows 11 Home Intel Core i9 with 32MB RAM.

Programming Languages

Python

Python is an open source programming language that can run on many different architectures. It has a syntax that is easy to learn and is notable as a learning language,

Head over to https://www.python.org/downloads/ and download the latest version of Python. As of this writing, version 3.10.1 is available.

Run the installer an make sure you add python to PATH. Open a command prompt and test with:

python –version

Coding IDE

My preference is VS Code. A good IDE is a MUST for any DevOps engineer.

Visual Studio Code

Visual Studio Code is a source-code editor made by Microsoft for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git.

https://en.wikipedia.org/wiki/Visual_Studio_Code

Free and is very customizable. Head on over to https://code.visualstudio.com/docs/?dv=win to download the installer. Version 1.63 is available as of this writing.

PyCharm

alternative, Python specific

Source Code Management

The goal of any successful engineer is to have repeatable and reproducible methods. This goal can be achieved by storing all work in a repository. Git is the most common SCM at this point in time.

Store your source for free on github or gitlab. Download the git CLI from https://git-scm.com/download/win

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

https://git-scm.com/

Virtualization

VirtualBox

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2. See “About VirtualBox” for an introduction.

https://www.virtualbox.org/

As of this writing, version 6.1.30 is available. Download the Windows installer here: https://www.virtualbox.org/wiki/Downloads

Infrastructure Automation

aws-cli

https://aws.amazon.com/cli/

vagrant

https://www.vagrantup.com/

Plugins (additional)

vagrant plugin install vagrant-disksize

terraform

download here https://www.terraform.io/downloads

Alternately install with chocolatey:

choco install terraform

Docker

https://www.docker.com/products/docker-desktop

uh oh for WSL 2

https://docs.microsoft.com/en-us/windows/wsl/install-manual#step-4—download-the-linux-kernel-update-package

chocolatey

Chocolatey is a software management solution unlike anything else you’ve ever experienced on Windows. Chocolatey brings the concepts of true package management to allow you to version things, manage dependencies and installation order, better inventory management, and other features.

https://chocolatey.org/
  1. First, ensure that you are using an administrative shell – you can also install as a non-admin, check out Non-Administrative Installation.
  2. Install with powershell.exe📝 NOTE: Please inspect https://community.chocolatey.org/install.ps1 prior to running any of these scripts to ensure safety. We already know it’s safe, but you should verify the security and contents of any script from the internet you are not familiar with. All of these scripts download a remote PowerShell script and execute it on your machine. We take security very seriously. Learn more about our security protocols.With PowerShell, you must ensure Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.
    • Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.Now run the following command:
    • Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://community.chocolatey.org/install.ps1’))
  3. Paste the copied text into your shell and press Enter.
  4. Wait a few seconds for the command to complete.
  5. If you don’t see any errors, you are ready to use Chocolatey! Type choco or choco -? now, or see Getting Started for usage instructions.

Additional Tools

mRemoteNG

mRemoteNG is a fork of mRemote: an open source, tabbed, multi-protocol, remote connections manager for Windows. mRemoteNG adds bug fixes and new features to mRemote and allows you to view all of your remote connections in a simple yet powerful tabbed interface.

https://mremoteng.org/

This is a tool for all remote connections. Supports VNC, RDP, SSH, and others, all in a single GUI Interface. PuTTY is used in the backend for SSH connections. Download the latest version here: https://mremoteng.org/download

Welcome Back!

I haven’t posted in a few years mainly due to disinterest and neglect. Last year I came back to this site only to find it in shambles with no backup. So, I decided to fix it up. I haven’t made any new posts up until now. I will try to post things that are relevant to the DevOps world, yet useful in other areas of life. Let’s get back to this!

Shell script to list current website IP

If your sites are in multiple geographical locations, this script will show where a site currently is being served from. It colors the output based on location.

#!/bin/bash
# where_are_you.sh
#do a dig against the company name servers and spit out the current IP of the sites.

array=( www.site.com www.site2.com www.site3.com www.site99.com )

for i in “${array[@]}”
do
dig @ns.server.company $i a | grep -v ‘;’ |grep $i | awk ‘{ if ( substr($5, 1, 8) == “x.x.x” ) printf “%-30s %s\n”, “\033[1;32;40m”$5,$1; else printf “%-30s %s\n”, “\033[1;34;40m”$5,$1 }’

done | sort -n
tput sgr0

Uptime and SLA Breakdown

If it’s up…​ A.K.A​ It’s down for…per year​
90%​ n/a​ 876 hours​
95%​ n/a​ 438 hours​
99%​ two 9’s​ 87 hours, 36 minutes​
99.9%​ three 9’s​ 8 hours, 45 minutes​
99.99%​ four 9’s​ 52 minutes, 33.6 seconds​
99.999%​ five 9’s​ 5 minutes, 15.36 seconds​
99.9999%​ six 9’s​ 31.68 seconds