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
#!/usr/bin/env python | |
''' | |
check_memcache.py | |
# A quick and *very* dirty script to health check memcache # | |
# server(s) and dump their stats. Requires python-memcache. # | |
# Author: Florian Hines <florian.hines<AT>gmail.com # | |
This program is free software; you can redistribute it and/or |
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
#!/usr/bin/env python | |
#assumes youre posting to your default site | |
#other wise you need to add site_id | |
import pycurl | |
username="[email protected]" | |
password="urSuperSekritPassword" | |
file="/home/syn/Desktop/charts/nvda-05032010.png" | |
title="$nvda" | |
tags="nvda, chart, doji, more, tags" | |
body="blah blah blah this is the body of this post" |
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 Growl | |
def growlAlert(self, type, eventclass, device): | |
""" | |
<type> = "New Alert" or "Clear" | |
<eventclass> (i.e. /Status/IpService) | |
<device> (i.e. server1.domain.com) | |
""" | |
name = "ZenWatch" |
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
# Make sure you've got the "healthcheck" pipeline entry in your [proxy|account|container|object]-server.conf: | |
[pipeline:main] | |
pipeline = catch_errors healthcheck cache ratelimit auth proxy-server | |
# And that you've added the filter for it as well (in the same config of course): | |
[filter:healthcheck] | |
use = egg:swift#healthcheck |
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
#!/usr/bin/python | |
""" | |
python rfind.py [search term] [filename] | |
""" | |
import mmap | |
import os | |
import sys | |
_cmd, search_term, filename = sys.argv |
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
from resource import getpagesize | |
from subprocess import call | |
import datetime | |
import time | |
import os | |
from sys import exit | |
# warn at 5GB of use , reload at 6GB | |
memlimit_warn = 5120 #in MB | |
memlimit_max = 6144 #in MB |
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
#!/usr/bin/env | |
import os | |
def proccount(): | |
if hasattr(os, 'sysconf'): | |
if 'SC_NPROCESSORS_ONLN' in os.sysconf_names.keys(): | |
return os.sysconf("SC_NPROCESSORS_ONLN") | |
else: | |
return None |
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
fhines@ubuntu:~/swift-temp (master)$ swift -A http://127.0.0.1:8080/auth/v1.0 -U test:tester -K testing upload test9 AUTHORS | |
Object PUT failed: http://127.0.0.1:8080/v1/AUTH_test/test9/AUTHORS 404 Not Found 404 Not Found | |
The resource could not be found. | |
==> proxy.log <== | |
Mar 14 23:50:03 ubuntu proxy-server - 127.0.0.1 15/Mar/2012/06/50/03 GET /auth/v1.0/ HTTP/1.0 200 - - - - - - - - 0.0007 | |
Mar 14 23:50:03 ubuntu proxy-server 127.0.0.1 127.0.0.1 15/Mar/2012/06/50/03 PUT /v1/AUTH_test/test9 HTTP/1.0 403 - - test%2CAUTH_tk6da2436a775342debba11c597311ebc2 - - - tx84fbd2ea15bb4900ba7dcf0df2896737 - 0.0008 - | |
Mar 14 23:50:03 ubuntu proxy-server - 127.0.0.1 15/Mar/2012/06/50/03 GET /auth/v1.0/ HTTP/1.0 200 - - - - - - - - 0.0010 | |
Mar 14 23:50:03 ubuntu proxy-server 127.0.0.1 127.0.0.1 15/Mar/2012/06/50/03 HEAD /v1/AUTH_test/test9/AUTHORS HTTP/1.0 404 - - test%2CAUTH_tk6da2436a775342debba11c597311ebc2 - - - txd522984e5d0b42778852fecf717f0c7c - 0.0091 - |
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
== ACCOUNT ====================================== | |
{ | |
"account_auditor_pass_completed": 0.085180044174194336, | |
"account_audits_failed": 0, | |
"account_audits_passed": 1, | |
"account_audits_since": 1333359057.7133241, | |
"replication_stats": { | |
"attempted": 1, | |
"diff": 2, | |
"diff_capped": 0, |
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
fhines@ubuntu:~/RingMaster (master)$ python ringscout.py -z 1 -w 1 -r 172.16.63.129-155 /etc/swift/object.builder -p 6010 | |
Scanning 172.16.63.129-155 for drives to add to zone 1 with meta data []... | |
---> 172.16.63.129:6010 found: ['sdc'] | |
Add all devices to ZONE 1: [y/n]: y | |
Backed up builder too /etc/swift/backups/1339649292.object.builder (b12532da805cc5b7f280604505f74213) | |
adding... | |
adding z1-172.16.63.129:6010/sdc_ 1 | |
fhines@ubuntu:~/RingMaster (master)$ python ringscout.py -h | |
Usage: | |
usage: ringscout.py [-v] [--suppress] [-y] [-z zone] [-w weight] [-m "meta info"] |
OlderNewer