Skip to content

Instantly share code, notes, and snippets.

View p0onage's full-sized avatar
:octocat:

Joshua Duxbury p0onage

:octocat:
View GitHub Profile
@p0onage
p0onage / TeamsRouting.ps1
Last active June 30, 2022 10:29
Add Teams Media IP subnets into the route table
$intIndex = "" # index of the interface connected to the internet
$gateway = "" # default gateway of that interface (change this)
# Query the web service for IPs in the Optimize category
$destPrefix = "52.120.0.0/14", "52.112.0.0/14", "13.107.64.0/18" # Teams Media endpoints
# Add routes to the route table
foreach ($prefix in $destPrefix) {New-NetRoute -DestinationPrefix $prefix -InterfaceIndex $intIndex -NextHop $gateway}
@p0onage
p0onage / RegisterAnyInterface
Created May 28, 2019 09:12
Scrutor Register any type of interface
.AddClasses(classes => classes.AssignableToAny(typeof(ISingletonService), typeof(ISingletonService)))
@p0onage
p0onage / ScrutorIinitialSetup.cs
Last active February 11, 2019 13:58
Setup Scrutor Dependency Injection
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
services.Scan(scan =>
{
scan.FromAssemblies(assemblies)
.AddClasses(classes => classes.AssignableTo<ITransientService>())
.AsImplementedInterfaces()
.WithTransientLifetime();
scan.FromAssemblies(assemblies)
.AddClasses(classes => classes.AssignableTo<ISingletonService>())