Posts

Showing posts from June, 2026

Plan 9 Plumber

Image
Plumb Zip file   View files inside a zip compressed file via Plumber without extraction. Zip file contents are accessible at /n/tapefs. (Note: sam displays the UTF Byte-Order-Mark (BOM) as is - the garbage in the beginning of the first line). #zip file content in a new window type    is    text data    matches    '([a-zA-Z¡-ï¿¿0-9_\-.,/]+)\.zip' arg    isfile    $0 plumb    start    window fs/zipfs $file; cd /n/tapefs; ls; rc   Plumber process, usually running in the parent process, does not have visibility into the folders mounted by the child process because of namespace isolation. Hence, you need the following changes: zipfs (or 32vfs, cpiofs, tapfs, tarfs, tpfs, v6fs, v10fs etc.) must expose a service in the /srv directory. ( fs.c ) plumber must mount the zipfs for paths starting with /n/tapefs before checking for file existence. ( match.c )   

Plan 9: Tiled Map

Image
  Use plot(1) to display tiled maps. The zoom factor decides the grid dimension. osm.js: Download tile images from OpenStreetMaps using hget. Cache the images. Convert the PNG image into Plan 9 format using png. Display the images using plot. Plot script   ra 0 0 200 200 m 0 100 im /file :Note - must end the script with a newline     Plot tries to center the drawing. Hence the origin is at the bottom with a slight offset from the left. However, image uses origin at the top left.     Interactive Plotting and Maps Use plot command in server mode (-s option). plot -s a.plt  mount /srv/plot /mnt/plot echo li 0 0 100 100 > /mnt/plot/ctl echo erase > /mnt/plot/ctl Usage as an interactive map.   OSM API Tiles https://tile.openstreetmap.org/zoom/x/y.png   The World map at zoom 0 https://tile.openstreetmap.org/0/0/0.png     Geocoding (Name to geographical co-ordinates) https://nominatim.openstreetmap.org/search?q=hebba...