Skip to content

Instantly share code, notes, and snippets.

View mwwhited's full-sized avatar

Matthew Whited mwwhited

View GitHub Profile
@mwwhited
mwwhited / UsingGitVersion.md
Created November 20, 2020 12:38
Configure and use GitVersion

Using GitVersion

Summary

Gitversion is a tool to generate version numbers based on your git repository commit history.

Configure

To customize GitVersion create a GitVersion.yml file at the root of your repository. Use this file to configure your repository. For framework libraries it is suggested to use Continuous Deliver for

@mwwhited
mwwhited / SimpleScaffoldEfCodeFirst.md
Created November 20, 2020 12:55
Generate EF Properties for MS SQL View

Generate Properties from MS SQL View Columns

Summary

This script may be used to generate the properties expected for an EF Entity to back a DBSet<> for a view.

DECLARE @procName NVARCHAR(2000) = '[dbo].[YourTable]';

WITH [SystemTypes] AS (
@mwwhited
mwwhited / EnumerateMsSql.md
Last active November 20, 2020 13:21
Enumerate schema of a MS SQL database

Enumerate Contents of an MS SQL Database

Summary

As Dataset

This will create a dataset listing all all schemas, objects and columns within the current database

SELECT 
@mwwhited
mwwhited / MergeGitRepositoryIntoSecondRemote.md
Created November 20, 2020 13:27
Move/Merge Git into different remote

Merge Git repository into second remote

Some times you need to move or merge git repositories... here is the general list of commands

git remote rename origin upstream
git pull upstream master
git remote add origin NEW_URL_HERE
git pull origin master --allow-unrelated-histories
…do merge voodoo…
@mwwhited
mwwhited / GitTips.md
Last active December 4, 2020 16:18
git tips

Git Notes

Summary

I can't remember all this voodoo so maybe this will help.

Commands

force accept remote changes

@mwwhited
mwwhited / UsbHidDecode.md
Last active December 7, 2020 22:39
USB HID Decoding Tips

HID USB Decoding

Summary

This is a guide on how you can decode existing USB devices and protocols.

Wireshark with USBPcap

Wireshark makes it possible to trace and capture raw data from USB Devices

TSQL Impersonation with Dynamic Datamasking

Summary

It is possible to use impersonation to change between a masked and unmasked data within the same connection.

/*
CREATE USER [unmasked] WITHOUT LOGIN WITH DEFAULT_SCHEMA=[dbo]

Create Private NuGet feed for use with Azure Devops

Summary

It is possible to host and publish to a private NuGet feed within Azure DevOps

Process

  • Under Artifacts click Create Feed
    • Name the feed as desired

ASP.Net Core Middleware Check

Summary

This uses reflection to evaluate the registered middleware pipeline fpr ASP.Net Core.

    //Stage
    var config = new ConfigurationBuilder()
        .AddJsonStream(this.GetResourceStream("appsettings.json"))

Revert System Versioned tables

ALTER TABLE dbo.your_table
	DROP CONSTRAINT DF_SysStart , DF_SysEnd 
ALTER TABLE dbo.your_table
	DROP PERIOD FOR SYSTEM_TIME
ALTER TABLE dbo.your_table
	DROP COLUMN [SysStartTime], [SysEndTime]