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
loop do | |
begin | |
Timeout::timeout(0.2) { | |
parsed_data = parser.parse_line(ARGF.readline) | |
/(?<section>(http:\/\/\w+\.?\w*)?(\/[\w0-9]*))/ =~ parsed_data[:request] | |
sections["#{section}"] ||= 0 | |
sections["#{section}"] += 1 | |
hits += 1 | |
} | |
rescue Timeout::Error |
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 | |
HOST="http://www.google.com" | |
CURL="/usr/bin/curl" # Assuming this is installed | |
NUM=$(sed '1q;d' current.txt); | |
INT=$(sed '3q;d' current.txt); | |
# Matt - switch to curl with a HEAD request so you're not sucking down | |
# actual html. This still checks the network without pulling much data. | |
# Make the failure happen in 20s longer than it would take for an SSH |
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 | |
createTunnel() { | |
autossh -f -M 0 -q \ | |
-o "TCPKeepAlive no" \ | |
-o "ServerAliveInterval 15" \ | |
-o "ServerAliveCountMax 4" \ | |
-t -t -D 9999 root@localhost -p 2222 | |
if [[ $? -eq 0 ]]; then |
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 | |
# Changes - Matt: | |
# Fail in 60s instead of 3m. Less downtime & AutoSSH will take care of the reconnect. | |
# Look for (pidof) the autossh master process instead of *any* ssh process. | |
# Turn TCPKeepAlive off as it's redundant, can interfere, and SSH is already sending keepalives. | |
EXT=$(sed '2q;d' current.txt) | |
echo "ip is $EXT"; |
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
package Crowdtilt::Internal::StatsClient; | |
# Abstraction for statsd client that handles things like prefixing | |
use Dancer qw( debug ); | |
use DataDog::DogStatsd; | |
use Function::Parameters; | |
use Moose; | |
use Time::HiRes qw( time ); |
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
" Gist Plugin | |
let g:gist_open_browser_after_post = 1 |
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
set autoindent " always set autoindenting on set autowrite " auto saves changes when quitting and swiching buffer | |
set background=dark | |
set clipboard=unnamed | |
set encoding=utf-8 | |
set expandtab | |
set foldmethod=marker " use typed folding | |
set history=500 | |
set hlsearch " highlight searches | |
set ignorecase " ignore case when searching | |
set incsearch " do incremental searching |
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
--- stress-campaigns.sh 2015-12-09 15:45:47.647177342 +0000 | |
+++ stepping-stress-campaigns.sh 2016-07-06 20:59:01.047093230 +0000 | |
@@ -86,19 +86,19 @@ | |
fi | |
echo "Running ..." | |
-CMD="echo "\""GET ${URL}"\"" | vegeta attack -rate=${RATE} -duration=${DURATION} -output=vegeta-`uname -n`.bin" | |
- | |
-echo $CMD | |
- |
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
{ | |
"viz": "change", | |
"requests": [ | |
{ | |
"q": "sum:postgresql.database_size{$env,$db_role} by {host}", | |
"compare_to": "day_before", | |
"change_type": "absolute", | |
"order_by": "change", | |
"order_dir": "desc", | |
"extra_col": "present", |
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
[ mattw@staging-webhooks-459eccc2:/opt/datadog-agent ]$ sudo su - dd-agent | |
$ dd-agent check api_gpg | |
2016-05-12 14:28:05,608 | INFO | dd.collector | checks.collector(collector.py:535) | Running check api_gpg | |
Metrics: | |
[] | |
Events: | |
[] | |
Service Checks: | |
[{'check': 'api_gpg', | |
'host_name': 'staging-webhooks-459eccc2', |