Category Archives: Linux How-To

How to Flush DNS cache

HowTo: Flush nscd dns cache Nscd caches libc-issued requests to the Name Service. If retrieving NSS data is fairly expensive, nscd is able to speed up consecutive access to the same data dramatically and increase overall system performance. Just restart … Continue reading

Posted in Linux How-To | Leave a comment

How to setup NRPE monitoring with Nagios

1 – Summary NRPE (Nagios Remote Plugin Executor) plugin allows you to monitor any number of remote network devices and services using Nagios. Installing and Configuring a Nagios Server is not part of this HowTo. You will need a nagios … Continue reading

Posted in Linux How-To | Leave a comment

Nagios check_http Plugin Examples for HTTP / HTTPS

1. Check HTTP Check whether Apache HTTP is running on a remote server using check_http. $ check_http -H 192.168.1.50 HTTP OK HTTP/1.1 200 OK – 332 bytes in 0.004 seconds |time=0.004144s;;;0.000000 size=332B;;;0 2. Check HTTPS Check whether Apache HTTPS is … Continue reading

Posted in Linux How-To | 2 Comments

NTP Server using Ubuntu 14.04

Network Time Protocol (NTP) is a networking protocol for time and date synchronisation between computers. By default, Windows 7 provides five servers (default being time.windows.com) to synchronise with. Time varies based on network latency however with tens of milliseconds over the … Continue reading

Posted in Linux How-To | Leave a comment

How to Calculate Yesterday in PHP

Method 1 – mktime() echo date(“Y-m-d”, mktime(0, 0, 0, date(“m”),date(“d”)-1,date(“Y”))); This method was by far the slowest. Performing at 450% the time of the control. Method 2 – Subtracting minutes from the current unix timestamp time() echo date(“Y-m-d”, time() – … Continue reading

Posted in Linux How-To | Leave a comment

Adding a new Hard Drive in FreeBSD

Using sysinstall – Easy way to add a new hard disk The sysinstall utility is used for installing and configuring FreeBSD systems including hard disks. sysinstall offers options to partition and label a new disk using its easy to use … Continue reading

Posted in Linux How-To | Leave a comment

How To Restore from Amanda Virtual Tapes

Loading tapes manually (ancient, probably only useful for CentOS users) Instead of letting amrecover use the changer, you can also do everything manually. I will simply paste an amrecover session here (provided by JC Simonetti, author of chg-disk): # /usr/local/amanda/sbin/amrecover … Continue reading

Posted in Linux How-To | Leave a comment

Step by step instructions for setting up fail2ban for sendmail.

Create the filter First, create a filter file for sendmail, typically filter.d/sendmail.conf, with the following content: # Fail2Ban configuration file # # Source: http://www.the-art-of-web.com/system/fail2ban-sendmail/ # Contibutors: Gutza, the SASL regex # # $Revision: 0 $ # [Definition] # Option: failregex … Continue reading

Posted in Linux How-To | Leave a comment

Netstat: Linux network information

If you use Linux (especially on a server) it is important to be able to have plenty of information at the tips of your fingers. This includes all types of information. One of the first places to look for for … Continue reading

Posted in Linux How-To | Leave a comment

Fail2Ban setup

Introduction Fail2Ban is an intrusion prevention framework written in the Python programming language. It works by reading SSH, ProFTP, Apache logs etc.. and uses iptables profiles to block brute-force attempts. Installation To install fail2ban, type the following in the terminal: … Continue reading

Posted in Linux How-To | Leave a comment