Skip to content

Instantly share code, notes, and snippets.


Dan Rigby DanRigby

View GitHub Profile
ninjarobot /
Last active May 24, 2022
Trace .NET Core Applications on Linux with `strace`

Trace .NET Core Applications on Linux with strace

Troubleshooting a running application can be difficult, usually it starts around checking log output and then following through the likely code paths to get an idea of where a failure may occur. In a development environment, you might attach a debugger a step through source, but troubleshooting isn't always that convenient. There are several helpful tools that can assist, but one that gives the most comprehensive view of a running application is strace. With strace you are able to see all of the system calls an application makes to get a detailed understanding of what is going on "under the hood" in order to troubleshoot an issue.

Take a simple "hello world" F# application, the kind you get from dotnet new console -lang F# -n strace-sample". Build it with dotnet build and then launch it with strace to get a trace of all the system calls in a file called trace.log(adjusting for your build output path if on a different framework vers

tomasaschan /
Last active Jul 24, 2021
Rolling restart of all nodes in an AKS cluster
set -e
resourceGroupDefault='<set your default here, to avoid having to specify in the common case>'
clusterNameDefault='<set your default here>'
regionDefault='<set your default here>'
ayende / LetsEncryptClient.cs
Created Jan 11, 2018
ACME v2 client for Let's Encrypt
View LetsEncryptClient.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
View Update-Package-Versions.cs
void Main()
var writeChanges = false;
var basePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Util.CurrentQueryPath), @"..\.."));
UpdateVersions(basePath, writeChanges);
void UpdateVersions(string basePath, bool writeChanges = false)
View foo1.cs
while (ReferenceNameNavigator.GetByQualifier(referenceName) != null)
referenceName = ReferenceNameNavigator.GetByQualifier(referenceName);
plaurin / DependenciesVisualizer.linq
Last active Aug 17, 2018
LinqPad query to generate a DMGL of projects, libraries and NuGet packages dependencies
View DependenciesVisualizer.linq
<Query Kind="Program" />
private string[] projectExtensionExclusions = new[] { ".vdproj", ".ndproj", ".wdproj", ".shfbproj" };
private string rootFolder = @"C:\Users\Pascal\Dev\MyProject";
void Main()
GenerateDGML(Path.Combine(rootFolder, "Dependencies.dgml"));
erichexter / downloadBuildVideos.ps1
Created Nov 2, 2012
Download build 2012 videos
View downloadBuildVideos.ps1
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
$rss = (new-object net.webclient)
#Set the username for windows auth proxy
$a = ([xml]$rss.downloadstring(""))
$ | foreach{
$url = New-Object System.Uri($_.enclosure.url)
$file = $_.creator + "-" + $_.title.Replace(":", "-").Replace("?", "").Replace("/", "-") + ".wmv"
if (!(test-path $file))
hellerbarde / latency.markdown
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.markdown

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

jboner / latency.txt
Last active Aug 7, 2022
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
dragan /
Created May 5, 2012 — forked from half-ogre/
A bash script to install nuget.exe and make it available in bash with a proxy script
#!/usr/bin/env sh
set -e
# Respect PREFIX if set, otherwise default to /usr/local
if [ -z "${PREFIX}" ]; then
# Respect TMPDIR if set, otherwise default to /tmp