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
#https://github.com/caius/fio/tree/master/examples
# Do some important numbers on SSD drives, to gauge what kind of
# performance you might get out of them.
#
# Sequential read and write speeds are tested, these are expected to be
# high. Random reads should also be fast, random writes are where crap
# drives are usually separated from the good drives.
#
# This uses a queue depth of 4. New SATA SSD's will support up to 32
#!/bin/bash
TARGET="$GOPATH/src/github.com/pandemicsyn/$1/*"
INSTALL_ARG="github.com/pandemicsyn/$1"
md5sum_now=`md5 $TARGET`
md5sum_last=`md5 $TARGET`
echo "Attempting build/install of $TARGET"
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()
@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]
@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 / 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))
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False
package main
import (
"fmt"
"io"
"net/http"
"os"
"unsafe"
"code.google.com/p/vitess/go/cache"
)
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
"""
===============================================================================
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]