Skip to content

Instantly share code, notes, and snippets.

View mikaeldui's full-sized avatar
🏢
Working on something

Mikael Dúi Bolinder mikaeldui

🏢
Working on something
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mikaeldui on github.
  • I am mikaeldui (https://keybase.io/mikaeldui) on keybase.
  • I have a public key whose fingerprint is EEAC 4AB6 3980 4351 AA56 E189 CF4F F107 A83A 247D

To claim this, I am signing this object:

@mikaeldui
mikaeldui / TplinkTlEr6020Client.cs
Last active December 22, 2021 18:10
.NET Client for TP-Link TL-ER6020
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
using Windows.Storage.Streams;
@mikaeldui
mikaeldui / MiWiFiClient.cs
Last active December 22, 2021 18:10
Small Xiaomi MiWiFi .NET Client with some endpoints. Can get devices connected to Wi-Fi.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Windows.Security.Cryptography;
using Windows.Security.Cryptography.Core;
using Windows.Storage.Streams;
using System.Text.Json;
@mikaeldui
mikaeldui / PlexClient.cs
Last active December 22, 2021 18:18
.NET Client for getting Plex session from a local server
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Serialization;
@mikaeldui
mikaeldui / JsonReadOnlyDictionaryConverter.cs
Last active October 9, 2022 13:37
Deserialize ReadOnlyDictionary with System.Text.Json
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Text;
namespace System.Text.Json.Serialization
{
public class JsonIReadOnlyDictionaryConverter : JsonConverterFactory
{
@mikaeldui
mikaeldui / JsonReadOnlyCollectionConverter.cs
Last active January 15, 2022 01:03
Deserialize ReadOnlyCollection with System.Text.Json
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Text;
namespace System.Text.Json.Serialization
{
public class JsonIReadOnlyCollectionConverter : JsonConverterFactory
{
@mikaeldui
mikaeldui / RiotGamesApiProxyWorker.js
Last active February 2, 2022 18:02
Riot Games API proxy on Cloudflare Workers
addEventListener("fetch", (event) => {
event.respondWith(
handleRequest(event).catch(
(err) => new Response(err.stack, { status: 500 })
)
);
});
/**
* Many more examples available at:
@mikaeldui
mikaeldui / Add 1.1.1.1 for Families.ps1
Last active February 11, 2022 08:40
Add 1.1.1.1 for Families to Windows 11
# From https://developers.cloudflare.com/1.1.1.1/1.1.1.1-for-families
# After running this the templates will be available under hardware properties in the settings.
# Run as admin!
# Block malware
Add-DnsClientDohServerAddress 1.1.1.2 https://security.cloudflare-dns.com/dns-query
Add-DnsClientDohServerAddress 1.0.0.2 https://security.cloudflare-dns.com/dns-query
Add-DnsClientDohServerAddress 2606:4700:4700::1112 https://security.cloudflare-dns.com/dns-query
Add-DnsClientDohServerAddress 2606:4700:4700::1002 https://security.cloudflare-dns.com/dns-query
@mikaeldui
mikaeldui / caddy.service
Created February 9, 2022 10:25
A Caddy Service for Raspberry Pi Model B
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
@mikaeldui
mikaeldui / lol-wamp.js
Created February 21, 2022 21:07
League Client WAMP Implementation (minified)
function(e, t, n) {
'use strict';
function r(e, t) {
if (t && (h('Message QUEUED (' + t.length + ' bytes)'), e._sendQueue.push(JSON.stringify(t))), e._connected)
for (; 0 < e._sendQueue.length;) {
const t = e._sendQueue.shift();
h('Message SEND'), e._websocket.send(t)
}
}