Author: Peter Whyte

  • How to Check Linux Version in Ubuntu

    To check the Linux version running on an Ubuntu system, you can use the lsb_release -a or cat /etc/os-release commands. This is especially useful when accessing a host for the first time or verifying the installed Linux distribution and version. In this post, I’ll demo two ways to…

    Read More


  • How to Open WSL Projects in Windows File Explorer

    This is a guide on how to open WSL files in Windows File Explorer, with added descriptions. The best practice for managing project files in WSL is to store your files on the same Operating System as the tools your plan to use. So if the reason you’re…

    Read More


  • Drop Table if Exists in SQL Server

    The DROP TABLE command in SQL Server removes a table from the database, as its name suggests. In this post, we’ll look at how to use the DROP TABLE IF EXISTS command, which makes dropping tables more efficient and error-free by adding a conditional check. Example: Drop Table…

    Read More


  • How to Change Your Default Distro in WSL

    This post is a quick note on how to set your default Windows Subsystem for Linux Distro, which is useful for when managing multiple WSL installations on a computer. Setting Default WSL Distro First,we can list our installed WSL distributions by running wsl -l -v, note the name…

    Read More


  • Get Last Database Restore Date and Time in SQL Server

    This guide provides a script to retrieve the last restore date and time for each database in SQL Server. It’s particularly helpful for tracking restore operations or verifying backups during disaster recovery scenarios. The script below queries the sys.databases and dbo.restorehistory system tables to get the most recent…

    Read More


  • How to Install Postgres on Ubuntu 20.04 in WSL

    This is a post on how to install Postgres on Ubuntu 20.04, on Windows Subsystem for Linux (WSL). This should hopefully be a straightforward installation for you, which is done by following these 2 steps: # Update Local Packages on Ubuntu in WSL# Install Postgres on Ubuntu Update…

    Read More


  • List All SQL Agent Jobs in SQL Server

    This post provides a SQL script to list all SQL Server Agent Jobs on a Microsoft SQL Server instance. The sysjobs and sysjobsteps tables we are querying are in the M-S-D-B database. Fun fact, I am unable to publish a post with this actual database name without seeing…

    Read More


  • How to Check WSL Distro Versions

    This is a quick post on how to check your Windows Subsystem for Linux (WSL) distribution versions, with added info on what being on a different WSL version means. To check your WSL version we can simply run wsl -l -v in our PowerShell terminal window. This will…

    Read More


  • How to Restore a Database in SQL Server

    Restoring a database in SQL Server is an essential task for any Database Administrator. Whether it’s part of a disaster recovery plan, setting up a test environment, or moving data between servers, you’ll likely restore databases countless times in your career. You can restore databases through the SQL…

    Read More


  • How To Install Windows Subsystem for Linux (WSL)

    To install WSL (Windows Subsystem for Linux), we first enable the WSL Windows Feature using PowerShell, then install WSL Linux Distributions via the Microsoft Store. This post will help guide you through enabling and installing Windows Subsystem for Linux (WSL) on your local Windows computer. WSL allows Windows…

    Read More