Skip to content

Instantly share code, notes, and snippets.

View mivano's full-sized avatar

Michiel van Oudheusden mivano

View GitHub Profile
@mivano
mivano / gist:bbb7563b31177e038608
Last active August 29, 2015 14:03 — forked from nblumhardt/gist:8914175
Serilog extension for log context
public static class LoggerExtensions
{
public static ILogger ForHere(
this ILogger logger,
[CallerFilePath] string sourceFile = null,
[CallerLineNumber] int sourceLine = 0)
{
return logger
.ForContext("SourceFile", sourceFile)
.ForContext("SourceLine", sourceLine);
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
if (Test-PendingReboot) { Invoke-Reboot }
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@mivano
mivano / README.md
Last active August 29, 2015 14:11 — forked from hofmannsven/README.md
Git Cheatlist
@mivano
mivano / xunit_fact.snippet
Created August 30, 2017 10:09 — forked from marcduiker/xunit_fact.snippet
Visual Studio C# snippet for xUnit test methods (Facts) using the naming convention proposed by http://osherove.com/blog/2005/4/3/naming-standards-for-unit-tests.html. Import the snippet using the SnippetManager in VS and type `fact[tab][tab]` inside a class to insert the snippet.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>xUnit Fact</Title>
<Shortcut>fact</Shortcut>
<Description>Code snippet for an xUnit test method (Fact) following the naming convention UnitOfWork_StateUnderTest_ExpectedBehaviour.</Description>
. { Invoke-WebRequest -UseBasicParsing http://boxstarter.org/bootstrapper.ps1 } | Invoke-Expression
Get-Boxstarter -Force
Install-BoxstarterPackage `
-PackageName https://gist.githubusercontent.com/mivano/2b078f267d3ca1e9996c07085eb59a60/raw/Windows10-Setup.ps1 `
-Credential (Get-Credential -Message "Please provide login credentials for Boxstarter reboots")
@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
}
@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 / 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