Creating a Powershell Profile

Creating a Powershell profile is a great way to create variables or aliases that you can use in your day to day work. The first thing you need to do is see if you already have a Powershell profile. You can do this by running the following Powershell command. test-Path $Profile if you get the following result. False This means that you need to create a Powershell profile.

Another JavaScript Gotcha

I was working with TypeScript today and I ran into a JavaScript problem that caused me some issues. I needed to fix the number of decimal places in a temperature calculation example. This is my original TypeScript code. let printOutput = (fahrenheit: number, celsius: number) => { console.log(`${fahrenheit} f = ${celsius} c.`); }; let convert = (fahrenheit: number) => { let celsius = ((fahrenheit - 32) * (5 / 9)); return celsius; }; let fahrenheit = 100; let celsius = convert(fahrenheit); printOutput(fahrenheit, celsius); Returns.

Using PGrep

I often use grep in Windows and Linux to find text in files. I have noticed that grep only works on traditional text files with .txt, .c, .cpp, .list, etc extensions. It doesn’t work with Markdown and C# text files and I find this frustrating. I have found a parallel grep program in the Microsoft Learn code samples written by David Pine that overcomes the grep limitations. The thing that I really like about this program is that I can use regular expressions in the search text.

Creating a Root Password in Linux

I am used to gaining elevated privileges in Linux by adding sudo to a command e.g. sudo apt-get update I wanted to stay in elevated privileges so I went to login as root and realised that my normal Linux account didn’t have root privileges. I did some searching on the Internet and found that most versions of Linux disable the root account by default. I found that you can enable root by running the following command.

Converting Music Files

I have been searching for a musical holy grail for a number of years (well what I would call a holy grail). Converting music files from one format to another is something I have been doing for years but I have always had trouble reformatting .iso files into high quality FLAC files. I recently downloaded a Thelonious Monk album in .iso format and tried to load it into Foobar 2000, my music player of choice.

Using the Correct Version of Windows Subsystem for Linux

I have been using the Windows Subsystem for Linux (WSL) for a number of years and just assumed that I was using WSL 2. A quick check told me that I was definitely using WSL 2. Note: I am using Powershell to check the version of WSL I have installed. wsl --status Returned. Default Distribution: Ubuntu-20.04 Default Version: 2 Windows Subsystem for Linux was last updated on 3/11/2021

Sharing Files Between Windows and Hyper-V

One of the shortcomings I find with Hyper-V is that it isn’t easy to copy files from Windows into my Hyper-V virtual environment. I have found a quick and easy method to share a virtual Windows folder with Hyper-V and will describe how to set this up. Starting a file share You need to open Control Panel and “Turn Windows Features On And Off”. From here select SMB 1.0/CIFS File Sharing Support and SMB Direct.

Changing the Resolution on a Hyper-V Virtual Machine

I have installed Hyper-V on my PC. I am going to use this to test various Linux distributions. I have noticed that every time I load a new distribution as a virtual machine it doesn’t display full screen. I have to change the resolution to be able to see my Linux system in full screen mode. One way to change your resolution is via the following: Open a terminal window.

Changing Default Colours in Windows WSL Linux

I am using the bash shell in Windows WSL Linux. Currently I am using the Ubuntu 20.04, Debian and OpenSuse distributions. The problem I have is that the default colour scheme has an ugly green background colour with blue text This is a really disconcerting colour scheme! I looked around for an alternative colour scheme to use and found that I could run a command to change the colours manually but each time I opened the terminal I would have to run the command again.

Changing the Linux Swapfile Size

I am having real problems keeping my ASUS netbook running. It doesn’t have enough specs to run a lightweight version of Linux. Increasing the size of the swapfile is supposed to improve the performance of low specced machines. I have worked out how to change the swapfile size in the hope that it may help. To check if you actually have a swapfile. swapon -s This will either return nothing or detail the swapfiles statistics.