RSSAmplifier

Blog

Tech insights

lifeofpenguin.blogspot.comRSS feed ↗25 posts

Latest posts

Plan 9: Dynamic HTML

Render Dynamic HTML using plot and qjs. Render a simple website Font zoom E-Book Reader eBook is a collection of HTML files in a ZIP archive. Follow same steps for Comic Book reader which are collection of JPG/PNG images in a ZIP/RAR archive. For columns, pure HTML solution involves column-count CSS property. However, this works only for designed screen sizes. For non-standard sizes, the first…

Plan 9 Plumber

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;…

Plan 9: Tiled Map

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…

Browser in Javascript

A Proof-of-Concept Browser written in Javascript for minimal Web 2.0 browsing experience. This DOES NOT depend on any browser engine like Blink, Gecko or Webkit. Use an existing HTML rendering engine like netsurf or roll-out your own . This uses QuickJS-ng for JS runtime, Linkedom for DOM API and curl for network downloads. Font decoration uses Terminal ANSI escape codes . Since linkedom is an npm…

Plan 9: Network Printer (HP Deskjet Ink Advantage 3545)

Internet Printing Protocol Printing with Internet Printing Protocol (IPP) involves sending a Unirast Format (URF) image with appropriate protocol headers to port 631. It is the basis for standards like Windows Mopria Alliance , Apple AirPrint , and IPP Everywhere . It is also called Driverless Printing since this doesn't involve installing any printer specific driver. On Plan 9, printing involves…

Plan 9: Audio-Video Pipeline

Video pipeline in action Two important points about videos: A video is a series of images. RGB format is used for display. YUV format is used for storage and transmission. Recording ──────────────────────────────────────────────────────── [Video Source] → [Frame Processing] → [Video Encode] ┐ ├→ [Mux] → [Container Stream] [Audio Source] → [Audio Processing] → [Audio Encode] ┘ Playback…

Plan 9: Real Time Streaming

Stream a single window or the whole screen via Real Time Streaming Protocol (RTSP). This uses MJPEG stream over TCP-interleave . Plan 9 /dev/screen and /dev/window produces RGBA byte stream with Plan 9 headers. This is converted to JPEG using tojpg and streamed using RTSP. In the video, host port 12554 port is being forwarded to 554 in the Plan 9 VM. ffplay -rtsp_transport tcp…

Plan 9: WiFi Protected Setup

Demo of Wifi router connection using WiFi Protected Setup (WPS). WiFi Protected Setup (WPS) allows you to connect to an Access Point (router) via Push Button Control (PBC) or a temporary PIN. Authentication Flow Direction Message / Contents Phase / Purpose Supplicant → AP Authentication Request 802.11 Authentication Supplicant ← AP Authentication Response Supplicant → AP Association Request 802.11…

Plan 9: Share Media Content with TV via UPnP

Share media content with UPnP / DLNA capable players. This is a proof-of-concept of network programming (TCP and UDP) in Plan 9. For information, man udp is a useful place to get started. Device Quirks VLC VLC looks for "urn:schemas-upnp-org:service:ContentDirectory:1" instead of "urn:schemas-upnp-org:device:MediaServer:1" during M-SEARCH. LG WebOS TV LG WebOS TV needs the services…

Plan 9: Password Management

An authentication server manages users credentials in a Plan 9 grid. However, if you are just getting started, probably it would be a better idea to directly use factotum for managing credentials for various services. Create a file keys with the following content. key proto=pass service= ftp server=10.0.2.2 user=anand !password=<password> key proto= wpapsk service= wpa essid=Tomato24…

Plan 9: Intel Wireless 3165

Intel Wireless 3165 internal PCI card works with Plan 9. You'll need firmware blob /lib/firmware/ iwlwifi-7265D-29 .ucode from Linux as /lib/firmware/ iwlwifi-7265D-29 in Plan 9. Detect hardware on Linux lspci -nn 02:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [ 8086:3165 ] (rev 81) # slot_info=0000:02:00.0 # vendor_id=8086 # device_code=3165 Detect firmware on Linux sudo dmesg…

Plan 9: Quick Boot with UEFI

UEFI ( Unified Extensible Firmware Interface) provides a quick way to set up a Plan 9 terminal on modern hardware . EFI System Partition (ESP) is a FAT32 partition. You should be able to modify it in most of the operating systems. Run mk in /sys/src/boot/efi . aux/aout2efi converts an a.out file to an EFI executable. For x86_64 hardware, copy over the files bootx64.efi (EFI application) , 9pc64…

Lisp on Plan 9

Compile and run Tinylisp in under 2 minutes on Plan 9 ( 9front ). Both are modified versions. Code https://gitlab.com/atamariya/tinylisp (plan9 branch) https://gitlab.com/atamariya/plan9front (dev branch)

Plan 9 : The Infinity Notebook

Plan 9 is an Operating System (OS) from Bell Labs which is a successor to UNIX. It builds on the learnings from the previous Operating systems. Network computing and graphics is an integral part of the OS rather than an afterthought. It is modular and portable - it comes with a cross compiler . It is available, under MIT License , which anybody can use, learn and tweak. Features Everything is a…

Plan 9 Remote File Access from Emacs

Plan 9 Operating System uses 9p protocol for file access. This is an Elisp implementation of the protocol. Plan 9 ( 9front distribution) is running in QEMU with NAT networking. Local port 12564 is forwarded to 9fs service port 564 in the virtual machine. Code https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/net/plan9.el Troubleshooting Plan 9 connection Ensure you are booting with -a tcp!*!564…

Emacs: Binary File Viewer

Quick visualization tool for Binary data using C header definition. Semantic parses the C header file and generates a type definition. The type definition is passed to bindat-unpack along with the binary data. The result is displayed using speedbar . ;; Note: The command works on the binary data in the current buffer. M-x hexl-form (hexl-form) The image shows the example included in the commentary…

CEDET: Across the Language Barrier

Emacs at its core is a Lisp interpreter written in C. If you are an Emacs developer, this means you often need to jump between C and Lisp programming languages. CEDET is capable of maintaining project-wide tag database and hence allows the user to seamlessly jump across the definitions in either C or Lisp. Demo: Jump to definition across Lisp and C (including pre-processor) using CEDET . Note:…

Emacs Font is wider

Emacs Font is wider than other applications. Most people don't notice the difference. If you can perceive it, you are not hallucinating. This can be attributed to the following: Points per inch #ifndef HAVE_ANDROID /* Number of pt per inch (from the TeXbook). */ #define PT_PER_INCH 72.27 #else /* Android uses this value instead to compensate for different device dimensions. */ #define PT_PER_INCH…

Emacs: A non-intrusive browser

Web is simple. Browser can be simpler. Features No pop-up ads Content first (CSS and images are loaded asynchronously) No beacon or marketing pixel ( zero pixel) image tracking Split panes Fully customizable (custom theme using CSS) Fully extensible (write your plugins/extensions) Easy cookie mangement The technical details are here .

HTML Renderer (Emacs)

Emacs: A non-intrusive browser An Elisp implementation of HTML rendering using SVG. The browser functionality is an extension of eww . For Javascript, you can use either NodeJS or QuickJS as a JS interpreter . Developer Note: The entry point is shr-render. Table Colspan example Rowspan example Sample Table <html> <body> <table border="1"> <tr bgcolor="#9acd32"> <th…

The Oval Editor (Emacs)

The Oval Editor is a feature which allows the user to combine text with advanced formatting and drawings seamlessly in Emacs. This is an amalgamation of several disparate features developed over a period of time . It is also available as a single package in my Emacs fork . Draw and Scribble Notes in GNU Emacs Text inside a shape (uses librsvg fork ) Context menu Variable fonts Faux Bold and…

Variable Font in Emacs

Variable fonts are an evolution of the OpenType font specification that enables many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. Please note that the fonts are designed for readability. These are not simple geometric transformations. Hence, the fonts may or may not support full range of…

Faux Bold and Italic

Faux bold and italic using Freetype API Modern Outline fonts (Truetype and Opentype) have a separate file for each weight and style for better readability. They are usually suffixed as normal, Bold, Italic and Bold-Italic. This means that one cannot render these variants if the font files are missing. From the end user perspective this is annoying at times. Following APIs can be used to generate…

Annotate completion candidates (GNU Emacs)

GNU Emacs supports annotation for completion candidates. An annotation is a small bit of useful information shown next to a completion candidate which a package developer can use to provide additional help to the user while making a selection. e.g. while selecting a command, this is usually the keyboard shortcut. In the following example, annotation is used to display a sample text with the…

Text along a path (GNU Emacs)

SVG 2 specifications allows flowing text along a curve via textPath element. This opens up possibilities for cool text effects e.g. Formula Editor in GNU Emacs . GNU Emacs uses librsvg for SVG rendering on GNU/Linux. This fix for librsvg was available in 2014 [4]. But this wasn't applied for some reason. Librsvg has moved to Rust since then. The code below is pre-Rust version of librsvg.…