Skip to content

Instantly share code, notes, and snippets.

Migrate Azure Functions project from Application Insights to OpenTelemetry

Version 3.0.0 of Microsoft.ApplicationInsights.WorkerService is not compatible with the Azure Functions Worker as reported here and here. There will not be a fix according to this comment. Instead, migrating to OpenTelemetry-based monitoring is advised.

I've written the following instructions for myself to perform a (basic) migration to OpenTelemetry-based monitoring. They are based on:

@onomatopellan
onomatopellan / waydroidwsl2.md
Last active October 17, 2026 16:19
Waydroid in WSL2 with sound (Weston on top of Weston approach)

Waydroid in WSL2 with sound

Requirements

Recommended to install Waydroid in a brand new Ubuntu install. Waydroid needs a custom linux kernel. Actually just needs latest kernel for WSL2 with just these changes before compiling:

CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
@mfd
mfd / teams.sh
Last active November 6, 2026 15:16
Download any video from Microsoft Teams, SharePoint and OneDrive
2teams() {
NOW=$(date +"%Y-%m-%d_%H%M")
if [ ! -z $2 ] ; then
echo $NOW"_"$2.mp4
ffmpeg -i $1 -codec copy $NOW"_"$2.mp4
else
echo $NOW"_teamsvid".mp4
ffmpeg -i $1 -codec copy $NOW"_teamsvideo".mp4
fi
}
import { ChangeDetectorRef, ComponentRef } from '@angular/core';
import { OutletContext, Router } from '@angular/router';
import { Subject } from 'rxjs';
import { pluck, switchMap, takeUntil } from 'rxjs/operators';
import { getCurrentOutlet } from '../functions/get-current-outlet';
import { getRouteWithData } from '../functions/get-route-with-data';
import { StaticInjectorService } from '../services/static-injector.service';
export function NgResolve(name?: string, propagation = true) {
return function(
@ninlith
ninlith / mitm.sh
Last active December 7, 2024 16:18
Local transparent man-in-the-middle proxy setup
#!/usr/bin/env bash
# -*- indent-tabs-mode: nil; tab-width: 4 -*-
command=${@:-"mitmproxy --mode transparent --showhost --set block_global=false"}
if [ ! -f "/etc/ssl/certs/mitmproxyuser.pem" ]; then
sudo apt --yes install inotify-tools mitmproxy nftables
sudo useradd --create-home mitmproxyuser
grep --max-count 1 "mitmproxy-ca-cert.pem" < <( \
sudo inotifywait -mrq -e close_write --format "%f" \
@giacomocerquone
giacomocerquone / adbCommands.txt
Last active May 3, 2026 15:52
Useful adb logcat commands when working with react native
// useful to debug js code errors
adb logcat "*:S" ReactNative:V ReactNativeJS:V
// useful to debug native errors (when the app won't even start)
adb logcat "*:E"
@dfrankland
dfrankland / how_to_use_wireshark_with_nodejs.md
Created May 28, 2020 05:06
How to use Wireshark with Node.js (especially with HTTPS / TLS / SSL)

How to use Wireshark with Node.js (especially with HTTPS / TLS / SSL)

It can be difficult to trace network traffic from a Node.js application. Typically, folks will just instrument some logging to check that everything is working as it is supposed to. Unfortunately, sometimes there are too many abstractions or possible race conditions to accurately get a good trace. To get the most objective possible trace of network traffic Wireshark can be used.

Wireshark is a network protocol analyzer that makes it extremely simple to capture and trace network activity from any source on your computer. It also has

//Reference
//https://gist.github.com/truekonrads/3173572
//https://docs.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsvirtualchannelquery
//https://github.com/FreeRDP/FreeRDP/blob/master/winpr/libwinpr/wtsapi/test/TestWtsApiQuerySessionInformation.c
#include <Windows.h>
#include <stdio.h>
#include <wtsapi32.h>
#include <tsvirtualchannels.h>
import { timer, Observable } from "rxjs";
import { scan, tap, switchMapTo, first } from "rxjs/operators";
function checkAttempts(maxAttempts: number) {
return (attempts: number) => {
if (attempts > maxAttempts) {
throw new Error("Error: max attempts");
}
};
}
@bgauduch
bgauduch / 0 - Multiple git identities on one machine.md
Last active November 16, 2026 20:40
Multiple git identities on one machine: config per folder and per provider (personal vs work). Every command verified.

Multiple git identities on one machine

One machine, several git identities (personal vs work, GitHub vs GitLab, two accounts on one provider). Each repository picks its own name, email and credentials. In a hurry: Appendix B, once per rule.

A wrong identity does not fail: git commits and pushes under the wrong author. Part 1 ends with the check that catches it.

Requirements

Feature Minimum git