Linux Fu: Better Bash Scripting

It is easy to dismiss bash — the typical Linux shell program — as just a command prompt that allows scripting. Bash, however, is a full-blown programming language. I wouldn’t presume to tell you that it is as fast as a compiled C program, but that’s not why it exists. While a lot of people use shell scripts as an analog to a batch file in MSDOS, it can do so much more than that. Contrary to what you might think after a casual glance, it is entirely possible to write scripts that are reliable and robust enough to use in many embedded systems on a Raspberry Pi or similar computer.

I say that because sometimes bash gets a bad reputation. For one thing, it emphasizes ease-of-use. So while it has features that can promote making a robust script, you have to know to turn those features on. Another issue is that a lot of the functionality you’ll use in writing a bash script doesn’t come from bash, it comes from Linux commands (or whatever environment you are using; I’m going to assume some Linux distribution). If those programs do bad things, that isn’t a problem specific to bash.

One other limiting issue to bash is that many people (and I’m one of them) tend to write scripts using constructs that are compatible with older shells. Often times bash can do things better or neater, but we still use the older ways. For example:

Continue reading “Linux Fu: Better Bash Scripting”

Books You Should Read: The Idea Factory

You’ve heard of Bell Labs, but likely you can’t go far beyond naming the most well-known of discoveries from the Lab: the invention of the transistor. It’s a remarkable accomplishment of technological research, the electronic switch on which all of our modern digital society has been built. But the Bell Labs story goes so far beyond that singular discovery. In fact, the development of the transistor is a microcosm of the Labs themselves.

The pursuit of pure science laid the foundation for great discovery. Yes, the transistor was conceived, prototyped, proven, and then reliably manufactured at the Labs. But the framework that made this possible was the material researchers and prototyping ninjas who bridged the gap between the theory and the physical. The technology was built on what is now a common material; semiconducting substances which would not have been possible without the Labs refinement of the process for developing perfectly pure substances reliably doped to produce the n-type and p-type substances that made diode and transistor possible.

Continue reading “Books You Should Read: The Idea Factory”

Friday Hack Chat: Making Electronics for Education

For this week’s Hack Chat on Hackaday.io, we’ll be talking with AnnMarie Thomas about making electronics for education. There’s a huge intersection between electronics and education, and whether you’re designing robots for a FIRST team or designing a geometry curriculum around 3D-printed objects, there’s a lot electronics can teach students.

AnnMarie Thomas is an associate professor at the School of Engineering and the Opus College of Business at the University of St. Thomas. She’s the founder of the Playful Learning Lab, and along with her students she’s created Squishy Circuits. AnnMarie is the author of Making Makers: Kids, Tools, and the Future of Innovation. Basically, if you’re looking for someone who knows how to make an educational product, you can’t do any better.

For this week’s Hack Chat, we’ll be talking about how to define how technology and education can intersect. There are ways to define a concept, build and sell an educational product, and how to find a market for a product. If you’ve ever wanted to know what goes into getting students to dive into electronics, this is the Hack Chat you have to sit in on.

Oh, AnnMarie is also a judge for this year’s Hackaday Prize. Neat.

Also on deck for this week’s Hack Chat will be Tindie. Tindie is Supplyframe’s (Hackaday’s parent company) answer to the question, ‘where should I sell my hardware product’. Think of it as ‘Etsy for electronics’, but with less furniture made out of pallet wood, but paradoxically more products that require a California prop 65 warning. Isn’t electronics fun?

Here’s How To Take Part:

join-hack-chatOur Hack Chats are live community events on the Hackaday.io Hack Chat group messaging. This Hack Chat will take place at noon Pacific time on Friday, July 21st. Confused about where and when ‘noon’ is? Here’s a time and date converter!

Log into Hackaday.io, visit that page, and look for the ‘Join this Project’ Button. Once you’re part of the project, the button will change to ‘Team Messaging’, which takes you directly to the Hack Chat.

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

Ask Hackaday: Selling Yourself as a Hacker

While there are plenty of hackers that hack just for the love of it, it’s no secret that many of us are looking to hit it big someday. Tales of the businesses like HP and Apple that started in someone’s garage inevitably lead to musings like, “Hey, I’ve got a garage!” and grand plans to turn that special idea into the Next Big Thing™. Many will try, most will fail for one reason or another, but hope springs eternal, and each new widget seems to start the entrepreneurial cycle again.

But for as much pressure as we may feel to be the next Packard, Wozniak, or Musk, not everyone is cut out to be the boss. Some of us have no interest in or aptitude for business — we don’t want to hire or fire people, we don’t want to wheel and deal, and we certainly don’t want to worry about salesmanship. Some of us just want to abstract all that complexity away and just find a job, preferably one that leverages the things we love to do.
Continue reading “Ask Hackaday: Selling Yourself as a Hacker”

Hackaday Links: July 16, 2017

[Carl Bass] has joined the board at Formlabs. This is interesting, and further proof that Print The Legend is now absurdly out of date and should not be used as evidence of anything in the world of 3D printing.

Here’s something cool: a breadboardable dev board for the Parallax Propeller.

Finally, after years of hard work, there’s a change.org petition to stop me. I must congratulate [Peter] for the wonderful graphic for this petition.

Want some flexible circuits? OSHPark is testing something out. If you have an idea for a circuit that would look good on Kapton instead of FR4, shoot OSHPark an email.

SeeMeCNC has some new digs. SeeMeCNC are the creators of the awesome Rostock Max 3D printer and hosts of the Midwest RepRap Festival every March. If you’ve attended MRRF, you’re probably aware their old shop was a bit on the small side. As far as I can figure, they’ll soon have ten times the space as the old shop. What does this mean for the future of MRRF? Probably not much; we’ll find out in February or something.

Rumors of SoundCloud’s impending demise abound. There is some speculation that SoundCloud simply won’t exist by this time next year. There’s a lot of data on the SoundCloud servers, and when it comes to preserving our digital heritage, the Internet Archive (and [Jason Scott]) are the go-to people. Unfortunately, it’s going to cost a fortune to back up SoundCloud, and it would be (one of?) the largest projects the archive team has ever undertaken. Here’s your donation link.

If you’re looking for a place to buy a Raspberry Pi Zero or a Pi Zero W, there’s the Pi Locator, a site that pings stores and tells you where these computers are in stock. Now this site has been expanded to compare the price and stock of 2200 products from ModMyPi, ThePiHut, Pi-Supply, and Kubii.

Books you should read: The Bridge

A few weeks ago, Amazon’s crack marketing AI decided to recommend a few books for me. That AI must be getting better because instead of the latest special-edition Twilight books, I was greeted with this:

“The asteroid was called the Hand of God when it hit.”

That’s the first sentence of The Bridge, a new Sci-Fi book by Leonard Petracci. If you think that line sucks you in, wait until you read the whole first chapter.

The Bridge is solidly in the generation ship trope. A voyage hundreds or even thousands of years long, with no sleep or stasis pods. The original crew knows they have no hope of seeing their destination, nor will their children and grandchildren. Heinlein delved into it with Orphans of the Sky. Even Robert Goddard himself discussed generation ships in The Last Migration.

I wouldn’t call The Bridge hard Sci-Fi — and that’s perfectly fine. Leonard isn’t going for scientific accuracy. It’s a great character driven story. If you enjoyed a book like Ready Player One, you’ll probably enjoy this.

The Bridge Is the story of Dandelion 14, a ship carrying people of Earth to a new planet. At some point during the journey, Dandelion 14 was struck by an asteroid, which split the ship in two. Only a few wires and cables keep the halves of the ship together. The crew on both sides of the ship survived, but they had no way to communicate. They do catch glimpses of each other in the windows though.

Much of the story is told in the first person by Horatius, a young man born hundreds of years after the asteroid strike. Horatius’ side of the ship has a population of one thousand, carefully measured at each census. They’ve lost knowledge of how to operate the ship’s systems, but they are surviving. Most of the population are gardeners, but there are doctors, cooks, porters, and a few historians. At four years old, Horatius is selected to become a gardener, like his father was before him. But Horatius has higher aspirations. He longs to become a historian to learn the secrets of the generations that came before him and to write his own story down for those who will come after.

Horatius sees the faces of the people on the other side of the ship as well. Gaunt, hungry, often fighting with knives or other weapons. A stark contrast to the well-fed people on his side of the vessel. The exception is one red-haired girl about his age. He often finds her staring back at him, watching him.

Horatius might have been chosen as a gardener, but he’s clever — a fact that sometimes gets him in trouble. His life takes an abrupt turn when the sleeping ship awakens with an announcement blaring “Systems Rebooting, Ship damage assessed. Reuniting the two halves of the ship and restoring airlock, approximately twenty-four hours until complete.”

The hardest part of writing a book review is not giving too much away. While I won’t tell you much more about the plot for The Bridge, I can tell a bit about how the book came about.
You might call this book a hack of the publishing system. Leonard Petracci is also known as leoduhvinci on Reddit. The Bridge started life as Leonard’s response to a post on /r/writingprompts. The prompt went like this:

After almost 1,000 years the population of a generation ship has lost the ability to understand most technology and now lives at a pre-industrial level. Today the ship reaches its destination and the automated systems come back online.

Leonard ’s response to the prompt shot straight to the top, and became the first chapter of The Bridge. Chapter 2 followed soon after. In only a few months, the book was complete. Available on Reddit, and on Leonard’s website. The Bridge is also available on Amazon for Kindle, and on paper from Amazon’s CreateSpace.

The only real criticism I have about The Bridge is the ending. The book’s resolution felt a bit rushed. It would have been nice to have a few more pages telling us what happened to the characters after the major events of the book. Leonard is planning a sequel though, and he teases this in the final pages.

You can start reading The Bridge right now on Leonard’s website. He has the entire book online for free for a few more weeks. If you’ve missed the free period, the Kindle edition is currently $2.99.

Retrotechtacular: London Bus Overhaul

If you have ever visited London as a tourist, what memories did you take away as iconic of the British capital city? The sound of Big Ben sounding the hour in the Elizabeth Tower of the Palace of Westminster perhaps, the Yeoman Warders at the Tower of London, or maybe the guardsmen at Buckingham Palace. Or how about the red double-decker buses? They’re something that, while not unique to the city, have certainly become part of its public image in a way that perhaps the public transport of other capitals hasn’t.

A city the size of London has many thousands of buses in the fleet required to provide transport to its sprawling suburbs. Until a few years ago the majority of these machines were built to a series of standard designs under the London Transport banner, so a Londoner with an eye for buses could have seen near-identical vehicles in any corner of the city. Each of these buses would have carried millions of passengers over hundreds of thousands of miles in a typical year, so many in fact that every few years they would have required a complete overhaul. For that task, London Transport maintained a dedicated factory capable of overhauling hundreds of buses simultaneously, and this factory is our subject today.

The overhaul works at Aldenham was the subject of a 1957 British Transport Films picture, Overhaul, in which we follow a bus in its journey through the system from tired-out to brand-new. We see the bus given a thorough inspection before being stripped of its upholstery and then having its body separated from its chassis and cleaned, then we see each part being refurbished. Along the way we gain a fascinating insight into the construction of a mid-century passenger transport vehicle, with its wooden frame and aluminium exterior panels being refurbished and rebuilt where necessary, before the camera. Meanwhile we see the chassis, with its separate gearbox in the centre of the vehicle, before it is painted to resist more years of road grime and reunited with a bus body. The completed vehicle is then taken for a test run before being sent to the paint shop for a coat of that iconic London Transport red. Enjoy the film in its entirety below the break.

The buses in the film are the AEC/London Transport “RT” vehicles, which entered service in the late 1930s and last ran in the 1970s. Their replacement, the visually similar “Routemaster” had only started to appear the previous year, and continued in regular service until 2005. Meanwhile the Aldenham bus overhaul works survived until its closure in 1986 due to the appearance of a range of new buses in the capital that did not conform to the standard design that it had been designed to serve.

Continue reading “Retrotechtacular: London Bus Overhaul”