- Create 5GB FreeBSD image.
- Install FreeBSD on xhyve.
- Mount host directory.
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 | |
| '''Using Webhook and self-signed certificate''' | |
| # This file is an annotated example of a webhook based bot for | |
| # telegram. It does not do anything useful, other than provide a quick | |
| # template for whipping up a testbot. Basically, fill in the CONFIG | |
| # section and run it. | |
| # Dependencies (use pip to install them): | |
| # - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot |
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 cv2 | |
| import numpy as np | |
| def main(): | |
| cap = cv2.VideoCapture(0) | |
| while(cap.isOpened()): | |
| ret, img = cap.read() | |
| skinMask = HSVBin(img) |
This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes.
Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes
CFFI is nice because:
- Reads C declarations (parses headers)
- Works in both CPython and PyPy (included with PyPy)
- Lower call overhead than
ctypes
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
| from tkinter import * | |
| import asyncio | |
| from functools import wraps | |
| import websockets | |
| def runloop(func): | |
| ''' | |
| This decorator converts a coroutine into a function which, when called, | |
| runs the underlying coroutine to completion in the asyncio event loop. | |
| ''' |
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
| ping6 -c 3 ietf.org | |
| PING6(56=40+8+8 bytes) 2001:db8:dead:beef::1 --> 2001:1900:3001:11::2c | |
| 16 bytes from 2001:1900:3001:11::2c, icmp_seq=0 hlim=50 time=169.853 ms | |
| 16 bytes from 2001:1900:3001:11::2c, icmp_seq=1 hlim=50 time=172.739 ms | |
| 16 bytes from 2001:1900:3001:11::2c, icmp_seq=2 hlim=50 time=166.899 ms | |
| --- ietf.org ping6 statistics --- | |
| 3 packets transmitted, 3 packets received, 0.0% packet loss | |
| round-trip min/avg/max/std-dev = 166.899/169.830/172.739/2.384 ms |
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 macros | |
| proc procToLambda(input: PNimrodNode): PNimrodNode {.compiletime.} = | |
| # Ident !"foo" | |
| # Empty | |
| # Empty | |
| # FormalParams | |
| # Ident retType | |
| # IdentDefs | |
| # ... |
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
- Does the design expect failures to happen regularly and handle them gracefully?
- Have we kept things as simple as possible?