This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Runbook for Disk space alert ## | |
# Step 1 : Get disk utilization | |
df -H | |
# Step 2 : Get biggest files on disk | |
du -am | gawk 1024 MB | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
############################################### | |
# Purpose : To push an application metric (process status metric) for visibility and subsequently creating alarms on it | |
# Usage : Run this script on ec2 instance | |
# Crontab usage : */1 * * * * /home/ec2-user/publishProcessStatus.sh | |
# | |
# Dependencies : AWS CLI needs to be installed | |
# Author : Neptune.io, Inc. | |
############################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
############################################### | |
# Purpose : To push an application metric (Memory utiization metric) for visibility and subsequently creating alarms on it | |
# Usage : Run this script on ec2 instance | |
# Crontab usage : */1 * * * * /home/ec2-user/publishProcessStatus.sh | |
# | |
# Dependencies : AWS CLI needs to be installed | |
# Author : Neptune.io, Inc. | |
############################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
############################################### | |
# Purpose : To push an application metric (Disk utiization metric) for visibility and subsequently creating alarms on it | |
# Usage : Run this script on ec2 instance | |
# Crontab usage : */1 * * * * /home/ec2-user/publishProcessStatus.sh | |
# | |
# Dependencies : AWS CLI needs to be installed | |
# Author : Neptune.io, Inc. | |
############################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do \ | |
echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB \ | |
$(docker ps | grep $line | awk '{printf $NF" "}') ; \ | |
done | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stage current file to index | |
Gwrite | |
# Read current file from last checkedin version | |
Gread | |
# Move current file and update vim buffer ( with relative paths, if starting with / means relative to git root directory) | |
Gmove | |
# Remove current file and update vim buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var root = $(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
if (element.data().hasOwnProperty('$scope')) { | |
angular.forEach(element.data().$scope.$$watchers, function (watcher) { | |
watchers.push(watcher); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create table in region us-west-1 from DynamoDB console : SatishTestTable | |
# Use only a hash number : primarykey | |
# With capacities read : 20 ; write 10 | |
# From your mac terminal using AWS CLI, fill up the table | |
for serialno in {1..2000} | |
do | |
aws dynamodb put-item --table-name SatishTestTable --region us-west-1 --item '{ "primarykey" : {"N":"'$serialno'"}, "text1" : {"S": "NeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNeptuneioNep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start with a float number | |
NP_TRIGGER_VALUES=999.23 | |
# Convert float to integer value as shell supports only integer arithmetic not float | |
CURRENT_QUEUE_COUNT=$(printf "%.0f" $NP_TRIGGER_VALUES ) | |
# Integer value | |
DYNO_CAPACITY=500 | |
# Division; Give a space before and after the operator - shell gotcha |