Skip to content

Instantly share code, notes, and snippets.

Cloud for all

Carlos Mendible cmendible

Cloud for all
View GitHub Profile
cmendible /
Created Nov 16, 2019
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
cmendible / Get-PasswordFromPmp.psm1
Created Jan 19, 2018
A PowerShell module to fetch passwords from Password Manager Pro (PMP).
View Get-PasswordFromPmp.psm1
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 / Roslyn.CodeGeneration.Program.cs
Created Aug 16, 2017
Create a class with dotnet core and roslyn with using statements outside the namespace
View Roslyn.CodeGeneration.Program.cs
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)

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 / VersionTelemetryInitializer.cs
Last active Oct 28, 2020
Application Insights Telemetry Initializer to send the application version and a custom "tags" property
View VersionTelemetryInitializer.cs
namespace Insights
using System.Configuration;
using System.Linq;
using System.Reflection;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Extensibility;
/// <summary>
/// Version TelemetryInitializer
cmendible / on_demand_azure_policy_scan.ps1
Created Apr 8, 2020
On-demand Azure Policy Scan with Azure CLI and Powershell
View on_demand_azure_policy_scan.ps1
# Based on @maikvandergaag work:
$account = (az account show -o json | ConvertFrom-Json)
$subscriptionId = $
$tenantId = $account.homeTenantId
$token = (az account get-access-token --tenant $tenantId -o json | ConvertFrom-Json).accessToken
$authHeader = @{
'Authorization'='Bearer ' + $token
cmendible / vCardQRCode.csx
Created Aug 28, 2016
Create vCard QR Codes using Azure Functions
View vCardQRCode.csx
#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 / SetupPodIdentityKeyVaultIntegration.ps1
Created Nov 30, 2019
AKS: Setup Pod Identity Key Vault Integration
View SetupPodIdentityKeyVaultIntegration.ps1
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
[Parameter(Mandatory = $true)]
cmendible / debug.log
Last active Dec 10, 2019
terraform destroy fails for azurerm_role_definition if role scope is a Management Group
View debug.log
This file has been truncated, but you can view the full file.
2019/12/10 19:22:08 [INFO] Terraform version: 0.12.17
2019/12/10 19:22:08 [INFO] Go runtime version: go1.12.13
2019/12/10 19:22:08 [INFO] CLI args: []string{"C:\\ProgramData\\chocolatey\\lib\\terraform\\tools\\terraform.exe", "destroy"}
2019/12/10 19:22:08 [DEBUG] Attempting to open CLI config file: C:\Users\terraformuser\AppData\Roaming\terraform.rc
2019/12/10 19:22:08 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/12/10 19:22:08 [INFO] CLI command args: []string{"destroy"}
2019/12/10 19:22:08 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/12/10 19:22:08 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/12/10 19:22:08 [DEBUG] New state was assigned lineage "eb32be79-5d30-b86d-2b34-21097b634648"
cmendible /
Last active May 21, 2019
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