Skip to content

Instantly share code, notes, and snippets.

View leafac's full-sized avatar

Leandro Facchinetti leafac

View GitHub Profile
  • Companies
    • Anthropic
    • OpenAI
    • Anysphere
    • Cognition AI
    • Codeium
    • Sourcegraph
    • GitHub
    • Google
  • Continue.dev
  • Encrypt data at rest
    • SQLite database only
      • SQLCipher / @journeyapps/sqlcipher
      • SQLite3 Multiple Ciphers / better-sqlite3-multiple-ciphers
      • No: It’s cumbersome because it requires us to change the SQLite that we use (which happens to be Node.js’s SQLite, so we probably want to keep that simple)
    • Directory
      • gocryptfs
        • FUSE
        • Replaces EncFS and ecryptfs
  • No: Could interact badly with SQLite, because it needs advanced filesystem features including locking, fsync() and so forth

Setting up Ubuntu Cloud virtual machine in macOS with QEMU

Install QEMU:

brew install qemu

Download Ubuntu Cloud:

$ brew uninstall --verbose --debug docker-desktop
/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading docker-desktop
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/lame
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/llhttp
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libtiff
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/gmp
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libiconv
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/deno
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/ffmpeg
```console
$ brew uninstall --verbose --debug docker-desktop
/opt/homebrew/Library/Homebrew/brew.rb (Cask::CaskLoader::FromAPILoader): loading docker-desktop
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/lame
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/llhttp
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libtiff
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/gmp
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/libiconv
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/deno
/opt/homebrew/Library/Homebrew/brew.rb (Formulary::FromAPILoader): loading homebrew/core/ffmpeg
import html from "@radically-straightforward/html";
// https://www.youtube.com/watch?v=dSK-MW-zuAc
const order = 2;
const viewBox = 24; /* var(--space--6) */
// Hilbert
// let points = [
// [1 / 4, 1 / 4],
// [1 / 4, 3 / 4],
// [3 / 4, 3 / 4],

We use two tools to measure the performance of slow pages:

  1. 0x: Profile the application and generate flame graphs.
  2. autocannon: Load test (send lots of requests) and measure response time (which autocannon calls “latency”) & throughput.

Here’s a step-by-step guide of how to use these tools in Courselore:

  1. Run the application normally.

    Note: Don’t use a custom HOSTNAME, because autocannon may not recognize the self-signed certificate generated by Caddy.