Skip to content

Instantly share code, notes, and snippets.


Johnathan May johnathanmay

View GitHub Profile

How To Create Stable Private Network On Hyper-V

If you find yourself stuck in a situation where you have to use Hyper-V and you hate how it doesn't come with the ability to keep the same static IP range for your private VLAN after a reboot, this gist might be for you. It shows the powershell commands to create a new private VLAN, configure it to NAT all outbound traffic, and assign the interface a static IP that doesn't change when your computer reboots. It also shows how to create and configure a very simple VM running dnsmasq that will always start at boot and handle all your DHCP needs on the private interface.

The example below uses the subnet. Please be sure to update the code as needed to reflect whatever subnet you want to use.

Create Private Network

New-VMSwitch -SwitchName "internal-" -SwitchType Internal -Verbose

Common Powershell Commands

#list powershell version and installed modules 
Get-Host | Select-Object Version

#bypass execution policy to run script
powershell.exe -executionpolicy bypass .\script.ps1
Get-Content .\script.ps1 | powershell.exe -noprofile -

Common Linux Commands

This is a collection of linux commands that have been helpful to me. Some are definitely better documented than others...

Active Directory / SSSD / Samba

#various methods to join and remove from AD based on OS version and AD settings
kinit admin@CORP.DOMAIN.COM
net ads join -v -k -U admin@CORP.DOMAIN.COM createcomputer="/ORG/Servers/LinuxServers"
johnathanmay /
Last active Jan 16, 2022
How to install and configure PixlOne's logid to program Logitech MX Master 3 buttons on Linux.

Logitech MX Master 3 Extras for Linux With logiops

The Logitech Options program isn't available for Linux, but a nice hacker on GitHub (PixlOne) created an open source project that lets you obtain some of that functionality. It's called logiops. It works in conjunction with the Solaar project as well, which I find especially handy since that shows your available battery life in the system tray and lets you pair/unpair devices with the Logitech Unifying Receiver.

Here are some additional pages with info that I used to generate this documentation: