Skip to content

Instantly share code, notes, and snippets.

View brianbunke's full-sized avatar

Brian Bunke brianbunke

View GitHub Profile
@markekraus
markekraus / Demo.ps1
Last active May 12, 2021 05:42
Format the Pipeline as Markdown
Invoke-WebRequest 'google.com' | Out-MarkDown
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active January 29, 2024 06:11
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
@indented-automation
indented-automation / Update-PesterTest.ps1
Last active October 4, 2021 18:17
Migrating to Pester 4.0.7
function Update-PesterTest {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('FullName')]
[String]$Path
)
begin {
$shouldParams = [String[]](Get-Command Should).Parameters.Keys
anonymous
anonymous / Compare-TwoCsvFiles
Created July 7, 2017 16:19
PS1 Function.
<#
.SYNOPSIS
Compares two CSV files using a common field.
.DESCRIPTION
Compares two CSV files using an index, or common field to flag and find rows with that matching field instead of comparing the files row by row, sequentially.
This will typically be used with files that have matching syntax and output from the same application or service. The oldest version of the two files being compared
should be Csv1. The newest version of the files being compared should be Csv2.
.PARAMETER Csv1FilePath
@Jaykul
Jaykul / ReadMe.md
Last active November 26, 2019 15:46
Making Publish-Module work with VisualStudio.com

This is a simple workaround solution for a complicated problem with registering VisualStudio online NuGet packages repositories as PowerShell module repositories.

The Problem with PowerShellGet

PowerShellGet just doesn't work with NuGet CredentialProviders, because it uses the -noninteractive switch whenever it calls nuget. However, the VisualStudio.com (VSO) nuget package repositories can work as internal PowerShell Galleries, because passing the credentials to Find-Module and Install-Module does work ...

Basically, the problem is two fold: authentication when publishing, and authentication when searching or installing. The second problem can be dealt with, inconveniently, by passing credentials every time. But the first cannot. These VSO repositories require a Credential Provider plugin to handle Microsoft Authentication (including support for 2-factor au

@lipkau
lipkau / AtlassianTuner.user.js
Last active July 9, 2020 03:05
UserScript for Atlassian's Jira and Confluence
// ==UserScript==
// @name AtlassianTuner
// @description Custom javascript to inject onto Atlassian's Jira and Confluence to make experience better (at least for me)
// @namespace https://gist.github.com/lipkau/481342249739847f2d7f8d3099783ce4
// @author Oliver Lipkau
// @version 0.10.1
// @include https://*.bsh-sdd.com*
// @require https://code.jquery.com/jquery-2.2.4.min.js#sha256=BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=
// @require https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js#sha256=WofcoLT8gToeaSmVRe28qpnlFxdBJH1n4K6Bk3YowvU=
// @run-at document-start
@nohwnd
nohwnd / CreateTagCategory.ps1
Last active January 15, 2017 18:59
Create tag category
$r = "c:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules\VMware.VimAutomation.Sdk\VMware.VimAutomation.Sdk.Types.dll",
"c:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules\VMware.VimAutomation.Core\VMware.VimAutomation.ViCore.Types.dll"
Add-Type -ReferencedAssemblies $r -typeDefinition "
using VMware.VimAutomation.ViCore.Types.V1;
using VMware.VimAutomation.ViCore.Types.V1.Tagging;
namespace Mocks
{
@cdhunt
cdhunt / Get-CredentialFromWindowsCredentialManager.ps1
Last active June 1, 2023 23:48 — forked from toburger/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real