Skip to content

Instantly share code, notes, and snippets.

@mikeymop
mikeymop / kanidm-access-logs.txt
Last active December 14, 2025 16:05
Kanidm-help-badcertificate
### Health check
3eaeb952-2e2e-4f0b-a565-8d576863b3d3 INFO request [ 44.7µs | 100.00% ] method: GET | uri: /status | version: HTTP/1.1 | connection_address: "127.0.0.1:44444" | client_address: "127.0.0.1" | latency: 0 | kopid: "3eaeb952-2e2e-4f0b-a565-8d576863b3d3" | status_code: 200
### Via browser
00000000-0000-0000-0000-000000000000 ERROR 🚨 [error]: Failed to create TLS stream | err: Custom { kind: InvalidData, error: AlertReceived(BadCertificate) }
### Via kanidm cli
00000000-0000-0000-0000-000000000000 ERROR 🚨 [error]: Failed to create TLS stream | err: Custom { kind: InvalidData, error: AlertReceived(BadCertificate) }
@mikeymop
mikeymop / flip_bytes.c
Last active March 29, 2024 23:46
Swap Endian-ness C
#include<stdio.h>
#include<assert.h>
/**
Accumulate into res |
1) Shift 8*i bits right, fill left in with 0xFF
( val >> (i * 8)
2) Shifts the isolated val left 8*i bits into res.
<< (size - i) * 8
3) Uses bitwise OR operation to accumulate the flipped bytes into res.
const fetch = require('node-fetch');
var testString1 = "137/erc721:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774";
var testString2 = "1/erc721:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774";
var testString3 = "137/erc1155:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774"
var testString4 = "1/erc1155:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774"
var badStringH = "137/erc721:0x723e481aef940fc7454850a83c54ca1ee770209c/291";
var badStringJ = "137/erc721:0xa6d6d5fbeb58cd8c1006fff02fd73ac8b0a9c0f2/16";
/** Returns void or the ipfs location of nft image.
* Modifies the following DBM vars:
@mikeymop
mikeymop / getNFTUri-compat.js
Last active June 7, 2022 04:34
This gets the uri of an nft pfp from the social.picture.value of an Unstoppable Domain
var https = require('https');
var resolveNFTUri = function (self, str, store, cache, actions, channel) {
log = function (msg) { console.log("getNFT: \n", msg); };
log('Finding nft uri for: ', str);
str = str[0];
var getChainId = function (str) {
@mikeymop
mikeymop / half_age.py
Created November 20, 2021 02:20
Finds the year that you will be half someone's age.
from datetime import date
from math import floor
def max_ttd(birth_year):
this_year = date.today().year
age = this_year - birth_year
max_year = (100-age) + this_year
return max_year # agv age is 75, but 100 is safe
@mikeymop
mikeymop / Part1.java
Created April 30, 2021 03:58
Assignment
package sortingArrays;
import java.util.Random;
import java.util.Scanner;
/**
<b>Part 1: Sorting Arrays</b>
<p>Develop a program that asks the user to enter a capital for a U.S. state.
Upon receiving the user input,the program reports whether the user input is correct.
<p>For this application, the 50 states and their capitals are stored in
@mikeymop
mikeymop / howto.md
Created April 1, 2021 03:27
Remove Mobile Broadband Connections gnome

Find UUID

bluetoothctl paired-devices

bluetoothctl remove [UUID]

@mikeymop
mikeymop / docker-compose.yml
Last active September 9, 2024 01:47
Plex Docker-Compose
version: "3.7"
services:
plex:
image: plexinc/pms-docker
container_name: plex
restart: unless-stopped
environment:
- TZ=America/New_York
devices:
@mikeymop
mikeymop / cr.ts
Created March 18, 2021 21:13
Compensate-rotation
/**
* Performs coordinate rotation math in order to abstract away positional discrepancies resulting from a
* rotated page.
* See: https://www.khanacademy.org/computing/pixar/sets/rotation/v/sets-8
* @param {PDFPage} page - The page that may be rotated
* @param {number} x - The desired *relative* x-coordinate of the object
* @param {number} y - The desired *relative* y-coordinate of the object
*/
public compensateRotation(page, x, y): {newX: number, newY: number} {
var dimensions = page.getSize();

Keybase proof

I hereby claim:

  • I am mikeymop on github.
  • I am mikeymop (https://keybase.io/mikeymop) on keybase.
  • I have a public key whose fingerprint is 21C7 73EE F4A0 EA93 B0CC 7D86 70F8 90BF CED1 59EE

To claim this, I am signing this object: