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 / New-AES256Key.ps1
Last active April 29, 2024 11:54
Generate a new AES 256 Key with PowerShell
$random = [System.Security.Cryptography.RandomNumberGenerator]::Create();
$buffer = New-Object byte[] 32;
$random.GetBytes($buffer);
[BitConverter]::ToString($buffer).Replace("-", [string]::Empty);
@lennybacon
lennybacon / .gitconfig
Last active October 11, 2022 06:48
.gitconfig with beyondcompare for linux
[core]
excludesfile = ~/.gitignore
autocrlf = input
editor = ~/tools/sublime_text_3/sublime_text
[user]
name = Daniel Fisher
email = info@lennybacon.com
[push]
default = tracking
[http]
@lennybacon
lennybacon / Setup-TfsBuildAgent.ps1
Last active June 21, 2022 20:24
Totally automated Team Foundation 2017 build agent setup
$tfsUrl = "https://domain.tld/";
$tfsCollection = "DefaultCollection";
$tfsProject = "projectName";
$nugetSourceName = "Libraries";
$nugetFeedUrl = "$tfsUrl/$tfsCollection/_packaging/Libraries/nuget/v3/index.json";
$nugetUserName = "TfsBuild";
$nugetPassword = "*******";
$ErrorActionPreference="Stop";
If(-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() ).IsInRole(
@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 / ietf-dark.css
Last active May 27, 2021 15:48
Stylus dark theme for RFCs
/* ==UserStyle==
@name IETF Dark
@namespace https://gist.github.com/lennybacon
@version 1.0.1
@description Dark theme for IETF
@author lennybacon
@homepageURL https://gist.github.com/lennybacon/aa4b520e6a04e17c820b70fca793db6a
@updateURL https://gist.githubusercontent.com/lennybacon/aa4b520e6a04e17c820b70fca793db6a/raw/355f11c3c3f4e4aa2103e2fe9754d61f41e07ced/ietf-dark.css
@license CC-BY-SA-4.0
==/UserStyle== */
@lennybacon
lennybacon / vscode-markdown.css
Created May 6, 2021 12:38
Visual Studio Code Markdown Style
html{
background-color: #343434;
font-size: 14px;
color: #404040;
}
body{
width:700px;
background-color: #e6e6e6;
margin: auto;
@lennybacon
lennybacon / userstyle_jsonview.css
Last active March 2, 2021 16:09
Dark Theme for Firefox/Chrome add-ons JSON View (http://jsonview.com/) and JSON Formatter (https://github.com/callumlocke/json-formatter) by using the add-on Stylish (https://userstyles.org/)
/* ==UserStyle==
@name JSONView Dark
@namespace https://gist.github.com/lennybacon
@version 1.0.1
@description Dark theme for JsonView Extension
@author lennybacon
@homepageURL https://gist.github.com/lennybacon/cb700cee27601e7473dd
@updateURL https://gist.githubusercontent.com/lennybacon/cb700cee27601e7473dd/raw/7cfb8b250a8067122a0f138e4f00ab463b9d59d4/userstyle_jsonview.css
@license CC-BY-SA-4.0
==/UserStyle== */
@lennybacon
lennybacon / Update-VisualStudio2017.ps1
Last active January 19, 2021 17:51
Headless update for Visual Studio
Write-Host "Update Visual Studio Installer" -ForegroundColor Cyan
# [Microsoft Developer community](https://developercommunity.visualstudio.com/content/problem/307261/unattend-self-update-of-vs-installer.html)
$vsCommunityDownloadUrl = "https://download.visualstudio.microsoft.com/download/pr/8a973d5d-2ccb-428c-8204-290a15d30e2c/be8c694b12879a8f47f34369d55d453c/vs_community.exe";
$vsSetupDirectory = "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Setup"
$vsCommunitySetupPath = "$vsSetupDirectory\vs_community.exe";
if((Test-Path -Path $vsSetupDirectory) -eq $false){
$r = md $vsSetupDirectory
}
if((Test-Path -Path $vsCommunitySetupPath) -eq $false){
@lennybacon
lennybacon / SetCodeManalysis.ps1
Created April 29, 2015 11:13
Enable or disable FxCop Code Analysis solution wide in Visual Studio Package Manager Console
function Disable-CodeAnalysis(){
ForEach ($project in $dte.Solution.Projects) {
Set-CodeAnalysis($project, $false)
}
}
function Enable-CodeAnalysis(){
ForEach ($project in $dte.Solution.Projects) {
Set-CodeAnalysis($project, $true)
}
@lennybacon
lennybacon / TimeZoneInfoConverter.tt
Created May 26, 2020 20:40
T4 Template for conversion of IANA and Windows time zones.
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ output extension=".g.cs" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="System.Text.Json" #>
<#@ assembly name="System.Memory" #>
<#@ assembly name="netstandard" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Net" #>
<#@ import namespace="System.Text.Json" #>
<#