The Database Of The Time Lords

Time zones have been a necessity since humans could travel faster than a horse, but with computers, interconnected over a vast hive of information, a larger problem has emerged. How do you keep track of time zones? Moreover, how do you keep track of time zones throughout history?

Quick question. If it’s noon in Boston, what time is it in Phoenix? Well, Boston is in the Eastern time zone, there’s the Central time zone, and Phoenix is in the Mountain time zone; noon, eleven, ten. If it’s noon in Boston, it’s ten o’clock AM in Phoenix. Here’s a slightly harder question: if it’s noon in Boston, what time is it in Phoenix during Daylight Savings Time? Most of Arizona doesn’t observe Daylight Savings Time, so if it’s noon in Boston, it’s 9 AM in Phoenix. What about the Navajo Nation in the northwestern part of Arizona? Here, Daylight Savings Time is observed. You can’t even make a rule that all of Arizona is always on Mountain Standard Time.

Indiana is another example of bizarre time zones. For most of the 20th century, Indiana was firmly in the Central time zone. Starting in the 1960s, the line between Eastern and Central time slowly moved west from the Ohio border. Some countries opted not to observe Daylight Savings Time. In 2006, the entire state started to observe DST, but the northwest and southwest corners of the state remained firmly in the Central time zone. The odd geographic boundaries of time zones aren’t limited to the United States, either; Broken Hill, New South Wales, Australia is thirty minutes behind the rest of New South Wales.

Working out reliable answers to all of these questions is the domain of the Time Zone Database, a catalog of every time zone, time zone change, and every strange time-related political argument. It records Alaska’s transition from the Julian to the Gregorian calendar. It describes an argument in a small Michigan town in 1900. It’s used in Java, nearly every kind of Linux, hundreds of software packages, and at least a dozen of the servers and routers you’re using to read this right now.

Continue reading “The Database Of The Time Lords”

Turn Command Lines Into Web Apps

Even if you like using a graphical user interface, you can probably agree that writing a graphical program is usually harder than writing an old-fashioned text-based program. Putting that GUI into an online format means even more to think about. [Adam Kewley] has the answer to that problem: Jobson. As you can see in the video below, the program is a web server that runs command line programs as jobs.

Simply write a YAML file to describe the program’s inputs and outputs and Jobson will create input fields for arguments and display the output in a web page. Any files the program creates are available to download. Basically any command line program can be quickly and easily pulled into one web interface to rule them.

If a program takes a long time to run, Jobson will let you switch away and then later resume looking at the output. You can also abort a job or look at the arguments it received. Jobson can also authenticate users with several different methods to prevent just anyone from executing jobs.

If you really want to write a graphical program, try QTCreator. Or, you can get a shell in a web browser if you want to go that route. But this is the smoothest method we’ve seen for gathering command line programs into one place for monitoring and control. Neat!

Continue reading “Turn Command Lines Into Web Apps”

IoT Garage Door Opener From Scrap

[Hans Nielsen] has a couple roommates, and his garage has become a catch-all for various items. And like any good hacker’s garage, it boasts an IoT controlled garage door opener. It had a problem though, it used a Particle Photon – a popular IoT board that required internet access and a web server to operate. So [Hans] raided his roommate’s spare parts bin and set-forth to rebuild it!

One of his main goals was to make something that did not require internet access to operate. Anyone connected to the local WiFi should be able to open and close the door via a web interface, and he would give our good friend [Linus Torvalds] a call to make it happen. The key component in the build is the C.H.I.P SBC that made the news a while back for being ridiculously cheap.

Be sure to check out [Han’s] blog if you’re at all interested in working with the C.H.I.P. He does a fantastic job of documenting the ins and outs of getting a project like this working.

Linux Fu: System Administration Made Easier

Linux can have a somewhat split personality. If you use it as a desktop OS, it has a lot of GUI tools, although sometimes you still need to access the command line. If you use it as a headless server, though, you probably ought to know your way around the command line pretty well. This is especially true if you don’t want to litter up your hard drive (and CPU) with X servers and other peculiarities of the graphical user interface.

Personally, I like the command line, but I am realistic enough to know that not everyone shares that feeling. I’ll also admit that for some tasks — especially those you don’t do very often — it is nice to have some helpful buttons and menus. There are several administration tools that you might be interested in using to handle administration tasks on your Linux machines. I’m going to look at two of them you might want to experiment with that both use a Web browser to provide their interface.

Continue reading “Linux Fu: System Administration Made Easier”

What Is Entropy And How Do I Get More Of It?

Let’s start off with one of my favorite quotes from John von Neumann: “Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such thing as a random number — there are only methods to produce random numbers, and a strict arithmetic procedure of course is not such a method.”

What von Neumann is getting at is that the “pseudo” in pseudorandom number generator (PRNG) is really a synonym for “not at all”. Granted, if you come in the middle of a good PRNG sequence, guessing the next number is nearly impossible. But if you know, or can guess, the seed that started the PRNG off, you know all past and future values nearly instantly; it’s a purely deterministic mathematical function. This shouldn’t be taken as a rant against PRNGs, but merely as a reminder that when you use one, the un-guessability of the numbers that it spits out is only as un-guessable as the seed. And while “un-guessability” isn’t a well-defined mathematical concept, or even a real word, entropy is.

That’s why entropy matters to you. Almost anything that your computer wants to keep secret will require the generation of a secret random number at some point, and any series of “random” numbers that a computer generates will have only as much entropy, and thus un-guessability, as the seed used. So how does a computer, a deterministic machine, harvest entropy for that seed in the first place? And how can you make sure you’ve got enough? And did you know that your Raspberry Pi can be turned into a heavy-duty source of entropy? Read on!

Continue reading “What Is Entropy And How Do I Get More Of It?”

10 Year Old Bug Crushed By Hacker On A Mission

PCI pass through is the ability of a virtualized guest system to directly access PCI hardware. Pass through for dedicated GPUs has just recently been added to the Linux kernel-based virtual machine. Soon afterward, users began to find that switching on nested page tables (NPT), a technology intended to provide hardware acceleration for virtual machines, had the opposite effect on AMD platforms and slowed frame rate down to a crawl.

Annoyed by this [gnif] set out to to fix the problem. His first step was to run graphics benchmarks to isolate the source of the problem. Having identified the culprit in the GPU, [gnif] began to read up on the involved technology stack. Three days of wrapping his head around technical docs allowed [gnif] to find the single line of code that resulted in a faulty memory set up and to implement a basic fix. He then passed the work on to [Paolo Bonzini] at patchwork.kernel.org, who released a more refined patch.

The bug affecting PCI pass through had been around for ten years and had received little attention from the manufacturer. It gained prominence when graphics cards were affected. In the end it took one very dedicated user three days to fix it, and then another day to roll out a patch for Open Source operating systems. In his notes [gnif] points out how helpful AMDs documentation was. With the right to repair in debate, DRMed technical docs and standards locked behind paywalls, [gnif]’s story is a reminder of the importance of accessible quality documentation.

The Linux FPGA

It was never unusual to have a CPU and an FPGA together. After all, each has different strengths and weaknesses. However, newer devices like the Xilinx Zynq have both a CPU and an FPGA in the same package. That means your design has to span hardware, FPGA configurations, and software. [Mitchell Orsucci] was using a Zynq device on a ArtyZ7-20 board and decided he wanted to use Linux to operate the ARM processor and provide user-space tools to interface with the FPGA and reconfigure it dynamically.

This sounds like a big project and it certainly isn’t trivial by any means. However, the Xilinx tools do a lot of the heavy lifting, including setting up the Linux kernel and a suitable root file system. The bulk of [Mitchell’s] work was in developing user space tools for Linux programs to interact with the FPGA hardware. You can see a short video demo below.

Continue reading “The Linux FPGA”