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
#!/bin/sh | |
# | |
# copied from https://gist.github.com/smoser/5823699 | |
# | |
set -e | |
[ -e "/usr/bin/apt-get.distrib" ] || | |
sudo dpkg-divert --local --rename --add /usr/bin/apt-get | |
sudo tee /usr/bin/apt-get >/dev/null <<"EOF" |
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
#!/bin/bash | |
usage="$(basename "$0") [-h] mountpoint nfs_server:directory" | |
while getopts ":h" opt; do | |
case $opt in | |
h) | |
echo $usage >&2 | |
exit 1 | |
;; |
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 collections | |
import json | |
import uuid | |
import aiohttp | |
Message = collections.namedtuple( | |
"Message", |
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
# REF: https://github.com/pyenv/pyenv/blob/master/README.md | |
# ... building Python 3.6.2 on Bastion, "locally" | |
# yum install [Python3 build pre-reqs, on CentOS 6.7] | |
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash | |
tee -a $HOME/.bash_profile <<EOF | |
export PATH="\$HOME/.pyenv/bin:\$PATH" | |
eval "\$(pyenv init -)" |
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 python | |
'''Script to pull data out of GitHub and push into Elasticsearch''' | |
import os | |
import sys | |
import requests | |
import httplib | |
import json # NOQA | |
from urlparse import urljoin | |
from uritemplate import expand |
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 random | |
import time | |
from tornado import gen | |
from tornado.concurrent import run_on_executor, futures | |
from tornado.ioloop import IOLoop | |
class TaskRunner(object): | |
def __init__(self, loop=None): | |
self.executor = futures.ThreadPoolExecutor(4) | |
self.loop = loop or IOLoop.instance() |
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
# | |
# This piece of code is written by | |
# Jianing Yang <jianingy.yang@gmail.com> | |
# with love and passion! | |
# | |
# H A P P Y H A C K I N G ! | |
# _____ ______ | |
# ____==== ]OO|_n_n__][. | | | |
# [________]_|__|________)< |YANG| | |
# oo oo 'oo OOOO-| oo\\_ ~o~~o~ |
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 time | |
import logging | |
from tornado.options import options, define | |
from tornado import gen | |
from tornado.tcpclient import TCPClient | |
from tornado.iostream import StreamClosedError | |
from tornado.ioloop import IOLoop | |
define("host", default="127.0.0.1", help="TCP server host") | |
define("port", default=9888, help="TCP port to connect to") |
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
# -*- coding: utf-8 -*- | |
# REWORKED by biggers@utsl.com, from: | |
# 16/7/7 | |
# create by: snower | |
import datetime | |
from tornado import gen | |
from tornado.ioloop import IOLoop | |
from torpeewee import ( | |
Model, |
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 logging | |
import os | |
import uuid | |
from tornado import gen | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from tornado.options import define, options | |
from tornado.web import Application, StaticFileHandler, url |