wget https://raw.githubusercontent.com/lukas2511/dehydrated/116386486b3749e4c5e1b4da35904f30f8b2749b/dehydrated
UPDATE: 下载最新版本:
wget https://raw.githubusercontent.com/lukas2511/dehydrated/master/dehydrated
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import copy | |
PY2 = sys.version_info[0] == 2 | |
class Result(object): |
// https://hackernoon.com/functional-javascript-resolving-promises-sequentially-7aac18c4431e | |
// Kefir.js version. | |
// Just a demo. | |
var ids = [1, 2, 3, 4]; | |
var thenables = ids.map(i => { | |
let thenable = fetch(`https://httpbin.org/anything?id=${i}`) | |
.then(r => r.json()) | |
.then(obj => obj.args.id); | |
return Kefir.fromPromise(thenable); | |
}) |
#!/usr/bin/env bash | |
#if [ `whoami` != 'root' ]; then | |
#echo "Please run as root." | |
#exit 1 | |
#fi | |
cat << 'EOF' > /etc/init.d/fluentd | |
#! /bin/sh |
# maybe.py - a Pythonic implementation of the Maybe monad | |
# Copyright (C) 2014. Milan Oberkirch <milan.py@oberkirch.org> | |
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import inspect | |
def iscoroutinefunction(fn): | |
if inspect.iscoroutinefunction(fn): | |
return True | |
if inspect.iscoroutinefunction(getattr(fn, "__call__", None)): | |
return True |
from time import time | |
def start(context): | |
context.log("Format: [send data timing] [waitting timing] [receive data timing] Request URL") | |
def request(context, flow): | |
context.started_at = time() | |
def response(context, flow): | |
sending = flow.request.timestamp_end - flow.request.timestamp_start |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from os import environ, path, makedirs | |
import imghdr | |
from datetime import datetime, timedelta | |
from concurrent.futures import ThreadPoolExecutor | |
from tornado import gen | |
from tornado.concurrent import run_on_executor |
#!/bin/bash | |
usage() | |
{ | |
cat <<EOF | |
Usage: $(basename $0) [options] | |
This shell script is a simple wrapper around the openssl binary. It uses | |
s_client to get certificate information from remote hosts, or x509 for local | |
certificate files. It can parse out some of the openssl output or just dump all |
#!/usr/bin/env python | |
# encoding: utf-8 | |
def retriable(retry_counts=3, before_retry=None, final=None, noexc=False): | |
is_callable = lambda x: x is not None and hasattr(x, "__call__") | |
if not is_callable(before_retry): | |
before_retry = lambda err, c: c | |
if not is_callable(final): | |
final = lambda err, c: c |