Skip to content

Instantly share code, notes, and snippets.

View pandemicsyn's full-sized avatar
🌮
everyday is taco tuesday.

Florian Hines pandemicsyn

🌮
everyday is taco tuesday.
View GitHub Profile
fhines@ubuntu:~/swift (review/darrell_bishop/bug/1025433)$ python test/unit/common/middleware/test_proxy_logging.py
Unable to find unit_test config section in /etc/swift/func_test.conf
Unable to read test config /etc/swift/func_test.conf - section unit_test not found
.............test/unit/common/middleware/test_proxy_logging.py:340: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
"header sent and there is content! 'l'", e.message)
......
----------------------------------------------------------------------
Ran 19 tests in 0.006s
OK
fhines@ubuntu:~/swift (review/david_goetz/detar)$ curl -v -X PUT -T /tmp/etc.tar.gz -H 'X-Auth-Token: AUTH_tk70b9b52ffc804ede85057bc3df0675e1' -H 'X-Extract-Archive: monkey.zip' http://127.0.0.1:8080/v1/AUTH_test/testit; echo
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_test/testit HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k zlib/1.2.3.3 libidn/1.15
> Host: 127.0.0.1:8080
> Accept: */*
> X-Auth-Token: AUTH_tk70b9b52ffc804ede85057bc3df0675e1
> X-Extract-Archive: monkey.zip
===============================================================================
Checking on account ring...
===============================================================================
[account] -> No ring change required
===============================================================================
Checking on object ring...
===============================================================================
--> [127.0.0.1/sdb4] weight 0.0 | target 1.0
-> ring requires change to meet target weight!
--> partitions last moved 138 hours ago [2012-12-06 00:19:04]
import os
import json
from diamond import *
import diamond.collector
class SwiftReconCollector(diamond.collector.Collector):
"""
Reads swift recon cache files to collect swift recon data
"""
package main
import (
"fmt"
"io"
"net/http"
"os"
"unsafe"
"code.google.com/p/vitess/go/cache"
)
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False
@pandemicsyn
pandemicsyn / something.sh
Last active December 21, 2015 13:28
Reverse all the prompts!
in a file called ~/.reverseit.py:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
from sys import stdin, stdout
pchars = u"abcdefghijklmnopqrstuvwxyz,.?!'()[]{}"
fchars = u"ɐqɔpǝɟƃɥıɾʞlɯuodbɹsʇnʌʍxʎz'˙¿¡,)(][}{"
flipper = dict(zip(pchars, fchars))
@pandemicsyn
pandemicsyn / ring_calc.py
Created September 10, 2013 10:53
@gholt's ring part power calculation script
#!/usr/bin/env python
import math
min_drives = 10
max_drives = 60000
replicas = 3
part_power = math.ceil(math.log(math.ceil(max_drives * 100.0 / replicas), 2))
print "part_power: %d\npartition_count: %d\napproximate per drive with %d drives: %.02f\napproximate per drive with %d drives: %.02f" % (part_power, 2**part_power, min_drives, 2**part_power * replicas / min_drives, max_drives, 2**part_power * replicas / max_drives)'
@pandemicsyn
pandemicsyn / gist:6771509
Created September 30, 2013 22:56
check_salt_minions
#!/usr/bin/env python
import sys
import json
import subprocess
import salt.client
error = False
keycmd = "sudo salt-key -L --out json --no-color --out-indent=-1"
out = subprocess.Popen(keycmd.split(), stdout=subprocess.PIPE).communicate()[0]
var wg sync.WaitGroup
for i := 0; i < 200; i++ {
wg.Add(1)
go blastSwift("images", token, url, &wg)
}
fmt.Println("Waiting on survivors")
wg.Wait()