I am Hack Sparrow
Captain of the Internets.

Archive for December, 2011

Linux scp command – Common use cases

scp is a very useful Linux tool which lets you copy files from one system to another via SSH in a secured manner. I will assume that, since you want to use the scp command, you have access to a Linux or related system. You can find out details about the scp command by doing man scp at the terminal. But that's not the point of it. I want to show you some common uses cases of scp and how t ...

How to forward non-www to www domain name and vice-versa in Node.js (Express)?

Forwarding domain names according to the requirements of 'www' is trivial in Apache using .htaccess. It's not hard either in Node.js, if you are using Express. Put the route definition of your requirement on top of all other routes in Express. This will detect the presence of 'www' and redirect the request to the domain name without 'www'. The status code of 301 means that it is a permanent redirect. If you omit the status code it doe ...

Node.js – Amazon S3: How to get Started

Believe it or not, integrating Amazon S3 service with Node.js is very easy. You just need to know two things to be able to use Amazon S3 and Node.js together smoothly. The first thing is a commandline utility called s3cmd. s3cmd lets you create S3 buckets, upload files to them, delete files from buckets and delete buckets - from the commandline / terminal. The second is a Node.js ...

Install Node.js on CentOS

Installing Node.js on CentOS is slightly different from installing on Ubuntu Linux. The main differences being in the name of the package manager and the package names. The package manager of CentOS is called Yum. Make sure a Cxx compiler and OpenSSL development packages are installed, else you will be stopped by these errors. [code] wscript:261: error: could n ...