Offpunk 2.0
ploum.net
ploum.net
def do_info(self, line):
"""Display information about the current page."""
renderer = self.get_renderer()
def get_renderer_class():
return str(renderer.__class__).lstrip("<class '__main__.").rstrip("'>") if renderer else "None"
def get_page_lists(url):
return [l for l in self.list_lists() if self.list_has_url(url, l)]
def get_list_status(l):
if self.list_is_system(l):
return ""
status = "normal list"
if self.list_is_subscribed(l):
status = "subscription"
elif self.list_is_frozen(l):
status = "frozen list"
return f"({status})"
url, mode = unmode_url(self.current_url)
out = [
f"{renderer.get_page_title()}\n\n",
f"URL : {url}\n",
f"Mime : {renderer.get_mime()}\n",
f"Cache : {netcache.get_cache_path(url)}\n",
f"Renderer : {get_renderer_class()}\n\n"
]
lists = get_page_lists(url)
if lists:
out.append("Page appeared in the following lists:\n")
for l in lists:
out.append(f" • {l}\t{get_list_status(l)}\n")
return ''.join(out)Have you measured that your code is significantly faster than the original one?
So I would be curious to have some benchmark and would happily accept patches improving performances in ansicat.
But yes, benchmarks are very much necessary.
> The offline content is stored in ~/.cache/offpunk/ as plain .gmi/.html files. The structure of the Gemini-space is tentatively recreated. One key element of the design is to avoid any database. The cache can thus be modified by hand, content can be removed, used or added by software other than offpunk.
One ambition I have it to setup
https://github.com/davidfstr/webcrystal
> An archiving HTTP proxy and on-disk archival format for websites.
so that all my regular web browsing is auto archived at some level.
It would sure be neat if the archive formats could be compatible. It would allow for a setup where everything I’ve seen with my eyes is then immediately accessible programmatically or in a terminal. I feel that could open some significant productive advantages, especially in the age of LLMs also in the terminal.
Here is my vision:
- mitmproxy is running in transparent mode with a plugin/custom code that does continuous archiving on all traffic, perhaps with help of your netcache tool instead of webcrystal I mentioned. it’s set as the gateway.
- terminal user can then retrieve quickly history list, fzf select, page/dump text for cut and paste, or perhaps some direct to LLM tools pipeline, for summarizing or extracting.
Perhaps I’m stating the obvious above and can be implied by my prior comment. I guess the one detail I’m adding is I think using mitmproxy transparent mode it could be completely transparent to the regular desktop user. No per website configs, no proxy settings.
I run my desktops in a VM using vfio-pci GPU passthrough on the physical workstations and then put all my traffic through another pfSense VM, so re-routing traffic for me is already a fundamental part of my setup.
Perhaps this all sounds a bit complicated and yes it is. But there are numerous reasons I feel it can have a huge payoff.
Thank you for your open source work and I hope I’ll have some time soon to play around with offpunk. It looks like a fantastic tool with many potential uses.
- netcache (caching and network) - ansicat (terminal rendering) - offpunk (browsing)
So you could use only the cache part
Is this really true for you? Seems surprising to me given how cheap large HDD storage is now. I have trouble believing even bloated web pages are that large relatively speaking. I guess I should try to do it and find out, probably I’m wrong and it’s much more data than I’m expecting.
Gemini seems really neat, I should have investigated earlier.
ssh kiosk@gemini.circumlunar.space
Let’s one get a sense of what it is about. 1 bookmarks found me some spaces.
2.5G gemini 1.3G gopher 1.5G http 23G https
With the exception of dynamic webpages, every single page I’ve read in those two years is there. With pictures. And with every single page linked by those webpages. And all the pages linked on HN.
I’d imagine putting the archive in git repo with annex/lfs and along with builtin time-stamping it means an activity archive also. Lot’s of interesting use cases if combined with LLMs and RAG for example.
“A few weeks ago I was researching technology XYZ and there was an open source python package that looked neat, but I can’t remember what it was. Could you use my browsing cache and prepare a report on what I was reading about and summarize it please?”
It should be said that the cache doesn’t have any versioning. When a new version is downloaded for a file, it replaces the old one.
That’s also why the cached date is displayed in the title of the page in Offpunk
Hard drive storage space being so cheap in the ~$15/TB range makes this more feasible even for video archival
It seems there should be some mashup of them all that can produce a solution. One that also involves using offpunk to access the archive in the terminal.
Mitmproxy caught my eye with transparent mode [1] and the idea that the client/user VM may not even need configuration in my setup, the vfio-pci GPU passthough desktop OS approach. The archiver VM produced archive/cache could just be NFS mounted over a private bridge interface between the desktop VM and archive VM.
[1] http://docs.mitmproxy.org.s3-website-us-west-2.amazonaws.com...
It's art, in the medium and using the tools the author knows. Many associate art with certain mediums, like paint on canvas. But does the painter make a sculpture or build the perfect engine? The programmer, when they feel the drive to make art, makes a program.
(Another signal of art, IMHO, is the author's seeming disinterest in global adulation. They aren't aiming for virality or influencer status or the next startup with an exit, not pivoting to the trending thing; they are making what they love.)
But again, I can't speak for this author at all.
1. keep my computer environment on a remote VPS. So I have an always-on machine with high-speed internet access. I read books, visit websites and write codes on the same machine. These are mainly text works so a mosh connection is enough. Occasionally when I want to view some images, I use chafa to preview the images. Because the machine is always on, syncing and backup is eaiser to do.
2. But sometimes either you are offline or the VPS is offline. In this situation I will switch to a raspberry pi zero (packed inside a mint tin). The computation resource is limited so do everything in cli/tui will make things faster.
What is incredible is when I got to the end of my tour before finishing my cup of tea. I feel like I finished what I had to read for today. I then go to empty the "to_read" list (which is never empty but stay between 10 and 30 items all the time).
I also create lists for stuff I want to bookmark and surprise myself by triaging them: rereading and deciding if I want to keep that article or not in a list. If yes, adding some comments in the list (lists are simple gemtext files that could be edited with "list edit my_list")