Skip to content

Instantly share code, notes, and snippets.

@hounsell
hounsell / KeyReader.cs
Created February 12, 2014 18:40
Old XmlDocument-based Keyreader
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.IO;
@hounsell
hounsell / ApiProxy.ashx.cs
Last active August 29, 2015 13:56
Quick and Dirty API Proxy for TCB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Caching;
using System.Net;
using System.Configuration;
using System.IO;
namespace TcbApiProxy

Keybase proof

I hereby claim:

  • I am hounsell on github.
  • I am hounsell (https://keybase.io/hounsell) on keybase.
  • I have a public key whose fingerprint is 7305 E1B7 2C6B F4F3 1960 25AB 5D62 51BB 272A E38B

To claim this, I am signing this object:

@hounsell
hounsell / RealVersionInfo.cs
Created September 26, 2014 14:01
Get Language Id for File (Part 1)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Permissions;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace VersionInfo
@hounsell
hounsell / NativeMethods.cs
Created September 26, 2014 14:01
Get Language Id for File (Part 2)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading.Tasks;
namespace VersionInfo
{
using System;
using System.Web;
namespace SecureTransfer
{
public class SecureTransferModule : IHttpModule
{
private const string DONT_LET_ROL_KNOW_THIS_SECRET = "flibbledeeflobbledeedoo";
public void Dispose()
@hounsell
hounsell / extract_streams_from_resx.ps1
Created March 24, 2023 13:34
Extract MemoryStream resources from a resx file (common in certain Longhorn-era components)
param([String] $resx_filename)
Add-Type -AssemblyName System.Windows.Forms
$resx = New-Object -TypeName 'System.Resources.ResXResourceSet' -ArgumentList $resx_filename
$root_path = [System.IO.Path]::GetDirectoryName($resx_filename);
foreach($item in $resx)
{
if ($item.Value.GetType() -Eq [System.IO.MemoryStream])
{
$out_path = [System.IO.Path]::Combine($root_path, $item.Name);