This file contains hidden or 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
ProcDump: http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx | |
ProcDump Command that I used: C:\Procdump>procdump.exe -ma w3wp.exe 3rdfix.dmp -n 20 | |
//analyze managed memory |
This file contains hidden or 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
using Microsoft.Web.Administration; | |
using Microsoft.WindowsAzure.ServiceRuntime; | |
using System; | |
namespace WebRole1 | |
{ | |
public class WebRole : RoleEntryPoint | |
{ | |
public override bool OnStart() | |
{ |
This file contains hidden or 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
ServiceHost host = new ServiceHost(typeof(SomeService), new Uri("http://localhost:8986")); | |
WebHttpBinding binding = new WebHttpBinding(); | |
ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(ISomeContractName), binding, "ServiceHost"); | |
WebHttpBehavior httpBehavior = new WebHttpBehavior(); | |
endpoint.Behaviors.Add(httpBehavior); | |
This file contains hidden or 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
--Generate self-signed cert for use on amazon | |
openssl genrsa -out server_privatekey.pem 1024 | |
openssl req -new -key server_privatekey.pem -out server_certificate_csr.pem | |
openssl x509 -req -days 3650 -in server_certificate_csr.pem -signkey server_privatekey.pem -out server_certificate.pem | |
) | |
Certificate Name: mycert |
This file contains hidden or 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
select * from sys.messages where message_id = '18452' and language_id = 1033 |
This file contains hidden or 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
NET TIME \\TIMESRV /SET /YES |
This file contains hidden or 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
NET TIME /domain:mydomainname /SET /Y |
This file contains hidden or 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 ControllerBase : System.Web.Mvc.Controller | |
{ | |
protected override void OnException(ExceptionContext filterContext) | |
{ | |
//Do whatever stuff you'd like | |
DoSomeOtherStuff(); | |
//Displays a friendly error, doesn't require HandleError | |
filterContext.ExceptionHandled = true; | |
this.View("Error").ExecuteResult(this.ControllerContext); | |
//Displays a friendly error, *requires* HandlError |
This file contains hidden or 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 virtual void OnException(ExceptionContext filterContext) | |
{ | |
if (filterContext == null) | |
{ | |
throw new ArgumentNullException("filterContext"); | |
} | |
if (!filterContext.ExceptionHandled && filterContext.HttpContext.IsCustomErrorEnabled) | |
{ | |
Exception innerException = filterContext.Exception; |
This file contains hidden or 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
protected byte[] CropImageFile(byte[] imageFile, int targetW, int targetH, int targetX, int targetY) | |
{ | |
MemoryStream imgMemoryStream = new MemoryStream(); | |
System.Drawing.Image imgPhoto = System.Drawing.Image.FromStream(new MemoryStream(imageFile)); | |
Bitmap bmPhoto = new Bitmap(targetW, targetH, PixelFormat.Format24bppRgb); |
NewerOlder