This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name VARCHAR(128) | |
DECLARE @SQL VARCHAR(254) | |
DECLARE @schema VARCHAR(128) | |
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'U' AND category = 0 ORDER BY [name]) | |
SELECT @schema = (SELECT TOP 1 schema_name(schema_id) FROM sys.tables WHERE [name] = @name) | |
WHILE @name IS NOT NULL | |
BEGIN | |
SELECT @SQL = 'DROP TABLE [' + @schema + '].[' + RTRIM(@name) +']' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[string]$filePath = $(throw "You must supply a file path") | |
) | |
clear | |
"--- Working... ---" | |
$filePath = Resolve-Path $filePath | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var startDateUtcMilliseconds = "2324324823" // In C#: (buildRun.Date.ToUniversalTime() - new DateTime(1970, 1, 1)).TotalMilliseconds.ToString(); | |
var hours, minutes, seconds; | |
if (rowItem.currentBuild) { | |
var startDate = new Date(parseInt(startDateUtcMilliseconds)); | |
var msec = Date.now() - startDate; | |
hours = Math.floor(msec / 1000 / 60 / 60); // discard | |
msec -= hours * 1000 * 60 * 60; | |
minutes = Math.floor(msec / 1000 / 60); | |
msec -= minutes * 1000 * 60; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see https://help.github.com/articles/generating-ssh-keys | |
// Get fingerprint | |
ssh-keygen -l -f /path/to/keys/id_rsa.pub | |
// Generate key | |
ssh-keygen -t rsa -C "your_email@example.com" | |
ssh-add ~/.ssh/id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); | |
store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadOnly); | |
var cert = store.Certificates.Find(X509FindType.FindByThumbprint, "ff9afddf408ccd62a5dc83aacc48f8432ab7c86c", false)[0]; | |
var messageHandler = new WebRequestHandler(); | |
messageHandler.ClientCertificates.Add(cert); | |
messageHandler.ClientCertificateOptions = ClientCertificateOption.Manual; | |
HttpClient httpClient = new HttpClient(messageHandler); | |
var result = httpClient.GetAsync("https://clientcertificatetesting.azurewebsites.net/").Result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var operationUrl = string.Format("{0}/repos/{1}/{2}/commits/{3}/comments", GitHubClientApiUrl, this.repoOwner, this.repoName, commitId); | |
var jsonBody = JsonConvert.SerializeObject(new { body = message }); | |
using (var httpClient = new HttpClient()) | |
{ | |
httpClient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Token", ConfigurationManager.AppSettings["GitHubApiAccessToken"]); | |
httpClient.DefaultRequestHeaders.Add("User-Agent", UserAgent); | |
httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); | |
return await httpClient.PostAsync(new Uri(operationUrl), new StringContent(jsonBody)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GitHubTokenEncoder | |
{ | |
public static string Encode(string body, string token) | |
{ | |
var tokenBytes = Encoding.ASCII.GetBytes(token); | |
var tokenHmacSha1 = new HMACSHA1(tokenBytes); | |
tokenHmacSha1.Initialize(); | |
var bodyBytes = Encoding.ASCII.GetBytes(body); | |
return BitConverter.ToString(tokenHmacSha1.ComputeHash(bodyBytes)).Replace("-", string.Empty).ToLowerInvariant(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netstat -ano | |
Open commandline as administrator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemGroup> | |
<MsDeploySkipRules Include="SkipNewRelic"> | |
<SkipAction></SkipAction> | |
<ObjectName>dirPath</ObjectName> | |
<AbsolutePath>\\newrelic$</AbsolutePath> | |
<Apply>Destination</Apply> | |
</MsDeploySkipRules> | |
</ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh wlan show interfaces |
OlderNewer