Skip to content

Instantly share code, notes, and snippets.

View codingoutloud's full-sized avatar
💭
Building.

Bill Wilder codingoutloud

💭
Building.
View GitHub Profile
@codingoutloud
codingoutloud / windows-azure-certs.txt
Created November 3, 2012 03:27
Dump of Windows Azure Certificates from a Web Role instance (output is from https://gist.github.com/4005661)
Store Location: CurrentUser
Store Location/Store Name: CurrentUser/AddressBook
Store Location/Store Name: CurrentUser/AuthRoot
Certificate (some fields): for OU=Security Communication EV RootCA1, O="SECOM Trust Systems CO.,LTD.", C=JP - has private key False by OU=Security Communication EV RootCA1, O="SECOM Trust Systems CO.,LTD.", C=JP
Certificate (some fields): for CN=D-TRUST Root Class 3 CA 2007, O=D-Trust GmbH, C=DE - has private key False by CN=D-TRUST Root Class 3 CA 2007, O=D-Trust GmbH, C=DE
Certificate (some fields): for OU=certSIGN ROOT CA, O=certSIGN, C=RO - has private key False by OU=certSIGN ROOT CA, O=certSIGN, C=RO
Certificate (some fields): for E=scr@registradores.org, STREET=Principe de Vergara 72 28006 Madrid, CN=Certificado de la Clave Principal, OU=Certificado Raiz, OU=Certificado Propio, O=Servicio de Certificacion del Colegio de Registradores (SCR), C=es - has private key False by E=scr@registradores.org, STREET=Principe de Vergara 72 28006 Madrid, CN=Certificado de la Clave Principal,
@codingoutloud
codingoutloud / DumpAllWindowsCerts.cs
Created November 3, 2012 03:03
Dump all digital certificates in Windows certificate store to stdout
// Iterates through all of the X.509 digital certificates installed in the certificate store
// on a Windows operating system, dumping out some metadata about each. Each certificate, in
// each Certificate Store, from each Certificate Location is included.
//
// Bill Wilder | @codingoutloud | Oct 2012
// Original: https://gist.github.com/4005661
using System;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
@codingoutloud
codingoutloud / make-waz-certs.bat
Created October 24, 2012 20:23
Generate a self-signed certificate (*.cer) useful for use with the Windows Azure Service Management API. Optionally create Private Key (*pvk) and Personal Information Exchange (*.pfx) files.
@echo off
rem - Generate a self-signed certificate (*.cer) useful for use with the Windows Azure Service Management API.
rem - Optionally create Private Key (*pvk) and Personal Information Exchange (*.pfx) files.
rem - A more advanced version of https://gist.github.com/3767941
rem - Assumes the makecert.exe and pvk2pfx.exe are available in your path on Windows.
rem - SOURCE: https://gist.github.com/3948621
if .%1.==.. goto USAGE
if .%2.==.. goto USAGE
if "%3"=="-private" goto PRIVATE
@codingoutloud
codingoutloud / Web.Release.config
Created October 3, 2012 20:40
Web.Release.config transform to apply a real Windows Azure SQL Database connection string
<?xml version="1.0"?>
<!-- Source: https://gist.github.com/3829717 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="NameOfConnectionStringNeedsToMatchWhatsInRegularWebConfig"
connectionString=
"Server=tcp:abcd12hdj.database.windows.net,1433;Database=pop-tart;User ID=hopefullynonadminuser@abcd12bhdj;Password=TopSecretPassw0rd;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
@codingoutloud
codingoutloud / azure-mvc-about.cshtml
Created October 3, 2012 19:02
Windows Azure Web About Box snippet
<!--
The beginnings of some useful context to display so one might understand some simple things about a
Windows Azure deployment without a lot of effort
Source: https://gist.github.com/3829053
-->
<!--
As might be included in an About page:
Note: only useful when run within a custom assembly; if run from within default.cshtml on, say, trivial
Windows Azure Web Sites site, it would show the About info for mscorlib, such as:
Last compiled: Saturday, January 21, 2012 at 5:40:04 PM UTC, File version: 4.0.0.0)
@codingoutloud
codingoutloud / WebRoleSimpleWAD.cs
Created September 23, 2012 12:48
Turning on Windows Azure Diagnostics
// Simple approach, usually done in RoleEntryPoint::OnStart - though could be otherwise (even done remotely)
// See full working project at https://github.com/codingoutloud/SimpleWAD
public override bool OnStart()
{
Trace.Listeners.Add(new DiagnosticMonitorTraceListener());
Trace.AutoFlush = true;
Trace.TraceInformation("Error");
// Set up to transfer to blob storage
DiagnosticMonitorConfiguration diagnosticConfiguration = DiagnosticMonitor.GetDefaultInitialConfiguration();
@codingoutloud
codingoutloud / make-waz-mgmt-cert.bat
Created September 22, 2012 21:49
Create a Windows Azure Management certificate for use with the Service Management API. This is also useful for using the "Publish" option from Visual Studio. A -private option can be used to also create a .pvk. You will need the private key (.pvk) if you
@echo off
rem - Generate a self-signed certificate useful for use with the Windows Azure Service Management API
if .%1.==.. goto USAGE
if .%2.==.. goto USAGE
if "%3"=="-private" goto PRIVATE
makecert.exe -r -pe -n %1 -ss My -sky exchange -sp "Microsoft Enhanced RSA and AES Cryptographic Provider" -sy 24 %2.cer
goto END
@codingoutloud
codingoutloud / .gitignore
Last active October 9, 2016 15:34
Git Ignore for ASP.NET MVC / Windows Azure development
# .gitignore for ASP.NET MVC / Windows Azure development
# Original file: https://gist.github.com/3318347 by @codingoutloud
## Github doc on ignoring files: https://help.github.com/articles/ignoring-files
## The man page for .gitignore (referenced by github): http://man.cx/gitignore
## Of possible interest (can be complex): https://github.com/github/gitignore
# Troubleshooting
# 1. If you add a .gitignore file to an existing repo (or significantly change one), you may want
# to force it to act as though the new/updated .gitignore was in force the whole time.
## http://stackoverflow.com/questions/1139762/gitignore-file-not-ignoring
@codingoutloud
codingoutloud / github-webhook.cs
Created July 26, 2012 20:18
Handle HTTP Post for WebHook
// POST /api/githubpushes
// FAILS: Content-Type: application/json
// WORKS: Content-Type: application/x-www-form-urlencoded
public HttpResponseMessage<string> Post(
// not needed, but might be if more complex: [FromBody]
SimpleFormData webHookData)
{
var pushManifestJson = webHookData.Payload;
var pushManifest = JsonConvert.DeserializeObject<GithubPushManifest>(pushManifestJson);
@codingoutloud
codingoutloud / blob-frame.html
Created July 26, 2012 20:12
Display a Public Blob in another HTML Page with an IFRAME
<html>
<body>
<iframe
width="100%"
src="http://pop.blob.core.windows.net/popstats/last-github-commit.txt"
frameborder="0"
scrolling="no"
name="lastGithubCommit"
title="Last Github commit."/>