I am Hack Sparrow
Captain of the Internets.

Archive for July, 2012

Node.js EventEmitter Tutorial

Heard about Node.js' EventEmitter class? Maybe you know that most of the built-in Node libraries use it? Maybe you were always curious about EventEmitter, but had no one to explain it to you? In this tutorial, I will give you a guided demo of the great EventEmitter class. You must be familiar with various Node library events like "on data", "on end", "on error", etc. The event mechanism work so flawlessly and perfectly, doesn't it. All courtesy of ...

A Port Scanner in Node.js

In this tutorial, I will show you how to write a port scanner in Node.js! Hope this tutorial helps remove the misconception that Node is only for serverside programming and creating websites. First off, what is a port scanner? A port scanner is a software that automates the process of checking if a port is open on a machine. There are various levels of sophistication when it comes to scanning ports, and there are numerous tools that are hailed as industry standard, but in this tutorial we wil ...

Express.js HTTPS Server Client Example

In this tutorial I will show you how to set up an HTTPS ExpressJS server and connect to it using a TLS client. I will assume you already know how to set up a basic Express.js app, if not read this tutorial. Create an Express app, and use the following code as the server: [code] var fs = require('fs'); var express = require('express'); var https = require('https'); var key = fs.readFileSync('./k ...

RSYNC Tutorial with Examples

Need a fast and efficient way to synchronize files on two systems? Looking for an alternative to FTP / SCP / RCP? RSYNC is the right tool for it! RSYNC's syncing capability makes it an excellent alternative to FTP and other file transfer tools like SCP and RCP. Why would one want to use RSYNC for file transfer? It is efficient (does not transfer files which are already in sync), safe (uses ...