Skip to content

Instantly share code, notes, and snippets.

View mivano's full-sized avatar

Michiel van Oudheusden mivano

View GitHub Profile
@mivano
mivano / Program.cs
Created January 19, 2018 22:49 — forked from nblumhardt/Program.cs
Enrich.WithCaller()
using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using Serilog;
using Serilog.Configuration;
using Serilog.Core;
using Serilog.Events;
namespace ConsoleApp24
@mivano
mivano / docker-clean.ps1
Created February 12, 2018 16:52 — forked from bradwilson/docker-clean.ps1
Docker Cleanup
(& docker images --all --quiet --filter 'dangling=true') | Foreach-Object {
& docker rmi $_ | out-null
}
(& docker ps --quiet --filter 'status=exited' ) | Foreach-Object {
& docker rm $_ | out-null
}

Keybase proof

I hereby claim:

  • I am mivano on github.
  • I am mivano (https://keybase.io/mivano) on keybase.
  • I have a public key ASBzhbvTYkTZ0AoYCqR-99I58z-TV-MCJUJXNrUpBBmBWAo

To claim this, I am signing this object:

@mivano
mivano / azuresqlqueryprofiler.sql
Created June 26, 2018 12:57 — forked from cmatskas/azuresqlqueryprofiler.sql
Azure SQL Query Profiler
SELECT query_stats.query_hash AS "Query Hash",
SUM(query_stats.total_worker_time) / SUM(query_stats.execution_count) AS "Avg CPU Time",
MIN(query_stats.statement_text) AS "Statement Text"
FROM
(SELECT QS.*,
SUBSTRING(ST.text, (QS.statement_start_offset/2) + 1,
((CASE statement_end_offset
WHEN -1 THEN DATALENGTH(ST.text)
ELSE QS.statement_end_offset END
- QS.statement_start_offset)/2) + 1) AS statement_text
@mivano
mivano / push to statuspage.js
Created October 31, 2018 09:20
You can do this by using statuspage.io and running a webjob that every 5 minutes retrieves a metric from App Insights and pushes it to statuspage.io. Here’s a sample script for you that runs in my webjob.
// Application Insights Application ID and API key:
var appID = “YOUR APP ID”;
var apiKey = “YOUR API KEY”;
// Statuspage metric info
var api_key = “YOUR KEY”;
var page_id = “YOUR PAGE ID”;
var metric_id = YOUR METRIC ID
var api_base = “https://api.statuspage.io/v1”;;
@mivano
mivano / edgerouter-x.md
Created November 7, 2018 19:27 — forked from Ruben-E/edgerouter-x.md
Configure EdgeRouter X for KPN fiber / glasvezel

Setup interface eth1 and configure the DHCP/DNS server

configure
 
set interfaces ethernet eth1 address 192.168.2.254/24
set interfaces ethernet eth1 description "eth1 - LAN"
set interfaces ethernet eth1 duplex auto
set interfaces ethernet eth1 speed auto
 
@mivano
mivano / Dockerfile
Created January 28, 2019 16:20 — forked from nur858/Dockerfile
Multi-stage Dockerfile for .net core with SonarQube
FROM microsoft/dotnet:2.1-sdk AS build
ARG PROJECT_VERSION
ENV DOTNET_CLI_TELEMETRY_OPTOUT = 1
WORKDIR /src
RUN apt-get update && apt-get install -y \
openjdk-8-jre-headless
RUN apt-get clean
COPY . .
@mivano
mivano / Check cert
Created January 29, 2019 08:39
Check certificate using curl
curl --insecure -v https://webservertocheck 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'
@mivano
mivano / resume.json
Last active March 2, 2022 21:17
resume
{
"basics": {
"name": "Michiel van Oudheusden",
"label": "Lead Consultant, Software Developer and Architect. Helping customers with cutting edge cloud technology.",
"image": "https://mindbyte.nl/images/profile.jpg",
"email": "[email protected]",
"phone": "",
"url": "https://www.mindbyte.nl",
"summary": "Michiel is an all-round Microsoft Azure and DevOps Consultant. He has worked at many organizations in a lead architect role but is still extremely hands-on. Michiel helps teams in their journey to the cloud and towards DevOps and assists them by showing how things should be done, work together to transfer the knowledge, and then guide the team when they are proficient in doing it themselves. Michiel has a lot of experience in the banking industry, Oil and Gas, and aerospace industry and is very familiar with building software delivery capabilities that need to comply with strong regulations. His expertise is not only in the setup of a secure and compliant Azure infrastruct
@mivano
mivano / gist:18e5c7ef95664801ca0ffe7e65e7883c
Created November 21, 2019 12:50
Get cosmosdb connectionstring in Azure Function
builder.Services.PostConfigure<CosmosDBOptions>(options =>
{
if (string.IsNullOrWhiteSpace(managedIdentity))
{
// When local, read it from the config. Most likely from the not checked in local.settings.json file
options.ConnectionString = configuration.GetValue<string>(CosmosDbConfig.ConnectionStringSetting);
}
else
{
// If we do have a managed identity, we can fetch the keys from Azure