thisdaveJ

Using jq and curl to Wrangle JSON Arrays from the Terminal

In this tutorial, we use jq and curl to query a web service and retrieve JSON objects containing embedded arrays. We then invoke a command based on each element in the array rather than simply printing the values to the console. A special thanks to one of my readers, B. Anderson, who left a comment on my Consuming Web API JSON Data Using curl and jq post and provided this question for us to explore. Let’s get started!

Share
curl-jq

Consuming Web API JSON Data Using curl and jq

Hey everyone! I decided to put a few extra batteries in the background color of the article image above. 🙂 I’m actually pretty charged up about our topic today, particularly about jq, which is a lightweight and flexible command-line JSON processor with “batteries included”.

Share
thisdaveJ

Web Scraping with Google Sheets: The Definitive Guide

In this tutorial, we learn how to scrape data from web pages and display the results in Google Sheets. We start with the standard built-in Sheets functions and move on to more advanced methods using custom JavaScript functions.

What is web scraping, you say? Web scraping is a technique of automatically extracting unstructured data from web pages using a computer rather than manually copying and pasting data. It is necessary when the data to extract is not available in a well-defined format such as JSON or XML.

Share
thisdaveJ

Three Ways to Build Dynamic Web APIs using PHP

In this article, we learn how to build dynamic Web APIs using PHP. Why PHP? PHP is a very popular programming language used for rendering server-side web pages and is included as a standard option with many web hosting providers including HostGator (my provider). I had a need to generate simulated one-minute IoT data for a recent article I wrote on Fetching, Filtering, and Sorting JSON APIs in Google Sheets: The Missing Functions. Much to my surprise and delight, PHP is both powerful and fun, and I am here to share some of my learnings with you. Let’s get started and highlight three ways to build dynamic Web APIs using PHP.

Share
Node emoji

Add Emoji to your Node Projects with node-emoji ✨

Attention 📣 Node developers. We’re building highly functional applications, but it’s time to add some pizzazz and breathe new life into our software creations. In this article, we’ll learn how to sprinkle in some emoji to add sparkle✨ to our Node projects with the help of the node-emoji package. We’ll culminate our efforts with the creation of a command-line emoji picker that we can use in a variety of contexts.

Share
Raspberry Pi ngrok

How to Host a Raspberry Pi Web Server on the Internet with ngrok

In Create a Web Server in Node without any Code, we used the http-server npm module to create a web server and serve up files in record time. Today I will share a way you can take the web server you built and make it available beyond your local network and on the public Internet. This is cool trick, but I recommend that you use this with caution as this will open a hole in your router/firewall when you make your web server available to the world. Let’s get started!

Share

Creating a Raspberry Pi Pandora Player with Remote Web Control

In our last article, we learned how to control a Raspberry Pi from a mobile device and, as a bonus, we created a menu to make it even easier to issue commands and control our Pi. We’re back today to put that remote menu to good use because we’re building an amazing Pandora music player we can connect to a stereo in our living room, for example, without a monitor, keyboard, or mouse. Our system will include a web interface served through Node.js so we can control our Pandora player remotely from a mobile phone—all from the comfort of our couch. 🙂 Follow along with me and let’s make this happen! Read More

Share
Install Redis on a Raspberry Pi using Docker

How to install Redis on a Raspberry Pi using Docker

I’m a big fan of Redis, a fast in-memory database that persists on disk, and I’ve previously written a Guide to Using Redis with Node.js which provides a fairly comprehensive overview of using Redis from the command line and using it in conjunction with Node.js.
With the introduction of the new Stream data type in Redis 5.0, I decided it was time to get the new Redis 5.0 bits up and running on my Raspberry Pi as Redis Streams looked like it could be useful in a number of IoT scenarios.

I updated my Raspbian package list using “sudo apt update” and, much to my chagrin, the most recent version of Redis available was Redis 3.2.6 which was almost two years old. Since the Raspbian package repository follows the LTS (long term support) Debian releases, the packages available are conservative and stable, but often dated.

How did I solve this dilemma and install the latest version of Redis given the obsolescing packages housed in Raspbian repository? My ship ⛵️ came in with Docker!😀 In this article, we learn how to install Redis on a Raspberry Pi using Docker. Using Docker provides many benefits including the ability to install the latest releases of Redis long before they are available in the Raspbian package repository—without the need to compile the Redis source code ourselves.

Share
Raspberry Pi firewall

How to Set up a Firewall for Redis using ufw

Here’s the scenario: we have a Redis server running on a Raspberry Pi and we want to make it available to other machines on a network rather than just using the Redis server in a localhost context. We have already added a password to the Redis server instance; however, due to the high-performance capabilities of Redis, it is possible for outside systems to barrage it with massive number of passwords in parallel to break in. It’s time for a firewall.

In this tutorial, we will learn how to set up a firewall for Redis using ufw. The steps we describe will be useful for any Debian-based distribution such as Debian, Ubuntu, or Raspbian, and will equip you to create firewall rules for other applications too.

Share