A black and white image of the Sun and Earth with a series of lines radiating out from the sun and bisecting rings circumscribed around it. On the Earth are three dots with the text "Active Server" on one exposed to the Sun and two dots representing "Inactive Server"s on the dark side.

Solar Protocol Envisions A Solar-Powered Web

The transition to low carbon energy is an important part of mitigating climate change, and the faster we can manage, the better. One project looking at how we could reduce the energy requirements of the web to more quickly adopt renewable energy is Solar Protocol.

Instead of routing requests to the fastest server when a user pulls up a website, Solar Protocol routes the request to the server currently generating the greatest amount of solar power. Once a user is on a website, the experience is energy-responsive. Website style and image resolution can range based on the power left in the active server’s batteries, including an image free low power mode.

Another benefit to the project’s energy efficiency approach is a focus on only the essential parts of a page and not any of the tracking or other privacy-endangering superfluous features present on many other websites. They go into much more depth in the Solar Protocol Manifesto. As a community project, Solar Protocol is still looking for more stewards since the network can go down if an insufficient number of servers are generating electricity.

For more details on the project that inspired Solar Protocol, check out this low-tech website.

Creating Your Alarm On The Fly

We suspect that most of us who use an alarm clock have our particular sound memorized. Common choices are annoying beeping, energetic marimbas, or what used to be your favorite song (which you have now come to despise). [Adam Kumpf] wanted a more pleasant alarm clock and came up with WakeSlow, an alarm clock audio stream, which is a spiritual successor to an earlier project he did called Warmly.

Some might say, “an audio stream? You could create an acceptable alarm tone generator with a 555 and a 2N2222”. The idea behind WakeSlow is to use your existing internet-connected alarm clock that can play an audio stream. You generate a URL using WakeSlow, and it plays the alarm. A custom URL is helpful since it incorporates weather data, letting you know if it’s going to rain, blowing wind, or be sunny that day. It mixes CC0 audio to form the stream, and includes a 5-minute fade to wake you up gradually. After five minutes, it’s jazz time, and it plays a sample of some CC0 jazz.

The code is super simple, and he makes it available on his website under a public domain/CC0 license. The simplicity offers something powerful, making it exactly how you like it. You could incorporate holiday information, a text-to-speech news announcer reading the news of what’s on your calendar that day, or anything you can dream of.

Hackers are generally particular about clocks, and alarm clocks fall under the same umbrella. WakeSlow allows you to skip the hardware part of making your customized alarm, but if you prefer to have the whole thing be custom, we have a few suggestions for alarms to look at.

Does PHP Have A Future, Or Are Twenty Five Years Enough?

In June, 1995, Rasmus Lerdorf made an announcement on a Usenet group. You can still read it.

Today, twenty five years on, PHP is about as ubiquitous as it could possibly have become. I’d be willing to bet that for the majority of readers of this article, their first forays into web programming involved PHP.

Announcing the Personal Home Page Tools (PHP Tools) version 1.0.

These tools are a set of small tight cgi binaries written in C.

But no matter what rich history and wide userbase PHP holds, that’s no justification for its use in a landscape that is rapidly evolving. Whilst PHP will inevitably be around for years to come in existing applications, does it have a future in new sites?

Continue reading “Does PHP Have A Future, Or Are Twenty Five Years Enough?”

Building A Low-Tech Website For Energy Efficiency

In an age of flashy jQuery scripts and bulky JavaScript front-end frameworks, loading a “lite” website is like a breath of fresh air. When most of us think of lightweight sites, though, our mind goes to old-style pure HTML and CSS sites or the intentionally barebones websites of developers and academics. Low-tech Magazine, an intentionally low-tech and solar-powered website, manages to incorporate both modern web aesthetics and low-tech efficiency in one go.

Rather than hosting the site on data centers – even those running on renewable power sources – they have a self-hosted site that is run on solar power, causing the site to occasionally go off-line. Their model contrasts with the cloud computing model, which allows more energy efficiency at the user-side while increasing energy expense at data centers. Each page on the blog declares the page size, with an average page weight of 0.77 MB, less than half of the average page size of the top 500,000 most popular blogs in June 2018.

Some of the major choices that have limited the size of the website include building a static site as opposed to a dynamic site, “dithering” images, sparing a logo, staying with default typefaces, and eliminating all third-party tracking, advertising services, and cookies. Their GitHub repository details the front-end decisions  including using unicode characters for the site’s logo rather than embedding an SVG. While the latter may be scalable and lightweight in format it requires distribution to the end-user, which can involve a zipped package with eps, ai, png, and jpeg files in order to ensure the user is able to load the image.

As for the image dithering, the technique allows the website to maintain its characteristic appearance while still minimizing image quality and size. Luckily for Low-tech Magazine, the theme of the magazine allows for black and white images, suitable for dithering. Image sprites are also helpful for minimizing server requests by combining multiple small images into one. Storage-wise, the combined image will take up less memory and only load once.

There are also a few extraneous features that emphasize the website’s infrastructure. The background color indicates the capacity of the solar-charged battery for the website’s server, while other stats about the server’s location (time, sky conditions, forecast) also help with making the website availability in the near future more visible. Who knows, with the greater conscience on environmental impact, this may be a new trend in web design.

Web Development: What’s Big In 2019?

I try to keep up with web development trends but it’s hard to keep pace since it’s such a fast evolving field. Barely a week goes by without the release of a new JS framework, elaborate build tool or testing suite — all of them touted as the one to learn. Sorting the hype from the genuinely useful is no mean feat, so my aim in this article is to summarise some of the most interesting happenings that web development saw in the last year, and what trends we expect to see more of in 2019.

A technology or framework doesn’t have to be brand new to be on our list here, it just needs to be growing rapidly or evolving in an interesting way. Let’s take a look!

Continue reading “Web Development: What’s Big In 2019?”

Framed Raspberry Pi Keeps Tabs On Spotify

Perhaps you’ve noticed, but we here at Hackaday have a slight obsession with the over-engineered. One could fairly say there’s a linear relationship between how likely we are to feature a project and how needlessly complex it is. That said, it isn’t as if we are unable to appreciate a minimalist approach. Taking the scenic route can be a lot of fun, but sometimes it’s nice to just get where you’re going before you run out of gas.

This very slick Spotify “Now Playing” display created by [Jon Ashcroft] is a perfect example of that principle. The hardware is so straightforward that it’s barely worth mentioning: a Raspberry Pi with a small HDMI display, tucked neatly into a photo frame. Nothing to get too excited about there. The real hook with this particular project is the software.

[Jon] is a web developer by trade, so it’s natural he would approach his personal projects with that same mentality. Rather than one of the “usual suspects” for a Pi project like Python, he wrote his software in ES6; which the Pi is running through Chromium in kiosk mode (full screen web content, no top bar). For those of you who aren’t keeping up on web languages, ES6 is short for EcmaScript 6: a new version of the standard on which JavaScript is based. It’s a bit heavier on resources than is strictly necessary, but it works well enough in the end.

Using Spotify’s excellent API, his software pulls down the current track information and stores it locally. It does this every ~4 seconds, checking to see if the track has changed. [Jon] isn’t thrilled with this brute force method, but it works for now. It displays the current playing song and artist, and uses a library called node-vibrant to extract a dominant color from the album art and use that to create a complementary background color. Very slick.

[Jon] provides all of his source code and made it easy to connect to your own Spotify account, so don’t be surprised if you see this running on a “Magic Mirror” near you soon.

FORTRAN For The Web

There’s an old saying: “I don’t know what programming language scientists and engineers will use in the 22nd century, but I know it will be called FORTRAN.” FORTRAN was among the first real programming languages and, along with LISP, one of the oldest still in common use. If you are one of those that still loves FORTRAN, you no longer have to be left out of the Web development craze thanks to Fortran.io.

Naturally, the Fortran.io site is served by — what else — FORTRAN. The system allows for Jade templates, SQLite databases, and other features aimed at serving up web pages. The code is hosted on GitHub, and you can find several examples there, as well.

If you’ve ever wanted to do formatted I/O to a web page, here’s your chance. Come to think of it, why not? We’ve seen servers in BASIC and even in Linux shell script. Of course, today’s FORTRAN isn’t the one we learned back in the 1970’s (we assume if you didn’t learn about FORTRAN in the 1970’s, you quit reading this post a while back… prove us wrong and show us your FORTRAN projects).