Skip to content

Instantly share code, notes, and snippets.

@kkaushal09
kkaushal09 / sec_groups_aws.py
Created September 24, 2018 07:36 — forked from toddlers/sec_groups_aws.py
Listing AWS Security groups with Python boto
#!/usr/bin/python
# Script will list all instances, all security groups and their rules for desired profile
# Before using script, you need to create "profile" file, which is ~/.aws/credentials where you put your AWS keys like this:
#
# [dev]
# aws_access_key_id = *****
# aws_secret_access_key = *****
#
# .. and then use it in this script
@kkaushal09
kkaushal09 / tomcatWatchdog.sh
Created September 24, 2018 07:32
Shell script to monitor tomcat is alive on port 8080
#!/bin/sh
da=`date`
HOST=127.0.0.1
PORT=8080
#infinite loop
#while [ 1 ]
#do
#try to access tomcat's page
RES=`timeout 120 wget -O - -o /dev/null --proxy=off http://${HOST}:${PORT}/isalive.html | awk '{ print $1 }'`