Skip to content

Instantly share code, notes, and snippets.

View chgeuer's full-sized avatar
🏠
Working from Düsseldorf

Dr. Christian Geuer-Pollmann chgeuer

🏠
Working from Düsseldorf
View GitHub Profile
IO.puts("Using .iex.exs file loaded from #{__DIR__}/.iex.exs")
defmodule Util do
def iex(n), do: IEx.Helpers.v(n)
def atom_status do
limit = :erlang.system_info(:atom_limit)
count = :erlang.system_info(:atom_count)
IO.puts("Currently using #{count} / #{limit} atoms")
end

Entra Domains

Mix.install([
  {:req, "~> 0.5.8"}
])

Libraries

Postgrex on Azure: How to connect to an Azure PostgreSQL DB from Elixir

Mix.install([
  {:x509, "~> 0.8.10"},
  {:postgrex, "~> 0.19.3"},
  {:req, "~> 0.5.7"},
  {:livebook_env, "~> 1.0"},
  {:kino, "~> 0.14.2"}
])

A simple .NET Core 8 sample running on Linux to show AES GCM encryption...

using System.Security.Cryptography;
using System.Text;

// https://learn.microsoft.com/en-us/dotnet/standard/security/cross-platform-cryptography#authenticated-encryption
Console.Out.WriteLine($"Is supported: {AesGcm.IsSupported}");
/*
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.64.0" />

Wetterdaten

Mix.install([
  {:req, "~> 0.5.6"},
  {:explorer, "~> 0.9.0"},
  {:kino_explorer, "~> 0.1.21"},
  {:iconv, "~> 1.0"},
  {:floki, "~> 0.36.2"}
])
@chgeuer
chgeuer / l.md
Last active December 11, 2024 15:27

Livebook on WSL2

Compile Erlang and Elixir from scratch

Install Linux dependencies

  • autoconf
  • automake
  • build-essential
  • gcc

Entra Domain Discovery

Mix.install([
  # {:ex_token_toys, path: "C:\\github\\chgeuer\\ex_token_toys"}
  {:ex_token_toys, github: "chgeuer/ex_token_toys"}, 
  {:kino, "~> 0.12.3"}
])

Sample integrating Bandit and Req/Finch

Mix.install([
  {:finch, "~> 0.17.0"},
  {:req, "~> 0.4.8"},
  {:bandit, "~> 1.1"}
])

A notebook to use the local MSAL cache to talk to Azure

Mix.install([
  {:jason, "~> 1.4"},
  {:jsonrs, "~> 0.3.3"},
  {:req, "~> 0.4.8"},
  {:jose, "~> 1.11"},
  {:jose_utils, "~> 0.4.0"},
  {:explorer, "~> 0.7.2"},