Linux Fu: Alternative Shells

On Unix — the progenitor of Linux — there was /bin/sh. It was simple, by comparison to today’s shells, but it allowed you to enter commands and — most importantly — execute lists of commands. In fact, it was a simple programming language that could make decisions, loop, and do other things to allow you to write scripts that were more than just a list of programs to run. However, it wasn’t always the easiest thing to use, so in true Unix fashion, people started writing new shells. In this post, I want to point out a few shells other than the ubiquitous bash, which is one of the successors to the old sh program.

Since the 7th Edition of Unix, sh was actually the Bourne shell, named after its author, Stephen Bourne. It replaced the older Thompson shell written in 1971. That shell had some resemblance to a modern shell, but wasn’t really set up for scripting. It did have the standard syntax for redirection and piping, though. The PWB shell was also an early contender to replace Thompson, but all of those shells have pretty much disappeared.

You probably use bash and, honestly, you’ll probably continue to use bash after reading this post. But there are a few alternatives and for some people, they are worth considering. Also, there are a few special-purpose shells you may very well encounter even if your primary shell is bash.

Continue reading “Linux Fu: Alternative Shells”

Dash With Arduino

Amazon Dash is a handy service, and when Amazon released their AWS IoT platform, [Brian Carbonette] felt that it left out all the hardware hackers from the tinkering fun. Seeking justice, he put together a guide for an Arduino Dash button aimed at hardware hackers and those who are still easing into the world.

For his build, [Carbonette] used an Arduino MKR1000, laying out a few different configuration options for building your button. He has also gone to great lengths to help all comers tackle the Arduino-Dash API communication process by building an AmazonDRS Arduino Library, which handles all the “boring details,” so you can focus on the hardware. With the warning that the software-side setup is tedious the first time around, [Carbonette] has included a detailed manual for setting up the aforementioned AmazonDRS library, some example code, and a breakdown thereof. He also suggests implementing other features — such as a notification if the item is out of stock on Amazon — to tie the project together.

Continue reading “Dash With Arduino”

33C3: Hunz Deconstructs The Amazon Dash Button

The Amazon Dash button is now in its second hardware revision, and in a talk at the 33rd Chaos Communications Congress, [Hunz] not only tears it apart and illuminates the differences with the first version, but he also manages to reverse engineer it enough to get his own code running. This opens up a whole raft of possibilities that go beyond the simple “intercept the IP traffic” style hacks that we’ve seen.

dash_block_diagramJust getting into the Dash is a bit of work, so buy two: one to cut apart and locate the parts that you have to avoid next time. Once you get in, everything is tiny! There are a lot of 0201 SMD parts. Hidden underneath a plastic blob (acetone!) is an Atmel ATSAMG55, a 120 MHz ARM Cortex-M4 with FPU, and a beefy CPU all around. There is also a 2.4 GHz radio with a built-in IP stack that handles all the WiFi, with built-in TLS support. Other parts include a boost voltage converter, a BTLE chipset, an LED, a microphone, and some SPI flash.

The strangest part of the device is the sleep mode. The voltage regulator is turned on by user button press and held on using a GPIO pin on the CPU. Once the microcontroller lets go of the power supply, all power is off until the button is pressed again. It’s hard to use any less power when sleeping. Even so, the microcontroller monitors the battery voltage and presumably phones home when it gets low.
Continue reading “33C3: Hunz Deconstructs The Amazon Dash Button”

Amazon Dash Reboots Your Pi

We all know feature creep can be a problem in almost any project. A simple idea can often become unusable if a project’s scope isn’t clearly defined in the beginning. However, the opposite problem sometimes presents itself: forgetting to include a key feature. [Zach] had this problem when he built a Raspberry Pi magic mirror and forgot to build a physical reset/shutoff switch. Luckily he had a spare Amazon Dash button and re-purposed it for use with his Pi.

The Raspberry Pi doesn’t include its own on/off switch. Without installing one yourself, the only way to turn off the device (without access to the terminal) is to unplug it, which can easily corrupt data on the SD card. Since [Zach]’s mirror was already complete, he didn’t want to take the entire thing apart just to install a button. There’s already a whole host of applications for the Dash button, so with a little Node.js work on the Raspberry Pi he was able to configure a remote-reset button for his mirror.

This is a similar problem for most Raspberry Pi owners, so if you want to follow [Zach]’s work he has done a great job detailing his process on his project site. If you’re looking for other uses for these convenient network-enabled buttons, he also links to a Github site with lots of other projects. This pizza button is probably our favorite, though.

Make Your Mailman Nervous With A Wifi Enabled Mailbox

“It’s not a bomb,” the mailman whispered to himself as he reached for [atxguitarist]’s mailbox, giving a nervous glance at the small black box stuck to the side. “This is THAT house, it’s not a bomb. I’m sure it’s not a bomb,” he muttered as a cold bead of sweat ran down his neck. His hand approached slowly, shakily. The mailman gathered courage, then, in a single quick movement, opened the box. He sighed relief as nothing happened. Somewhere in [atxguitarist]’s house a recording wailed “You’ve got mail!”

The mailbox enhancement in question is a hacked Amazon Dash Button in a project box. When the door of the mailbox is opened, a magnetic reed switch simulates a button press on the Dash. The Dash transmodulates the signal into WiFi pixies which are received by a Raspberry Pi. The Pi’s sole purpose in life is to run a 24-line Python script that plays the famous sound from AOL’s mail software and sends a notification to his phone.

Aside from unnerving the mailman, it’s a cool hack and keeps you from slugging it out there in the cold or rain to witness an empty box.

Continue reading “Make Your Mailman Nervous With A Wifi Enabled Mailbox”

Hack Corporate Overlords For Single Button Beer Delivery

[Brody Berson] is at it again, but this time he’s hacked the services floating in the aether around him to give him beer on demand. Finally the future we’ve been waiting for.

This hack is not as hacky as his first one, which, at the push of a button, could summon a bad driver straight to his house who would then give him pizza. The first one was done with a modified version of a button used to summon paper towels; because there’s nothing like needing paper towels RIGHT NOW, and then pushing a button to get them a few days later.

Apparently Amazon saw how practically no one was pushing the dish detergent button, but a lot of people were making scary mailboxes and magic pizza apps after ruthlessly scratching the branding off. So they shrugged and decided to sell the buttons as the newly branded (these get more hilarious when you don’t use the acronyms) Amazon, Amazon Web Services Internet of Things Button. Now your button can die along with the internet because Amazon is hosting your Raspberry Pi for a small fee, neat.

Anyway, [Brody] did some research on the best beer delivery services in his area, and went with one called Drizzly because they had a nice API. After integrating this system with Amazon’s, he can now push a button and minutes later, after subtracting some currencies from his account, a bad driver will show up and hand him beer.

Amazon Dash: Hack It To Run Your Own Code

The Amazon Dash is a $5 push-to-buy-cat-litter button which has excellent potential for repurposing, but you need to know what is going on inside first. [Tony Dicola] has the details in this excellent bare metal guide to the Dash. In this, he covers how to get inside the Dash and reprogram it to do something more interesting than buying cat litter.

He first cracks the device open, connecting a programmer, then building a toolchain to compile programs to run on. This isn’t for the faint-hearted because you are programming directly for a device that wasn’t really built for it, but [Tony] has posted examples and there are few tools to hold your hand on the way. There is a safety net, [Tony] provided details on how to reset the Amazon Dash Button if you manage to brick it.

We have seen some interesting hacks that repurpose the Dash to capture your child’s bowel movements by intercepting the device connecting to WiFi, but this guide takes it a step further. It allows you to run your own code, which turns this into a really low-cost and well-engineered all-in-one WiFi device. The missing piece is proof-of-concept code to run the WiFi module inside. If you’re working on that we’d love to hear about it!

Continue reading “Amazon Dash: Hack It To Run Your Own Code”