Skip to content

Instantly share code, notes, and snippets.

@michyprima
michyprima / LayoutModification.xml
Created January 5, 2018 22:21
Make Windows 10 non-LTSB bareable (dism stuff is for 1709)
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" Version="1" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification">
<LayoutOptions StartTileGroupCellWidth="6" />
<DefaultLayoutOverride>
<StartLayoutCollection>
<defaultlayout:StartLayout GroupCellWidth="6">
</defaultlayout:StartLayout>
</StartLayoutCollection>
</DefaultLayoutOverride>
</LayoutModificationTemplate>
@michyprima
michyprima / gpxsmooth.py
Last active October 11, 2021 15:55 — forked from jdeblese/gpxsmooth.py
Path smoothing script for GPX files (py3 + fixes)
import math
import numpy
import sys, os
from lxml import etree
Re = 6371000 # Earth radius in meters
# Extract the latitute and longitude as a tuple in radians from a <trkpt> element
def extract(trkpt) :
@michyprima
michyprima / test.cs
Created March 11, 2022 14:33
Getting an array element out of an object in c#
//I didn't know you could do this, figured it out from the docs
//I had to get a specific element out of an array which was returned from a library as a single object and didn't want to cast to the specific type
//An example:
object test = new int[] { 1, 2, 3, 4, 5 };
//ideally you would do this
object test2 = ((int[])test)[1]; //but this means you need to account for each type test can be
//this does not work (throws)
object test2 = ((object[])test)[1];
@michyprima
michyprima / resume-replica.ps1
Created June 1, 2022 08:21
Powershell: Auto resync critical Hyper-V VMs one at a time (Windows Server 2019 VM Replication)
$ReplicationData = Get-VMReplication
$ok = $true
$lastwait = $false
Do {
$ok = $true
Foreach ($VMReplica in $ReplicationData) {
If ($VMReplica.State -eq "Resynchronizing") {
if ($lastwait -ne $VMReplica) {
@michyprima
michyprima / broadcom_storcli_usage.txt
Last active June 1, 2022 08:41
How to add a physical drive to a virtual drive using the Broadcom Storcli utility
In this example we want to add the physical drive 134:3 to the virtual drive 2/2 (raid 0) on the controller 0.
Data and raid type will be preserved.
storcli64.exe /c0 show
VD LIST :
=======
---------------------------------------------------------------
DG/VD TYPE State Access Consist Cache Cac sCC Size Name
@michyprima
michyprima / edge.reg
Created July 14, 2023 14:41
Making microsoft edge tolerable
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge]
"AutofillAddressEnabled"=dword:00000000
"BrowserSignin"=dword:00000000
"SyncDisabled"=dword:00000001
"BrowserAddProfileEnabled"=dword:00000000
"HideFirstRunExperience"=dword:00000001
"EdgeShoppingAssistantEnabled"=dword:00000000
"BingAdsSuppression"=dword:00000001