SED is a very powerful utility which allows find and replace/insert text functionality. It should be used with Caution and is recommended to use dry-run before committing the changes. Below are the various commands for text manipulation.

Note: \n = for newline and \t = for TAB space and For dry run just remove "-i" from the command

 Find the pattern and Insert text AFTER

# sed -i 's/.*search 1st Line.*/&\nInsert 2nd line/' file1

Add a comment

When you come across this error "LDAP Error: Connect error: TLS error -8054:You are attempting to import a cert with the same issuer" enrolling a client to FreeIPA/IDM server, it means that the existing certificate does not match the one on the IDM server and can be fixed quite easily with just one command. The scenario in which this can happen is that you might have had the client enrolled to a different IDM server previously and the old cert is still lying around.

Add a comment

When trying to get the custom time range for PNP4Nagios graphs, it might result in an error "application/models/data.php [664]:". It can easily resolved by editing "system.php"  in PNP4Nagios controllers folder. To start with first make a backup of the file.

# cp -a /usr/local/pnp4nagios/share/application/controllers/system.php /usr/local/pnp4nagios/share/application/controllers/system.php.bkp

Add a comment

Page 1 of 13

Most Read Articles

Add/Detect a new disk in ...

Written By Farooq Mohammed Ahmed on Sunday, 11 January 2015 19:22
Add/Detect a new disk in ...

Replace SSL Certificates ...

Written By Farooq Mohammed Ahmed on Friday, 16 December 2016 08:05
Replace SSL Certificates ...

Using awk in Alias Comman...

Written By Farooq Mohammed Ahmed on Friday, 19 February 2016 14:22
Using awk in Alias Comman...

Sed - Insert Text before ...

Written By Farooq Mohammed Ahmed on Monday, 20 November 2017 00:58
Sed - Insert Text before ...

Script to Monitor Nagios ...

Written By Farooq Mohammed Ahmed on Monday, 18 July 2016 22:48
Script to Monitor Nagios ...