Linux Fu: Regular Expressions

If you consider yourself a good cook, you may or may not know how to make a souffle or baklava. But there are certain things you probably do know how to do that form the basis of many recipes. For example, you can probably boil water, crack an egg, and brown meat. With Linux or Unix systems, you can make the same observation. You might not know how to set up a Wayland server or write a kernel module. But there are certain core skills like file manipulation and editing that will serve you no matter what you do. One of the pervasive skills that often gives people trouble is regular expressions. Many programs use these as a way to specify search patterns, usually in text strings such as files.

If you aren’t comfortable with regular expressions, that’s easy to fix. They aren’t that hard to learn and there are some great tools to help you. Many tools use regular expressions and the core syntax is the same. The source of confusion is that the details beyond core syntax have variations.

Let’s look at the foundation you need to understand regular expression well.

Continue reading “Linux Fu: Regular Expressions”

3D Printering: Print Smoothing Tests With UV Resin

Smoothing the layer lines out of filament-based 3D prints is a common desire, and there are various methods for doing it. Besides good old sanding, another method is to apply a liquid coating of some kind that fills in irregularities and creates a smooth surface. There’s even a product specifically for this purpose: XTC-3D by Smooth-on. However, I happened to have access to the syrup-thick UV resin from an SLA printer and it occurred to me to see whether I could smooth a 3D print by brushing the resin on, then curing it. I didn’t see any reason it shouldn’t work, and it might even bring its own advantages. Filament printers and resin-based printers don’t normally have anything to do with one another, but since I had access to both I decided to cross the streams a little.

The UV-curable resin I tested is Clear Standard resin from a Formlabs printer. Other UV resins should work similarly from what I understand, but I haven’t tested them.

Continue reading “3D Printering: Print Smoothing Tests With UV Resin”

Friday Hack Chat: Everything About The ESP

When the ESP-8266 first arrived, it was a marvel. For two dollars, you could buy a simple module that could serve as a bridge between WiFi networks and microcontroller projects. It understood the Hayes command set, it didn’t use much power, and, as noted before, it only cost two dollars. The idea of cheap and accessible Internet of Things things was right there for the taking.

Then hackers figured out what was actually going on inside the ESP-8266. It was a full-blown microcontroller. There was Lua stuff you could put on it. You could program it with the Arduino IDE. It had WiFi. This was the greatest microcontroller release in the last decade, and it came from a company no one had ever heard of.

Since then, the ESP ecosystem has bloomed, and there’s a new ESP on the block. The ESP-32 is an even more powerful WiFi and Bluetooth-enabled chip that’s just as easy to program, and it costs three dollars. Microcontrollers have never been cooler.

For this week’s Hack Chat, we’re going to be talking all about the ESP. Our guest for this Hack Chat should need no introduction, but if you’re unfamiliar, [Sprite_tm] plays video games on his keyboard and has installed Linux on a hard drive. He also works at Espressif, the company behind the ESP-8266 and ESP-32, where he’s applied his skills towards tiny Game Boys and miniature Macs.

During this week’s Hack Chat, we’re going to be covering everything about the ESP, including peripherals, ultra-low power consumption, SIP packages, and what’s coming up for the ESP family. You are, as always, welcome to submit your questions for [Sprite]; just add those as a comment on the Hack Chat page.

join-hack-chat

Our Hack Chats are live community events on the Hackaday.io Hack Chat group messaging. [Sprite]’s in China, so we’re not doing this one at the usual time: This week, the Hack Chat will happen at 7:00 am, Pacific, Friday, March 9th. Want to know what time this is happening in your neck of the woods? Have a countdown timer!

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io.

You don’t have to wait until Friday; join whenever you want and you can see what the community is talking about.

Retrotechtacular: A Very British MagLev

When we look back to the 1970s it is often in a light of somehow a time before technology, a time when analogue was still king, motor vehicles had carburettors, and telephones still had rotary dials.

In fact the decade had a keen sense of being on the threshold of an exciting future, one of supersonic air travel, and holidays in space. Some of the ideas that were mainstream in those heady days didn’t make it as far as the 1980s, but wouldn’t look out of place in 2018.

The unlikely setting for todays Retrotechtacular piece is the Bedford Levels, part of the huge area of reclaimed farmland in the east of England known collectively as the Fens. The Old Bedford River and the New Bedford River are two straight parallel artificial waterways that bisect the lower half of the Fens for over 20 miles, and carry the flood waters of the River Ouse towards the sea. They are several hundred years old, but next to the Old Bedford River at their southern end are a few concrete remains of a much newer structure from 1970. They are all that is left of a bold experiment to create Britain’s first full-sized magnetic levitating train, an experiment which succeeded in its aim and demonstrated its train at 170 miles per hour, but was eventually canceled as part of Government budget cuts.

A track consisting of several miles of concrete beams was constructed during 1970 alongside the Old Bedford River, and on it was placed a single prototype train. There was a hangar with a crane and gantry for removing the vehicle from the track, and a selection of support and maintenance vehicles. There was an electrical pick-up alongside the track from which the train could draw its power, and the track had a low level for the hangar before rising to a higher level for most of its length.

After cancellation the track was fairly swiftly demolished, but the train itself survived. It was first moved to Cranfield University as a technology exhibit, before in more recent years being moved to the Railworld exhibit at Peterborough where it can be viewed by the general public. The dream of a British MagLev wasn’t over, but the 1980s Birmingham Airport shuttle was hardly in the same class even if it does hold the honour of being the world’s first commercial MagLev.

We have two videos for you below the break, the first is a Cambridge Archaeology documentary on the system while the second is a contemporary account of its design and construction from Imperial College. We don’t take high-speed MagLevs on our travels in 2018, but they provide a fascinating glimpse of one possible future in which we might have.

It does make one wonder: will the test tracks for Hyperloop transportation break the mold and find mainstream use or will we find ourselves 50 years from now running a Retrotechtacular on abandoned, vacuum tubes?

Continue reading “Retrotechtacular: A Very British MagLev”

Controlling OctoPrint On The Go

Not too long ago I took the plunge into the world of OctoPrint by shoehorning a Raspberry Pi Zero into a PrintrBot Play, and I have to say, the results were quite impressive. OctoPrint allows you to run your 3D printer untethered from your computer, but without all the downsides of printing off of an SD card. Generally running off of a Raspberry Pi, OctoPrint serves up a very capable web interface that gives you full control over slicing and printing from essentially any device with a modern browser.

That’s all well and good if you’ve got your laptop with you, or you’re sitting at your desktop. But what if you’re out of the house? Or maybe out in the garage where you don’t have a computer setup? OctoPrint is still happily serving up status information and a control interface, you just don’t have a computer to access it. Luckily, there are options for just that scenario.

In this post we’re going to take a look at a couple of options for controlling and monitoring OctoPrint from your mobile device, which can help truly realize its potential. Personally I have an incredible amount of anxiety when leaving a 3D printer running a long job, and in the past I’ve found myself checking every 10 minutes or so to see if it was done. Now that I can just glance at my phone and see an ETA along with status information about the machine, it’s given me the confidence to run increasingly longer and complex prints. Continue reading “Controlling OctoPrint On The Go”

Hackaday Links Column Banner

Hackaday Links: March 4, 2018

Guess what’s happening next weekend? The SoCal Linux Expo. SCALE is in its 16th year, and is the second greatest convention happening this year at the Pasadena Convention Center. The first, of course, is AlienCon this summer, with a special guest appearance by the guy with the hair on Ancient Aliens. What’s cool at SCALE? Tons of stuff! Tindie and Hackaday will have a booth, you’ll be able to check out the new stuff from System 76, and this is where I first picked up my most cherished possession, a Microsoft (heart) Linux sticker. NEED A TICKET? Cool, use the code ‘HACK’ to get 50% off!

[Muth] over on hackaday.io has been working on a very, very, very cool high voltage display. It’s a ИГГ1-64x64M, or a Gazotron, or something. What is it? It’s a two-color (green and red) 64×64 pixel VFD bitmap display. You want the king of all vacuum-based displays? Here you go. Progress on driving this display is slow, but it’s happening, and it will result in the coolest clock ever created.

Need a pick and place machine? Don’t want to shell out thousands for a Neoden? Here’s an Indiegogo campaign for the Open Placer, a machine that works with OpenPNP software. It’s got vision and a 295x195mm working area.

A few months ago, news came from Havana that the US embassy was under attack. Staffers at the US embassy in Cuba were feeling sick and apparently suffered neurological damage. Explanations ranged from poisoning to some sort of non-lethal weapon. Now, there might be a banal explanation. Researchers at the University of Michigan think it could simply be two ultrasonic sensors placed just the right distance apart. Acoustic interference happens, and that inaudible 35kHz signal becomes a maddening audible signal.

Last week, we had a great talk with OSH Park about PCBs. These Hack Chats are getting out of control, but at least we have a transcript. The biggest takeaway? They’re out of jellybeans, but OSH Park is working on new stickers.

Open Hardware Summit is the greatest con for all things Open Hardware. This year, it’s going to be in Boston. The Summit will be held on September 27th, 2018 at MIT Stratton Student Center. If you’d like to get there a week and a half early, the MIT ham flea market is the third Sunday of the month.

Unionize Your Variables – An Introduction To Advanced Data Types In C

Programming C without variables is like, well, programming C without variables. They are so essential to the language that it doesn’t even require an analogy here. We can declare and use them as wildly as we please, but it often makes sense to have a little bit more structure, and combine data that belongs together in a common collection. Arrays are a good start to bundle data of the same type, especially when there is no specific meaning of the array’s index other than the value’s position, but as soon as you want a more meaningful association of each value, arrays will become limiting. And they’re useless if you want to combine different data types together. Luckily, C provides us with proper alternatives out of the box.

This write-up will introduce structures and unions in C, how to declare and use them, and how unions can be (ab)used as an alternative approach for pointer and bitwise operations.

Continue reading “Unionize Your Variables – An Introduction To Advanced Data Types In C”