Time conversion using Bash

This article show how you can obtain the UNIX epoch time (number of seconds since 1970-01-01 00:00:00 UTC) using the Linux bash "date" command. It also shows how you can convert a UNIX epoch time to a human readable time.

Obtain UNIX epoch time using bash
Obtaining the UNIX epoch time using bash is easy. Use the build-in date command and instruct it to output the number of seconds since 1970-01-01 00:00:00 UTC. You can do this by passing a format string as parameter to the date command. The format string for UNIX epoch time is '%s'.


Automatically redirect non-existing pages to the home page in Apache

How to configure Apache so that requests for non-existing pages are redirected to the home page.

In some occasions, you don't want people to get 404 messages when they surf to pages or folders that don't exist on your web server (anymore). For example, when you have Basic Authentication, end users only get the pop-up that requests them to authenticate when they surf to an existing page or folder. The security impact of this is that when attackers perform a brute force scan on your file server, they can easily detect whether pages and folders exist or not:



You might also be interested in...

Subscribe to RSS - Linux