monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit 041a2d14fa4dc88a9b0be196586d03cab85fb982
parent a3a9a49c7e1228797d66852d347d5ace3c9c9964
Author: z3bra <willy@mailoo.org>
Date:   Sat, 14 Feb 2015 00:53:57 +0100

New article: gopher

Diffstat:
2015/02/do-you-gopher.txt | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
config.mk | 3++-
index.txt | 1+
3 files changed, 135 insertions(+), 1 deletion(-)

diff --git a/2015/02/do-you-gopher.txt b/2015/02/do-you-gopher.txt @@ -0,0 +1,132 @@ +# [Do you gopher ?](#) +## &mdash; 03 February, 2015 + +> Pocket gophers, commonly referred to as gophers, are burrowing rodents of the +> family Geomyidae.[3] There are approximately 35 species of gopher living in +> Central and North America.[4] They are commonly known for their extensive +> tunneling activities. Gophers are endemic to North and Central America. +> +> -- wikipedia + +This article is not about them. + +The gopher I'll cover here is the TCP/IP protocol. It is a simple protocol used +to share resources across the internet. The goal is to make the all internet +look like a giant filesystem, where everything is read-only. + +How does it looks? + + $ curl -s gopher://z3bra.org + iYou found me. Happy browsing ! Err z3bra.org 70 + i============================== Err z3bra.org 70 + i Err z3bra.org 70 + 0prolog /prolog.txt z3bra.org 70 + 1notes /notes z3bra.org 70 + 1ascii /ascii z3bra.org 70 + 1images /img z3bra.org 70 + hhttp://blog.z3bra.org URL:http://blog.z3bra.org z3bra.org 70 + . + +We'll come back on this later. First, how does it works? + +### gopher indexes + +Gopher is a text based protocol, where each line either points to an index +(directory), or an item (items being files). +The items will either be files or text (see file types later). To understand +what the indexes are, let's assume we have the following filesystem: + + /var/gopher/ + ├── img + │ ├── index.gph + │ ├── dad.png + │ ├── mom.png + │ └── son.png + ├── index.gph + ├── notes + │ ├── index.gph + │ ├── memories.txt + │ └── tricks.txt + └── hello.txt + + 2 directories, 9 files + +The files `index.gph` are the equivalent for `index.html` for most HTTP servers. +In this case, each `index.gph` lists the content of the directory, so from a +gopher client, we'll see: + + / + ├── img [index] + │ ├── dad.png [file] + │ ├── mom.png [file] + │ └── son.png [file] + ├── hello.txt [file] + └── notes [index] + ├── memories.txt [file] + └── tricks.txt [file] + +Pretty simple. You could however create a more difficult architecture by making +`.gph` point to other files not in their directories and such.. but that's not +the point here. + +### the protocol + +To put it simply, each gopher "line" is composed of 5 distinct parts: + + <type><description> <path> <server> <port> + +So each line is a link to another file, which could be on any server. + +* &lt;type&gt; : type of the line, usualy the type of the file pointed to +* &lt;description&gt; : just text, to describe what the link points to +* &lt;path&gt; : path to the item, from gopher's server root +* &lt;server&gt; : the server which hosts the file +* &lt;port&gt; : the port on which the server is listenning + +A gopher index is then just a list of links, each one pointing to a file which +can be anywhere accross the world. And you don't need any unreadable markup +language for this! + +### file types + +The gopher protocol implements a rudimentary filetype thingy, by putting a +character at the beginning of each line, indicating what the "item" points to. +For example: + + 0this is a file /path/to/the/file domain.tld port + 1this is an index path/to/the/index domain.tld port + 9this is a binary file /path/to/the/binary domain.tld port + Ithis is an image /path/to/the/image domain.tld port + +There is also a special type: 'i', which doesn't point to anything, so it is +only used to display text: + + iThe following is a set of cat pictures Err domain.tld port + Icat1.png /img/cats/1.png domain.tld port + Icat2.png /img/cats/2.png domain.tld port + Icat3.png /img/cats/3.png domain.tld port + Icat4.png /img/cats/4.png domain.tld port + +### gopher holes + +Gopher spaces are commonly named "holes". All you need now is a gopher to crawl +this huge gallery. Here are a few I recommend: + +* gopher - http://gopher.quux.org:70/give-me-gopher/ +* cgo - https://github.com/kieselsteini/cgo + +Or you could use an HTTP proxy : http://gopher.floodgap.com/gopher/ + +### final thoughs + +As you might have noticed (or not), I run my own gopher hole. I first wanted to +move this whole blog over gopher, but finally decided to keep it as is (because +I'm kind of attached to it after all!), and use my gopher space to share some +quick thoughs & notes about POSIX systems and other IT related subjects. + +Because of this, I might reduce the freequency of posts I publish here, in favor +of more notes on my gopher space. So see you there! + + gopher://z3bra.org + +<!-- vim: set ft=markdown ts=4 et tw=80: --> diff --git a/config.mk b/config.mk @@ -23,7 +23,8 @@ PAGES = index.html \ 2014/09/backup-someone.html \ 2014/11/avoid-workspaces.html \ 2014/12/so-tox-me-maybe.html \ - 2015/01/you-are-the-wm.html + 2015/01/you-are-the-wm.html \ + 2015/02/do-you-gopher.html FEEDS = rss/feed.xml EXTRA = css img vid errors favicon.ico diff --git a/index.txt b/index.txt @@ -1,3 +1,4 @@ +* 0x0014 - [Do you gopher ?](/2015/02/do-you-gopher.html) * 0x0013 - [You are the WM](/2015/01/you-are-the-wm.html) * 0x0012 - [So tox me maybe](/2014/12/so-tox-me-maybe.html) * 0x0011 - [Avoid workspaces](/2014/11/avoid-workspaces.html)