Skip to content

Instantly share code, notes, and snippets.

@boseabhishek
boseabhishek / hello.json
Created September 18, 2024 11:40
refs, defs, schemas
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Person",
"type": "object",
"properties": {
"contact": {
"anyOf": [
{ "$ref": "#/$defs/emailContact" },
{ "$ref": "#/$defs/phoneContact" }
]
@boseabhishek
boseabhishek / FooWSNetworkAdapter.ts
Last active January 12, 2025 09:42
sync server + am-repo ws n/w adapter (using deno)
import { NetworkAdapter } from "@automerge/automerge-repo";
import { PeerMetadata, Message } from "@automerge/automerge-repo";
import { PeerId } from "@automerge/automerge-repo";
export class FooWSNetworkAdapter extends NetworkAdapter {
sockets: Map<PeerId, WebSocket> = new Map();
#ready = false;
#readyResolver?: () => void;
#readyPromise: Promise<void> = new Promise<void>((resolve) => {
@boseabhishek
boseabhishek / ubu-on-mac.md
Created May 29, 2025 21:21 — forked from gsf/ubu-on-mac.md
Ubuntu VM on macOS with QEMU

Ubuntu VM on macOS with QEMU

For work I have an Intel Core i5 MacBook. With the Docker Desktop license changes I looked into minikube and Multipass but both failed when I got on our VPN with Cisco AnyConnect due to bridged networking in hyperkit (see links at bottom).

I realized I would be happy SSHing into a local Linux VM but passed on VirtualBox to avoid depending on legacy system extensions. I landed on libvirt for the VM, then realized I could remove libvirt from the equation to finally end up at this quick, simple setup for an Ubuntu VM on macOS with QEMU.

First, install QEMU (see https://wiki.qemu.org/Hosts/Mac for other o