Running Web Browser on Ubuntu on Windows Sybsystem for Linux (WSL) on Windows 10

If you have tried to install Google Chrome or Firefox on Windows Subsystem for Linux (WSL) on Windows 10, you will find that it requires the snap package which is not supported under Windows 10 WSL.

One alternative browser that you can try is Dillo. The rendering of HTML page is not great but it works. You can install Dillo using the following command:

> sudo apt install dillo

Hosting Static Website using FastAPI and Uvicorn

Here is an example program that allows you to host a static website with HTML, CSS and JPEG files using FastAPI and Uvicorn. The example assumes that all the static files are located inside the “site” directory and its sub-directories (e.g. css, images sub-directories etc).

from os.path import isfile
from fastapi import Response
from mimetypes import guess_type
from fastapi.responses import FileResponse
from fastapi import FastAPI

app = FastAPI()

@app.get("/{filename}")
async def get_site(filename):
    filename = './site/' + filename

    if not isfile(filename):
        return Response(status_code=404)
    else:
        return FileResponse(filename)

@app.get("/")
async def get_site_default_filename():
    return await get_site('index.html')

All these images were generated by Google’s latest text-to-image AI – The Verge

https://www.theverge.com/2022/5/24/23139297/google-imagen-text-to-image-ai-system-examples-paper

In each case, the text at the bottom of the image was the prompt fed into the program, and the picture above, the output. Just to stress: that’s all it takes. You type what you want to see and the program generates it.