View ping.py
This file contains 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 python3 | |
import asyncio | |
@asyncio.coroutine | |
def ping(loop, target, dump=False): | |
create = asyncio.create_subprocess_exec('ping', '-c', '10', target, | |
stdout=asyncio.subprocess.PIPE) | |
proc = yield from create |
View mailq.py
This file contains 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 python3 | |
import subprocess | |
import re | |
from pypred import Predicate | |
SPACE = re.compile(r"\s+") | |
def mailq(): |
View Dockerfile
This file contains 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 debian:jessie | |
ENV DEVTOOLS git-core build-essential pkg-config libtool libevent-dev \ | |
libncurses-dev zlib1g-dev automake cmake ruby libssl-dev | |
RUN apt-get update && apt-get install --yes --no-install-recommends $DEVTOOLS \ | |
libssl1.0.0 libevent-2.0-5 libncurses5 &&\ | |
rm -rf /var/lib/apt/lists/* &&\ | |
mkdir -p /src &&\ |
View Dockerfile
This file contains 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 base/archlinux | |
RUN pacman-key --populate archlinux &&\ | |
pacman-key --refresh-keys &&\ | |
pacman-key -r arojas@us.es | |
RUN pacman -Sy | |
RUN yes | pacman -Sy libevent libssh libutempter msgpack-c openssl zlib automake cmake ruby autoconf gcc pkg-config make libunistring git |
View influx.py
This file contains 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 pyparsing import QuotedString, Word, nums, delimitedList, Optional, \ | |
Regex, Group, Suppress, ParseException | |
integer = Regex(r"(?P<integer>\d+)i").setParseAction(lambda s, locs, toks: | |
int(toks[0][:-1])) | |
real = Regex(r"[+-]?\d+(\.\d+)?")("real").setParseAction(lambda s, locs, toks: | |
float(toks[0])) | |
number = Word(nums) | |
key = Regex(r"[a-zA-Z][a-zA-Z0-9_]*") |
View sig.py
This file contains 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 asyncio | |
import functools | |
import os | |
import signal | |
def ask_signal(signame, exit=False): | |
print("got signal %s" % signame) | |
if exit: | |
loop.stop() |
View metaping.py
This file contains 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 python3 | |
import os | |
import asyncio | |
import aiohttp | |
from aiohttp import web | |
@asyncio.coroutine | |
def do_ping(session, domain): |
View pubsub.go
This file contains 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
package main | |
import ( | |
"math/rand" | |
"net/http" | |
"sync" | |
"golang.org/x/net/websocket" | |
) |
View fastcgi_proxy.go
This file contains 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
package main | |
import ( | |
"fmt" | |
"github.com/mholt/caddy/middleware/fastcgi" | |
"net" | |
"net/http" | |
"net/http/fcgi" | |
"os" | |
) |
View dns_txt.py
This file contains 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 python2 | |
from __future__ import print_function | |
from dns import resolver | |
from StringIO import StringIO | |
import sys | |
buff = StringIO() | |
answers = resolver.query(sys.argv[1], 'TXT') |