Skip to content

Instantly share code, notes, and snippets.

Pavel cpoDesign

Block or report user

Report or block cpoDesign

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cpoDesign / searchForIndexByTableAndIndexName.sql
Created Feb 26, 2019
Find an index with a specific name
View searchForIndexByTableAndIndexName.sql
select * from sys.tables as t
inner join sys.columns as c
on t.object_id = c.object_id
inner join sys.index_columns as ic
on c.column_id = ic.column_id and c.object_id = ic.object_id
inner join sys.indexes as i
on ic.index_id = i.index_id and ic.object_id = i.object_id
WHERE = 'table_name' AND = 'index_name'
-- where = 'table_name' and = 'column_name'
View API-wrapper.cs
public partial class ApiClient
private readonly HttpClient _httpClient;
private Uri BaseEndpoint { get; set; }
public ApiClient(Uri baseEndpoint)
if (baseEndpoint == null)
cpoDesign / project.nuspec
Created Sep 8, 2018
Project setup for .net core showing how nuspec will get updated as part of a build
View project.nuspec
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="">
<description>package desciptions</description>
cpoDesign / gist:26482f97e2dc8e35625bcd7b08cafb54
Created Aug 16, 2018
How to get client list with all auth. keys to be served to a list of services. using token for authentication. This presents how-ever security risk as all active configuration is presented at once.
View gist:26482f97e2dc8e35625bcd7b08cafb54
/// <summary>
/// used to provide definition for gateway service about active keys for clients, to about active client configuration
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
public IActionResult GetClientList(string token)
if (ValidateToken(token))
cpoDesign / ForceRequestToSpecificIPandPort.cs
Created Jun 1, 2018
Force request to specific IP address and port
View ForceRequestToSpecificIPandPort.cs
string sendingIp = "";
int sendingPort = 5000;
Uri uri = new Uri("");
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(uri);
ServicePoint sp = ServicePointManager.FindServicePoint(uri);
sp.BindIPEndPointDelegate =
(servicePoint,remoteEp,retryCount) =>
return new IPEndPoint(IPAddress.Parse(sendingIp),sendingPort);
cpoDesign / PublishBuildArtifacts.yaml
Last active May 30, 2018
Break apart powershell arguments dynamically
View PublishBuildArtifacts.yaml
- task: PublishBuildArtifacts@1
displayName: Publish Artifact: DynamicPowerShellArguments
PathtoPublish: test.ps1
ArtifactName: DynamicPowerShellArguments
publishLocation: Container
cpoDesign / tester.exe.config
Created Apr 27, 2018
Sample for configuration string
View tester.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<add name="ConnectionStringUnderTest" connectionString="Data Source=localhost;Initial Catalog=MyDatabaseCatalogToReplace;Integrated Security=True" />
<add key="CommandTimeOut" value="90"/>
cpoDesign / cntlm.ini
Created Apr 20, 2018
CNTLM configuration ini file
View cntlm.ini
Username user
Domain domain
# provide actual value if autodetection fails
# Workstation pc-name
NoProxy 127.0.0.*, 192.168.*
cpoDesign / SQL2016DropIFExistsNew.sql
Last active Jan 23, 2018
SQL 2016 new way of checking if exists
View SQL2016DropIFExistsNew.sql
cpoDesign / PSExecution.cs
Last active Jan 17, 2018
Example how to run powershell in .net 4.7 from C#
View PSExecution.cs
namespace Web.Controllers
public class PSExecution
public PSCommand PSCommand{get;set;}
public string Output{get; private set;}
public void SetOutput(string output){
this.Output = output;
You can’t perform that action at this time.