Skip to content

Instantly share code, notes, and snippets.

@mootinator
mootinator / React18Component.cs
Last active September 26, 2023 23:20
React.NET React 18 Shim
using React;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace React18Shim
{
public class React18Component : ReactComponent
{
var crypto = require('crypto');
// Your password goes here
var password = '***';
let utf8Encode = new TextEncoder();
async function generateKey(e, n) {
const r = await crypto.subtle.importKey("raw", e, "PBKDF2", !1, ["deriveBits", "deriveKey"]);
return crypto.subtle.deriveKey({
name: "PBKDF2",
@mootinator
mootinator / expect-openvpn.sh
Last active November 19, 2020 17:34
Use sexpect to initiate OpenVPN connection which uses DUO mobile from router.
#!/bin/sh
if ! which sexpect >& /dev/null; then
echo "sexpect not found in your \$PATH"
exit 1
fi
export SEXPECT_SOCKFILE=/tmp/sexpect-openvpn-aa0.sock
sexpect spawn openvpn --config /root/client.ovpn

Keybase proof

I hereby claim:

  • I am mootinator on github.
  • I am mootinator (https://keybase.io/mootinator) on keybase.
  • I have a public key ASAcDSet1O_qNtCMLRGjSBO4_T8FJxcHcTLUPO77xRi5Swo

To claim this, I am signing this object:

public byte[] AsByteArray()
{
// Represents little endian point on unit circle
var result = new byte[] { 0xE6, 0x10, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Buffer.BlockCopy(BitConverter.GetBytes(Longitude), 0, result, 9, 8);
Buffer.BlockCopy(BitConverter.GetBytes(Latitude), 0, result, 17, 8);
return result;
}
@mootinator
mootinator / AuthConfig.cs
Last active December 16, 2015 21:19
Attempt at a Google Apps OpenID client. Running into a difficult to debug problem where no useful info is returned as to why it fails.
using System.Collections.Generic;
using Microsoft.Web.WebPages.OAuth;
namespace MvcOauth1
{
public static class AuthConfig
{
public static void RegisterAuth()
{
// To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,