Skip to content

Instantly share code, notes, and snippets.

View lennybacon's full-sized avatar
🏠
Working from home

Daniel Fisher lennybacon

🏠
Working from home
View GitHub Profile
@lennybacon
lennybacon / GetWindows10Key.vbs
Created August 10, 2015 09:00
Show the Windows 10 Key after the free upgrade from Windows 8.1
Set WshShell = CreateObject("WScript.Shell")
InputBox "Windows Product Key", "Product Key", ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Set WshShell = Nothing
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
@lennybacon
lennybacon / aspnet-ysod-dark.css
Created November 10, 2015 10:42
ASP.NET yellow screen of death dark theme using the add-on Stylish (https://userstyles.org/)
body[bgcolor='white']{
background: #191919;
color: #999;
}
h2{
color: red;
}
body>font>b{
@lennybacon
lennybacon / Set-FrameworkVersion.ps1
Last active December 12, 2015 20:02
Powershell script to update TargetFrameworkVersion in *.csproj files recursively
function Start-Executable {
param(
[String] $FilePath,
[String[]] $ArgumentList,
[String] $WorkingDirectory
)
$process = New-Object System.Diagnostics.Process
$process.StartInfo.FileName = $FilePath
$process.StartInfo.Arguments = $ArgumentList
$process.StartInfo.UseShellExecute = $false
@lennybacon
lennybacon / AspNetMaxRequestLength.cs
Last active January 20, 2016 14:09
Reading ASP.NET maximal request length
using System.Web.Configuration;
namespace lennybacon.Samples
{
internal class AspNetMaxRequestLength
{
public static int GetMaxRequestLengthOfAspNet()
{
var configuration = WebConfigurationManager.OpenWebConfiguration("~");
var httpRuntimeSection =
@lennybacon
lennybacon / IisMaxRequestLength.cs
Created January 20, 2016 14:09
Reading IIS request filtering maximal request length
using System;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Xml;
namespace lennybacon.Samples
{
class IisMaxRequestLength
@lennybacon
lennybacon / userstyle_twitter-ad-killer.css
Created March 18, 2016 11:02
Twitter Ad-Killer using the add-on Stylish (https://userstyles.org/)
div[data-advertiser-id]{
display: none;
}
li[data-item-type='prompt'] {
display: none;
}
@lennybacon
lennybacon / Junction.ps1
Created August 16, 2016 08:44
Junctions with Powershell
New-Item -Path M:\Library -ItemType SymbolicLink -Value F:\Music
@lennybacon
lennybacon / juncrion.cmd
Created August 16, 2016 08:46
Junctions with DOS Command
cmd /c mklink /D M:\Library F:\Music\
@lennybacon
lennybacon / ES6DateCtorTest.js
Created December 22, 2016 09:55
Check ES6/ISO8601 compliance
class TimeTest {
constructor(name) {
this.name = name;
}
start() {
var x = new Date('2016-01-29T14:00:00');
return "Project " + this.name + ": " + x.getTime();
}
}
@lennybacon
lennybacon / sql_2016_unattended.ps1
Last active February 6, 2017 14:43
Install Microsoft SQL Server 2016 unattended
$serviceAccount = "";
$serviceAccountPassword = "";
$key = "";
$instanceName = "MSSQLSERVER";
$sqlRootDir = "";
$setupPath = [System.IO.Path]::Combine($installLocation, "SQL2016", "Setup.exe");
$argumentList = `
"/Q " +`
"/ACTION=`"Install`" " +`