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
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
cmendible / vCardQRCode.csx
Created August 28, 2016 17:36
Create vCard QR Codes using Azure Functions
#r "System.Drawing"
#r "QRCoder.dll"
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using QRCoder;
cmendible / Roslyn.CodeGeneration.Program.cs
Created August 16, 2017 09:30
Create a class with dotnet core and roslyn with using statements outside the namespace
using System;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Roslyn.CodeGeneration
public class Program
public static void Main(string[] args)
cmendible / Get-PasswordFromPmp.psm1
Created January 19, 2018 11:31
A PowerShell module to fetch passwords from Password Manager Pro (PMP).
function Get-PasswordFromPmp {
# Gets a password from PMP.
# Gets a password from PMP.
#.PARAMETER pmpServer
# The server name and port where PMP is hosted.
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
cmendible /
Last active May 21, 2019 18:52
Script to Install Azure CLI and Ansible on Ubuntu
# Install Azure CLI
AZ_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
curl -L | sudo apt-key add -
sudo apt-get install -y apt-transport-https
sudo apt-get update && sudo apt-get install -y azure-cli
cmendible /
Created November 16, 2018 11:05 — forked from davidfowl/
.NET project structure
cmendible /
Last active April 27, 2019 16:05
Kubernetes deployment for the Global Azure Bootcamp 2019 Science Lab

Kubernetes deployment for the Global Azure Bootcamp 2019 Science Lab

This deployment file will attempt to deploy 3 replicas of the container used in the Global Azure Bootcamp 2019 Science Lab.

Just run:

kubectl apply -f ./gab-2019-science-lab.yaml
cmendible /
Last active January 18, 2021 17:52

Keybase proof

I hereby claim:

  • I am cmendible on github.
  • I am cmendibl3 ( on keybase.
  • I have a public key ASAFDp7ZcZ0ARweRA9g8BFrM8DO8mTA8FBlGcC4iJM48cAo

To claim this, I am signing this object:

cmendible /
Created November 16, 2019 22:02
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
# Receives your Windows username as only parameter.
curl -LO
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl