Tuesday, October 16, 2018

Recursively Replace String in Base Folder

#!/bin/bash

if [ $# -lt 2 ]; then
  echo "Usage: $0 < Base folder> <depth>"
  exit $LINENO
fi

baseFolder=$1
depth=$2

cd ${baseFolder}

i=1
searchPath="*"
while [ $i -lt $depth ]; do
for fileToFix in `egrep -l "mykeyword" ${searchPath}`
do
echo "Processing $fileToFix"
echo "
1,$ s/mykeyword/myKeyWord/g
.
w
q" | ed ${fileToFix}
done
   i=$(($i + 1))
   searchPath="*/${searchPath}"
done

Thursday, October 11, 2018

Oracle: RDA

Login as Oracle User
1. Create configuration file

$ rda -S

2. Generate Reports
$ rda
or
$ rda -fv

3. Optional, put the output on web server, i.e. Apache httpd.

http://www.goweekend.ca/output/RDA__start.htm




Saturday, October 6, 2018

Create Cacti-SNMP Plugin

1. SNMP Agent
2. SNMP xml
3. Data Queries
4. Data Template
5. Associate Graph Template in Data Queries