Skip to content

Instantly share code, notes, and snippets.

View cmendible's full-sized avatar
🖖
Cloud for all

Carlos Mendible cmendible

🖖
Cloud for all
View GitHub Profile
Seems more likely now.
First, what version of WSL are you on?
> wsl.exe --version
Second, to confirm this, we would add:
[wsl2]
debugConsole=true
@cmendible
cmendible / addcasa.ps1
Created February 3, 2018 19:59
Powershell Script to add Code Analysis and Style Cop to all your .NET Core Projects.
# Place the script in the solution folder
# Add the ca.ruleset to the solution folder
# Run the Powershell Script to add Code Analysis and StyleCop to all your .NET Core Projects.
$projects = (Get-ChildItem . -recurse) | Where-Object {$_.extension -eq ".csproj"}
foreach ($project in $projects) {
$content = Get-Content $project.FullName
if (!($content | Select-String -pattern "<CodeAnalysisRuleSet>ca.ruleset</CodeAnalysisRuleSet>")) {
$content = $content.Replace("</Project>", "`t<PropertyGroup>`r`n`t`t<CodeAnalysisRuleSet>ca.ruleset</CodeAnalysisRuleSet>`r`n`t</PropertyGroup>`r`n</Project>")
$content | Out-File $project.FullName -Encoding Default
}
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active April 25, 2024 17:43
Ansible variable precedence (order, hierarchy)
@nohwnd
nohwnd / Uninstall-Pester.ps1
Last active March 14, 2024 13:57
Remove built-in version of Pester 3 (or -All) from Windows 10 Program Files and Program Files (x86).
#Requires -RunAsAdministrator
function Uninstall-Pester ([switch]$All) {
if ([IntPtr]::Size * 8 -ne 64) { throw "Run this script from 64bit PowerShell." }
#Requires -RunAsAdministrator
$pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) {
$path = "$programFiles\WindowsPowerShell\Modules\Pester"
if ($null -ne $programFiles -and (Test-Path $path)) {
if ($All) {
@pshrosbree
pshrosbree / DeserializeAzureEventHubCapture.cs
Last active February 14, 2023 11:06
Deserializing Azure event hub capture files from Apache Avro with C#
/*
NuGet references:
Microsoft.Hadoop.Avro2 (1.2.1 works)
WindowsAzure.Storage (8.3.0 works)
Namespaces:
Microsoft.Hadoop.Avro.Container
Microsoft.WindowsAzure.Storage
*/
@cmendible
cmendible / VersionTelemetryInitializer.cs
Last active October 28, 2020 15:23
Application Insights Telemetry Initializer to send the application version and a custom "tags" property
namespace Insights
{
using System.Configuration;
using System.Linq;
using System.Reflection;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
/// <summary>
/// Version TelemetryInitializer
@davidfowl
davidfowl / dotnetlayout.md
Last active May 11, 2024 20:40
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/