Nerd Babel

flashlight, blackout, power failure, energy, energy crisis, night, dark, supply failure, catastrophe, power supply, power plant, nuclear power plant, oil, gas, natural gas, green energy, error, breakdown, failure, heating, electricity, report, flashlight, flashlight, blackout, blackout, blackout, blackout, blackout, failure

Power Outage

Today I was waiting for clients to get back to me. While I waited, I started installing OpenStack.

So far it has been going well. A few typos slowed things down. Errors are not always clear, but I am now at the point of installing neutron

This is the scary part. The terrifying part.

Neutron interfaces with Open Virtual Networking (OVN). This could be magical, or it could break everything.

OVN sits on top of Open vSwitch, providing configuration.

The gist is that you install OVS, then you add configuration options to the OVS database. This configuration instructs OVN how to talk to its databases.

Once OVN starts talking to its databases, it performs changes in the OVS database. Those changes affect how OVS routes packets.

The physical network is broken into subnets. This is a requirement for high-availability networking. As links go up and down, the network routes around the failures.

On the other hand, many of the tools I use prefer to be on a single network; subnets increase the complexity greatly. Because of this, I created overlay networks. One for block storage, one for compute nodes, and one for virtual machines.

Neutron could modify the OVN or OVS that brings my overlay networks down.

So I’m well into this terrifying process, and the power goes out. It was only out for a few minutes, but that was enough.

The network came back to life.

All but two servers came back to life. One needs a BIOS change to make it come up after a power failure.

One decided that the new drive must be a boot drive, so it tried to boot from that, failed, and just stopped.

All of that put me behind in research, so nothing interesting in the 2A front to report, even though there are big things happening.

The number of moving parts in a data center is almost overwhelming.

Network Maps

There was a time when I would stand up at a whiteboard and sketch an entire campus network from memory, including every network subnet, router, and switch.

Today, not only can I no longer hold all of that in my head, my whiteboards no longer exist.

In the first office I rented, I installed floor-to-ceiling whiteboards on all walls. I could write or draw on any surface.

I can remember walking into Max’s office with an idea, asking for permission to erase his whiteboard, and then drawing out or describing the idea or project. Maybe 30 minutes of drawing and discussing.

What surprised me was asking to erase my chicken scratches months later and being told, “No,” because they were still using it.

Regardless, today I need to draw serious network maps.

I have multiple routers between multiple subnets. Managed and unmanaged switches. Gateways and VPNs. I have an entire virtual network layered over the top of all of that to make different services appear to be on the same subnet.

Not to mention the virtual private cloud(s) that I run, the internal, non-routing networks.

It is just to much for me to do in my head.

Oh, here’s one that’s currently messing with me. I have a VPC. It has multiple gateways allowing access residing on different chassis in different subnets. I can’t figure out how to make it work today. Even though it was working yesterday.

I’ll be messing with networks for the next week to get things stabalized.

Business woman drawing global structure networking and data exchanges customer connection on dark background

Virtual Devices

When I started to babysit Cray Supercomputers it was just another step. Massive mainframe handling many users, doing many things.

But I quickly learned that there are ways of making “supercomputers” that don’t require massive mainframes. My mentor used to say, “Raytracing is embarrassingly parallel.”

What was meant by that is that every ray fired is completely independent of every other ray fired. His adjunct program rrt was able to distribute work across 1000s of different compute nodes.

We were constantly attempting to improve our ability to throw more compute power at any problem we were encountering. It was always about combining more and more nodes to create more and more powerful compute centers.

Which moved the bottleneck. We went from being CPU starved to being memory starved to being network starved. So we added more network bandwidth until it all balanced out again. Until we bottlenecked on networks again.

After his passing, I did work with a company that supported multiple large corporations.

I was introduced to VMware. A virtualization framework.

Instead of taking “small” computers and joining them together to create larger computers, we were taking “medium” computers and breaking them into small virtual devices.

What is a virtual device

A virtual device is nominally a network interface, a virtual disk drive, or a compute instance.

To create a virtual computer (instance), you tell your vm manager to create a virtual drive, attach it to a virtual computer, attach a virtual DVD drive, allocate a virtual network interface, and boot.

The virtual drive can be a physical drive on the host computer. It can be a partition on a physical drive, it can be a file on the host computer, or it can be a network-attached drive.

If you attach from the host computer, you can only move the drive to other instances on the same computer.

If you attach a network-attached drive, you can only move the drive to other instances with access to the network-attached drive.

I use libvirt for my virtual manager. If I expect the instance to stay on the same host, I use a file on the host computer. That is easy.

If I need to be able to migrate the virtual computer to different machines, I’ll use a Ceph Raw Block Device or a file on a shared filesystem.

What are the cons of using a virtual machine

It can be slower than a physical device. It doesn’t have to be, but sometimes it is.

While you can oversubscribe CPUs, you can’t oversubscribe memory. Memory is always an issue with virtual machines.

When the network isn’t fast enough, network-attached drives will feel slower.

And the big one: if the Network Attached Storage (NAS) fails, all instances depending on the NAS will also fail. Which is why I use Ceph. Ceph can survive multiple drive or node failures.

Another big con: if a host computer fails, it will cause all virtual computers running on that host to also fail.

What are the pros of using a virtual machine

It is trivial to provision virtual machines. There is an entire framework OpenStack that does exactly this. Using OpenStack you can provision an instance with just a few simple commands.

You can migrate an instance from one host computer to another. Even if the disk drive is located on the host computer, it is possible to move the contents of that drive to another host computer.

If you are using a NAS, you can attach a virtual drive to an instance, work on it with that instance, then detach that virtual drive and attach it to a different instance. This means you don’t have to use over the wire data moves.

You can also increase the size of a virtual drive, and the instance can take advantage of more disk space without having to be rebooted or any downtime.

Besides increasing the size, we can attach new drives.

This means that storage management is much easier.

Virtual Networks

The host computer lives on one or more physical networks. The instances can be bridged onto that physical network.

The instance can also be protected behind a Network Address Translation (NAT) service. This gives complete outbound connectivity but requires extra configuration for inbound.

But an instance can be placed within a Virtual Private Cloud (VPC). A VPC provides the complete internet IP space to the instance (or instances).

This means that user A can have their instances on 192.168.100.x and user B can have their instances on 192.168.100.x with out collisions.

None of user A’s traffic appears in user B’s VPC.

VPCs can be connected to share with gateways. When this is done, all the VPCs must use non-overlapping subnets.

In other words, 192.168.100.1 on user A’s VPC cannot communicate with an instance on user B’s VPC at address 192.168.100.55.

But if user A agrees to use 192.169.100.x and user B agrees to use 192.168.99.x then the VPCs can be connected with a (virtual) router.

Using a VPC means that the user must use a gateway to talk to any other VPC or physical network. This places a NAT service in the gateway.

A physical address is assigned to the gateway, which forwards all traffic to one or more VPC IPs.

Conclusion

While every infrastructure manager (network manager) needs to know their VM Manager. They all work in similar ways. If you know the basics, the rest is just a matter of finding the correct button or command.

This stuff is easy once the infrastructure is set up.

Cyber security concept. Data protection and secured internet access. Identity info.

Password Managers

People do a poor job of creating, managing, and remembering passwords. We are horrible at making random numbers and worse at creating things that are random-like but we can remember.

Part of this is because of the rules put in place by NIST and ISO. ISO 27001 has this to say about passwords:

Length
Shorter the password, easier it is to crack. The minimum acceptable length for a strong password is at least eight characters.
Complexity requirements
Creating a lengthy password is effective only as long as it is difficult to crack. Your name, city, pet name, and so on may have more than eight characters but are weak passwords that are easy to guess.
Characters
Continuing on the previous point, the key to a complex password is a mix of lowercase, uppercase, numbers, special characters, and symbols.

As computers have become faster, the need for better passwords has also increased. Brute forcing a password has a simple cost formula:
complexity length 2
For example, if the complexity is all uppercase letters and the length of the password is 8 characters then we have:
26 8 2 = 104,413,532,288

Which might look like a large number, but in computer terms isn’t really. As the complexity goes up, the final number goes up. Adding length causes the number to go up even faster. Consider adding the set of numbers, 0-9 to our complexity verse adding one more character to the length of our password.
36 8 2 = 1,410,554,953,728
And adding one more character to the length:
26 9 2 = 2,714,751,839,488

Adding just one extra character gives us nearly twice as many values to test.

Oh, the divide by 2 is the average number of tests before we guess right.

If the characters are not truly random, the number of guesses decreases substantially. Using names or words, even with character exchanges, produces a much smaller search space. Regardless, the formula stays the same, even if the vocabulary changes.

Consider just using a 3-word passphrase:

104,334 3 2 = 567,868,237,365,852

As you can see, using a passphrase increases the search space incredibly. The only requirement is that the search space of the letter search meet or exceed the search space of the word search.

Unfortunately, many password methods do not handle long passwords well. In early Unix times, no matter how long of a password you entered, only the first 8 characters were used.

Which brings us to

Password Managers

A password manager stores passwords in an encrypted form and retrieves them for you on demand.

For a password manager (PM) to be acceptable to the users, it must interface with the users browsers and other tools that need passwords. This means it must have a mobile app. If it does not, it will not be used.

The PM should monitor applications for password requests and autofill those requests.

The PM must lock itself after a certain amount of idle time or browser/device restart.

Finally, and in some senses, most important, the PM must be secure from data breaches.

To be secure from data breaches, the PM should never store credentials in clear text.

LastPass

This is one of the better-known PMs. While it had a good track record, there was a data breach and credentials were exposed.

One of my clients used LastPass, so I used it. I never particularly liked it. When I could, I moved away from it.

One of the big downsides is that it requires a live, active internet connection to function. No network, no access.

Keeper

I have used Keeper. It is a well-rounded PM with all the expected features. It stores all credentials encrypted by your password. They can’t access your credentials even if they wanted to. Since they can, your passwords cannot be exposed in a data breach.

One of the strong points of Keeper is the ability to share “folders.” You can have a folder for passwords related to a single project or client and share that folder with other users, inside or outside the organization.

The ability to share passwords means that the administrator can update a shared password, and every member with access to that password gets the change immediately.

Shared folders requires a paid tier.

There is also the ability to store small files securely.

The one downside I discovered with Keeper is that it too requires an active internet connection to function.

We were on a long road trip when my kid ran us out of data on my mobile plan. They consumed nearly 10GB of data in a little over 6 hours.

This left me in the position of attempting to log into my provider’s website using credentials stored in Keeper. Except that the amount of bandwidth available to me was so low that it took 30 minutes to get that password and login.

BitWarden

This is my current PM of choice. It provides all the features of Keeper with a few that appeal to me.

First, it is can be self-hosted. This means that all the data security is provided by me. With the self-hosted version, I can offer PM services to anybody at cost to me.

When you move up to any of the paid tiers, the lowest being $4/user per month, you get the ability to create organizations and then share a collection (folder) with that organization.

The mobile application does not need to have Internet access to function, though you might need to request a sync if there are recent changes to your vault.

All data is stored encrypted. The key to decrypt your vault is your master password. Even if there were to be a data breach, your password would still be secure because decrypting your passwords requires your master password.

The BitWarden allows for the use of a Personal Identification Number, or PIN. Unlike most PINs, the BitWarden PIN can be any number of digits. I find that it is easier to remember a number sequence than to remember random character strings.

You can set when the master password is needed to unlock the vault.

If you happen to forget your PIN, you can still unlock your vault with the master password.

Like all good PMs, BitWarden offers two factor authentication (2FA). It supports YubiKeys and TOTP options. TOTP is commonly referred to as an authenticator.

You can use a secondary authenticator for your 2FA to access BitWarden. But you can also use BitWarden’s integrated TOTP generator.

The pricing appears to be reasonable: $4/user per month for “small teams” and $6/user per month for enterprise-level features.

Psono

This is another self-hosted option. It does not seem to have the same polish as BitWarden. It would be my choice if I were just playing.

Conclusion

If you are not using a Password Manager, now is the time to start. For my readers, I’m willing to give you a free account on our BitWarden server, though you are likely better off using BitWarden’s free offering.

Businessman typing on laptop computer keyboard at desk in office.

Using AI

Using AI

Discover how AI is revolutionizing content creation in our latest article. By leveraging Grok, a powerful AI tool, the tedious task of formatting articles—such as removing hard line breaks and adjusting fonts—becomes effortless. With just a click, Grok can transform raw text into polished HTML, generate unique excerpts, and even craft social media posts. From clean, ready-to-run code to seamless API integration, explore how AI can save time and enhance readability. Dive into this astonishing journey of automation and see how it could transform your workflow!

The world is changing. It might be getting better.

I started speaking with Grok Thursday night. I was treating it as a search engine. What I wanted was a method to format the daily dump.

There is a lot of good content, but I wanted a method to make it look nicer without having to spend an excessive amount of time working it over. When I am quoting legal opinions, the longest part is manually formatting the quote.

Manually quoting means removing hard line breaks, removing hyphens, and adding the proper font style back. It just takes time.

What I want is to be able to click a button and have WordPress make a call to the Grok API to apply formatting to the article. Hopefully making it easier to read.

Grok 3 was able to give me good feedback on how to accomplish what I needed. The code was clean, commented, and ready to run.

I do read this stuff.

This led me to setting up an API account to use Grok 4 directly. I asked Grok-3 to provide me with code to do so.

Over the course of an hour or so, we were able to create a Python program that will fetch an article from the site. Reformat the article for proper HTML. Provide an excerpt that is different from the first part of the article. Create a post for X, and make that post.

This is pretty astonishing, in my opinion.

Now comes the testing.

Complex Systems

My internal infrastructure is getting better and better. Unfortunately, it is still not stable enough.

The router is having issues with memory. I need to add more memory to fix the issues. The problem being that I need to take the router out of production to do so. I’ve not been willing to do that.

The symptom is that connections time out. The fix, restart HAProxy.

HAProxy forwards traffic to the ingress service. This should be running on multiple servers, but it currently is not. There is an issue which I have not resolved where communications from the second ingress service gets lost, leading to the gateway not responding.

This means that when the server that runs the ingress service has to reboot, all ingress stops.

The network is broken into segments, each segment is on a different subnet. Ceph prefers to be on a single subnet.

My solution was to use OpenVSwitch to create a virtual network for Ceph. This works great!

This adds a dependency on OpenVSwitch, which should not be an issue.

The underlaying physical network depends on good routing. The reason I don’t use static is that some nodes have multiple paths and I want there to be multiple paths for every node. This adds a dependency on the routing stack.

Free Range Routing, or FRR, is the solution. It supports OSPF, which is the correct routing protocol for internal routing. It just works.

Unfortunately, FRR and the Linux kernel will stop talking to each other. When this happens, we lose routing of the physical networks.

When we lose routing on the physical network, the OpenVSwitch network stops working.

If the OpenVSwitch network goes down, then the different Ceph nodes can’t talk to each other.

All of this is to say, I’m sorry for the issues you have been seeing with this site. Thank you for hanging in there.

I had to find the sick FRRs and restart them. Once that happened, everything came back to life.

Software source code. Program code. Code on a computer screen. The developer is working on program codes in the office. Photo with source code. Python IDE

One step forward …

Tuesday I picked Ally up at The Fort at No 4. On the way home, we stopped to do some banking and pick up some groceries.

As we were walking to the bank I said, “Oh, it is closed.”

“Why?”

“Because it’s Sunday.”

“Huh?”

I then got home and posted “Tuesday Tunes” to show up on Wednesday.

I’ve been working on a major website. This includes a content management system for the site that meets the requirements for that vertical.

What I decided on was a “management bar” for those logged in as manager. When they activate the “edit page” function, all the blocks that can be edited are highlighted. Click on the block to start editing the block.

Save your changes. When you are satisfied, click “make live” on the management bar to make all the changes at once.

There are a few good tools for editing text in place.

This left all the other blocks, image editor, carousel editor, calendar editor and a few others.

Design from the top, build from the bottom

I know what I want to do, how I want it to work. Fortunately, I only have to worry about the “working” part. Not the pretty part. I have a team member who helps with that.

What this means is that I see the entire system laid out. This thing will do this, this other thing will do that, the user will see this.

Which leads to a balancing game. How much is done in the template build out? How much is done in the JavaScript module? How much is done on the backend? And how much support does the Frontend request from the Backend?

Currently, I have three different editing models built, each one a bit different from the others. Why? Piece wise progression.

In my original implementation, all logic was done on the Frontend from data provided by the Backend during page load. These led me to a working edit for the carousel. Click here, drag and drop or upload an image. Click there, and you can rotate, mirror, flip, and crop an image, maintaining a fixed aspect ratio.

The next was the text editor. That was simple because the editor works in place, sort of. But it is working. I’ll be adding more features to it, but that is mostly done.

Then the new image processing came into play. Click on the image you want to edit, a dialog pops up, the original, raw image is loaded. Recorded edits are applied, the image can now be edited.

All modals had to be preloaded. All the content of the modal was preloaded. Everything works by modifying existing elements or modifying the DOM. The only communications with the backend are fetching the raw image.

Which led to the calendar editor.

Piecewise progression.

With this, the amount of data started to exceed easy storage in the DOM. Access to needed data was looking more and more like a call back to the backend. The need to serialize objects on the backend for the frontend to manipulate was starting to get stupidly complex.

This led to a redesign. Instead of multiple modals, there is now a single modal (dialog) which is fetched, on need, from the Backend. In this modal, there is a tabbed pane. Click on the tab, a different pane shows.

By listening for a pane to be displayed, we can determine what content we require and request that from the backend, which has full access to all the data and logic required to make this work.

Bingo, everything starts to get easier.

Which means, once this edit is completed, I’ll return to the image editor, make the same design decisions, which in turn will make the carousel editor a simple modification of the image editor.

Things are getting a little easier as I become more comfortable with TypeScript and “promises”

Why the concerns?

First, when I started programming, you didn’t do redundant things because there were no spare cycles and there were no spare bytes.

As an example, I like to write a = do_it(param)->do_other(params2)->do_different(do_wildly_different(param3)).

This seems reasonable to me. No extra cycles, no extra bytes.

Today, it is better to do r1=do_it(param); r2=do_wildly_different(param3); r3=r1.do_other(param2); r4=r3.do_different(r2); This performs the same actions, but it is often clearer to read and allows for checking results at each step. All good.

The other big thing is communications. My last project was a shopping app. Our family still uses it. It creates shopping lists that you can then use from your Android Phone. It has more to it, but that’s the gist.

Because communications is sketch around here, it was designed to work in a standalone state, uploading changes when it could, downloading changes when required.

This lead to an entire mindset of “Communications is expensive”. Which I’ve had to break. The new site makes seriously different design choices.

  1. All Manager level actors will have modern browsers
  2. All staff working with the site will have reasonable download speeds
  3. All volunteers using the site will have reasonable browsers and speeds.
  4. All visitors to the site will have a relatively modern browser.

In other words, If you are working on the site, and it takes 5 seconds to get an updated pane or modal, this will be acceptable, or you will need to upgrade your device.

In looking at the current usage of browsers on the Internet, more than 95% of the people using the Internet will do just fine.

Now back to the Bootstrap 5 grind as I design pretty forms.

Coding Styles and Methods

My formal education is as a computer scientist. I was lucky enough to get this education at one of the cusps of computer development.

My Mentor went through a computer science program just 4 years earlier. There were classes he took that were not even offered in my program. The change was in moving from a need to understand hardware to a place where understanding the hardware wasn’t important to computer science.

What this meant was that my Mentor could design a computer from the gate up, I still struggle with hardware design.

My education included understanding low level instructions, instruction timings, bit manipulation, data structures, semaphores, and a host of other low level concepts. It also included much higher concepts.

At the time, my program included a year-long class where we wrote a working compiler, a required class where we wrote an operating system, as well as all the languages of the day. We even had theory class, such as the class on proving a program correct.

In addition to the formal classes offered by the University, I participated in an intense 8-week course where I was taught how to apply the classroom theory to actual working systems. This was the “systems class”. It started at 0800, ran through to 1200 with no breaks. We had a lunch break from 1200 to 1300. Then classes continued from 1300 to 1700.

We had to turn in our assignment of the day at 0800 the next morning.

This is what a day was like on the third week.

Wake up on a table in the student workroom of the computer center. Collect our work, stumble next door to start our 0800 classes. At 1200 hoof it out of there 2 miles to the house, shower, change clothes, move it back to the computer center and get there before 1300.

Being more than 15 minutes late was failure.

Study and learn new topics from the instructors. At 1700, head out to get dinner. Get back to the computer center by 1830. Work on assignments and projects until the computer was shutdown for nightly maintenance at 0400.

Decide if an hour of travel time to sleep in a real bed was worth more than an extra hour of sleep. Claim a table and fall asleep.

Repeat the next day.

Structured Programming

It is hard for a modern programmer to understand what a huge breakthrough the concept of “if-then-else-end if” was. It was the first of our structured code.

Before we had that type of language structure, we used “if condition goto”. Which was even more confusing when you used the FORTRAN IV construct of “IF value goto1, goto2, goto3” where the goto used was based on if the value was negative, zero, or positive. And yes, there was way too much code that used that instruction.

I helped my father with his MBA by being the computer dude to help him with the software he was using. It was written in FORTRAN IV or III. It wasn’t uncommon to be reading a section of code, have a GOTO that took you somewhere else in the code, which then had another goto back to the place where we just were.

In some cases, the code would conditionally jump to that “patch” which would then jump back into the other routine. It was a mess.


if condition then
do something
else if condition then
do something else
else
do something entirely different.
endif

Structured programming has at its base the concept of block correctness. Every block must be well-defined, do one job, have a set of well-defined inputs and outputs.

If this is satisfied, then you can verify the correctness of that block. You can test the set of acceptable and unacceptable inputs and verify that you get the correct outputs. If this test succeeds, then you can mark the block as ‘good’.

You can combine blocks in sequence. If you are connecting blocks, then the preceding blocks must contain all the outputs that will be used by the following blocks.

You can use conditional structures to create a block that is composed of verified working blocks.

Building from Blocks

One of the things about using blocks, is that you can build iteratively.

To give an example, I am working on a website. The front page has a carousel of rotating “hero” images.

From this, I knew I needed to be able to upload an image. The carousel has a fixed aspect ratio, this meant that I needed to have images in this aspect ratio. I also know that the user will want to decide what part of the uploaded image they wanted to use for the hero image.

In simpler terms, this means that I needed the ability to apply simple cropping to an uploaded image.

There is a black box in my head. It has defined the “cropper” block to take as input an image, the current cropping, and the current canvas to draw on. That block will interact with the user. When the user finishes, the block will output (x, y, width, height) in image pixel coordinates.

There is a different block box that takes two HTML elements and uses them to generate the required inputs to the crop block.

Another block takes the output from the crop block and turns it into a post to the server, to update those values.

Here is the thing, I’m using an obsolete cropping package because it is “simpler” while I’m extending my TypeScript and JavaScript knowledge. But I will be able to replace it with a very modern version and none of the other code will break, as long as the inputs and outputs do not change.

Currently, when you save your changes, the code submits the modifications as form data, which causes the page to reload.

Piece Wise Progression

What this means to me is that I’m constantly testing small changes. I will write a block of code, compile, deploy to the test server, test the results, edit some more.

Saturday was a lazy day. I only performed this cycle 50 or so times.

Every time I get a block working better, I make a git commit.

Friday, I had a breakthrough. I managed to make drag and drop work to select a file for uploading. Created a thumbnail of it. This was all via simple HTML and TypeScript.

Progress was fairly slow on this, learning curve, but what I found interesting is that I would get to a point where I had a working image selection, and only then realize that I had not connected the save button to anything.

Once that was working, the edit process turned out to be more difficult than I expected. It was all working from before, but I needed to hook into the code from a different place. But because that edit process had well-defined inputs, it was merely a matter of creating the correct inputs and it all “just worked”.

Of course, once I click that save button, I found out that I wasn’t actually uploading the image. Which was another thing to fix.

That worked, and it turns out that the server side needed some changes.

But everything was working because the process was all about blocks. When a block didn’t do what I wanted, it was a simple process of checking the inputs for correctness, then checking the output for correctness. If input was good and output was bad, it was a logic error. Track it down and everything gets fixed.

Working On The Railroad

When we code, it is not uncommon to find that there is some exception which can’t be processed by “normal means”.

For example, you are expecting an integer, representing the width of something. You get a string instead.

You could go down a new path, or you can convert the string into an integer. I.e. “768” becomes, simply, 768. That’s simple enough.

But what happens if instead of 768 you get “100%”? The answer could be to go down a separate logic path to deal with width, height, x, and y as percentages.

The railroad method says that you treat the code as a railroad line.

There is the mainline, it is a single track running between two cities. If you have a fast train on the tracks, and it is followed by a slow train, that fast train will get held up behind the slow train.

The answer to this is sidings. Much like the passing lanes on a two lane road, a siding is used to shunt one train out of the way while another train passes.

When the fast training is getting near, the slower train is shunted onto a siding. It waits there until the fast train has passed, then continues down the siding and back onto the mainline.

You can write code this way. When there is a problem with the input, you are being shunted onto that siding. You can decide there is no way to continue and abort, throw an error, you can do something else to get yourself back on the mainline.

Using the “100%” example, the siding means that we will do whatever code is required to convert the 100% into an integer that meats the requirements. This could be as simple as looking up the size of the parent and using that size.

The 100% could mean that we want this size to be a match for the other size. I.e., if the natural size of the image is 640×480, 100% width could mean 640. It could also mean that if we scale the height to 75% of natural height, we want to keep the width as 100% of that natural height.

These logical choices are done, and that conversion takes place on the siding. After the conversion is properly completed, the code can join the mainline again and nothing on the mainline needs to change.

Would It Hurt To Document The Device You Sent Me?

I am actually good at this computer stuff. It is what I do. So I get frustrated when I order hardware and it doesn’t work.

A month ago, I ordered a Mini-ITX board. It was cheap, and it wasn’t 17×17 cm, it was 17x19cm. Which didn’t fit in the case. The low profile CPU cooler/fan I ordered was too tall, so I needed to get a shorter unit. It just wasn’t worth the fight.

I ordered a new Mini-ITX board. This was supposed to be the right size. Not only was it the wrong size, it only had 3 SATA ports, not the 4 on the board I ordered.

That was taken care of with still another motherboard purchase. This time all was good. And amazingly, I didn’t have to wait 2 weeks for the board to get here from China.

Everything is installed, I install the PCI SFP+ NIC, it won’t power up. I don’t know if the card is bad but I replaced the card and that machine is now in production.

Switches are the next big issue. I gave up trying to find a cheap switch, I ordered a new switch, the same as the last I purchased. It should just work.

This switch is an 8 port SFP+ unit, similar to the one in the featured image. It is powered by a 12v DC wall wart.

What arrived was a plastic box with 8 RJ45 connectors. Similar switches can be found on Amazon for under $8. To make it pass the Amazon inspectors, they threw in a free USB-A to USB-C connector. That was returned and a refund was issued.

So I ordered another L3 switch. It arrived in short order. When I powered it up, the power light came on. Then the SYS light started blinking.

Read the manual. Green blinken SYS light means the unit is starting up. Figure that it might be that the unit isn’t fully configured. No problem, I connected it to the network.

Still the blinken light. I scan the network where the device is supposed to be. No response.

Well, the instructions don’t mention the “console” port on the unit (missing from the image because they used the wrong image on the Amazon listing). I ordered a generic console cable to watch the boot sequence, maybe I can spot what went wrong.

What went wrong? Nothing.

The unit is working exactly as it should. I’ve configured it, ready to go into production. The documentation is wrong about what the green blinken light means.

Frustration with hardware, yet this time it is working correctly.

Once this device is in place, every machine, but one, will have at least on 10Gbit fiber link to the main back plain network. Every machine will have a connection to the management network.

As a side effect, it means that each data closet will have at least two fibers into the closet for redundant backup links.

Oh, this also means I can consider using bonded links to get 20G bit transfer rates. That will be cool.

HTML code close up

Document Object Model

A modern website is a complex system of inter related pieces. Each of which must work correctly and communicate correctly with the other parts of the system.

As website creators, we break the design into the Frontend and the Backend. The front end is anything the end user sees, while the back end is responsible for generating content to be displayed.

The backend is further subdivided into the Model, Controller, and View. The model is our term for the database and database access. The controller is the rules for the website. The view is the creation of content to be displayed.

Consider a website that allows you to purchase an item. The “model” would describe that item. SKU, size, weight, cost, price, images, description, name, and much more. The “controller” encodes the business rules. We can only ship to people that have paid us. And the view turns all the information into content for a browser to display.

The content is delivered as HTML. We can also supply JavaScript code and Cascading Style Sheets. The HTML can have the JavaScript and CSS embedded in the HTML or the HTML can link to other resources to be included with this page.

HyperText Markup Language

The US government wanted a standardized way of creating electronic documents for printing. This was the Standard Generalized Markup Language, ISO8879.

SGML has the advantage of being very application-specific. If you are writing a book, you use one set of tags, if you are creating the Message Of The Day, you use a different set of tags.

The power of markup is that you describe what you are marking up, rather than formatting whatever it might be.

Consider and address. Bilbo Baggins, 999 Bagshot Row, Hobbiton, The Shire. As written in this sentence, it is just a row of text. You could write it that way on a letter and it would be delivered, but the postman would be unhappy at the formatting

<b>Bilbo Baggins</b><br/>
999 Bagshot row<br/>
Hobbiton, The Shire<br/>

Is the address formatted, which looks like

Bilbo Baggins
999 Bagshot row
Hobbiton, The Shire

Using DocBook, a particular version of SGML, we would write that same address something like:

<address><surname>Baggins</surname><givenname>Bilbo</givenname>
<street>99 Bagshot row</street>
<city>Hobbiton</city><state>The Shire</state>
</address>

We do not know how to display the address, but we know that it is an address. If we are provided rules on how to display addresses, we can display this address per the rules.

Structure

HTML was designed to be simpler than SGML. There are fewer tags, and the fixed meaning of the tags made it easy to write HTML by hand.

Almost every post I create is written in raw HTML. That HTML is then styled and displayed in nearly pretty ways.

HTML defined the structure of the document. The structure was of a header section, describing the page, and a body section with the actual content.

Within the content section were the different displayable content. You had headers, levels 1 through 5, you had numbered lists, unnumbed lists, and definition lists (a word with an attached definition). There were paragraphs, links, tables, and finally, there were images.

This content was rendered however the browser wanted to.

There were formatting tags for bold, italics, blinking, and not much more.

If you wanted to “layout” your webpage, you used tables and fought to get things right.

Cascading Style Sheets

CSS allowed us to provide styling to an element. The paragraph above has margins, padding, and boarders applied to it. It has colors applied for the background and for the font. All are set via a style sheet. Your browser has a default style for each element.

The problem that arises is how to attach that styling to particular elements. The answer starts with the structure of the document.

p {
  color: red;
  background-color: green;
  margin-left: 50px;
  border: 2px;
}

This uses a CSS selector, ‘p’ to locate all paragraph elements. It then sets the background to green, the font to red, moves it to the right 50px, then draws a 2px solid border around the paragraph.

This is a basic selector. Selectors get very complex.

DOM

Every element in an HTML document is loaded into the DOM. From there, we can select elements and modify the style of the element with CSS and CSS Selectors.

The simplest method is to give important elements an ID. IDs are unique for a DOM. If there is more than one element with the same ID, this will generate an error, which most people will never see. The rules tell us which element will own that identifier.

To find a particular element with a particular ID you use the ‘#’ symbol. Thus, to find the header just above, we would write “#DOM”. While the header would look like <h3 id=”DOM”>DOM</h3>.

We can add a multiuse identifier, called a class, to multiple elements at the same time. <div class=”quote”> is the code I use to create a quote. The class “quote” has a CSS group attached. This causes all the divs of class quote to be rendered as a block quote.

We then have the tag selector. We used one above with the “p” element. This allows us to select all the elements of a particular type. The selector “li” would select all the list items in the DOM. We could use this to make every line italic.

We can combine selectors to limit which elements are selected. “ul>li” would select all line items of unordered(without numbers) list, while “ol>li” would select all line items which were part of an ordered (with numbers) list.

These selectors can even allow us to move through the DOM in a structured way. We can ask for the first paragraph after a header for special treatment.

DOM Manipulation

When we load JavaScript on a web page, that JavaScript can watch for events on elements. This is done by locating an element with a selector, then watching for a particular event to take place on that element.

The JavaScript can then modify the DOM. This can be by changing the structure of the DOM, or it can be modifying the style of elements in the DOM.

A recent example of this, I added a class to some table data items (td). I did it with a class. I then found all the elements with that class and watched for a mouse click on those elements.

When the click was detected, my JavaScript ran. The JavaScript grabbed the contents of the element, stripped out formatting, then put that content into a text input box, displayed the text input box for the user to edit.

When the user completed their edit, the value they entered was formatted, the input was removed from the DOM. The formatted value was then placed back in the element.

All with a bit of good selection to make it work.

Finally, Selenium uses different types of selectors to find elements for manipulation or testing.

Very powerful stuff.