Skip to content

Instantly share code, notes, and snippets.

View mivano's full-sized avatar

Michiel van Oudheusden mivano

View GitHub Profile
@mivano
mivano / EmptyTelemetryWrapper.cs
Created April 6, 2022 20:46
Telemetry wrappers
public sealed class EmptyTelemetryWrapper : ITelemetryWrapper
{
/// <inheritdoc />
public void Dispose()
{
}
/// <inheritdoc />
public void SetType(string type)
{
@mivano
mivano / windows_hardening.cmd
Created May 12, 2020 12:37 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@mivano
mivano / CustomerController.cs
Created March 26, 2020 10:26 — forked from vkhorikov/CustomerController.cs
Handling failures and input errors in a functional way
[HttpPost]
public HttpResponseMessage CreateCustomer(string name, string billingInfo)
{
Result<BillingInfo> billingInfoResult = BillingInfo.Create(billingInfo);
Result<CustomerName> customerNameResult = CustomerName.Create(name);
return Result.Combine(billingInfoResult, customerNameResult)
.OnSuccess(() => _paymentGateway.ChargeCommission(billingInfoResult.Value))
.OnSuccess(() => new Customer(customerNameResult.Value))
.OnSuccess(
@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
@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": "m.vanoudheusden@gmail.com",
"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 / 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 / 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 / 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 / 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 / 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