joubin's Kardz

TSQL - Find duplicates in a column

SELECT   {col_name},
         COUNT({col_name}) AS dupe_cnt
FROM     {table_name}
GROUP BY {col_name}
HAVING   COUNT({col_name}) > 1


  1. {col_name} with the column name being examined
  2. {table_name} with the respective table name

Shared by joubin on Tue Jun 23 2020


Returns the table's column length in bytes:

COL_LENGTH ( 'table' , 'column' )


Shared by joubin on Wed Apr 29 2020

Using MSI for debugging in Visual Studio

To debug against Azure (e.g. getting access to Key Vault etc.) configure Visual Studio to use the account with which it uses to send credentials to Azure.

This configuration is under: Options => Azure Service Authentication => Account Selection


Shared by joubin on Fri Apr 17 2020

Azure Data Factory Trigger files

The trigger files are stored in a location similar to:


Each trigger has the following information:

  • the schedule/condition defintion
  • a collection of pipelines references


Shared by joubin on Fri Apr 03 2020

Roslyn & RyuJIT


  • The .NET Platform Compiler i.e. compiles your C# (etc) code into IL
  • Has a public API e.g. could be included in your app to compile other code on-the-fly


  • Compiles the Roslyn generated IL into native code (only x64)
  • No public API available

Shared by joubin on Thu Apr 02 2020

tracert, Windows

The TRACERT diagnostic utility determines the route to a destination by sending Internet Control Message Protocol (ICMP) echo packets to the destination.


Shared by joubin on Tue Mar 31 2020

.NET Portability Analyzer

The .NET Portability Analyzer is an open source tool that is utitlized to analyze assemblies, files or directory of files for compatibility across .NET implementations.

This tool reports on the compatibility of the current app across .NET implementations.

It comes as:

  1. Visual Studio Extension - analyzes individual assemblies/projects or the solution
  2. A console app (ApiPort) - analyzes assemblies/files/directories


Shared by joubin on Fri Sep 06 2019

Debugging modes, VS Code

In VS Code, there are two core debugging modes, Launch and Attach.

  1. Starting in the browser
    • When you open DevTools in a browser, you are attaching DevTools to the open browser tab.
  2. Starting in the code editor
    • The editor launches your process, and it automatically attaches its debugger to the newly launched process.


Shared by joubin on Fri Aug 09 2019

Launch Configuration, VS Code

A configuration file allows you to configure and save debugging setup details.

VS Code keeps debugging configuration information in a launch.json file located in a .vscode folder in your workspace (project root folder)


Shared by joubin on Fri Aug 09 2019

Angular Framework app version

1. ng --version (or ng v)

2. Open Developer Tools in the browser. Under the 'Elements' tab, look for html/body/app-root[ng-version]

3. To render the Angular version on a page, import VERSION from @angular/cli.

const version = VERSION.full;

Shared by joubin on Wed Jul 31 2019

Prune/Cleanup the local references to remote branch

Dry-run: The command git remote prune origin --dry-run lists branches that can be deleted/pruned on your local.

To remove the local remove '--dry-run'.


Shared by joubin on Mon Jun 03 2019

OData - Querying Data

$filter: The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response.

serviceRoot/People?$filter=FirstName eq 'Scott'

$orderby: The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.

serviceRoot/People('scottketchum')/Trips?$orderby=EndsAt desc

$count: The $count system query option allows clients to request a count of the matching resources included with the resources in the response.


$select: The $select system query option allows the clients to requests a limited set of properties for each entity

serviceRoot/Airports?$select=Name, IcaoCode

$top & $skip: The $top system query option requests the number of items in the queried collection to be included in the result. The $skip query option requests the number of items in the queried collection that are to be skipped and not included in the result.


$expand: The $expand system query option specifies the related resources to be included in line with retrieved resources.


Supporting multiple filters:

Use the and/or operators to apply multiple filters.


Shared by joubin on Fri Jun 23 2017

Theory attribute, xUnit

Marks a test method as being a data theory.

Data theories are tests which are fed various bits of data from a data source, mapping to parameters on the test method.

If the data source contains multiple rows, then the test method is executed multiple times (once with each data row). Data is provided by attributes which derive from Xunit.Sdk.DataAttribute:

  • Xunit.InlineDataAttribute
  • Xunit.MemberDataAttribute


Shared by joubin on Thu May 16 2019

Content-Disposition, Http Header

The Content-Disposition response-header field has been proposed as a means for the origin server to suggest a default filename if the user requests that the content is saved to a file.


Content-Disposition: attachment; filename="fname.csv"

Note: In the context of a CORS request, use the Access-Control-Expose-Headers Http header to expose Content-Disposition as a header value.


Shared by joubin on Thu May 16 2019

CORS related headers

All CORS related headers are prefixed with "Access-Control-".



Shared by joubin on Thu May 16 2019

Azure Security Center

Azure Security Center (ASC) is a monitoring service that provides threat protection across all of your services both in Azure, and on-premises.

ASC is part of the Center for Internet Security (CIS) recommendations.


Shared by joubin on Mon May 13 2019

Center for Internet Security

The Center for Internet Security (CIS) is a nonprofit organization, formed in October, 2000.

Its mission is to "identify, develop, validate, promote, and sustain best practice solutions for cyber defense and build and lead communities to enable an environment of trust in cyberspace".

The organization is headquartered in East Greenbush, New York, with members including large corporations, government agencies, and academic institutions.


Shared by joubin on Mon May 13 2019

SIEM, Security

Security information and event management (SIEM) software products and services combine security information management (SIM) and security event management (SEM). They provide real-time analysis of security alerts generated by applications and network hardware.

Vendors sell SIEM as software, as appliances or as managed services; these products are also used to log security data and generate reports for compliance purposes.

See also:

SIM - Security Information Management

SEM - Security Event Management


Shared by joubin on Mon May 13 2019

Global Error Handling, Angular

Create a class that implements ErrorHandler.

It has one method needs implementing: handleError 


Shared by joubin on Mon May 13 2019

Http Interception, Angular

You declare a class as an interceptor in Angular by implementing the HttpInterceptor interface.

An interceptor will transform the client requests and responses from the server.


Shared by joubin on Wed May 08 2019