Skip to content

Instantly share code, notes, and snippets.

@gcorrao
gcorrao / config.xml
Created March 2, 2012 20:48
combyne simple test
<server>
<app-id = "{{dept}}-{{app}}-{{service}}" />
<app-port>{%if app_port == ""%}8080{%else%}{{app_port}}{%endif%}</app-port>
<memcached-servers>
{%each memcached_servers as name ip%}
<server>
<name>{{name}}</name>
<ip>{{ip}}</ip>
<server>
{%endeach%}
@gcorrao
gcorrao / varni.sh
Created June 22, 2011 21:19
Script that takes varnish stats and writes out a log-like file
#/bin/bash -l
function get_stats {
(
echo "stats"
echo ""
sleep 1
echo "quit"
) | telnet $1 6082 2>&1
}
@gcorrao
gcorrao / blackbox.sh
Created June 10, 2011 17:57
bash- script that detects high CPU and runs a "system scan"
#!/bin/bash
INTERVAL=$1
THRESHOLD=$2
if [ "" == "$INTERVAL" -o "" == "$THRESHOLD" ]; then
echo "You must insert interval and cpu threshold"
exit 1
fi
while [ 1 ]; do
@gcorrao
gcorrao / Reachable.java
Created June 9, 2011 19:25
Java - test INetAddress speed against regular ping
import java.net.InetAddress;
import java.util.Arrays;
public class Reachable {
public static void main(String[] args) {
try {
long startTime;
boolean result;