Skip to content

Instantly share code, notes, and snippets.

View tipabu's full-sized avatar

Tim Burke tipabu

  • San Francisco, CA
View GitHub Profile
@notmyname
notmyname / saio_bringup.sh
Last active October 29, 2019 17:01
py3-only saio setup on ubuntu 18.04 (bionic)
#!/bin/bash
set +e
VBoxManage controlvm saio_vm poweroff
VBoxManage unregistervm saio_vm --delete
rm /home/john/vbox_storage/saio_vm/*
set -e
@clayg
clayg / move_part.py
Created February 28, 2018 15:38
saio rebalance simulator
#!/usr/bin/env python
import sys
from argparse import ArgumentParser
from swift.common.ring import RingData
import random
parser = ArgumentParser()
parser.add_argument('ring', help='the ring')
parser.add_argument('part', type=int, help='the part')
parser.add_argument('replica', nargs='?', type=int, help='the replica')
@clayg
clayg / timeout_server.py
Created February 27, 2018 10:39
Listen on a port and do nothing good
# Timeout server program
import sys
from eventlet import spawn_n, sleep, Timeout
from eventlet.green import socket
HOST = ''
PORT = int(sys.argv[1])
TIMEOUT = 3.1
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@dnozay
dnozay / python33.rb
Last active November 6, 2016 11:13
python3.3 homebrew formula.
# taken from https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python3.rb
# and adapted to use 3.3.x instead of 3.4
# Homebrew: https://github.com/Homebrew/homebrew
# Homebrew is licensed under BSD 2 Clause: https://github.com/Homebrew/homebrew/blob/master/LICENSE.txt
require "formula"
class Python33 < Formula
homepage "https://www.python.org/"