Skip to content

Instantly share code, notes, and snippets.

View pmbanka's full-sized avatar

Paweł Bańka pmbanka

View GitHub Profile
@ninjarobot
ninjarobot / strace-netcore.md
Last active May 24, 2022 19:22
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

#r "packages/Twilio/lib/net451/Twilio.dll"
#r "System.Xml.Linq"
open System
open Twilio.TwiML
open Twilio.TwiML.Voice
module Model =
/// Represents what we will tell the Twilio phone system to do
type PhoneCommand =
@Horusiath
Horusiath / AkklingAPI.fs
Last active March 13, 2018 11:25
akka-typed Akkling API idea
type Command = Job of string
let active (count: int): Behavior<Command> =
Actor.behavior (fun ctx msg ->
match msg with
| Job payload ->
printfn "Received %s, current state: %d" payload count
// return updated state behavior, equivalent of become
active (count + 1))
|> onSignal (fun ctx sig ->
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@Horusiath
Horusiath / Program.cs
Created January 26, 2017 09:08
Akka.Persistence example with proto-buf.net as a custom domain event serializer
using System;
using Akka.Actor;
using Akka.Configuration;
using Akka.Persistence.SqlServer;
namespace TestApp
{
class Program
{
public static void Main()
@jcmm33
jcmm33 / RetryWithConditionMixins.cs
Last active January 26, 2016 16:02
Reactive Extension Retry with Condition. Usage of Materialize could possibly reduce some of the leg work here but it seems to work for my scenario anyway. Similarly there may be issues related to observables which just complete and don't emit values, but that isn't a scenario we don't have.
public static class RetryWithConditionMixins
{
/// <summary>
/// Retry with condition observable.
/// </summary>
/// <typeparam name="TIn"></typeparam>
/// <typeparam name="TOut"></typeparam>
/// <param name="source"></param>
/// <param name="selector">The selector function which potentially can be retried</param>
@ruxo
ruxo / fp.fs
Last active February 9, 2023 23:14
F# Fundamental libraries Compatibility break (since v9): Option and Result extensions are moved to RZ.Fsharp.Extension lib.
// v9
module TiraxTech.Foundation
let inline sideEffect ([<InlineIfLambda>] f) x = (f x); x
let inline flip f a b = f b a
let inline constant x = fun _ -> x
let inline cast<'t> (x :obj) = x :?> 't
let inline tryCast<'a> (x:obj) =
@ohanhi
ohanhi / frp.md
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

Deployment steps for this blog post:
http://kearon.blogspot.co.uk/2015/01/installing-service-using-topshelf-with.html
@staltz
staltz / introrx.md
Last active June 29, 2024 15:58
The introduction to Reactive Programming you've been missing