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
| sudo('DEBIAN_FRONTEND=noninteractive apt-get -qq install mdadm xfsprogs') | |
| disks = ' '.join(['/dev/xvd%s' % c for c in letters]) | |
| sudo('mdadm --create /dev/md0 --level=0 -c256 --raid-devices=4 %s' % disks) | |
| run('cat /proc/mdstat') | |
| # if you ever come across a blog that suggests to use this setting, IGNORE!! | |
| # sudo('blockdev --setra 65536 /dev/md0') | |
| sudo('mkfs.xfs -f /dev/md0') |
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
| cd ~/git/borkbork | |
| git pull | |
| bin/bork install chashring |
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 | |
| import sys | |
| import socket | |
| import os | |
| def get_free_ports(num, host=None): | |
| if not host: | |
| host = '127.0.0.1' |
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
| func check(ch chan string) string { | |
| select { | |
| case ret := <-ch: | |
| return ret | |
| case <-time.After(10 * time.Millisecond): | |
| return "nada" | |
| } | |
| } |
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 sockets | |
| var s = sockets.socket(typ=sockets.SOCK_DGRAM, protocol=sockets.IPPROTO_UDP) | |
| s.bindAddr(port=sockets.TPort(5555)) | |
| var port = s.getSockName() | |
| echo("started: ", port) | |
| const BUF=4096 | |
| var data = newString(BUF) |
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
| pb.Room( | |
| 50, | |
| name="The Lads", | |
| users=[pb.User(10), pb.User(20)]) | |
| {'room': { | |
| 'room_id': 50, | |
| 'name': 'The Lads', | |
| 'users': [ |
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
| class encoderdecoder(object): | |
| def __init__(self, encoding, decoding): | |
| self.encoding = encoding | |
| self.decoding = decoding | |
| def encode(self, message): | |
| return encode(self.encoding, message) | |
| def decode(self, message): | |
| return decode(self.decoding, message) |
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 sys | |
| import signal | |
| from vanilla import malt | |
| h = malt.Hub() | |
| ch = h.channel() | |
| def beat(name, step, offset=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
| protolite: force | |
| protolite-generate --protos proto/objects.proto --output protolite --prefix PB | |
| protolite-generate --protos proto/command.proto --output protolite --prefix PBCommand | |
| protolite-generate --protos proto/activity.proto --output protolite --prefix PBActivity |
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
| class decoding(object): | |
| __slots__ = ( | |
| "envelope", | |
| "user_signup_request", | |
| "user_signup_response", | |
| "user_login_request", | |
| "user_login_response", | |
| "user_identify_challenge", | |
| "user_identify_request", | |
| "user_identify_response", |