Gawking Text Files

Some tools in a toolbox are versatile. You can use a screwdriver as a pry bar to open a paint can, for example. I’ve even hammered a tack in with a screwdriver handle even though you probably shouldn’t. But a chainsaw isn’t that versatile. It only cuts. But man does it cut!

aukAWK is a chainsaw for processing text files line-by-line (and the GNU version is known as GAWK). That’s a pretty common case. It is even more common if you produce a text file from a spreadsheet or work with other kinds of text files. AWK has some serious limitations, but so do chainsaws. They are still super useful. Although AWK sounds like a penguin-like bird (see right), that’s an auk. Sounds the same, but spelled differently. AWK is actually an acronym of the original author’s names.

If you know C and you grok regular expressions, then you can learn AWK in about 5 minutes. If you only know C, go read up on regular expressions and come back. Five minutes later you will know AWK. If you are running Linux, you probably already have GAWK installed and can run it using the alias awk. If you are running Windows, you might consider installing Cygwin, although there are pure Windows versions available. If you just want to play in a browser, try webawk.

Continue reading “Gawking Text Files”

Linux: Assembly Required

Sometimes you might need to use assembly sometime to reach your project objectives. Previously I’ve focused more on embedding assembly within gcc or another compiler. But just like some people want to hunt with a bow, or make bread by hand, or do many other things that are no longer absolutely necessary, some people like writing in assembly language.

In the old days of DOS, it was fairly easy to write in assembly language. Good thing, because on the restricted resources available on those machines it might have been the only way to get things to fit. These days, under Windows or Linux or even on a Raspberry Pi, it is hard to get oriented on how to get an assembly language off the ground.

Continue reading “Linux: Assembly Required”

Virtually Free Rapsberry Pis

One of the nice things about the Raspberry Pi is that it runs Linux and you can do a lot of development right on the board. The converse of that is you can do a lot of development on a Linux desktop and then move things over to the Pi once you get the biggest bugs out. However, sometimes you really need to run code on the actual platform.

There is, however, an in-between solution that has the added benefit of upping your skills: emulate a Pi on your desktop. If you use Linux or Windows on your desktop, you can use QEMU to execute Raspberry Pi software virtually. This might be useful if you don’t have a Pi (or, at least, don’t have it with you). Or you just want to leverage your large computer to simplify development. Of course we would be delighted to see you build the Pi equivalent of the Tamagotchi Singularity but that’s a bit beyond the scope of this article.

Since I use Linux, I’m going to focus on that. If you insist on using Windows, you can find a ready-to-go project on Sourceforge. For the most part, you should find the process similar. The method I’ll talk about works on Kubuntu, but should also work on most other Debian-based systems, including Ubuntu.

Continue reading “Virtually Free Rapsberry Pis”

TV Stick Out-Raspberries Raspberry Pi

Android-based TV sticks should be in more projects. They are readily available and inexpensive. They have a lot of horsepower for the price, and they can even boot a mainline Linux kernel, unlike some single-board computers we know. They’re smaller than the Pi Zero, so they’ll fit almost anywhere.

The one thing they don’t have, though, is I/O. Sure, it’s got a USB port, but that’s just about it. [Necromant] considered these problems and created a carrier board that fixes all that.

  • On-board 3A DC-DC. You can power the whole thing with anything from 7 to 24 volts DC
  • A 4-Port USB hub
  • An ATtiny 2313, connected to the hub via the V-USB stack
  • 2 USB ports on the back, with power control via GPIO lines
  • One USB port on the front (with power always on)
  • 3 relays
  • Fits a common anodized aluminum enclosure

The ATtiny code is on GitHub and allows for full I/O control, saving the state of the pins in EEPROM, and providing up to eight channels of servo control. The device connects through the USB port (consuming one port on the hub).

Repurposing consumer gear for embedded service is nothing new. We’ve seen it with phones. We’ve even seen remotes used as a mouse. But this is such a nice template for adding cheap and easy computing power to your projects that we’re surprised we don’t see it more often. Why aren’t you hacking a TV stick into your projects?

Hackaday Links: April 24, 2016

TruckThe Internet Archive has a truck. Why? Because you should never underestimate the bandwidth of a truck filled with old manuals, books, audio recordings, films, and everything else the Internet Archive digitizes and hosts online. This truck also looks really, really badass. A good thing, too, because it was recently stolen. [Jason Scott] got the word out on Twitter and eagle-eyed spotters saw it driving to Bakersfield. The truck of awesome was recovered, and all is right with the world. The lesson we learned from all of this? Steal normal cars. Wait. Don’t steal cars, but if you do, steal normal cars.

In a completely unrelated note, does anyone know where to get a 99-01 Chevy Astro / GMC Safari cargo van with AWD, preferably with minimal rust?

[Star Simpson] is almost famous around these parts. She’s responsible for the TacoCopter among other such interesting endeavours. Now she’s working on a classic. [Forrest Mims]’ circuits, making the notebook version real. These Circuit Classics take the circuits found in [Forrest Mims]’ series of notebook workbooks, print them on FR4, and add a real, solderable implementation alongside.

Everyone needs more cheap Linux ARM boards, so here’s the Robin Core. It’s $15, has WiFi, and does 720p encoding. Weird, huh? It’s the same chip from an IP webcam. Oooohhhh. Now it makes sense.

Adafruit has some mechanical keyboard dorks on staff. [ladyada] famously uses a Dell AT101 with Alps Bigfoot switches, but she and [Collin Cunningham] spent three-quarters of an hour dorking out on mechanical keyboards. A music video was the result. Included in the video: vintage Alps on a NeXT keyboard and an Optimus Mini Three OLED keyboard.

A new Raspberry Pi! Get overenthusiastic hype! The Raspberry Pi Model A+ got an upgrade recently. It now has 512MB of RAM

We saw this delta 3D printer a month ago at the Midwest RepRap festival in Indiana. Now it’s a Kickstarter. Very big, and fairly cheap.

The Rigol DS1054Zed is one of the best oscilloscopes you can buy for the price. It’s also sort of loud. Here’s how you replace the fan to make it quieter.

Here’s some Crowdfunding drama for you. This project aims to bring the Commodore 64 back, in both a ‘home computer’ format and a portable gaming console. It’s not an FPGA implementation – it’s an ARM single board computer that also has support for, “multiple SIDs for stereo sound (6581 or 8580).” God only knows where they’re sourcing them from. Some tech journos complained that it’s, “just a Raspberry Pi running an emulator,” which it is not – apparently it’s a custom ARM board with a few sockets for SIDs, carts, and disk drives. I’ll be watching this one with interest.

This Teddy Bear Steals Your Ubuntu Secrets

Ubuntu just came out with the new long-term support version of their desktop Linux operating system. It’s got a few newish features, including incorporating the “snap” package management format. One of the claims about “snaps” is that they’re more secure — being installed read-only and essentially self-contained makes them harder to hack across applications. In principle.

[mjg59] took issue with their claims of increased cross-application security. And rather than just moan, he patched together an exploit that’s disguised as a lovable teddy bear. The central flaw is something like twenty years old now; X11 has no sense of permissions and any X11 application can listen in on the keyboard and mouse at any time, regardless of which application the user thinks they’re providing input to. This makes writing keylogging and command-insertion trojans effortless, which is just what [mjg59] did. You can download a harmless version of the demo at [mjg59]’s GitHub.

This flaw in X11 is well-known. In some sense, there’s nothing new here. It’s only in light of Ubuntu’s claim of cross-application security that it’s interesting to bring this up again.

xeyes

And the teddy bear in question? Xteddy dates back from when it was cool to display a static image in a window on a workstation computer. It’s like a warmer, cuddlier version of Xeyes. Except it just sits there. Or, in [mjg59]’s version, it records your keystrokes and uploads your passwords to shady underground characters or TLAs.

We discussed Snappy Core for IoT devices previously, and we think it’s a step in the right direction towards building a system where all the moving parts are only loosely connected to each other, which makes upgrading part of your system possible without upgrading (or downgrading) the whole thing. It probably does enhance security when coupled with a newer display manager like Mir or Wayland. But as [mjg59] pointed out, “snaps” alone don’t patch up X11’s security holes.

Pine64: The Un-Review

Even before the announcement and introduction of the Raspberry Pi 3, word of a few very powerful single board ARM Linux computers was flowing out of China. The hardware was there – powerful 64-bit ARM chips were available, all that was needed was a few engineers to put these chips on a board, a few marketing people, and a contract manufacturer.

One of the first of these 64-bit boards is the Pine64. Introduced to the world through a Kickstarter that netted $1.7 Million USD from 36,000 backers, the Pine64 is already extremely popular. The boards are beginning to land on the doorsteps and mailboxes of backers, and the initial impressions are showing up in the official forums and Kickstarter campaign comments.

I pledged $15 USD to the Pine64 Kickstarter, and received a board with 512MB of RAM, 4K HDMI, 10/100 Ethernet and a 1.2 GHz ARM Cortex A53 CPU in return. This post is not a review, as I can’t fully document the Pine64 experience. My initial impression? This is bad. This is pretty bad.

Continue reading “Pine64: The Un-Review”