Skip to content

Instantly share code, notes, and snippets.

import sys
import math
def is_prime(num):
"""
Returns True or False.
"""
if num < 2:
return False
Test gist.
Test gist.
Test gist.
@markcaudill
markcaudill / gist:1196348
Created September 6, 2011 01:45
bender specs
[mark@bender:~]$ cat /proc/cpuinfo | grep -E 'processor|model name|cpu MHz' | xargs -l3
processor : 0 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 1 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 2 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 3 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 4 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 5 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 6 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
processor : 7 model name : Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz cpu MHz : 1600.000
[mark@bender:~]$ free -m
@markcaudill
markcaudill / gist:1196360
Created September 6, 2011 01:49
zoidberg specs
[mark@zoidberg:~]$ cat /proc/cpuinfo | grep -E 'processor|model name|cpu MHz' | xargs -l3
processor : 0 model name : Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz cpu MHz : 1199.000
processor : 1 model name : Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz cpu MHz : 1199.000
processor : 2 model name : Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz cpu MHz : 1199.000
processor : 3 model name : Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz cpu MHz : 1199.000
[mark@zoidberg:~]$ free -m
total used free shared buffers cached
Mem: 3825 3498 327 0 166 1689
-/+ buffers/cache: 1642 2183
Swap: 4317 3 4314
[mark@dev:~]$ traceroute uxxxxxxxx.onlinehome-server.com
traceroute to uxxxxxxxx.onlinehome-server.com (x.x.x.x), 30 hops max, 40 byte packets
1 x.x.x.x (x.x.x.x) 0.599 ms 0.677 ms 0.711 ms
2 x.x.x.x (x.x.x.x) 0.765 ms 1.042 ms 1.122 ms
3 x.x.x.x (x.x.x.x) 0.524 ms 0.714 ms 0.798 ms
4 x.x.x.x (x.x.x.x) 1.379 ms 1.380 ms 1.383 ms
5 equinix.bb-b.cr.chi.us.oneandone.net (206.223.119.24) 2.156 ms 2.364 ms 1.983 ms
6 te-2-4.bb-d.ws.mkc.us.oneandone.net (74.208.1.54) 12.411 ms 12.689 ms 12.574 ms
7 te-3-2.bb-d.ga.mkc.us.oneandone.net (74.208.1.73) 12.793 ms 12.780 ms 12.755 ms
8 * * *
[mark@dev:~]$ traceroute uxxxxxxxx.onlinehome-server.com
traceroute to uxxxxxxxx.onlinehome-server.com (x.x.x.x), 30 hops max, 40 byte packets
1 x.x.x.x (x.x.x.x) 0.612 ms 0.679 ms 0.724 ms
2 x.x.x.x (x.x.x.x) 0.813 ms 1.075 ms 1.187 ms
3 x.x.x.x (x.x.x.x) 0.583 ms 0.745 ms x.x.x.x (x.x.x.x) 0.660 ms
4 x.x.x.x (x.x.x.x) 1.444 ms 1.420 ms x.x.x.x (x.x.x.x) 1.383 ms
5 equinix.bb-b.cr.chi.us.oneandone.net (206.223.119.24) 2.169 ms 2.432 ms 2.402 ms
6 te-2-4.bb-d.ws.mkc.us.oneandone.net (74.208.1.54) 28.042 ms 13.160 ms 12.926 ms
7 te-3-2.bb-d.ga.mkc.us.oneandone.net (74.208.1.73) 30.132 ms 30.473 ms 30.443 ms
8 * * *
[mark@dev:~]$ traceroute uxxxxxxxx.onlinehome-server.com
traceroute to uxxxxxxxx.onlinehome-server.com (x.x.x.x), 30 hops max, 40 byte packets
1 x.x.x.x (x.x.x.x) 0.603 ms 0.688 ms 0.739 ms
2 x.x.x.x (x.x.x.x) 0.732 ms 1.016 ms 1.127 ms
3 x.x.x.x (x.x.x.x) 0.772 ms x.x.x.x (x.x.x.x) 0.672 ms x.x.x.x (x.x.x.x) 0.900 ms
4 x.x.x.x (x.x.x.x) 1.390 ms x.x.x.x (x.x.x.x) 1.402 ms x.x.x.x (x.x.x.x) 1.421 ms
5 equinix.bb-b.cr.chi.us.oneandone.net (206.223.119.24) 2.036 ms 2.181 ms 2.152 ms
6 te-2-4.bb-d.ws.mkc.us.oneandone.net (74.208.1.54) 13.121 ms 12.841 ms 12.483 ms
7 te-3-2.bb-d.ga.mkc.us.oneandone.net (74.208.1.73) 67.594 ms 67.798 ms 67.801 ms
8 te-2-1.bb-d.slr.lxa.us.oneandone.net (74.208.1.65) 13.341 ms 13.319 ms 13.047 ms
* * * * * /usr/bin/python /path/to/update-haproxy.py --security-group=webservers --access-key='YOURACCESSKEY' --secret-key='YoUrSeCrEtKeY' --haproxy=/path/to/haproxy --pid=/var/run/haproxy.pid --output=/path/to/haproxy.cfg --template=/path/to/templates/haproxy.cfg --eip='1.2.3.4' --health-check-url='http://1.2.3.4/health_check.txt'