(#my-heading)
See my heading
[root@garrett-laptop:~]# ip addr | |
... | |
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1406 qdisc pfifo_fast state UNKNOWN group default qlen 500 | |
link/none | |
inet 10.249.208.187/32 scope global tun0 | |
valid_lft forever preferred_lft forever | |
inet6 fe80::a4be:e60c:f593:2fac/64 scope link stable-privacy | |
valid_lft forever preferred_lft forever | |
[root@garrett-laptop:~]# ip route |
(#my-heading)
See my heading
import sys | |
import time | |
import socket | |
import asyncio | |
addr = ('127.0.0.1', 1064) | |
@asyncio.coroutine |
Description | |
Written in 2015 by Garrett Berg <garrett@cloudformdesign.com> | |
© Creative Commons 0 | |
To the extent possible under law, the author(s) have dedicated all copyright | |
and related and neighboring rights to this software to the public domain | |
worldwide. THIS SOFTWARE IS DISTRIBUTED WITHOUT ANY WARRANTY. | |
<http://creativecommons.org/publicdomain/zero/1.0/> |
#!/usr/bin/python | |
''' | |
Progress Bar - A Simple Progress Bar to use in the command line | |
Written in 2015 by Garrett Berg <garrett@cloudformdesign.com> | |
© Creative Commons 0 | |
To the extent possible under law, the author(s) have dedicated all copyright | |
and related and neighboring rights to this software to the public domain | |
worldwide. THIS SOFTWARE IS DISTRIBUTED WITHOUT ANY WARRANTY. | |
<http://creativecommons.org/publicdomain/zero/1.0/> |
Demonstrates some simple zmq communication
Similar to this example but usable more generally.
Quoting http://zeromq.org/area:faq:
Can I subscribe to messages using regex or wildcards?
import imp | |
module = imp.find_module('path/to/module') | |
module = imp.load_module('module_name', *module) |
# python 3 | |
import os | |
import platform | |
import ctypes | |
import re | |
import subprocess | |
import psutil | |
def processor(): | |
'''Get type of processor |
from enum import Enum | |
def enum(name, attrs=None): | |
'''enum generator function | |
Creates an Enum type. attrs can be: set, list, tuples or a dictionary. | |
The behavior is as follows: | |
- dictionaries and lists/tuples of the form [(name, key), (name2, key2), ...] will behave | |
as expected. (dictionaries will have their items() method called | |
- sets will be converted to zip(sorted(attrs), range(len(attrs))) | |
- lists/tuples without embeded tuples will do the same without sorting |