Wednesday, July 25, 2018

Column selection in Eclipse


Buy Moto series phones: Moto E, Moto G, Moto X or Other phones
Buy eBooks from Flipkart
-----------------------------------------------

Eclipse also offers column selection functionality similar to popular text editors Notepad++, Sublime Text2.

On a Mac, need to press "cmd + option + A"
On Windows and Linux, you need to press "alt + shift + A"

Please note doing above will take you to block selection mode, and you need to press same keys again to come back to normal mode.

Source: https://stackoverflow.com/questions/1053725/how-do-i-enable-the-column-selection-mode-in-eclipse


Wednesday, July 18, 2018

Validate firewall connectivity using nc


Buy Moto series phones: Moto E, Moto G, Moto X or Other phones
Buy eBooks from Flipkart
-----------------------------------------------

In absence of telnet we can use nc (which version??) to validate connectivity.

nc -w 2 -v 10.0.0.1 < /dev/null; exitCode=$?; echo "Exit code = $exitCode"; if [ $exitCode -ge 1 ]; then echo "No connectivity"; else echo 'SUCCESS!!!'; fi; >> fw_validation.txt



Friday, July 13, 2018

To setup a simple log monitoring script


// TODO


#! /bin/bash
echo "monitoring log files"
if grep SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log ;
then
    echo "sending mail"
    grep -10 SQLSTATE application-cronjob-*-`date +"%Y-%m-%d"`.log | mail -s "errors found in  logs for `date +"%Y-%m-%d"` example@example.com
fi

Latest Posts