How to set up a secure Apache webserver on Ubuntu

This tutorial assumes that you have a running Ubuntu Server, that networking has been set up, and that you have ssh access. Apache2 is the default webserver used by many Linux installations. It is not the only one available, or the best for all circumstances, but it covers many usage scenarios. During the installation, you […]
Continue reading…

 

How to append current date and timestamp to filename in shell script

Sometimes it is useful to include current date or timestamp information in file names, especially when files are generated on a regular basis such as monthly/daily/hourly for backup, logging and other archiving purposes. Here is how you can format current date and time, and append formatted string to a file name, in a shell script. […]
Continue reading…

 

How to synchronize time with NTP

NTP is a networking protocol which enables one to synchronize clock among different computers using IP packets. NTP is commonly used when one maintains a cluster of hosts to operate compute and storage cloud in data centers. NTP is capable of compensating for variable latency over networks, and can achieve clock synchronization with 1 millisecond […]
Continue reading…

 

How to use high-resolution gettimeofday in Perl

In some cases, you may need to measure time in high-resolution, for example, microsecond resolution as provided by gettimeofday() system call. In order to use microsecond-resolution time in Perl, you can use Time::HiRes Perl module which provides gettimeofday() microsecond-resolution timer function. To install Time::HiRes on Linux, run the following. $ sudo perl -MCPAN -e ‘install […]
Continue reading…