Useful Commands for Windows Subsystem for Linux

wsl -l -v - check current WSL version in use

wsl -–set-default-version 1 - set default WSL version. Currently 1 or 2.

wsl -–set-version Ubuntu-20.04 2 - convert WSL version to version 2 where Ubuntu-20.04 is the name of the distribution.

· 2020/08/22 01:10 · 2021/03/11 13:36

Upgrade/Install PHP 7.4 in CentOS 8

The good news is this whole process is relatively painless, so here we go.

As always, all the commands assume you have root permissions.

Install the EPEL and remi repositories.

dnf install
dnf install

List the PHP versions you have available

dnf module list php

This should list versions of PHP both in the main repositorys as well as the remi repository. We want to enable remi-7.4.

Reset the php module (if you already have an existing PHP version installed)

dnf module reset php

Install PHP 7.4

dnf module enable php:remi-7.4

Update using dnf

dnf update

PHP 7.4 should now be installed.

Verify PHP version

php -v

· 2020/07/31 14:54 · 2021/03/01 05:13

Set up unattended-upgrades on Ubuntu 20.04

Package upgrades can be set up to install updates on Ubuntu without user intervention.

Install unattended-upgrades

apt install unattended-upgrades

Install mailx

apt install bsd-mailx

This will install also install Postfix. mailx is what unattended upgrades uses to send external mail.

Configure unattended-upgrades

Edit /etc/apt/apt.conf.d/50unattended-upgrades. This file is mostly self explanatory. The options can be enabled by deleting un-commenting the line. At the very least, configure the following:

  • Unattended-Upgrade::Mail “”; to allow sending notifications to your e-mail address.
  • Unattended-Upgrade::Automatic-Reboot “true”; to enable auto-reboots
  • Unattended-Upgrade::Remove-Unused-Kernel-Packages “true”; to remove kernel-related packages. This is usually done using apt autoremove.
  • Unattended-Upgrade::Remove-New-Unused-Dependencies “true”; - remove unneeded dependancies. Also manually done with apt autoremove.
  • Unattended-Upgrade::Remove-Unused-Dependencies “false”; - remove unused packages, also, apt autoremove.

Restart unattended-upgrades

systemctl restart unattended-upgrades

Configure Postfix

Edit /etc/postfix/ Configuration of postfix is outside the scope of this article. For my purposes, I use a relay, so I edit and uncomment relayhost = to point to my relay.

Test mail

mailx -vvv -s "Subject"

Press CTRL D to send the email.

Test your set up

unattended-upgrades --dry-run -–debug
· 2020/07/29 16:38 · 2020/07/30 13:11

Quick time server set up on HP/Aruba switches

This is a quick configuration of setting a time server on Aruba/HP switches.

Enable sntp

timesync sntp

Specify how to get to your time server

sntp unicast

If your DHCP server specifies an SNTP server in it's leases, then you didn't really have to go through this.

Specify the time server

sntp server priority 1 IP.IP.IP.IP

Replace IP.IP.IP.IP with your server IP.

Set timezone

time timezone -360

Set this to for your location.

Set daylight-savings time rule

time daylight-time-rule continental-us-and-canada

Set this to for your location.

Verify your changes

show sntp
· 2020/07/29 10:51 · 2021/04/29 15:04

Fix software updates in Cockpit in Ubuntu 20.04

Software updates on the Ubuntu system will fail because Cockpit on Ubuntu doesn't detect a network connection. To fix this, you must use NetworkManager instead of the default networkd.

You need to be root or sudo root for all these commands. Edit your netplan file in /etc/netplan and add the following two lines under network:.

version: 2
renderer: NetworkManager

Remember that spaces matter in YAML files.

You will then need install network-manager.

apt install network-manager

Disable networkd.

systemctl disable systemd-networkd

Enable NetworkManager

systemctl enable network-manager

Apply your new settings

netplan apply


· 2020/07/17 14:15 · 2020/07/17 14:23

<< Newer entries | Older entries >>