Here's the question: Why have a website? After all, this is 2022 not 1995. We have loads of social spaces for sharing our thoughts and images, why go to the trouble? I'm not sure I can articulate the answer but it's similar to the reason one might grow a garden. We can easily go to the store to buy vegetables but with a garden we have control over the process, we get the vegetables we want and the satisfaction of seeing our labor turn into something tangible. Building a website by hand is the same. It's not something everyone wants to do but if you're interested let me show you how to get started.
Modern web design is complicated and the barrier to entry is high. Most pages use a raft of technologies, JavaScript, CSS, CMS and so on. These are great and allow institutions to create the web experience we all know but learning each of them is like learning a new programming language. This kept me from building a website for a long time. I felt like not having a huge stylesheet and a full content management system meant that I couldn't have a real website. Luckily, I found that making the conscious decision to avoid those technologies altogether freed me to make what I wanted. That sort of simple, bare bones web design is what I'll be covering here. It doesn't look as fancy but maybe there's something to be said for focusing on content over presentation.
First steps: Most large web hosts want you to use their content systems and templates. This is the opposite of what we're looking for. To get started, you want a shell account. Most shell accounts will let you host your own web page but they also give you access to a different way of interacting with the net. SDF is one of the oldest shell providers and is a great place to get started. In order to connect to a shell account you'll need to use a program called ssh. On Unix like systems such as Linux or Mac OS you can access ssh from the terminal. On windows ssh needs to be enabled first. Check this article from Microsoft for details. Once you're at the terminal you can connect using the command ssh username@ssh.host.name
with your username
and whatever the address of your shell account provider is. For example, I connect to SDF with the command ssh ipxfong@tty.sdf.org
. If all of this seems a little arcane, check out this great intro to using a terminal.
Getting Set Up: Once you have a shell account you'll need to create the space for your website. This process is different for every account provider. On SDF you can follow this tutorial this tutorial. Check the documentation for other providers, they should have something which explains the process of setting up a website. To create your web page, you'll be using a text editor. There a bunch of different editors that range from simple to complex systems that attract followers who will defend them with almost religious fervor. Don't worry about any of that. Most tutorials reference a text editor called Nano. This was the simplest editor "back in the day". It's a fine choice but its command structure is old fashioned. If you're used to a modern graphical interface you might find Micro more to your liking. It has mouse support and it's commands are likely to be more like what you're used to: ctrl+c
and ctrl+v
for copy and paste, ctrl+s
to save and ctrl+q
to quit. Both Nano and Micro are available on SDF, on other providers the environment may be different. To use the text editor type micro filename
where filename
is the file you want to edit or create. For example I would type micro index.html
(or nano index.html
) to edit the file index.html
. If the file didn't exist, it would be created automatically so I could work on it.
HTML: At its heart a web site is a collection of text files which can be linked together by the browser. These files are written in HTML. This has become quite complex but it doesn't have to be. An HTML document is jut a plain text file that contains a bit of extra information that tells the browser how to present the text (should it be bold or underlined or whatever), how it should be arranged on the page (paragraphs, lists and so on) and how the documents should be linked together. By convention documents written in HTML have a filename that ends with .html
though this isn't critical. An HTML file tells the browser how to display the file by using tags. Tags are extra bits of text that don't show up on screen but instead tell the browser how to present the information. Tags look something like this: <b>this text will be bold</b>
. The tags are the bit in between the <
and the >
. In this case b
tells the browser to make the text bold. Tags often come in pairs, a start tag and and end tag. The text between the tags is affected by the tags. End tags are the same as regular tags but always start with /
. Here <b>
tells the browser where to start making the text bold and </b>
tells it where to stop. Not every tag needs to be followed by a closing tag those that don't operate on text (like adding horizontal line) are often one and done. Some tags also contain a little extra information which we call attributes. We'll see more about this when we look at links. One thing to keep in mind, HTML only uses tags for formatting so if you document is formatted with blank lines and paragraphs they won't show up in your web page unless you also include tags. Here are some of the formatting tags I use:
<b></b>
: Bold
<i></i>
: Italic
<s></s>
: <u></u>
: Underline
<code></code>
: Make the text look like code.
<pre></pre>
: Pre-formatted text. That is use the formatting in the text file. Different browsers interpret this in different ways and it doesn't always work like you might expect.
<p>
: Start a new paragraph.
<br>
: Insert a line break.
<hr>
: Draw a horizontal line across the page.
<center></center>
: Align the text in the center of the page.
Lists: Lists are a great way to organize information in an HTML document. HTML supports two kids of lists: Ordered lists <ol></ol>
where every item gets a number and Unordered lists <ul></ul>
which use bullet points instead. Lists are slightly more complex since they require two sets of tags the ol
or ul
to enclose the entire list and a second set of tags, <li></li>
, to indicate each item on the list. Anything you want can go in a list item, even another list. This is a great way to make outlines. A simple list would look something like this:
<ol>
<li>Item One</li>
<li>Item Two</li>
</ol>
The Structure: An HTML document needs a few more tags to make it into a web page. Each page should start with the line <!DOCTYPE html>
. This lets the browser know what kind of document to expect. Next we need to enclose the rest of the document in a set of <html></html>
tags. Inside the html
tags there are two parts: <head></head>
and <body></body>
. There's lots of information that can go in the head
section but for our purposes the important part is a pair of <title></title>
tags. The text inside the title
tags is displayed in the title-bar of the browser. The body
section contains the part of the document that gets displayed as the web page. The final bit of structure we'll talk about is the <div></div>
tags. div
lets you organize you documents into discrete sections. You can also give these sections an ID which makes it easy to refer to them from other places in your document. You do this by modifying the start tag to add the id
attribute. It looks like this: <div id="someName">
the closing tag is unchanged.
Linking it All Together: Links are the defining feature of HTML. They can link to sections of the current document, to other pages in your website and to different websites entirely. To make a link you use the <a></a>
tags. The text between these tags is what will show up as the clickable link on the web page. These tags are modified to tell the browser what to link to using the href
attribute, similar to the way we modify the div
tag to give it an ID. There are three broad classes of things you can link to.
First you can link to parts of the current page. To do this you need to first have a named div
. Let's say your page has a section for cool cat pictures. You set up a div
to contain them and it looks something like this: <div id="coolcats">Cat pictures go here!</div>
. You can link to any div
on your page as long as it has an ID by adding the attribute href="#DivID"
. The #
tells the browser that we're looking for a section on this page. So to link to our section of cat pictures we would use: <a href="#coolcats">My cool cat pics!</a>
. You also get a couple of freebies. Even if you haven't set up any div
s you can always use href="#top"
and href="#bottom"
to jump to the top or bottom of the page. It looks like this <a href="#top">Back to the top.</a>
.
Next you can link to other pages in the same directory. This works just like linking to a div
except instead of using a #
in our href
we use ./
to tell the browser to look in the same directory (or folder) for a new HTML document. If, instead of putting our cat pictures in a div
, we put them on a separate page called coolcats.html
we could link to it like this: <a href="./coolcats.html">My cat pictures page!</a>
Finally, you can link to other people's web sites. To do this we include the whole web address in our href
which looks like this: <a href="https://ipxfong.sdf.org">My cool web site!</a>
One more thing. If you want to link to a specific section on a page you can tack the #id
onto the end of the href
like this: <a href="./coolcats.html#felix">My cat Felix.</a>
Pictures: You can add pictures to your web page using the <img>
tag. There is no closing tag for images. img
has two attributes src
which tells the browser where to find the picture and alt
which should provide a text description of the image. If you wanted to include a picture of your cat Felix on your page, you would put the image file (felix.jpg
) in the same directory as the web page and add it to the page with the tag <img src="./felix.jpg" alt="Felix the cat chasing his tail">
. There are all sorts of things you can do with the img
tag like scaling and so on. If you're interested do a web search for "img tag html".
Special Characters: For whatever reason, HTML doesn't always show special characters like we might want it to. If you have a character you can't get to display correctly you'll need to use something called an HTML entity. Entities start with an &
followed by a bit of text. For example, since the browser thinks that < is part of the html code it won't display. To get one on the page you have to use the entity &lt
where lt
stands for 'less than'. There are too many entities to list here but there are a bunch of pages have all the codes you could ever want.
Putting it All Together: To understand how all these parts fit together it's best to look at the HTML code for a bunch of web pages. If the page uses lots of scripts or CSS it probably won't be that useful to look at the code but a simple page (like this one) can be pretty helpful. To see the page source type ctrl+u
. This works for most browsers though on MacOS I think it's command+option+u
instead.
Final Thoughts: Now, you should know enough to build your own web page from the ground up. There's so much information about HTML on the web, a few quick searches should be able to provide info on any topic. Keep in mind, a lot of this information is directed at people who are looking for the latest and greatest. There's nothing wrong with that. But, there's nothing special about it either. It's up to you to decide what fits your needs. Though, in my mind, content is more important than presentation. If I add a bunch of fancy transitions or scripted styles to my writing does it improve the information I'm trying to present? Maybe? But, probably not.
What Next? There are so many things you can do with your shell account. Check out Gopher and Gemini, try IRC or play a MUD. Oh, if your spelling is anything like mine, from the shell prompt you can spellcheck your HTML files using the command aspell check <filename>
. Have Fun!
Back in 1983 NEC released their version of the Model T laptop. At the time most portable computers came in a form factor affectionately know as "luggable". These machines were shaped like large suitcases weighed a ton and had to be plugged into the wall. The Model T computers came soon after and were the first real laptop computers, small, portable and battery powered. The first Model T computers were manufactured by Kyocera in Japan. These were not a great seller and Kyocera licensed the technology to other companies such as Olivetti, Tandy and NEC. I first used the NEC version back in the 80's when I borrowed my Uncle's machine for a weekend. It felt very futuristic. Not only was it tiny and portable, the OS was really advanced for the time. It had a built in file manager, Microsoft BASIC and the ability to use the system RAM as a file system. The NEC has a beautiful keyboard with a crisp 40x8 character LCD display. My first goal is to be able to use my NEC as a distraction free environment for writing.
Getting Online: There are a couple of ways to get your 8201 online.
systemctl enable getty@ttyUSB0.service
systemctl start getty@ttyUSB0.service
Connect the USB to RS232 cable to the back of the 8201, plug the cable into the computer and turn the 8201 on. From the menu choose TELCOM
and press f.5
to enter terminal mode. If you hit enter a few times on the 8201, you should see the login prompt for the computer you're connected to.
Once you have your WiFi modem you'll need to configure it. This can be a bit tricky because in order to talk to the modem its serial port and the port on the 8201 need to be set to the same speed, parity and so on. Luckily, it's easy to configure the RS232 port on the 8201 using the STAT
command. The syntax for STAT
looks like this STAT CPBSXS
where C
is baud rate, P
is parity, B
is word length, S
is stop bit and XS
is used for flow control. Acceptable values for C
are:
1 (75bps), 2 (110bps), 3 (300bps), 4 (600bps), 5 (1200bps), 6 (2400bps), 7 (4800bps), 8 (9600bps), 9 (19200bps)
Values for P
are:
N (No Parity), E (Even Parity), O (Odd Parity), I (Ignore Parity)
Word length (B
) can be set to 6, 7
or 8
bits. And you can have 1
or 2
stop bits (S
). I don't think most modern systems make use of the flow control bits so it's best to set them to N
.
Let's say your WiFi modem comes preset to 9600 baud with an 8 bit word length, no parity and 1 stop bit. To configure it, start by connecting the modem to the 8201 (make sure the power is off for both the modem and the 8201). Power things on and from the main menu select TELCOM
. Once TELCOM
has loaded, press f.4
for STAT
then type the string corresponding to the settings you need. In this case 8N81NN
The final two N
s are for flow control. Now press f.5
to enter terminal mode. If you hit return a few times you should see the menu for your WiFi modem. One thing to keep in mind, most WiFi modems only support telnet. Be sure the host you are trying to connect to has this enabled.
I wrote a tiny library to read a two dimensional array of integers and write a grayscale PGM file. PGM is so simple that nobody needs this I just wanted to learn about file I/O and pointer passing in c. Maybe this will be useful for someone, not in itself but just as an example of how easy it is to make images from numerical data.
If you're interested, you can grab a copy here.
Back in grad school, I worked on generating mathematical models for erosive processes. Turns out to be what one of my professors referred to as "non-trivial". Using vector calculus, you can tell a lot about a landscape represented as a field but there's really no way (that I found) to take the next step and act on that field in a way that simulates erosion. This is why people who are studying stream formation and erosion still use a pile of sand and a garden hose. That said, you can use an iterated functions to simulate the physical process of erosion using brute force and ignorance.
Currently, I've got the process that uses "sand" poured out a grain at a time to build heaps. These are the mountains that will be eroded over time. The grains experience no physics when they are laid down. They are distributed across the map using a random walk. which produces something that looks like this: