Mohan Cheema's Online Diary

Site Just to Keep Track of My Day to Day Work.

April 28, 2010
by Mohan Cheema
0 comments

Nagios Installation Quick Guide

Introduction

This guide is intended to provide you with simple instructions on how to install Nagios from source (code) on RHEL and have it monitoring your local machine within 20 minutes. No advanced installation options are discussed here – just the basics that will work for almost all users who want to get started. These instructions were written based on a standard RHEL 5 distribution.

April 28, 2010
by Mohan Cheema
0 comments

Often Useful often forgotten unix commands

Here I have tried to list the commands that are useful for us (sys admins) but we still tend to forget. Listed here are a bunch of unix commands.

April 28, 2010
by Mohan Cheema
0 comments

Protecting Your Web Server Using Mod Security

ModSecurity is a web application firewall (WAF). With over 70% of attacks now carried out over the web application level, organisations need all the help they can get in making their systems secure. WAFs are deployed to establish an increased external security layer to detect and/or prevent attacks before they reach web applications. ModSecurity provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring and real-time analysis with little or no changes to existing infrastructure.

April 28, 2010
by Mohan Cheema
0 comments

Protecting Your Web Server

If you plan to run a web server, you’d better be prepared to see it attacked. Securing a web server is a non-trivial task that requires an understanding of the web server’s relationship with the network. By being aware of what security measures are on the web server, you can balance the security necessary within your applications. In this chapter, we will look at how to ensure the network is secure, and then go through the steps for making a secure and dynamite web server. We will also address what to do in the event of an attack.

April 28, 2010
by Mohan Cheema
0 comments

SED One Liners

FILE SPACING

  • double space a file
sed G
  • double space a file which already has blank lines in it. Output file should contain no more than one blank line between lines of text.
sed '/^$/d;G'
  • triple space a file
sed 'G;G'
  • undo double-spacing (assumes even-numbered lines are always blank)
sed 'n;d'
  • insert a blank line above every line which matches “regex”
sed '/regex/{x;p;x;}'
  • insert a blank line below every line which matches “regex”
sed '/regex/G'
  • insert a blank line above and below every line which matches “regex”
sed '/regex/{x;p;x;G;}'