Skip to content

Instantly share code, notes, and snippets.

Greg MacLellan gregmac

Block or report user

Report or block gregmac

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gregmac
gregmac / output.md
Last active Oct 2, 2019
.NET FIPS test
View output.md

FIPS testing

FIPS mode on

SHA256

SHA256.Create()

9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08

@gregmac
gregmac / $PROFILE\Microsoft.PowerShell_profile.ps1
Last active Jul 3, 2019
PowerShell Set-WindowTitle profile config
View $PROFILE\Microsoft.PowerShell_profile.ps1
# Import posh-git (if installed via scoop)
$poshGitModule = "$HOME\scoop\apps\posh-git\current\posh-git.psd1";
if (Test-Path $poshGitModule) { Import-Module $poshGitModule }
# msbuild convenience alias
Set-Alias MSBuild 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe'
# bash-style completion
Set-PSReadlineKeyHandler -Key Tab -Function Complete
#Set-PSReadlineOption -ShowToolTips
View tailblazer.json
{
"homepage": "https://github.com/RolandPheasant/TailBlazer",
"version": "0.9.0.536",
"license": "GPL-3.0-only",
"url": "https://github.com/RolandPheasant/TailBlazer/releases/download/0.9.0.536/Tailblazer_v0.9.0.536.zip",
"hash": "53341485375b0a9ebd4085dbafa71c68af9a2044ff1bb65f3300be4b43f6c11c",
"bin": "TailBlazer.exe",
"shortcuts": [
[
"TailBlazer.exe",
@gregmac
gregmac / winaero-tweaker.json
Created Jan 23, 2019
Winaero Tweaker manifest for Scoop
View winaero-tweaker.json
{
"homepage": "https://winaero.com/comment.php?comment.news.1836",
"license": "Freeware",
"description": "Tweaks and hidden settings for power-users for Windows 7/8/8.1/10",
"version": "0.12.1",
"url": "https://winaero.com/request.php?1796#/winaerotweaker.zip",
"hash": "359aeda5a637cfd6010810b11ac6a0b582ff3b7b9e361334d13e619e4ef4d6c2",
"innosetup": true,
"bin": "WinaeroTweaker.exe",
"shortcuts": [
@gregmac
gregmac / winsshterm.json
Last active Jan 24, 2019
WinSSHTerm Manifest for Scoop
View winsshterm.json
{
"homepage": "https://winsshterm.blogspot.com/",
"license": {
"identifier": "Freeware",
"url": "https://winsshterm.blogspot.com/p/license.html"
},
"description": "A tabbed SSH solution for Windows, combining PuTTY/KiTTY, WinSCP and VcXsrv",
"version": "2.4.1",
"url": "http://dl.winsshterm.net/WinSSHTerm-2.4.1.zip",
"extract_dir": "WinSSHTerm",
View VisualStudio Extensions.md

Essential:

  • Git Diff Margin - Show git diff in the margin, and allow reverting
  • Mouse Navigation - Use mouse forward/back buttons
  • Spell Checker - Find and fix typos and speling mistaeks in both code and comments
  • NoMorePanicSave - Auto "save all" on focus lost -- such as when you go to your git client -- which means you don't forget to check in your latest changes or modifications to the proj/sln files
  • Power Commands - Mostly for "Collapse all projects" and "Open explorer window"
  • SmartPaster2019 -
@gregmac
gregmac / notes.md
Last active Apr 27, 2018
LetsEncrypt certificate issuance notes
View notes.md

Some random tests of certbot (0.22) behaviour, as part of an effort to script its usage.

Setup:

  • *.wildcard.example.org DNS points at this server, so HTTP-01 auth works.
  • CERTBOT_PARAMS=" --test-cert --email me@example.org --agree-tos --webroot --webroot-path /var/www/html --non-interactive"

Add a domain, without --expand

certbot certonly $CERTBOT_PARAMS --domains test1.wildcard.example.org
View windows-secrets.md

This is just random things I've come across that are not well known, but useful, and I'd like to remember.

Shout outs to https://twitter.com/SwiftOnSecurity where I probably found most/all of these.

  • psr.exe - Screen steps recorder
  • Win+Shift+S - Snipping tool
  • Reliablity Monitor - Fast troubleshooting tool
  • |clip - Pipe output of commands to clipboard
View FriendlyPasswordGenerator.cs
using System;
using System.Globalization;
using System.Security.Cryptography;
/// <summary>
/// Generates human-friendly and easily remembered passwords such as "RelevantLecture!217"
/// or "AirlineCoffee$538".
///
/// Existing word set generates nearly 1.3 billion possible passwords.
/// </summary>
@gregmac
gregmac / CopyPaste.ps1
Last active Apr 24, 2017
Find RaspberryPi's on local network from Windows
View CopyPaste.ps1
# Powershell script
$nic=gwmi -computer . -class "win32_networkadapterconfiguration"|Where-Object{$_.defaultIPGateway -ne $null}
$IP=$nic.ipaddress|select-object -first 1;$Mask=$nic.ipsubnet|select-object -first 1;$IPInt=([Net.IPAddress]$IP).Address;$MaskInt=([Net.IPAddress]$Mask).Address;$start=($IPInt -band $MaskInt);$end=($IPInt -bor(-bnot [uint32]$MaskInt))-16777216;
Write-Host "Scanning $IP/$Mask...";while($start -lt $end){$start += 16777216;Test-Connection (new-object System.Net.IPAddress $start).ToString() -Count 1 -AsJob|Out-Null};Start-Sleep 1;
Write-Host "Looking up hostnames..";Get-NetNeighbor|Where-Object{$_.LinkLayerAddress.StartsWith("B8-27-EB")}|ForEacH { [PSCustomObject]@{IP = $_.IPAddress; MAC = $_.LinkLayerAddress; Host = [System.Net.Dns]::GetHostByAddress($_.IPAddress).HostName}}
You can’t perform that action at this time.