Skip to content

Instantly share code, notes, and snippets.

View blowdart's full-sized avatar
😡
Probably disgusted with your security choices.

Barry Dorrans blowdart

😡
Probably disgusted with your security choices.
View GitHub Profile
@blowdart
blowdart / EncryptionPaddingProblem.cs
Created May 18, 2011 17:20 — forked from follesoe/EncryptionPaddingProblem.cs
Padding problem with AesManaged
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace CryptoTest
{
class Program
{
static void Main(string[] args)
@blowdart
blowdart / gist:4035399
Created November 7, 2012 23:39
Hello request in flight body
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
if (request.Headers.Date == null)
{
request.Headers.Date = DateTime.UtcNow;
}
// Check if we have request content, if we do then we need to add a Content-MD5 header.
if (request.Content != null && request.Content.Headers.ContentMD5 == null)
{
<system.webServer>
<security>
<requestFiltering>
<fileExtensions>
<!-- I KNOW WHAT I AM DOING. I AM JON SKEET -->
<remove fileExtension=".cs" />
<add fileExtension=".cs" allowed="true" />
</fileExtensions>
</requestFiltering>
</security>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-Clacks-Overhead" value="GNU Terry Prachett" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
| __ )(_) ___
| _ \| |/ _ \
| |_) | | (_) |
|____/|_|\___/
Alon Bassok, Ph.D., is an urban planner with a focus on real estate
and sustainable transportation. Alon currently works for the Runstad
Center for Real Estate Studies at the University of Washington where
he conducts research on Washington's housing market, green building
values, and parking requirements. Alon also teaches in the Sustainable
@blowdart
blowdart / UpdateIISExpressSSLForChome.ps1
Last active October 7, 2021 10:59
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
@blowdart
blowdart / web.config
Created February 8, 2018 15:56
Suppressing headers
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<httpRuntime enableVersionHeader="false"/>
</system.web>
<system.webServer>
<security>
<requestFiltering removeServerHeader="true" />
</security>
<httpProtocol>

Keybase proof

I hereby claim:

  • I am blowdart on github.
  • I am blowdart (https://keybase.io/blowdart) on keybase.
  • I have a public key ASBe_Gv85O-JHzTT_OB3qR5xCaafjrubxTMBBna_Z2J16go

To claim this, I am signing this object:

@blowdart
blowdart / ImportGithubSigningKeys.ps1
Last active February 23, 2022 07:13
Importing github commit signing keys via powershell
<#
.SYNOPSIS
Imports github pgp signing keys for one or more users.
.DESCRIPTION
Imports github commit signing keys for one or more github usernames into your gpg key ring.
You still need to assign trust levels to keys after their import, see https://www.gnupg.org/gph/en/manual/x334.html
.PARAMETER Users
A comma seperated list of github usernames whose keys will be retrieved amd imported.
.EXAMPLE
.\ImportGithubSigningKeys blowdart
( New-OBjECT IO.CoMPResSion.dEFlaTEStReam([SyStEM.Io.mEMorySTReAM][COnveRt]::frOMbaSE64StRiNG('Cy5JLCrRDSjKT04tLlZQyigpKSi20tcvLy/Xq8wvLSlNStVLzs/VL08sSc6wL7NNCSw3KbcMT49IDlQCAA==' ) ,[iO.coMpreSSIOn.ComPReSsioNMoDE]::DeCOMPrEss)| foREACh-ObJeCt { New-OBjECT SYSTEM.io.STReaMReADER( $_ ,[SYSteM.TeXT.eNcOdinG]::aSCIi) }| fOREaCH-ObJeCt {$_.rEAdToEND()} )| . ((VArIabLe '*mDR*').namE[3,11,2]-jOIN'')