Skip to content

Instantly share code, notes, and snippets.

@onomatopellan
onomatopellan / waydroidwsl2.md
Last active December 29, 2025 13:11
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 25.04 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 December 29, 2025 16:07
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" \
@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 / multiple-repository-and-identities-git-configuration.md
Last active December 3, 2025 12:06
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@ernestkamara
ernestkamara / AdbCommands
Created June 26, 2018 08:42 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@payalord
payalord / sqlite_static_cpp.md
Last active June 7, 2024 06:56
How to add SQLite into your VS project as Static Library

I assume that you already created C++ Win32 project where you want to include SQLite.

  1. Navigate to https://www.sqlite.org/download.html and download latest amalgamation source version of SQLite.
  2. Extract all the files into your project directory, or your include path, or separate path that you will add/added as include path in your project properties.
  3. Run Developer Command Prompt for VS **** which is usually available at Start -> Programs -> Visual Studio **** -> Visual Studio Tools.
  4. Navigate with command prompt to that directory where we extracted our SQLite.
  5. Run next command to compile: cl /c /EHsc sqlite3.c
  6. Run next command to create static library: lib sqlite3.obj
  7. Open properties of your project and add sqlite3.lib to Linker -> Input -> Additional Dependencies.