Skip to content

Instantly share code, notes, and snippets.

View trentmswanson's full-sized avatar

Trent Swanson trentmswanson

  • Can we build it?
View GitHub Profile
@trentmswanson
trentmswanson / gist:410859e6961ed1c81240
Created March 6, 2015 03:10
log4net transform to replace file appender with trace appender
<?xml version="1.0"?>
<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
<log4net>
<appender name="DataAccessLogFile" type="log4net.Appender.TraceAppender" xdt:Transform="SetAttributes(type)" xdt:Locator="Match(name)" >
@trentmswanson
trentmswanson / autopart.sh
Last active December 3, 2022 08:22
Linux bash script to partition and format all data disks in azure
#!/bin/bash
# An set of disks to ignore from partitioning and formatting
BLACKLIST="/dev/sda|/dev/sdb"
# Base directory to hold the data* files
DATA_BASE="/media"
usage() {
echo "Usage: $(basename $0) <new disk>"
}
@trentmswanson
trentmswanson / DebugWriter.cs
Last active August 29, 2015 14:03
Semantic Logging Application Block Output Console to Debug
public class DebugWriter : StringWriter
{
public override void WriteLine(string value)
{
Debug.WriteLine(value);
}
//This is the one SLAB Console sink uses
public override void Write(string value)
{