oh whoops forgot to #LynneTeachesTech
forgot to tag this! #LynneTeachesTech

View this post with its original formatting and images here: https://bune.city/2019/05/lynne-teaches-tech-protocols-and-formats/

This question was originally submitted via the survey.

This question, like our last reader-submitted question, is in three parts:

What exactly is a protocol?
What exactly is a format?
Can you give a short rundown of how standardisation in IT works?

I’ll answer them from top to bottom.

=== Protocols ===

Protocols are used to facilitate communication between computers. You need rules for what things mean and how to behave, otherwise your computer won’t know what to do with all the data it’s receiving.

For the sake of the explanation, we’ll create our own fake protocol, ETP: Face Transfer Protocol. You can use this protocol to send an emoji from one networked computer to another.

A proper ETP communication will have two pieces of information: An emoji, and a date the emoji was sent. When you connect your ETP client to an ETP server, you might receive this:

Emoji: 🍔
Date: 2019-05-23 10:31:45

Your ETP client can then format this raw data into something more readable.

🍔
Received on May 23rd at 10:31 AM from etp://bune.city

This isn’t a very useful protocol, but it gets the point across: A protocol allows computers to communicate using a predefined set of rules.

The client can treat this ETP data however it wants. It can show just the emoji, or just the date, or maybe it tells your printer to make 100 copies of the emoji. The ETP server doesn’t tell the client what to do with the data, it just sends the data. Your client might even send a response back.

A real world example is HyperText Transfer Protocol, or HTTP. To view this blog post, your computer sent a HTTP request, specifying that you want to view this particular page. The server then sent the page back, including some additional info, such as the size of the response, the encoding (such as text/html), the date it was last modified, and so on. The only information you end up seeing is the content – your web browser handled the rest.

HTTPS works the same way as HTTP in this regard. It’s the same protocol with encryption added, and otherwise behaves the same.

=== Formats ===

Formats are ways to store types of data on a computer. There are formats for documents (.docx, .pdf, .odt…), audio (.mp3, .ogg, .flac…) and so on. Documents are sort of similar to protocols in that they describe data to be interpreted. The main difference is that protocols work over a network, and formats are files. You can transfer files between computers using protocols, but you can’t use a format to transfer a file. You also can’t store a protocol as a file, because protocols are conversational – your computer needs to be able to talk to a HTTP file. You can, however, run a server on your computer to make and respond to HTTP requests.

Let’s invent a simple format, a .face file. A .face file looks like this:

Face file version 1<<<
:)

The first line lets the face file reader know that it’s definitely reading a face file. The second line is the actual face. The first line appears in every single face file, and the second line changes between files. Another example would be:

Face file version 1<<<
:(

Most files are unreadable by us humans. (Okay, so a face file is far from unreadable, but try opening an MP3 in a text editor and you’ll see what I mean.) Because we can’t read this raw data on our own, we need a viewer to interpret them.

Let’s call our face file viewer FacesTime, because I’m uncreative. When you tell FacesTime to open a file, it first checks to make sure the first line is there. If it is, it assumes it’s looking at a genuine face file, and reads on.

It then gets to the second line, which is the data portion. FacesTime takes this previously unreadable :) and converts it into a human readable version, as demonstrated by the highly realistic mockup below.
[A very poorly drawn sketch of FacesTime.FacesTime displaying our .face file.]

Some formats are more flexible than others. Our .face format could be displayed as an emoji, or a drawing, or even a photo. When you have something like an audio file, however, there’s not much room for interpretation. You can change things like contrast and colour balance, but you obviously want the actual sound to remain unchanged. On the other hand, you could have a program that opens the file and displays a visualised version instead of playing the song, or a program that lets you edit the song title and album art without actually playing it. You can do what you want with formats, but most of the time, you just want to display the content of it in a human-readable (or listenable!) way.

A .txt file specifies nothing but the raw text inside it, meaning that you’re free to interpret it however you want. Your viewer can choose the font size, colour, and so on. However, a Word document is a different story. You could, of course, create a Word document viewer that always displayed text as Comic Sans, but then you wouldn’t have a very good document viewer. It’s usually best to just follow the standard, because everyone else is following it, too.

=== How are standards created? ===

Anyone can create a standard. I created two just then: The ETP protocol, and the .face format. I didn’t really define them very well, but I did define them to some extent. Someone could create an ETP server right now with the information provided. However, what actually happens with my standards is beyond my control. Someone could create an ETP server that allows for more than one emoji at a time. A text format could have a standard saying “all text must be displayed as hot pink on neon green”, but nobody actually has to follow that. It’s different if there’s a certification process, however.

To display a DVD Video label, a DVD player must comply with the DVD standard. If it does anything differently (such as playing all the video upside down), it doesn’t get approved, and can’t display the label. Again, there’s nothing stopping you from creating such a player, and if you don’t care about having the DVD Video label applied to your product (or being allowed to call your product a “DVD player”), then you’re good to go.

In the end, standards are just a guideline. Things will typically go badly if you don’t follow them, but you don’t have to, and sometimes you might want to violate them on purpose. An example is our .face format – you might want to violate the standard by including multiple faces. However, any standard .face file viewer wouldn’t be able to understand your modified version, so unless everyone agrees on your standard, then things probably won’t work out too well.

=== Summary ===

A protocol defines a method of communication for two computers to “talk” to each other. A format defines a method for one computer to read and display data. Standards can be created by anyone, and are occasionally enforced.

Thanks for reading!

Emoji: 😀
Date: 2019-05-24 00:45:18 AEST

#LynneTeachesTech

You can view the original post with inline images and better formatting
here:
https://bune.city/2019/05/lynne-teaches-tech-what-is-the-linux-kernel/
You can submit a question to be answered on LTT here:
https://l.bune.city/ltt-survey
This post contains inline links.

Our first survey question! The submitted question asked:

What is the Linux kernel?
Why does apt make me install a new one every month or so?
Why do the old ones stick around and waste space?

We’ll be answering all three of these questions. Let’s start with the
first one.

=== What is the Linux kernel? ===

The kernel is the underlying part of a computer that makes all the low
level stuff work. Things like reading files, managing which programs
are running, and keeping track of memory usage are handled by the
kernel.

Almost every operating system has a kernel – Windows uses the NT
kernel, macOS uses the Darwin kernel, and Linux distributions
(including Android!) use the Linux kernel.

The kernel handles communication between the software running on your
computer and the hardware your computer is made with, so you won’t get
far without it. This also means you can’t swap it out while your
computer’s running, so if you update the kernel using apt (or
otherwise), you’ll need to restart afterwards, even if the computer
doesn’t tell you to (or force you to).

Note: There are methods of replacing the Linux kernel while the system
is still running, but that is beyond the scope of this post.

When the kernel encounters a critical failure that it can’t recover
from, your computer will stop working. On Windows computers, this is
known as a stop error, and when a stop error occurs, Windows will
display… [Image 1: A Blue Screen of Death!]

This happens (much less frequently) on Linux systems too, with a much
less visually appealing (although more informative, if you’re able t
o understand what it’s talking about) error screen.
[Image 2: A kernel panic on a very old version of Ubuntu. They still
look like this, though! Jpangamarca [CC BY 3.0], via Wikimedia Commons]

So now we know what a kernel is and does – it’s a piece of software
that allows other software to communicate with your computer’s
hardware, and it’s critical to everything working.

=== Why do I need to update the kernel so often? ===

This is because the Linux kernel is updated very often. As of the time
of writing, the latest kernel version is 5.x. You can see a list of
update logs here
notice how short the times between each changelog are.

Most Linux distributions (including Ubuntu) won’t receive every single
one of these versions. There’s so many of them, and many only introduce
minor changes. Additionally, the Ubuntu developers need to make sure
that everything works properly with the new kernel version, so it won’t
be available right away.

You can check the Linux kernel you’re running with the command uname
-r, and you can check the latest version at kernel.org.

This doesn’t answer why the kernel is updated so frequently, though.

This is because there are many, many changes made to the Linux kernel every single day, by a wide range of
contributors across the world. Not every single update gets its own
version number, though. With the high frequency of changes made, there
are understandably many updates released in a month. Every now and
then, the Ubuntu developers will pick one of these versions, work on
testing it to ensure it’s compatible with the rest of Ubuntu, and then
release it for you to download.

=== Why do the old versions stick around? ===

This requires a more in-depth explanation of how your system handles
kernel updates. I’ll be talking about Ubuntu specifically here, but
almost all of this applies to other Debian-based distributions too.

Even with the testing done by Ubuntu, it’s impossible to know that a
new kernel release will work with every single Ubuntu user on Earth. To
make sure you still have a working computer at the end of the day,
Ubuntu will keep the previous version of the kernel installed. If you
restart, and the new kernel doesn’t work properly, you can switch back
to the old kernel to have a working PC.

The Ubuntu developers tend to keep older versions of the kernel around
as separate packages. When your computer tries to install the Linux
kernel image (linux-image-generic), apt will tell it which particular
version it needs to install. [Image 3: Ubuntu Bionic’s linux-image-
generic package currently depends on the linux-image-4.15.0-50-generic
package.]

This means that you only ever have to install linux-image-generic and
the system will automatically install the correct kernel version for
you.

You can see how many kernel versions Ubuntu Bionic currently has
available by checking this page.

apt will never remove a package without your permission. If a package
is no longer required, you need to remove it manually by running sudo
apt autoremove. This will clean up any packages that aren’t currently
in use, including older Linux kernels.

You’ll notice that uname -r will give you the same result before and
after updating the kernel. Even though the new kernel update was
installed, it’s not active yet. You need to restart your computer to
start using the new kernel version.

So, in short: to get rid of those old, unused kernel versions, try
rebooting (to make sure you’re running the latest kernel), then run
sudo apt autoremove.

=== Summary ===

The Linux kernel is a critical piece of your computer’s software.
Without it, nothing will work, and if it crashes, the whole system
comes down with it. It can’t be updated without a reboot. New versions
are frequently releases, and the Ubuntu team tests and releases a new
version once every month or so. Ubuntu keeps old versions around for
various reasons, but you can get rid of the ones you aren’t using
fairly easily.

#LynneTeachesTech

want to submit your own #LynneTeachesTech question(s)? there's now a simple little survey form for doing just that!

bear in mind that LTT questions should be more like "how does thing work" or "why does thing do X" and not "why does microsoft do this" or "how do i change the wallpaper on android".

here's the survey: https://l.bune.city/ltt-survey

feel free to submit multiple questions! 

View the post with its original formatting here: https://bune.city/2019/05/lynne-teaches-tech-dark-mode/

It depends!

Right now, there are two common types of consumer-oriented display technologies: LCD, and OLED (including AMOLED). LCD screens won’t save any battery life by using dark themes, while OLED ones do.

=== LCD ===

Consumer electronics with LCD displays use LED backlights to give the image brightness. You may sometimes see LCD displays referred to as “LED-LCD”, or (mistakenly) “LED”. The LED provides the backlight, while the LCD displays the picture. It’s possible to have an LCD display without a backlight (the Gameboy and Gameboy Colour had one), but uncommon.

The LED backlight provides brightness to the whole LCD display at once. To light up even one pixel, the whole display needs to be lit up. There’s no way to have only some areas bright and others dark, it’s all or nothing. Issues like backlight bleeding are inherent to this approach, and “true black” can never be displayed, as the display is always emitting light. [Image 1: An example of backlight bleeding (light “leaking” from the edges of the screen). Image source in blog post.]

Colour is irrelevant to power saving on an LCD display. The only thing that helps is turning down the brightness. Displaying black at full brightness uses much more power than displaying white at low brightness, even though the white screen would provide much more light. The LCD filters out the blacklight to provide black, but the backlight’s still on.

However, LCD displays tend to be more power efficient when displaying bright images than OLED displays. As soon as you start turning down the brightness, though, OLED quickly pulls ahead.

=== OLED ===

OLED displays don’t have backlights. Every pixel is individually lit, so making half the screen black would use (about) half the power. Because of this, dark themes really do save power on OLED displays. Darker colours mean less power usage, and i a pixel is completely black (pure black, no light at all), it will turn off. A dark theme with a pure black background saves much, much more power than a dark grey background, because it allows the pixels to turn off entirely.

There’s a downside to this, however – the pixels can’t be turned on instantly. If you’re scrolling quickly down a page with a pure black background on an OLED device, you might notice subtle “smears” caused by the pixels taking some time to turn on. This effect is hard to notice in most cases, but is still something to consider.

The colour can also affect the battery usage. Google gave a real world example of battery usage with various colours on their 2016 Pixel phone: [Image 2:
Blue uses much more power than red or green, and white uses the most.]

=== Summary ===

Dark themes don’t make a difference to power consumption on an LCD display, although you may find them easier on the eyes. While LCD displays light up the entire display at once with a backlight, OLED displays can set the brightness individually for each pixel, meaning that mostly black images use less power.

#LynneTeachesTech

Original post: https://bune.city/2019/05/lynne-teaches-tech-windows-restarts/

***

There are many different system files that Windows needs in order to function. These files are often updated using Windows Update to add new features, fix bugs, patch security issues, and more.

Windows is unable to replace these files while they’re in use. This is for numerous reasons, both technical and practical.

If an update specifies that file X needs to be replaced, and file X is being used by a critical system process, then we have an issue. Closing the critical process would cause Windows to stop working, which is obviously unacceptable behaviour. There’s no way to switch the old version of file X with the new one while the critical process is running, but Windows needs that process.

The only way to safely stop the critical process is to restart Windows. Updated can either be applied before or after you restart. Windows will ensure that the critical process isn’t running yet, replace file X, and then start up normally. Windows can’t start up properly until the new version of file X is in place, so you can’t use Windows while it’s updating.

Not all updates require a restart. Windows Vista introduced a feature that allows system files to be replaced while the system is running under certain conditions. If an update replaces a non-critical file, or a file your computer isn’t using, it’s not necessary to restart.

Unix-based systems like macOS and Linux don’t need to reboot as often, due to the way they handle loading files. In short, Unix systems load critical files in memory and don’t depend on the version on the hard drive, while Windows depends on the files on the hard drive staying the same. If a critical file on Linux needs to be updated, the system will simply swap the old version with the new one while running. Currently running processes will use the old version, but new processes will use the new file. Replacing certain files still requires rebooting. This does, however, pose a security risk, and rebooting to ensure the new files are loaded is still recommended, even if it’s not technically required.

#LynneTeachesTech

View the original post with better formatting and embedded images here: https://bune.city/2019/05/lynne-teaches-tech-usb/

***

Describing something like an Ethernet port is easy. You have one number to worry about: the speed rating. 100Mbps, 1Gbps, 10Gbps… It’s very simple.

USB, on the other hand, has two defining attributes: the type, and the version. Calling a USB port “USB 3.1” or “USB-C” doesn’t tell you the whole story.

Note: I’ll be using the term “port” to mean “bus” at times throughout this post for simplicity’s sake.

=== The letters ===

At first, there really was only one USB port type.
When people describe a port as a “USB port” without any additional info, they’re talking about this one. USB-A ports can be found everywhere, and are (as of writing) still more common than USB-C.

If this is USB-A, and we’re up to USB-C, then where’s USB-B? You might have used one without knowing.
USB-B ports are often referred to as “printer cables”, as they are most commonly used on printers.
A more commonly seen port is USB Micro-B, which was used on most Android smartphones, before manufacturers adopted USB-C.
There are many more varieties of USB, such as USB Mini-A, USB SuperSpeed B, and, of course, USB-C.
A USB-C port.

===The numbers===

USB 1.0 offered transfer rates of up to 1.5 Mbits per second, and future versions improved upon that speed. A USB 3.0 port can (theoretically) reach speeds of up to 5 Gbits/s. A USB-C port can implement USB 3.0 or later, which is where the issue lies.

Describing a given port as USB-C doesn’t tell you the speed it operates at, and describing a port as USB 3.1 doesn’t tell you what type it is. The original USB port with the lowest version – the original port that debuted in ’96 – is not just a USB port, it’s a USB-A 1.0 port.

===To make matters worse===

Thunderbolt 3 is a standard that uses the USB-C port. It allows for (among other things) communicating with an external GPU and connecting external displays. Thus, when describing a USB-C port, it is also pertinent to note whether or not it has Thunderbolt support. This doesn’t apply to non-C ports (yet!).
Recap

The letter (USB-A, USB-C) refers to the type of connector. You cannot mix and match types (a USB-C device will not connect to a USB-B port).

The number (USB 3.1, USB 2.0) refers to the version number. You can usually mix and match version numbers, but you may encounter reduced performance or functionality.

Thunderbolt is an optional extension for USB-C ports. A Thunderbolt device cannot work with a non-Thunderbolt port, but a non-Thunderbolt device will work with a Thunderbolt port.

There’s more that I didn’t go into in this post, but if I wanted to describe the ins and outs of every USB specification, we’d be here forever! 

Some of the images used in this article were created by Wikipedia user Fred the Oyster, under the CC-BY-SA 4.0 license.

#LynneTeachesTech

i'll be posting future #LynneTeachesTech posts on https://bune.city, but i'll still crosspost them here. be aware that the versions copied here will lose some formatting, such as hyperlinks and in-text images.
Bune City Blog

A blog about software and more.

Bune City Blog

View the original post here: https://bune.city/2019/05/lynne-teaches-tech-firefox-addon-bug/

Mozilla, the company behind Firefox, have implemented a number of security checks in their browser related to extensions. One such check is a digital certificate that all add-ons must be signed with. This certificate is like a HTTPS certificate – the thing that gives you a green padlock in your browser’s URL bar.

You’ve probably seen a HTTPS error before. This happens when a site’s certificate is invalid for one reason or another. One such reason is that the certificate has expired.

HTTPS certificates are only valid for a certain amount of time. When that time runs out, they need to be renewed. This is done to ensure that the person with the certificate is still running the website, and is still interested in keeping the certificate.

When a certificate expires, your browser will refuse to connect to the website. A similar issue happened with Firefox – their own add-on signing certificate expired on the 4th of May, 00:09 UTC, causing everyone’s add-ons to be disabled after that timed passed.

One would think that Firefox wouldn’t disable an addon that had been signed with a certificate while it was still valid, but apparently they didn’t do that. Even so, this could have been avoided if anybody had remembered to renew the certificate, which nobody did. This is a particularly embarrassing issue for Firefox, especially considering both how easily it could have been avoided and the fact that it really shouldn’t have been possible for this to happen in the first place. It also raises the question: What happens if Mozilla disappears, and people keep using Firefox? Thankfully, there are ways to disable extension signing, which means that you can protect yourself from ever happening again, but note that doing this is a minor security risk.

One could argue that by remotely disabling some of the functionality of your browser, intentionally or not, Mozilla is violating the four essential freedoms, specifically, the right to unlimited use for any purpose.

#LynneTeachesTech