Hello everyone, my name is Miguel Grinberg, and I am super excited to join the Developer Voices team at Twilio.
I have a Masters degree in Computer Science, and for the last few years I’ve been active in open source, mostly within the Python community. I live in a small rural village in Ireland. This is the peaceful and relaxing view that I have from my home office window:
I Love Code
The main thing you need to know about me is that since my teenage years I have been a coder, and the more I code the more I like it.
I learned to code writing video games in the BASIC programming language, on Texas Instruments and Commodore home computers. In those pre-Internet days there wasn’t much of a choice in computer languages, so after being unhappy with the lag in some of my BASIC games I taught myself …
Today is Halloween and this holiday provides a wonderful excuse to hack on some spooky-themed projects.
We've curated a few of our favorite Halloween hacks in this post, ranging from a Raspberry Pi-controlled pumpkin to a Dracula dark theme for your Terminal.
The Jack o'Lantern can be controlled to change the colors of the LED lights inside the face and a motion sensor triggers a unique lighting sequence for people when they walk by.
Spotify-Powered Halloween Sound Effects
This Halloween Sound Effects using Spotify and Raspberry Pi project uses a Spotify playlist with Halloween sounds to power the hardware hack. Check out the accompanying video to see how it works.
Dracula Dark Theme
Short Message Service (SMS) text messages are ubiquitous for time-sensitive communication. They’re also easy to send at scale by combining a Django web application with an application programming interface (API).
In this tutorial, we will build a straightforward Django project with SMS capability that transmits messages to multiple recipients.
Required Project Dependencies
We will also use the following application dependencies in our application:
- Django web framework, version 2.2.x
- pip and virtualenv
- The Twilio Python helper library, version 6.32.0 or greater
- A free Twilio account. Sign up to get an account so you can use the Twilio APIs
The internet has an amazingly wide variety of information for human consumption. But this data is often difficult to access programmatically if it doesn't come in the form of a dedicated REST API. With Python tools like Beautiful Soup, you can scrape and parse this data directly from web pages to use for your projects and applications.
Let's use the example of scraping MIDI data from the internet to train a neural network with Magenta that can generate classic Nintendo-sounding music. In order to do this, we'll need a set of MIDI music from old Nintendo games. Using Beautiful Soup we can get this data from the Video Game Music Archive.
Getting started and setting up dependencies
Before moving on, you will need to make sure you have an up to date version of Python 3 and pip installed. Make sure you create and activate …
How can an organization’s security team defend its customers against threats at scale?
When the Twilio Security Operations team (SecOps) was founded, this challenge weighed heavily on our minds. We knew that automating all our threat investigation and response procedures would be key to safeguarding our customers, but we had no clue where to begin. We also knew that many of our peers were in the same boat.
That’s why today, we’re proud to open-source SOCless: a serverless framework to help organizations easily automate their security workflows and respond to threats quickly and at scale.
To get started with SOCless, visit the documentation at https://twilio-labs.github.io/socless/
Building automated security runbooks
When performing investigations and responding to threats, security professionals follow well-documented, pre-planned, step by step procedures. We call these procedures runbooks.
A typical runbook may require a security professional to use multiple security products, custom scripts, and decision trees to …
Since I started learning how to code, one thing that has always fascinated me was the concept of computers creating music. With Magenta, a Python library built that makes it easier to process music and image data, this can be done more easily than before. Magenta has pre-trained example models you can use to generate music, as seen in a previous blog post, but it's a lot more fun to create your own.
Let's walk through how to use Magenta to train a neural network on a set of music data from classic Nintendo games to generate new Nintendo-sounding tunes.
First we need to install Magenta, which can be done using pip. Make sure you create a virtual environment before installing. I am using Python 3.6.5, but Magenta is compatible with both Python 2 and 3.
Run the following command to install Magenta in your …
Artificial creativity is amazing, and I am always blown away by what people accomplish with neural networks. Lots of developers have used Python libraries like Magenta to create awesome music.
I used Magenta to train a neural network on a bunch of classic Nintendo music, and I thought it would be fun to hack around with that and make a Twilio phone number you can call to hear computer-generated NES music. If you're in the US, try calling (424) 398-8637 (424-39-TUNES) to hear!
Let's walk through how to build a phone number that plays computer generated music using Magenta.
First we need to install Magenta, which can be done using pip. Make sure you create a virtual environment before moving forward. I am using Python 3.6.5, but Magenta is compatible with both Python 2 and 3.
Run the following command to install Magenta in your …
If you’re reading this, you’ve probably grappled with impostor syndrome at one time or another.
Experience doesn’t always help, either. As our skills grow, we tackle harder problems. Technologists are always working at the edge of our knowledge.
What can we do to fight impostor syndrome? Studies have shown that self-affirmation can counteract negative ruminations and increase achievement. So I decided to build an Internet of Things button that delivers an SMS affirmation when pressed.
Physical responses to negative thoughts
Why use hardware to fight imposter syndrome?
This project could totally be a web application. But – taking a physical action in response to negative thoughts helps ground me emotionally.
Using SMS lets me receive the affirmation without the cognitive load of opening another browser tab. Twilio’s IoT capabilities let me take the button anywhere with cell service. No WiFi configuration required!
The imposter syndrome button was my first hardware …
MIDI is an extremely popular and versatile format for music data, whether you're using it as a digital musical instrument interface or just transcribing music in it to show your bandmates new songs. Mido is a Python library you can use to interact with MIDI in your code.
Let's walk through the basics of working with MIDI data using the Mido Python library.
Run the following command to install Mido in your virtual environment:
pip install mido==1.2.9
In the rest of this post, we will be working with these two MIDI files as examples. Download them and save them to the directory where you want your code to run.
Have you ever wanted a smart monitor that not only lets you see your kids, but also texts you the temperature in their crib, so you can be certain they are comfortable? I certainly have!
That’s why I made the Raspberry Pi (RPi) Smart Baby Monitor, and I want to show you how easy it is to build yourself using Twilio, a Raspberry Pi, and a little bit of code.
Here's my son at 4 months old along with the smart baby monitor I created for him:
The Tech Stack
The IoT app we are going to create will use the Python programming language, a Raspberry Pi, a Raspberry Pi camera, a DS18B20 temperature sensor, and the Twilio SMS API:
- Python version 3.5: The language we will write our code in
- Raspberry Pi: Environment that will hold our software (code) and our hardware (peripherals)
- RPi …