Jekyll2021-09-16T12:38:32-05:00https://www.jackofalladmins.com/feed.xmlJack of all AdminsSystem Admin of all the things here to drop some knowledge bombs.Matt SHacktoberfest 20202020-10-21T00:00:00-05:002020-10-21T00:00:00-05:00https://www.jackofalladmins.com/dev%20dungeon/hacktoberfest-findmebeer<p>In this crazy year that is 2020, I have made some time to participate in my second <a href="https://hacktoberfest.digitalocean.com/">Hacktoberfest</a>. This is a yearly event sponsored by <a href="https://www.digitalocean.com/">Digital Ocean</a> and <a href="https://dev.to/">DEV</a> all about promoting the open source software community.</p>
<!--more-->
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2020-10-21/hf-logo.png" alt="hf-logo" class="align-center" /></p>
<p>Last year I mostly spent Hacktoberfest just learning about the open source development process and how to contribute to projects on <a href="https://github.com/">GitHub</a>. Things like forking projects and creating branches and pull requests were still fairly foreign concepts as I mostly spent my time making commits to master on my personal projects. I found some repositories of scripts and algorithms to contribute to, got my points and my t-shirt, and called it a day. It was a great learning experience at the time, but this year I wanted to do something different.</p>
<p>I have been wanting to work on developing a site from scratch with a JavaScript library as well as gain some more experience working with APIs. So after gathering some inspiration from some sources I’ll list below, I dove straight into building my first React website. I built a site around the <a href="https://www.openbrewerydb.org/">Open Brewery DB</a> that let’s a user enter the name of a city and returns a list of breweries there. My first iteration was very simple and I was excited just to get it to make a call out to the API and dump a bunch of data. I then started googling some CSS and quickly had my breweries and some relevant information such as their website laid out in little cards.</p>
<p>I decided it would also be interesting to see what it is like to manage an open source project and work together with other members of the community. So with a little magic from my friends over at <a href="https://www.netlify.com/">Netlify</a>, I had “Find Me Beer” up and hosted on the web in a few short minutes. I then went to my GitHub repository and started opening some simple issues for things like “Make the user input field look pretty”, “Automatically transform user input” (the API requires any whitespace to be replaced), and “Clear the input box when selected”. I marked my repository and issues with the “Hacktoberfest” topic, this is how maintainers can opt-in to Hacktoberfest now, and was blown away when I suddenly had people lining up to work on issues for my little learning project.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2020-10-21/findmebeer-ss.png" alt="findmebeer-ss" class="align-center" /></p>
<p>Nearly a week later, I have had the pleasure of working with a diverse group of developers, ranging from just starting out to the more seasoned, to improve <a href="http://findmebeer.app/">Find Me Beer</a>. It has been a great learning experience both from the aspect of managing all the questions and PRs, as well as all the knowledge I have been able to absorb from reviewing the code contributed by others. Netlify really helps to simplify the pull request review portion of this process as each time one is submitted it automatically builds a deploy preview separate from my production instance. This allows both myself and the contributor to easily see that the build is still succeeding and visually verify the changes that are being submitted before pushing them to prod.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2020-10-21/netlify-deploy-preview.png" alt="netlify-deploy-preview" class="align-center" /></p>
<p>As we continued to work on the site, I began to notice that some of the data for local breweries was out of date. This lead me to begin contributing back to the Open Brewery DB and the whole thing came full circle. I plan to continue to open more issues for the Find Me Beer project on GitHub so it will be interesting to see how it evolves from here. Hacktoberfest goes until the end of the month so you still have time to participate if you get started now. Check out the links below if you too are looking for some inspiration or want to contribute.</p>
<ul>
<li>Hacktoberfest - <a href="https://hacktoberfest.digitalocean.com">https://hacktoberfest.digitalocean.com</a></li>
<li>Find Me Beer website - <a href="https://findmebeer.app/">https://findmebeer.app/</a></li>
<li>Find Me Beer repo - <a href="https://github.com/MStewGT/FindMeBeer">https://github.com/MStewGT/FindMeBeer</a></li>
<li>NASA Photo of the Day API/React tutorial (by Kapehe) - <a href="https://www.youtube.com/watch?v=H1nENYv-r_w">https://www.youtube.com/watch?v=H1nENYv-r_w</a></li>
<li>React Hooks Todo App tutorial (by Coding Garden) - <a href="https://www.youtube.com/watch?v=9eSwZ0z-50c">https://www.youtube.com/watch?v=9eSwZ0z-50c</a></li>
<li>GitHub repo of public APIs - <a href="https://github.com/public-apis/public-apis">https://github.com/public-apis/public-apis</a></li>
<li>Open Brewery DB - <a href="https://www.openbrewerydb.org/">https://www.openbrewerydb.org/</a></li>
</ul>Matt SIn this crazy year that is 2020, I have made some time to participate in my second Hacktoberfest. This is a yearly event sponsored by Digital Ocean and DEV all about promoting the open source software community.Enable Copy on Select in Windows Terminal2020-09-27T00:00:00-05:002020-09-27T00:00:00-05:00https://www.jackofalladmins.com/knowledge%20bombs/dev%20dungeon/windows-terminal-copy-selection<p>If you are coming from using any *nix terminal to Windows Terminal, there is probably one feature you are really missing. Copy on select, immediately copying any text you highlight to the clipboard, is not enabled by default.</p>
<!--more-->
<p>Luckily, this can easily be remediated by adding the following line to the global defaults area of your settings file.</p>
<p><code class="language-plaintext highlighter-rouge">"copyOnSelect": true,</code></p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2020-09-27/copyonselect.png" alt="copy_on_select" class="align-center" /></p>Matt SIf you are coming from using any *nix terminal to Windows Terminal, there is probably one feature you are really missing. Copy on select, immediately copying any text you highlight to the clipboard, is not enabled by default.Format a Linux USB or SD Card Using Windows2020-03-04T00:00:00-06:002020-03-04T00:00:00-06:00https://www.jackofalladmins.com/admin%20adventures/knowledge%20bombs/format-linux-drive-windows<p>You may have noticed that if you connect a disk with Linux partitions to your Windows box, that you cannot view all of the files or the size of the drive seems to be reported incorrectly. Here is a super quick way to format a Linux USB drive or SD card on a Windows PC using Diskpart so that it can be repurposed.</p>
<!--more-->
<p>Start by launching a command prompt or Powershell session, then run the command <code class="language-plaintext highlighter-rouge">diskpart</code>. This will open the Diskpart command line application in a new window.</p>
<p>From here, start by using <code class="language-plaintext highlighter-rouge">list disk</code> to show all of the disks connected to the PC. Now determine which of these is your Linux disk. You can usually identify it based on the sizes listed. You will want to be 100% sure of your selection here because the following commands will wipe <strong>ALL DATA</strong> from whichever disk you select.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2020-03-04/diskpart.png" alt="diskpart" class="align-center" /></p>
<p>Select the disk by using the command <code class="language-plaintext highlighter-rouge">select disk X</code> where <em>X</em> is the number of your disk from the previous command.</p>
<p>Once you have selected your disk, use <code class="language-plaintext highlighter-rouge">clean</code> to remove all existing partitions. Create a new partition with <code class="language-plaintext highlighter-rouge">create partition primary</code> and then mark it as <code class="language-plaintext highlighter-rouge">active</code>.</p>
<p>Finally, we can format the disk with <code class="language-plaintext highlighter-rouge">format fs=Fat32 quick</code>. Now your USB drive or SD card is ready to be used again.</p>
<p>For quick reference, here are all of the commands in order:</p>
<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>diskpart
list disk
<span class="k">select </span>disk X
clean
create partition primary
active
format <span class="nv">fs</span><span class="o">=</span>Fat32 quick
</code></pre></div></div>
<p class="notice--info"><strong>Note:</strong> If your disk is larger than 32gb you can format it using <code class="language-plaintext highlighter-rouge">fs=exFat</code> instead of Fat32 to support larger capacities.</p>Matt SYou may have noticed that if you connect a disk with Linux partitions to your Windows box, that you cannot view all of the files or the size of the drive seems to be reported incorrectly. Here is a super quick way to format a Linux USB drive or SD card on a Windows PC using Diskpart so that it can be repurposed.Get a Windows PC Serial Number via Command-line2020-02-18T00:00:00-06:002020-02-18T00:00:00-06:00https://www.jackofalladmins.com/admin%20adventures/knowledge%20bombs/get-windows-pc-serial-number<p>I just wanted to share a quick way to pull a Windows PC’s serial number via Cmd prompt or Powershell. You can do this by using the WMI command-line utility as follows:</p>
<!--more-->
<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">wmic</span><span class="w"> </span><span class="nx">bios</span><span class="w"> </span><span class="nx">get</span><span class="w"> </span><span class="nx">serialnumber</span><span class="w">
</span></code></pre></div></div>
<p>While we are on the topic, you should also be able to snag the computer model using this command:</p>
<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">wmic</span><span class="w"> </span><span class="nx">csproduct</span><span class="w"> </span><span class="nx">get</span><span class="w"> </span><span class="nx">name</span><span class="w">
</span></code></pre></div></div>
<p class="notice--info"><strong>Note:</strong> These commands should be fairly widely supported but may not be compatible with all models if the information has not been coded in the BIOS.</p>Matt SI just wanted to share a quick way to pull a Windows PC’s serial number via Cmd prompt or Powershell. You can do this by using the WMI command-line utility as follows:Upgrade Ubuntu from the Command-line2019-11-09T00:00:00-06:002019-11-09T00:00:00-06:00https://www.jackofalladmins.com/admin%20adventures/knowledge%20bombs/upgrade-ubuntu-command-line<p>Here is the quick down and dirty on how to upgrade Ubuntu via the command line. If you have a firewall or an older version installed, then there may be some additional steps involved. Listed below is simply the bare minimum process from 16.04 forward.</p>
<!--more-->
<p>Connect to your Ubuntu host and run the following cli commands:</p>
<ol>
<li><code class="language-plaintext highlighter-rouge">sudo apt update</code></li>
<li><code class="language-plaintext highlighter-rouge">sudo apt upgrade</code></li>
<li>Restart your host machine <code class="language-plaintext highlighter-rouge">sudo reboot</code>.</li>
<li>Make sure Update Manager is installed <code class="language-plaintext highlighter-rouge">sudo apt install update-manager-core</code></li>
<li>Begin the upgrade with <code class="language-plaintext highlighter-rouge">sudo do-release-upgrade</code>, you will need to accept several prompts.</li>
<li>Verify upgrade <code class="language-plaintext highlighter-rouge">lsb_release -a</code></li>
</ol>Matt SHere is the quick down and dirty on how to upgrade Ubuntu via the command line. If you have a firewall or an older version installed, then there may be some additional steps involved. Listed below is simply the bare minimum process from 16.04 forward.Siri Shortcut to Disable Pi-hole2019-09-29T00:00:00-05:002019-09-29T00:00:00-05:00https://www.jackofalladmins.com/home%20automation/siri-shortcut-disable-pihole<p>Pi-hole is great at blocking ads and protecting you on the internet. However, you occasionally may need to disable it for a few minutes so you can click on that sketchy link at the top of your Google search. In this quick post, I will walk you through how to set up a Siri Shortcut button on your iPhone to temporarily disable PiHole.</p>
<!--more-->
<p>First of all, we will need to snag an API key from our Pi-hole instance. To generate an API key you will need to have a password set up on your Pi-hole instance. If you have not done this yet, or you forgot your password, you can reset it with the following console command: <code class="language-plaintext highlighter-rouge">pihole -a -p</code>. To generate the API key, log in to the admin page <a href="http://pi.hole/admin">http://pi.hole/admin</a> and navigate to the <em>Settings</em> menu on the left-hand side. Here, go to the <em>API/Web interface</em> tab and then click on the <em>Show API token</em> button in the bottom-left of the pane. Confirm a security prompt and then you will be shown your API token. Save this off somewhere or keep it open as you will need to input this on your phone shortly.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/pihole-api-settings.png" alt="profiles-json" class="align-center" /></p>
<p>Next, let’s switch over to our iPhone and open up the <strong>Shortcuts</strong> app. Tap the blue <strong>+</strong> icon in the top right-hand corner. This will bring you to the <em>New Shortcut</em> screen, here, tap on the <strong>Add Action</strong> button.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/new-shortcut.png" alt="profiles-json" class="align-center" /></p>
<p>In the search bar at the top of the screen type ‘url’ and then select the <strong>URL</strong> action from the list below.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/url-action.jpg" alt="profiles-json" class="align-center" /></p>
<p>Tap on the blue <strong>+</strong> icon just below the URL action to add another action.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/add-action-button.png" alt="profiles-json" class="align-center" /></p>
<p>Type ‘Get contents’ in the search bar at the top and then select the <strong>Get Contents of URL</strong> action to add it to your shortcut.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/search-get-contents.jpg" alt="profiles-json" class="align-center" /></p>
<p>Use the <strong>+</strong> icon to add one more action. This time type ‘Notification’ in the search bar at the top and then select the <strong>Show Notification</strong> action to add it to your shortcut.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/search-notification.jpg" alt="profiles-json" class="align-center" /></p>
<p>Tap on the <strong>URL</strong> action and enter the following: <code class="language-plaintext highlighter-rouge">http://PIHOLE_URL_HERE/admin/api.php?disable=300&auth=API_KEY_HERE</code>. You will need to adjust this to match the URL for your Pi-hole instance and then add your API key at the end. The number following the <code class="language-plaintext highlighter-rouge">disable=</code> key is the number of seconds that your Pi-hole will be turned off for. For example: <code class="language-plaintext highlighter-rouge">http://192.168.1.42:80/admin/api.php?disable=300&auth=3A43A66AF8685D3B155886994875C</code>.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/filled-out-url.jpg" alt="profiles-json" class="align-center" /></p>
<p>Next, tap the <strong>Notifications</strong> action and replace the default “Hello World” text with the <strong>Contents of URL</strong> variable.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/notification-add.jpg" alt="profiles-json" class="align-center" /></p>
<p>Tap on the <strong>Contents of URL</strong> variable you just added and tap where it says <strong>as File ></strong>. Scroll down and choose <strong>Text</strong> as the type instead and then verify there is a checkmark next to the default of Text as the return.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/notification-config.jpg" alt="profiles-json" class="align-right" /></p>
<p>Once you have finished the above steps, your shortcut should look similar to the screen shot below.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/shortcut-full.jpg" alt="profiles-json" class="align-center" /></p>
<p>At this point feel free to tap on the <strong>…</strong> button in the top right-hand corner to enter the <em>Details</em> screen. Here you can rename your shortcut and change the icon that will be displayed for it.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/shortcut-properties.jpg" alt="profiles-json" class="align-center" /></p>
<p>Now that our shortcut is complete, let’s test it out! You can use your shortcut from the Shortcuts app or the widget on your home screen if you have enabled it.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/shortcuts.jpg" alt="profiles-json" class="align-center" /></p>
<p>If it was successful, you should see <code class="language-plaintext highlighter-rouge">{"status":"disabled"}</code> returned in a notification.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-09-29/notification-example.jpg" alt="profiles-json" class="align-center" /></p>
<p>If you wanted to play around with the shortcut further, you could add options for different lengths of time to disable your Pi-hole.</p>Matt SPi-hole is great at blocking ads and protecting you on the internet. However, you occasionally may need to disable it for a few minutes so you can click on that sketchy link at the top of your Google search. In this quick post, I will walk you through how to set up a Siri Shortcut button on your iPhone to temporarily disable PiHole.Setup Custom SSH Profiles in Windows Terminal2019-08-10T00:00:00-05:002019-08-10T00:00:00-05:00https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/custom-ssh-profiles-windows-terminal<p>Windows 10 has OpenSSH support that is now enabled by default as of version 1803. To make quick use of this feature you can create custom options in <em>Windows Terminal’s</em> drop-down menu. We will do this by adding a new profile to the Windows Terminal settings file. If you have not yet installed Windows Terminal follow the instructions in <a href="https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/install-windows-terminal/">this post</a> first to get started.</p>
<!--more-->
<p>To get started launch <em>Windows Terminal</em>, click on the drop-down menu, and select <em>Settings</em> (or use the shortcut <em>Ctrl+,</em>). This should open the <em>profiles.json</em> file in whatever your default editor for JSON files is, in my case VSCode.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-08-10/profiles-json.png" alt="profiles-json" class="align-center" /></p>
<p>In the profiles section add a comma after the last profile in the list followed by a new curly-bracketed section. Copy the below template and paste it after the last profile in the list as shown in the screenshot above.</p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">}</span><span class="err">,</span><span class="w"> </span><span class="err">//Make</span><span class="w"> </span><span class="err">sure</span><span class="w"> </span><span class="err">to</span><span class="w"> </span><span class="err">add</span><span class="w"> </span><span class="err">a</span><span class="w"> </span><span class="err">comma</span><span class="w"> </span><span class="err">here</span><span class="w"> </span><span class="err">after</span><span class="w"> </span><span class="err">the</span><span class="w"> </span><span class="err">previous</span><span class="w"> </span><span class="err">profile</span><span class="w"> </span><span class="err">in</span><span class="w"> </span><span class="err">the</span><span class="w"> </span><span class="err">list.</span><span class="w">
</span><span class="p">{</span><span class="w">
</span><span class="nl">"guid"</span><span class="p">:</span><span class="w"> </span><span class="s2">"{5064e844-37f9-4c7c-aba5-51fa0795ee1a}"</span><span class="p">,</span><span class="w"> </span><span class="err">//Random</span><span class="w"> </span><span class="err">GUID</span><span class="w">
</span><span class="nl">"hidden"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
</span><span class="nl">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"DockerHost"</span><span class="p">,</span><span class="w">
</span><span class="nl">"commandline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ssh user@localhost"</span><span class="w"> </span><span class="err">//username@hostIP</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>
<p>You will need to provide a random GUID for each profile, you can either make changes to an existing one or use a <a href="https://www.guidgenerator.com/">generator</a> online just as long as they are all unique. Choose a name for your profile, this is what will show up in the <em>Windows Terminal</em> drop-down menu. Finally, edit the <em>commandline</em> to something appropriate for your local or remote host, ex. <code class="language-plaintext highlighter-rouge">ssh docker@192.168.0.42</code>. Save the file then return to Windows Terminal. You should see your new entry similar to the screenshot below.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-08-10/windows-terminal-dropdown.png" alt="windows-terminal-dropdown" class="align-center" /></p>
<p>You can, of course, continue adding profiles in this manner to handle other connections you may require. I am currently unsure if there is a limit to the number of profiles you can have; if you find out let me know in the comments below.</p>Matt SWindows 10 has OpenSSH support that is now enabled by default as of version 1803. To make quick use of this feature you can create custom options in Windows Terminal’s drop-down menu. We will do this by adding a new profile to the Windows Terminal settings file. If you have not yet installed Windows Terminal follow the instructions in this post first to get started.How to Install Windows Terminal2019-08-03T00:00:00-05:002019-08-03T00:00:00-05:00https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/install-windows-terminal<p><strong>Windows Terminal</strong> is a new terminal emulator developed by Microsoft for Windows 10. The current release is still in Preview but is quite stable. Let’s quickly run through how to get it setup and configured. <strong>Note</strong>: you will need to be running Windows 10 version 18362.0 (1903) or higher to install this.</p>
<!--more-->
<p>First, open the Microsoft Store app and search for <em>terminal</em>. You should find the <strong><em>Windows Terminal (Preview)</em></strong> app at the top of the results; click on it to be taken to the appropriate store page.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-08-03/ms-store-terminal-search.png" alt="ms-store-terminal-search" class="align-center" /></p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-08-03/ms-store-windows-terminal.png" alt="ms-store-windows-terminal" class="align-center" /></p>
<p>Click the blue <em>Get</em> button followed by the <em>Install</em> button. You should now be able to click the <em>Launch</em> button to take Windows Terminal for its first test run. By default, Windows Terminal currently has built in support for Windows PowerShell, cmd, and Azure CloudShell. If you have also setup Windows Subsystem for Linux (see <a href="https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/setup-windows-subsystem-for-linux/">this post</a> to learn how), then there will be an option in the drop down menu to launch a shell into your chosen Linux distro.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-08-03/windows-terminal-dropdown.png" alt="windows-terminal-dropdown" class="align-center" /></p>
<p>You can also learn how to add custom SSH session options to the drop-down menu by following the instructions in <a href="https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/custom-ssh-profiles-windows-terminal/">this post</a>.</p>Matt SWindows Terminal is a new terminal emulator developed by Microsoft for Windows 10. The current release is still in Preview but is quite stable. Let’s quickly run through how to get it setup and configured. Note: you will need to be running Windows 10 version 18362.0 (1903) or higher to install this.How to Setup Windows Subsystem for Linux2019-07-19T00:00:00-05:002019-07-19T00:00:00-05:00https://www.jackofalladmins.com/dev%20dungeon/admin%20adventures/setup-windows-subsystem-for-linux<p><strong>Windows Subsystem for Linux (WSL)</strong> provides you with a handy Bash shell running directly in Windows 10 without the need for a local virtual machine or a remote host. This allows you to install and run many Linux command-line tools from the comfort of your Windows desktop. For stability purposes, I recommend being on at least the Fall Creator’s Update for Windows 10 (1709) before continuing with the installation instructions below.</p>
<!--more-->
<h3 id="enable-windows-feature">Enable Windows Feature</h3>
<p>To get started, open <em>Control Panel</em>, navigate to <em>Programs and Features</em>, and select <em>Turn Windows features on or off</em> on the left-hand side. In the Windows Features pop-up, scroll down and check the box next to <em>Windows Subsystem for Linux</em> and click the <em>OK</em> button.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/windows-features.png" alt="windows-features" class="align-center" /></p>
<p>Once the addition of the feature is complete, you will be prompted to restart your computer. We’ll wait and do this later by clicking the <em>Don’t restart yet</em> button. You can exit out of Control Panel at this time.</p>
<h3 id="choose-a-linux-distro">Choose a Linux Distro</h3>
<p>Launch the <em>Microsoft Store</em> application and type <em>Linux</em> in the search box. You should see <em>“Run Linux on Windows”</em> at the top of the suggestions, click on it to proceed to the list of available distro options.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/ms-store-linux-search.png" alt="ms-store-linux-search" class="align-center" /></p>
<p>On this screen, select your desired distribution to continue to its store page; for my purposes I chose Ubuntu.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/ms-store-distro-list.png" alt="ms-store-distro-list" class="align-center" /></p>
<p>Click the <em>Get</em> button followed by the <em>Install</em> button and wait for the installation to complete. At this time go ahead and restart your PC.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/ms-store-ubuntu.png" alt="ms-store-ubuntu" class="align-center" /></p>
<h3 id="completing-setup">Completing Setup</h3>
<p>After your computer has restarted, go to the start menu and search for the Linux distro that you chose earlier. Launch the application and you should get a Bash shell window with a message stating that it is completing the installation process. Once the install is finished, you will need to choose a user name and password, these do not need to match the account you use for Windows.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/windows-bash.png" alt="windows-bash" class="align-center" /></p>
<h3 id="testing">Testing</h3>
<p>To test out our WSL setup, we will go ahead and install <a href="https://github.com/dylanaraps/neofetch">neofetch</a> which is a small application that will return some system information in the terminal window. Let’s start by updating our package listing using the command <code class="language-plaintext highlighter-rouge">sudo apt update</code>. Once that is complete, we can install <em>neofetch</em> using <code class="language-plaintext highlighter-rouge">sudo apt install neofetch</code>. Finally, run neofetch by simply typing <code class="language-plaintext highlighter-rouge">neofetch</code> at the shell prompt and hitting the return key.</p>
<p><img src="https://www.jackofalladmins.com/assets/images/Posts/2019-07-19/windows-bash-neofetch.png" alt="windows-bash-neofetch" class="align-center" /></p>
<p>From here, you can install any number of Linux command-line utilities you may desire to use. Not everything will be fully supported at this time so there may be some trial and error involved. You can refer to this <a href="https://github.com/ethanhs/WSL-Programs">list</a> to see what other users have discovered so far.</p>Matt SWindows Subsystem for Linux (WSL) provides you with a handy Bash shell running directly in Windows 10 without the need for a local virtual machine or a remote host. This allows you to install and run many Linux command-line tools from the comfort of your Windows desktop. For stability purposes, I recommend being on at least the Fall Creator’s Update for Windows 10 (1709) before continuing with the installation instructions below.Use PowerShell to List VMs that Need Tools or Hardware Updated2019-02-16T00:00:00-06:002019-02-16T00:00:00-06:00https://www.jackofalladmins.com/admin%20adventures/vms-need-tools-updated<p>This PowerShell script will help you easily determine what VM hardware version each of your VMs are currently running. Updating your VM hardware compatibility version can offer you benefits like supporting new CPU architectures, helping you squeeze every last bit of performance out of your VMs.</p>
<!--more-->
<p>This script will allow you to quickly determine which VMs need be addressed in a large environment and help you triage them accordingly.</p>
<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Import PowerCLI module and connect to VSphere servers</span><span class="w">
</span><span class="n">Import-Module</span><span class="w"> </span><span class="nx">VMware.PowerCLI</span><span class="w">
</span><span class="n">Connect-VIServer</span><span class="w"> </span><span class="nx">YOUR_VSPHERE_FQDN</span><span class="w"> </span><span class="nt">-User</span><span class="w"> </span><span class="nx">YOUR_USERNAME</span><span class="w"> </span><span class="nt">-Password</span><span class="w"> </span><span class="nx">YOUR_PASSWORD</span><span class="w">
</span><span class="c"># Get VMs and initialize counter</span><span class="w">
</span><span class="nv">$vms</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-Datacenter</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Get-VM</span><span class="w">
</span><span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="w">
</span><span class="c"># Create table and add columns</span><span class="w">
</span><span class="nv">$table</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">System.Data.DataTable</span><span class="w"> </span><span class="s2">"NeedsUpdated"</span><span class="w">
</span><span class="nv">$col1</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">System.Data.DataColumn</span><span class="w"> </span><span class="s2">"Name"</span><span class="w">
</span><span class="nv">$col2</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">System.Data.DataColumn</span><span class="w"> </span><span class="s2">"HardwareVersion"</span><span class="w">
</span><span class="nv">$col3</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">System.Data.DataColumn</span><span class="w"> </span><span class="s2">"ToolsVersion"</span><span class="w">
</span><span class="nv">$col4</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">New-Object</span><span class="w"> </span><span class="nx">System.Data.DataColumn</span><span class="w"> </span><span class="s2">"ToolsStatus"</span><span class="w">
</span><span class="nv">$table</span><span class="o">.</span><span class="nf">Columns</span><span class="o">.</span><span class="nf">Add</span><span class="p">(</span><span class="nv">$col1</span><span class="p">)</span><span class="w">
</span><span class="nv">$table</span><span class="o">.</span><span class="nf">Columns</span><span class="o">.</span><span class="nf">Add</span><span class="p">(</span><span class="nv">$col2</span><span class="p">)</span><span class="w">
</span><span class="nv">$table</span><span class="o">.</span><span class="nf">Columns</span><span class="o">.</span><span class="nf">Add</span><span class="p">(</span><span class="nv">$col3</span><span class="p">)</span><span class="w">
</span><span class="nv">$table</span><span class="o">.</span><span class="nf">Columns</span><span class="o">.</span><span class="nf">Add</span><span class="p">(</span><span class="nv">$col4</span><span class="p">)</span><span class="w">
</span><span class="c"># Check hardware and tools versions</span><span class="w">
</span><span class="kr">foreach</span><span class="p">(</span><span class="nv">$vm</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$vms</span><span class="p">){</span><span class="w">
</span><span class="nv">$vmview</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$vm</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Get-View</span><span class="w">
</span><span class="nx">if</span><span class="p">((</span><span class="nv">$vmview</span><span class="o">.</span><span class="nf">Guest</span><span class="o">.</span><span class="nf">ToolsVersionStatus</span><span class="w"> </span><span class="o">-notlike</span><span class="w"> </span><span class="s2">"*Current"</span><span class="p">)</span><span class="w"> </span><span class="o">-OR</span><span class="w"> </span><span class="p">(</span><span class="nv">$vm</span><span class="o">.</span><span class="nf">HardwareVersion</span><span class="w"> </span><span class="o">-notlike</span><span class="w"> </span><span class="s2">"*13*"</span><span class="p">)){</span><span class="w">
</span><span class="nv">$row</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$table</span><span class="o">.</span><span class="nf">NewRow</span><span class="p">()</span><span class="w">
</span><span class="nv">$row</span><span class="o">.</span><span class="nf">Name</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$vm</span><span class="o">.</span><span class="nf">Name</span><span class="w">
</span><span class="nv">$row</span><span class="o">.</span><span class="nf">HardwareVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$vm</span><span class="o">.</span><span class="nf">HardwareVersion</span><span class="w">
</span><span class="nv">$row</span><span class="o">.</span><span class="nf">ToolsVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$vmview</span><span class="o">.</span><span class="nf">Guest</span><span class="o">.</span><span class="nf">ToolsVersion</span><span class="w">
</span><span class="nv">$row</span><span class="o">.</span><span class="nf">ToolsStatus</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$vmview</span><span class="o">.</span><span class="nf">Guest</span><span class="o">.</span><span class="nf">ToolsVersionStatus</span><span class="w">
</span><span class="nv">$table</span><span class="o">.</span><span class="nf">Rows</span><span class="o">.</span><span class="nf">Add</span><span class="p">(</span><span class="nv">$row</span><span class="p">)</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="nv">$i</span><span class="o">++</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="c"># Format table and export to csv</span><span class="w">
</span><span class="nv">$table</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Format-Table</span><span class="w"> </span><span class="nt">-AutoSize</span><span class="w">
</span><span class="nv">$csv</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$table</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Export-Csv</span><span class="w"> </span><span class="nx">C:\temp\NeedsUpdates.csv</span><span class="w"> </span><span class="nt">-noType</span><span class="w">
</span></code></pre></div></div>
<p class="notice--info"><strong>Note:</strong> Change the HardwareVersion number above to whatever version you consider acceptable in your environment. The statement could also be modified to report anything lower than a specific version if you have a minimum that is acceptable outside the current version.</p>Matt SThis PowerShell script will help you easily determine what VM hardware version each of your VMs are currently running. Updating your VM hardware compatibility version can offer you benefits like supporting new CPU architectures, helping you squeeze every last bit of performance out of your VMs.