Run Your Own Server For Fun (and Zero Profit)

It seems there’s a service for everything, but sometimes you simply learn more by doing it yourself. If you haven’t enjoyed the somewhat anachronistic pleasures of running your own server and hosting your own darn website, well, today you’re in luck!

Yes, we’re going to take an old computer of some sort and turn it into a web server for hosting all of your projects at home. You could just as easily use a Raspberry Pi –even a Zero W would work — or really anything that’ll run Linux, but be aware that not all computing platforms are created equally as we’ll discuss shortly.

Yes, we’re going to roll our own in this article series. There are a lot of moving parts, so we’re going to have to cover a lot of material. Don’t worry- it’s not incredibly complicated. And you don’t have to do things the way we say. There’s flexibility at every turn, and you’re encouraged to forge your own path. That’s part of the fun!

Note: For the sake of space we’re going to skip over some of the most basic details such as installing Linux and focus on those that have the greatest impact on the project. This article gives a high level overview of what it takes to host your project website at home. It intentionally glosses over the deeper details and makes some necessary assumptions.

Continue reading “Run Your Own Server For Fun (and Zero Profit)”

Review: DevTerm Linux Handheld Has Retro-Future Vibe

It’s not every day that an open-source, portable Linux handheld computer gets announced, so I couldn’t resist placing an order for the DevTerm by ClockworkPi back when we first learned about the stylish little terminal, which includes a 1280 x 480 screen (double-wide VGA) and a modular little thermal printer.

Of course, the global semiconductor shortage combined with shipping slowdowns led to delays, but things did ultimately come together for the project. I’ve always been a sucker for small-format machines, especially ones that come as a well-designed kit, and that means I can tell you all about what it was like to put it together and turn it on. There’s a lot to look at, so let’s get started.

Continue reading “Review: DevTerm Linux Handheld Has Retro-Future Vibe”

Linux Fu: Fusing Hackaday

Unix and, by extension, Linux, has a mantra to make everything possible look like a file. Files, of course, look like files. But also devices, network sockets, and even system information show up as things that appear to be files. There are plenty of advantages to doing that since you can use all the nice tools like grep and find to work with files. However, making your own programs expose a filesystem can be hard. Filesystem code traditionally works at the kernel module level, where mistakes can wipe out lots of things and debugging is difficult. However, there is FUSE — the file system in user space library — that allows you to write more or less ordinary code and expose anything you want as a file system. You’ve probably seen FUSE used to mount, say, remote drives via ssh or Dropbox. We’ve even looked at FUSE before, even for Windows.

What’s missing, naturally, is the Hackaday RSS feed, mountable as a normal file. And that’s what we’re building today.

Writing a FUSE filesystem isn’t that hard, but there are a lot of tedious jobs. You essentially have to provide callbacks that FUSE uses to do things when the operating system asks for them. Open a file, read a file, list a directory, etc. The problem is that for some simple projects, you don’t care about half of these things, but you still have to provide them.

Luckily, there are libraries that can make it a lot easier. I’m going to show you a simple C++ program that can mount your favorite RSS feed (assuming your favorite one is Hackaday, of course) as a file system. Granted, that’s not amazing, but it is kind of neat to be able to grep through the front page stories from the command line or view the last few articles using Dolphin. Continue reading “Linux Fu: Fusing Hackaday”

Turning The PS4 Into A Useful Linux Machine

When the PlayStation 3 first launched, one of its most lauded features was its ability to officially run full Linux distributions. This was of course famously and permanently borked by Sony with a software update after a few years, presumably since the console was priced too low to make a profit and Sony didn’t want to indirectly fund server farms made out of relatively inexpensive hardware. Of course a decision like this to keep Linux off a computer system is only going to embolden Linux users to put it on those same systems, and in that same vein this project turns a more modern Playstation 4 into a Kubernetes cluster with the help of the infamous OS.

The Playstation 4’s hardware is a little dated by modern desktop standards but it is still quite capable as a general-purpose computer provided you know the unofficial, unsupported methods of installing Psxitarch Linux on one. This is a distribution based on Arch and built specifically for the PS4, but to get it to run the docker images that [Zhekun Hu] wanted to use some tinkering with the kernel needed to be done. With some help from the Gentoo community a custom kernel was eventually compiled, and after spending some time in what [Zhekun Hu] describes as “Linux Kernel Options Hell” eventually a working configuration was found.

The current cluster is composed of two PS4s running this custom software and runs a number of services including Nginx, Calico, Prometheus, and Grafana. For those with unused PlayStation 4s laying around this might be an option to put them back to work, but it should also be a cautionary tale about the hassles of configuring a Linux kernel from scratch. It can still be done on almost any machine, though, as we saw recently using a 386 and a floppy disk.

IBM PalmTop Running Modern (Modified) Linux

The handheld computing market might seem dominated by smartphones today, but before their mass adoption there were other offerings for those who needed some computing power on-the-go. If a 90s laptop was too bulky, there was always the IBM PalmTop which packed punch for its size-to-weight ratio, and for the era it was created in. [Mingcong Bai] still has one of these antiques and decided to see if it was still usable by loading a customized Linux distribution on it.

The PalmTop sported modest hardware even for its time with an Intel 486SL running at 33 MHz with 20 MiB of RAM. This one also makes use of a 1 GB CompactFlash card for storage and while [Mingcong Bai] notes that it is possible to run Windows 95 on it, it’s not a particularly great user experience. A Linux distribution customized for antique hardware, AOSC/Retro, helps solve some of these usability issues. With this it’s possible to boot into a command line and even do some limited text-based web browsing as long as the Ethernet adapter is included.

While the computer is running at its maximum capacity just to boot and perform basic system functions, it’s admirable that an antique computer such as this still works, especially given its small size and limited hardware functionality. If you’re curious about more PalmTop-style computers, take a look at the first one ever produced: the HP-200LX.

Continue reading “IBM PalmTop Running Modern (Modified) Linux”

The Fifteen Dollar Linux Computer

Over the years we’ve seen many small computer boards of various abilities, among them many powerful enough to be almost-useful Linux general purpose computers. We’ve also seen more than a few computers that claimed the impossible, usually an amazing spec for a tiny price tag. Here for once is a small computer that’s neither of those two; a minimum viable Linux handheld terminal whose $15 USD price tag is openly discussed as a target price for a large production run rather than touted as its retail price.

It’s the work of legendary former Hackaday writer [Brian Benchoff], and instead of being merely a PCB it’s a fully usable computer with case, keyboard and display. It’s based upon an Allwinner F1C100s SoC, it’s powered by AAA cells, and it sports a split rubber keyboard that likely builds on his previous experience with the VT-69 portable RS-232 terminal. On the back is a USB port and an SD reader, and in the centre of the front panel lies a 320 x 240 pixel display. It’s important to note that this is not intended to run a GUI, while it’s DOOM-capable it remains very much a command-line Linux tool. Perhaps most interestingly it’s claimed that all the parts are available in quantity here in the chip shortage, so maybe there’s even a chance we might see it as more than a project. We can hope.

Thanks [Sathish Guru V] for the tip.

Linux Fu: Bash Strings

If you are a traditional programmer, using bash for scripting may seem limiting sometimes, but for certain tasks, bash can be very productive. It turns out, some of the limits of bash are really limits of older shells and people code to that to be compatible. Still other perceived issues are because some of the advanced functions in bash are arcane or confusing.

Strings are a good example. You don’t think of bash as a string manipulation language, but it has many powerful ways to handle strings. In fact, it may have too many ways, since the functionality winds up in more than one place. Of course, you can also call out to programs, and sometimes it is just easier to make a call to an awk or Python script to do the heavy lifting.

But let’s stick with bash-isms for handling strings. Obviously, you can put a string in an environment variable and pull it back out. I am going to assume you know how string interpolation and quoting works. In other words, this should make sense:

echo "Your path is $PATH and the current directory is ${PWD}"

The Long and the Short

Suppose you want to know the length of a string. That’s a pretty basic string operation. In bash, you can write ${#var} to find the length of $var:


#/bin/bash
echo -n "Project Name? "
read PNAME
if (( ${#PNAME} > 16 ))
then
   echo Error: Project name longer than 16 characters
else
   echo ${PNAME} it is!
fi

Continue reading “Linux Fu: Bash Strings”