Watch A Web Page Fetch Itself Over TLS, Complete With Commentary

TLS, byte by byte performs an unusual and interesting function: it fetches itself over HTTPS, and provides a complete annotation of what’s going on in the process, one byte at a time. Visit the site and give the button a click to watch it happen, it’s neat!

Transport Layer Security (TLS) is what’s responsible for encrypting traffic over the internet, and it’s normally implemented on top of TCP to encrypt an application-layer protocol like HTTP (resulting in HTTPS and the little padlock icon in browsers indicating a connection with a web site is encrypted.) Back in the day, traffic over the internet was commonly unencrypted, but nowadays no communication or hardware is too humble for encryption and methods are easily accessible.

So for what purpose would someone actually need or use such an implementation of TLS? Well, probably no one actually needs it. But it is a userspace TLS implementation in javascript that may fit a niche for someone, and it certainly provides beautifully-indented and annotated binary data in the process. Sound up your alley? The GitHub repository for the project has all the details, so give it a look.

Here’s How To Build A Tiny Compiler From Scratch

Believe it or not, building a tiny compiler from scratch can be as fun as it is accessible. [James Smith] demonstrates by making a tiny compiler for an extremely simple programming language, and showing off a hello world.

Here’s what happens with a compiler: human-written code gets compiled into low-level machine code, creating a natively-executable result for a particular processor. [James]’ compiler — created from scratch — makes native x64 Linux ELF binary executables with no dependencies, an experience [James] found both educational and enjoyable. The GitHub repository linked below has everything one needs, but [James] also wrote a book, From Source Code to Machine Code, which he offers for sale to anyone who wants to step through the nitty-gritty.

The (very tiny) compiler is on GitHub as The Pretty Laughable Programming Language. It’s tiny, the only data types are integers and pointers, and all it can do is make Linux syscalls — but it’s sufficient to make a program with. Here’s what the code for “Hello world!” looks like before being fed into the compiler:

; the write() syscall:
; ssize_t write(int fd, const void *buf, size_t count);
(syscall 1 1 "Hello world!\n" 13)
0

Working at such a low level can be rewarding, but back in the day the first computers actually relied on humans to be compilers. Operators would work with pencil and paper to convert programs into machine code, and you can get a taste of that with a project that re-creates what it was like to program a computer using just a few buttons as inputs.

Hackaday Links Column Banner

Hackaday Links: April 30, 2023

Cloudy with a chance of concrete? The “success” of last week’s brief but eventful Starship launch has apparently raised some regulatory eyebrows, with the Federal Aviation Administration launching an investigation into the destruction wrought by the mighty rocket. And it’s not just the hapless Dodge Caravan that they’re concerned with — although we found some fantastic POV footage that shows the kill shot as well as close-ups of the results — but also the damage rained down upon residents around the Boca Chica launch complex. Tons of concrete and rebar were excavated by the 33 Raptor engines during the launch and sent in all directions, reportedly landing up to 6 miles (10 kilometers) from the pad. What’s worse, a lot of debris ended up on beaches that are home to endangered species, which has the Sierra Club also taking an interest. The FAA has apparently nixed any launches from the Texas facility until they complete their investigation.

Continue reading “Hackaday Links: April 30, 2023”

Fail Of The Week: Epic 312 Weeks Of Fixing A Broken Project

If a hacker guardian angel exists, then we’re sure he or she was definitely AWOL for six long years from [Aaron Eiche]’s life as he worked on perfecting and making his Christmas Countdown clock. [Aaron] started this binary clock project in 2016, and only managed to make it work as expected in 2022 after a string of failures.

In case you’d like to check out his completed project first, then cut the chase and head over to his Github repository for his final, working version. The hardware is pretty straightforward, and not different from many similar projects that we’ve seen before. A microcontroller drives a set of LED’s to show the time remaining until Christmas Day in binary format. The LEDs show the number of days, hours, minutes and seconds until Christmas and it uses two buttons for adjustments and modes. An RTC section wasn’t included in the first version, but it appeared and disappeared along the six year journey, before finding a spot in the final version.

The value of this project doesn’t lie in the final version, but rather in the lessons other hackers, specially those still in the shallow end of the pool, can learn from [Aaron]’s mistakes. Thankfully, the clock ornament is not very expensive to build, so [Aaron] could persevere in improving it despite his annual facepalm moments.

Continue reading “Fail Of The Week: Epic 312 Weeks Of Fixing A Broken Project”

Binary Watch Rocks A Bare PCB With Pride

Most of us learn to read digital clocks first, which display the time in obvious numbers. Analog clocks are often learned later, with the hands taking our young brains a little longer to figure out. Once you’ve grown into a 1337h4XX0r, though, you’re ready to learn how to read a binary watch. Then you can build your own, just like [taifur] did.

The watch rocks a simplistic, bare bones design with the PCB acting as the body of the device itself. It’s not great for water resistance, or even incidental contact, but it’s a sharp look with the golden traces on display. The heart of the operation is a ATmega328P, as seen in the popular Arduino Uno, and it’s paired with a DS3231M real-time clock module to keep accurate time. 13 SMD LEDs are charged with displaying the time in binary format, with [taifur] choosing to spec a classic red color for the build. The watch is powered via a CR2032 coin cell, which you’re best advised not to swallow. So far, [taifur] has found the watch will last for over a month before the battery is tapped out.

It’s a fun build, and one that looks good when paired with a classic NATO watch strap in green. If, however, you desire a watch that definitely won’t last a month on a single coin cell, you can always build a Nixie watch instead. Video after the break.

Continue reading “Binary Watch Rocks A Bare PCB With Pride”

Simple Binary Watch Uses A PCB Body

There are many ways to tell the time, from using analog dials to 7-segment displays. Hackers tend to enjoy binary watches, if only for their association with the digital machines that seem to make the world turn these days. [Vishal Soni] decided to build one of their own.

It’s a straightforward design, that uses six bits to show the time. A red light is illuminated at the top of the watch to indicate the watch is showing minutes, and these are displayed in binary on the six blue LEDs below. Then, the watch indicates it is showing hours, and again uses the six blue LEDs to show the relevant number. Continue reading “Simple Binary Watch Uses A PCB Body”

DIY “Solid State Drive” Puts Four Bytes In Your Pocket

In a relatively short amount of time, the average capacity of USB flash drives has skyrocketed. It wasn’t so long ago that two and four gigabyte drives were considered to be on the high end, but today you can grab a 512 GB drive for less than $50 USD. In fact they’ve gotten so large that it can feel wasteful using them for some tasks, and we occasionally find ourselves wishing we could find some modern USB drives that didn’t rival the storage capacity of our whole computer.

That said, this USB-C tetrabyte drive created by [Glen Akins] might be slightly too small for our tastes. No, that’s not a typo. As in the Greek tetra, this drive can hold a massive four bytes at a time. Even better, you don’t need a computer to write to it: the 32 DIP switches let you key in the content on the fly, bit-by-bit.

Reading out the first byte from the DIP switches.

As explained in a Twitter thread, [Glen] was inspired to create this gadget after another user posted a picture of a 32 position DIP switch with a caption that said it was a “One Tetrabyte SSD” back in December. He apparently couldn’t track down the same switch, but the four red Grayhill 76 Series switches arguably make it a bit clearer when entering in your bytes.

Each of the individual DIP switches are connected to one of the GPIO pins of the 8-bit EFM8UB2 microcontroller, and the code simply reads the state of each pin in order and saves the binary results in a variable to put together the “file” it presents to the OS when plugged in.

We’ve seen our fair share of unusual USB flash drives in the past, but this one is truly in a league of its own. Can’t say we can think of any four bytes of data important enough to hold on a dedicated piece of hardware, but we certainly appreciate the effort to store it in the most robust way possible.

Thanks to [J. Peterson] for the tip.