Saving Tweets to Mongo in preparation for learning Hadoop

This week I found out how easy it is to spin up a Hadoop cluster with Amazon AWS. My fist app was the simple word count app found on the AWS tutorial site. The biggest thing missing from the tutorial is an interesting data set. (The tutorial uses a 3 line text file.) After the Word Count Hadoop tutorial the next most popular tutorial is calculating Twitter sentiment. For this I needed to become familiar with Twitter's API, specifically the Streaming API.

SSL with node.js, express and socket.io

Using HTTPS with express is almost as simple as replacing require('http') with require('https'). For my application I am using a self-signed certificate that I created after following the directions on Nate Good's blog. I placed the certs in a folder called cert.

Redis key value store and Node.js

My application uses node.js and socket.io for communication between server and client. For communication between server and local hardware/programs I need a way to pass events and variables from node.js to python. The solution I am using is to store the values in Redis and access them from both node.js and python. First Redis needs to be installed; on Ubuntu simply run

Headless client connection to Socket.io and authenticated with Passport

Now that I have a working HMI setup with user authentication, I want to extend it to include remote devices and computers. The easiest way to connect remote computers is to emulate the browser connection. Since malicious hackers will probably attempt to do this anyway it is also a great way to test the security and robustness of the system. My example is taken directly from the creator of Passport.SocketIO, José F.

Socket.io and node.js Passport Authentication

Authenticating socket.io with passport is tricky because socket.io doesn't have direct access to the cookie data that passport.js and express create. The solution is to add a socket.io function that requests the cookie and checks it against the list created by passport. Fortunately jfromaniello on github has already created passport.socketio.

node.js, socket.io, and real-time web HMI example

Using node.js, socket.io, and express I created a simple real-time HMI for controlling valves. This method can be used to control any device including a network connected arduino or raspberry pi, local USB connected IO boards, or any other device that can communicate with web sockets. In this simple web based HMI clients connect and enter their name. Clients are then allowed to send and receive chat messages or press the open and close buttons associated with each valve. Security and access restrictions were not used here, but could be added later.

Screencasting with Ubuntu

Getting started Screencasting with Linux and open source software was an adventure. I was looking for a single tool that could do all the editing for audio, video and effects. What I came up with is a combination of Kdenlive, Audacity, RecordMyDesktop, and a couple command line tools.

Raspberry Pi, Arduino and node.js

Putting them all together

I wrote about installing Drupal 7 on the Raspberry Pi and about installing node.js on the Raspberry Pi. Now I am writing about adding an Arduino. The Arduino will communicate with the Raspberry Pi over Ethernet. My setup uses an Arduino Uno with an Ethernet Shield. I imagine you could use any of the Ethernet capable Arduino variants as well.

Node.js Install on Raspberry Pi

After successfully installing a LAMP stack and Drupal on my Raspberry Pi, I moved to the next step of installing node.js. Since the Whezzy image for Raspberry Pi is Debian Linux it was straight forward to install node.js. In fact I followed my own tutorial with the exception of installing npm.

Drupal 7 install on Raspberry Pi

For my birthday a good friend got me a Raspberry Pi. It took three months, but I finally received the raspberry pi in the mail this week. After spending time reading through performance reports on SD cards, I ordered the SanDisk Extreme Pro 8GB. Once it arrived I used my Ubuntu machine to download the Raspbian “wheezy” disk image and extract the image onto the SD card using ImageWritter. Using an iPhone USB charger I plugged in a micro USB cable to the power input on the Raspberry Pi board as well as an HDMI monitor and wireless keyboard/mouse dongle.

Pages

Subscribe to Chris Larson RSS