Blog

  • Where The Terminal Came From

    Today if you are a Linux user and fire up a terminal window to “do something” at the command-line, you are using a gooey program to emulate an old terminal which was separate to the computer.

    Today you are almost always using a keyboard and screen connected directly to the computer you are using and the gooey program you fire up as a terminal is in fact originally called a terminal emulator. That is, it pretends to be a real terminal.

    So what were these real terminals?

    The earliest “terminals” were actually teletypes for communicating text messages over long distances (over wires!). Not only was there no digital computer involved, but they predate computers by quite a way – the earliest ones were used in the late 19th century. And of course printed the text onto paper directly. The earliest digital computers used these teletypes as input and output devices, so you could type in commands and see the result immediately (or as quickly as the result could be produced). These early days still leave some traces today :-

    ✓ mike@Lime» tty
    /dev/pts/5

    The “tty” command commemorates those old printing terminals – the “tt” in “tty” is short for “teletype”.

    The speed and wasted paper of those printing terminals was a bit tedious, so the 1970s saw them gradually replaced with glass teletypes – which were basically keyboards and CRT screens built into an enclosure that would attach to a central computer over a serial line.

    binary comment

    These terminals (and showing an ADM 3A here is a little unfair as it wasn’t quite this simple) were really simple – they had exactly the same capabilities as the printing terminals. No cursor control (meaning no full screen editing), plain text, no italics or bold, etc.

    Over time, more and more features were added to the terminal allowing more usable software (in particular the learning curve was not quite as steep). These features grew to accommodate colour, graphics, the ability to load and save data locally, and even the ability to function as a microcomputer (the HP pictured below could run CP/M in certain configurations).

    But where did they go?

    The heyday of the terminal was in the 1980s when many office-based companies were busy trying to put something like a computer on every desk, and a terminal connected to a central computer was one way of doing that. But they compared rather poorly with microcomputers – typically very slow in comparison, less likely to offer any kind of graphics (graphics was an option but typically cost as much as a microcomputer), and just wasn’t very “cool”.

    Despite several attempts at resurrecting them (they were popular amongst those who had to centrally support them), they never really returned.

    But they do survive inside modern operating systems in terms of a terminal emulator (as mentioned previously) to access the operating system command line – all three main operating systems (Windows, macOS, and Linux) have a terminal emulator of sorts. And Microsoft is actually investing in re-engineering their terminal emulator.

  • Faggots. And Why Simple Censureship Is Bad

    This is related to the Scuntthorpe problem although it looks more at the meaning of a word rather than its appearance. This particular issue cropped up when a Facebook group I’m a member of briefly blew up (in a very English way) when Facebook prevented us mentioning that a particular shop was well known for its faggots.

    But perhaps I should explain what I mean by faggots; the word itself has had plenty of meanings from bundles of wood (or any bundle) to a naughty child; in the case we’re talking about it is about a British meatball – the faggot.

    Now this isn’t a “freedom of speech” thing – I’m not arguing those who denigrate homosexuals should get off scot free. But blindly banning the word “faggot” can have unintended consequences.

    That posting on Facebook I mentioned? It went an interesting way – the blame wasn’t put on naïve censorship software but on political correctness itself. Whilst that was a mistake, there is now a few members of that group that will automatically respond badly whenever “political correctness” is mentioned and start talking about edible faggots.

    When the blame is squarely with the censorship software that doesn’t take context into account – when you’re talking about “faggots and onions” or “a faggot shop”, you’re unlikely to be throwing rocks at homosexuals.

  • Does Racism Really Exist?

    Of course it does.

    But let us go a little deeper.

    First of all, does race really exist? It is notable that the Wikipedia articles on race (1 and 2) distinguish between biological race and the definition of race as it applies to humans. The later seems to be a rather vague term defined differently in different places or circumstances and as someone who likes clearly defined terms the temptation is to go with the biological definition of race and declare that humans are all one race.

    But people do insist it exists. So lets take a look at the “white” race; a supposedly monolithic race. But in reality it subdivides up into different “racial” subgroups – the Irish, Finns, Arabs, Jews, and the Romani have all been at times classified as non-white. At what proportion does non-white ancestry qualify one as non-white? In the US, the standard varied from 1/4, to 1/16, or any African ancestry at all (which excludes every single person from being classified as “white”).

    Nothing illustrates that US “whiteness” is a qualification for a privileged position (“white privilege”) more than the one-way one-drop rule which although no longer part of the law is still widely accepted socially. If you have one drop of non-white “blood” (ancestry), you are non-white; yet the opposite doesn’t apply – one drop of white “blood” doesn’t disqualify a person from being black.

    Which means that racism is little more than an excuse to divide us all into “them” and “us”. Which neatly leads on to the second point.

    Many of these ‘isms – racism, excessive nationalism (and xenophobia), … – are just means to an end. To divide us up into “them” and “us” so we can blame “them” for everything that is wrong. Just like the school bullies, we can pick anything to divide people into “them” and “us” – wear glasses, be too tall or too short, gender, a built-in tan, … just about any stupid reason can be used.

    With this in mind, racism is using an invented means to divide people just to bully one category. Silly isn’t it?

    Lastly some of us have a suspicion that the fires of racism are stoked by those in power as a means of distracting the proles from the real enemy – unrestrained capitalism. Next time you wonder why that immigrant is allowed to steal a well-paid job from you, instead wonder why there aren’t well-paid jobs for both of you.

    Standing On The Board

    Yes racism exists, but it is as childish as schoolyard bullying and based on little more than the arbitrary grouping of people. And those who promote racism might just have a hidden agenda.

  • ZFS: Replacing A Functional Mirrored Disk

    This is a procedure to replace one working drive in a fully functional mirror vdev; if you are replacing a failed disk there is no advantages in following this procedure. Although if you have a somewhat functional disk it may be worth trying.

    So why not simply yank out the working disk you want to replace? Well, you can of course and that would work but there is nothing Murphy likes more than a mirrored vdev temporarily down to a single disk – resilvering onto a new disk guarantees a higher chance of failure of the previously working disk (I have actually seen this happening).

    So I’m going to describe how to make a three-way mirror with three disks and then detach the disk you wanted to replace.

    To do this there are some prerequisites :-

    1. You will need space to install an additional disk into your system; perhaps temporarily in an “unsuitable” location.
    2. You will need a spare SATA controller port to plug the new disk into. If necessary with an additional PCIe SATA controller (which sounds expensive but safety is worth the cost).
    3. You will need a SATA data cable and a SATA power cable.

    The first step is to make very careful note of what devices you are going to “swap over” – ideally using their WWNs. If you don’t use WWNs, sorting out which disk is which is going to be a bit trickier.

    The second step is to practice the steps involved using a ‘fake’ storage pool backed up by tiny disk files :-

    # cd /pool1/temp
    # for w in one two three
    do
      dd if=/dev/zero of=test-disk-${w}.img bs=1M count=1000
    done
    # zpool create test mirror /pool1/temp/test-disk-one.img /pool1/temp/test-disk-two.img
    # zpool attach test /pool1/temp/test-disk-one.img /pool/temp/test-disk-three.img
    # zpool detach test /pool1/temp/test-disk-one.img

    That’s pretty much it in a nutshell.

    The real process is a bit more disturbing of course and most of the work is physical. The first difference from practice is that when you attach the new disk to one or other of the existing devices within the mirror, you will have to wait until the resilvering process is complete.

    Whilst you will receive an estimate for that if you run zpool status, the estimate that you get :-

      scan: resilver in progress since Sun Jul 18 08:20:54 2021
    	8.25T scanned at 1.09G/s, 7.28T issued at 981M/s, 8.25T total
    	995G resilvered, 88.23% done, 0 days 00:17:16 to go

    (Only showing the relevant part as the full output from my system is confusing and deceptive)

    Is wildly inaccurate – partially because the resilvering process takes second place to any ordinary file system activity. My own estimate (1 hour per Tbyte) is probably also wildly inaccurate; basically it is done when it is done.

    Detaching the old device is fast – you won’t need to sit down to wait for it.

  • The Resurrected Model F Keyboard

    Available (for now) from www.modelfkeyboards.com.

    I do not usually do product reviews, but for various reasons decided to do this – of my newly arrived Model F F77 keyboard. The original IBM keyboard F was produced by IBM between 1981-1994 in various forms, and one keyboard enthusiast decided to re-create one of the more obscure F keyboards because of it’s similarity to modern keyboard layouts and size.

    Don’t instantly reject it because it looks old-fashioned – I deliberately went this way and there are plenty of alternative configurations.

    Two key points if you decide to buy one :-

    1. Read the manual before starting to fit the key caps. It really will save you time (guess who didn’t?).
    2. If you decide to flash the Via firmware (actually QMK with the Via option turned on), when you run the via program to configure the keyboard, load the relevant json file before wondering why it can’t see your keyboard.

    Initial Impressions

    Solid. Very solid. And very, very heavy. This keyboard is over 4Kg with a full metal case supposedly of even higher quality than the original.

    There are no legs to prop up the back of the keyboard which makes it unusually flat for a normal desktop keyboard. But that is easily solved with something stuffed under the back of the keyboard, and it is sufficiently stable that a prop in the middle of the back doesn’t make it wobbly unless you bang on your keyboard exceptionally hard. And if that happens, just prop it up with two props. Rubber feet are available when you purchase the keyboard.

    The layout (bear in mind that I deliberately chose a HHKB-style layout) is pretty much a modern tenkeyless keyboard with various options for the navigation cluster (I have arrows and numbers; other options are available). The raised lip between the alpha cluster and the navigation cluster doesn’t seem to interfere with typing (although your mileage may vary).

    The keyboard is supplied with a full set of keycaps, so you can customise the layout to your preferences. They are also exceptionally well printed.

    Describing the keyswitch feel is a bit tricky – they are perhaps a bit crisper and lighter than a model M keyswitch, which doesn’t really help if you have never tried one before. The only thing to say is that most keyboard keyswitch connoisseurs will claim that the model F is one of the best keyswitches ever made, and people far more familiar with that keyswitch than I am say that this keyboard matches the original IBM model F keyswitch quality.

    In terms of hardware, there is almost nothing to fault with this keyboard; the biggest “fault” is the lack of legs to raise the back of the keyboard. But the original lacked this feature so it is a little unfair.

    Firmware

    Well this because a bit more nuanced. As originally envisioned, this keyboard would have been equipped with the xwhatis firmware but towards the end of the pre-production process a beta version of QMK was released which supported the keyboard better. My keyboard was delivered with the QMK firmware but without the Via option turned on.

    The keyboard with the default firmware works well – there is no real need to swap out the firmware unless you want more advanced features.

    But I did.

    The first problem I encountered was that the qmk_toolbox gooey is an empty shell under Linux – it doesn’t actually do anything. Which is not widely publicised … and perhaps the distribution of this tool should not make a Linux version so easily available. I ended up using macOS to load the firmware I wanted.

    Under Linux it is possible to use dfu-programmer to load the firmware, but as I have not done this myself I can’t comment on how that is done.

    And once I managed that, of course I neglected to load the right JSON file into Via so at first it didn’t recognise the keyboard as something that could be controlled. But that was soon put right and I’d programmed the keyboard with the layout I wanted.

    Once you have the firmware you want and a suitable way of setting up the firmware layout that you want, the keyboard becomes exceptional. Although the initial configuration is a little rough around the edges, the QMK firmware offers features unbeaten by any commercial keyboard out there – even though Via is not capable of making use of some of them. And frankly, hardware wise, there isn’t a better new keyboard out there.

    Is it worth the cost? It is after all expensive but it is actually cheaper than the original IBM model Fs after inflation has been taken into account. And it is the kind of keyboard that could well last a lifetime.