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 | |
from __future__ import print_function | |
import sys | |
from circuits.node import Node, remote | |
from circuits import Component, Event, Timer |
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 | |
"""Simple VCS""" | |
from hashlib import sha256 | |
from json import dumps, loads | |
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 | |
from circuits.io import stdout, File, write | |
class Cat(File): | |
stdout = stdout |
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 numpy | |
>>> data = numpy.genfromtxt("test.dat", names=["x", "y"]) | |
>>> data | |
array([(0.0, 1.0), (0.1, 2.0), (0.2, 3.0), (0.3, 4.0), (0.5, 7.0), | |
(1.0, 9.0)], | |
dtype=[('x', '<f8'), ('y', '<f8')]) | |
>>> data["x"] | |
array([ 0. , 0.1, 0.2, 0.3, 0.5, 1. ]) | |
>>> data["y"] | |
array([ 1., 2., 3., 4., 7., 9.]) |
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 | |
from circuits.net.events import write | |
from circuits import handler, Component, Debugger | |
from circuits.net.sockets import TCPServer, UDPServer | |
class UDPTCPBroadcaster(Component): |
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 | |
import sys | |
from time import sleep | |
from functools import partial | |
import boto.ec2.autoscale |
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
root@data | |
Fri May 01 09:31:54 | |
~ | |
$ zpool status | |
pool: data | |
state: ONLINE | |
scan: scrub repaired 0 in 0h28m with 0 errors on Wed Apr 29 13:13:08 2015 | |
config: | |
NAME STATE READ WRITE CKSUM |
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
autodock: | |
image: prologic/autodock | |
ports: | |
- "1338:1338/udp" | |
- "1338:1338/tcp" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
autodocklogger: | |
image: prologic/autodock-logger |
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
prologic@daisy | |
Wed Apr 29 11:55:09 | |
~/tmp | |
$ time ./collatz.py 65 1800000 | |
Smallest n: 1805311 | |
Collatz Sequence: [1805311, 5415934, 2707967, 8123902, 4061951, 12185854, 6092927, 18278782, 9139391, 27418174, 13709087, 41127262, 20563631, 61690894, 30845447, 92536342, 46268171, 138804514, 69402257, 208206772, 104103386, 52051693, 156155080, 78077540, 39038770, 19519385, 58558156, 29279078, 14639539, 43918618, 21959309, 65877928, 32938964, 16469482, 8234741, 24704224, 12352112, 6176056, 3088028, 1544014, 772007, 2316022, 1158011, 3474034, 1737017, 5211052, 2605526, 1302763, 3908290, 1954145, 5862436, 2931218, 1465609, 4396828, 2198414, 1099207, 3297622, 1648811, 4946434, 2473217, 7419652, 3709826, 1854913, 5564740, 2782370, 1391185, 4173556, 2086778, 1043389, 3130168, 1565084, 782542, 391271, 1173814, 586907, 1760722, 880361, 2641084, 1320542, 660271, 1980814, 990407, 2971222, 1485611, 4456834, 2228417, 6685252, 3342626, 1671313, 5013940, 2506970, 1253485, 3760456, 1880228, 940114, 470057, 1410172, 705086, 352543, |
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 | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
fds = [int(x.strip()) for x in open("fds.log", "r")] | |
plt.plot(fds) |