How to check for DNS server speeds

As you may know DNS is a system by which a browser or other software converts a domain name to a IP4 or IP6 address. Each time we access a website the browser needs to convert the domain name to a IP4/IP6 address using a DNS server. The DNS server configured on your computer could be automatically selected by your service provider or hard-coded. A fast DNS server is one of the essential elements to a faster browsing experience.
(more…)

Read More

Raspberry Pi as a Node.js server

I finally got my hands on the Raspberry Pi a few days back. My upcoming plan is to use the Pi as a Node.js server. If you haven’t heard of the open, platform-friendly, inexpensive $35 Linux-powered computing platform known as Raspberry Pi by now, you better do so. Starting with the Auduino, this is surely the start of inexpensive open-source hardware computing. Think of your traditional PC motherboard with integrated graphics, network, sound, HDMI, and keyboard/mouse shrunken down to the size of a deck of playing cards, and you’ll get the idea of what the Raspberry Pi is all about. Driven by an ARM1176JZF 700MHz processor, the Raspberry Pi has 256 megabytes of on-board RAM and hardware-accelerated graphics.
(more…)

Read More

Merge multiple PDFs using Ghostscript

Merging multiple PDF is not a common task, but it is good to know how to do it once the requirement arises. Specially if you want to merge documents from within a language like PHP. Although there are a few PHP classes that do the job, many throw out errors due to incompatibility between different versions of PDF and the compression used thereof. The last good (and free) solution I found was that of using Ghostscript to merge the PDF’s, and calling the command from PHP.

A simple Ghostscipt command to merge two PDFs in a single file is shown below.

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

Read More

Searching server files using GREP

During debugging the majority of my time is spent in searching for specific text. Searching on the local machine is a breeze via a IDE, but if I’ve an application hosted on a remote server then it can get difficult and slow, unless of course you have access to SSH when you can use good-old Grep. But many times the server does not have SSH access at which time I have to rely on using Linux commands though PHP.

So for example the following will allow me to recursively search all the files in a directory for the string ” mail”. I just upload the file to the server directory from where I need to make the search. Here I’m using the PHP backtick operator that allows me to escape to the shell, execute the specified command, and return the result in the variable $output.
(more…)

Read More

Installing node.js on ubuntu 10.04

With all the euphoria about node.js since the last few months, I finally decided to give it a try. As it is not available for Windows, I decided to install it on Linux instead of going for Windows/Cygwin. node.js is a implementation of CommonJS, a JavaScript ecosystem in development to be used for developing application outside the browser, like:

– Server-side JavaScript applications
– Command line tools
– Desktop GUI-based applications
(more…)

Read More