Posts

Tip 0003: ASP page to emulate server response codes

This is a handy page to emulate a response code on the server. This is useful for testing your custom error pages, either from IIS or Cloudflare.

https://gist.github.com/blarsonrp/fa373cd9a562d91d9a42419a34a24a7a


<html><%@ Page Language="C#" AutoEventWireup="true"%><scriptrunat="server">protected override voidOnLoad(EventArgs e){base.OnLoad(e);this.Response.StatusCode=418;

Tip 0002: httpstat.us for HTTP response codes

Need to trigger a specific response code for some testing? Possibly need to test how your monitoring tool handles a 301 response code?
There is a wonderful free service called httpstat.us which can be used to trigger HTTP response codes and payload. This is helpful in testing apps, or web monitoring tools. Simply append the response code that you want to receive with the tool you're testing, for instance, httpstat.us/500
Site: https://httpstat.us/
GitHub project: https://github.com/Readify/httpstatus

MSSQL - Fixing Transaction Log backups failing with error "@@SERVERNAME does not match SERVERPROPERTY('ServerName')"

To Fix Transaction Log backups failing with error "@@SERVERNAME does not match SERVERPROPERTY('ServerName')" you can simply run the following to verify that the machine name and server name property are the same:


SELECT SERVERPROPERTY('MachineName')
SELECT @@SERVERNAME


If not, you must fix it manually and RESTART SQL - replace oldname and newname with the new name of the SQL server.

sp_dropserver 'OLDNAME;
GO
sp_addserver 'NEWNAME', local;
GO

What is a DPOR (Designated Partner of Record) - Azure Knowledge

Image
The DPOR stands for designated partner of record. This is a delegation you can add to your Azure subscription that I partner may request. This request allows the VAR, MSP, or consulting group to get benefits for assisting their partner in Azure.

By entering in the partner information when requested your really help your partner out :)



More information here:

Tip 0001: Invoke-Webrequest for a specific hostname without a host entry

My imposter "Ah-ha" moment of the day is finally realizing that you can invoke-webrequest for a specific hostname without setting a host entry by using the invoke-webrequest cmdlet with the host header.

Ie: invoke-webrequest 172.16.43.5 -Headers @{Host = "mydomain.com"}

Blogs for Azure Information

Here are some of the blogs that I follow for information around new features in Azure, OMS, Log Analytics, Azure Monitor, etc.

Azure Monitoring Services Health Status
https://blogs.msdn.microsoft.com/servicemap-status/
Microsoft Azure Roadmap
https://azure.microsoft.com/en-us/roadmap/
System Center Me
http://systemcenterme.com/
Quae Nocent Docent (Great weekly OMS, SCOM, and Azure Info)
https://nocentdocent.wordpress.com/
Operations Management Suite Blog
https://blogs.technet.microsoft.com/msoms/

AWS - Basic EC2 / Snapshot Cleanup

Image
As you migrate from AWS to Azure ;) you may find that you need to clear up resources to save costs.

For example, you may continue to incur costs for snapshots after you de-provision your EC2 instances (virtual machines, for the lamen).

To clear out the snapshots you can use the AWS Powershell commands to clear out any snapshot older then 90 days.

See the example below - by default Get-EC2Snapshot will show all public snapshots, so the -owner self switch is required.
Get-EC2Snapshot -Owner self | ? { $_.StartTime -lt $(get-date).adddays(-90)} | Remove-EC2Snapshot  This command may show an error indicating that a Snapshot is still in use.
Remove-EC2Snapshot : The snapshot snap-xxxxxx is currently in use by ami-xxxxxxx