This file contains hidden or 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
import json | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
class MyHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
print self.headers | |
print self.command | |
print self.path | |
print self.request_version |
This file contains hidden or 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
Append to /etc/security/limits.conf | |
ubuntu core hard unlimited | |
ubuntu core soft unlimited | |
ubuntu data hard unlimited | |
ubuntu data sft unlimited | |
ubuntu fsize hard unlimited | |
ubuntu fsize soft unlimited | |
ubuntu nofile hard 999999 | |
ubuntu nofile soft 999999 |
This file contains hidden or 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/bash -eux | |
// set $DATADOGKEY to your API key | |
DATE=$(date +%s) | |
HOSTNAME=`hostname` | |
cat /proc/net/sockstat | grep TCP | cut -d":" -f2 |sed 's/^ //g' | awk '{print $1, $2"\n"$3, $4"\n"$5,$6"\n"$7,$8"\n"$9,$10}' > /tmp/stats.tmp | |
while read LINE; do | |
METRIC=$(echo $LINE | cut -d" " -f1) | |
VALUE=$(echo $LINE | cut -d" " -f2) | |
curl -X POST -H "Content-type: application/json" \ |