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
class Import: | |
def __init__(self, args, attr): | |
self.args = args | |
self.attr = attr | |
self.done = False | |
def __import__(self): | |
module = __import__(*self.args) | |
if not self.attr: |
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
# find . -name project.json | python3 collect.py | |
# | |
# total_projects: 41228 | |
# total_projects_eq: 182 | |
# % affected: 0.44% | |
# total_files: 285248 | |
# total_files_eq: 1276 | |
# % affected: 0.45% | |
# total_reqs: 642447 | |
# total_reqs_bare: 460080 |
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/python | |
# . | |
# |-- animals.py | |
# `-- sounds | |
# |-- cat.wav | |
# |-- cow.wav | |
# |-- dog.wav | |
# |-- oops.wav | |
# |-- sheep.wav | |
# `-- wolf.wav |
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
# encoding: utf8 | |
from __future__ import absolute_import | |
from __future__ import print_function | |
import datetime | |
import itertools | |
import json | |
import sys | |
import threading |
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
# encoding: utf8 | |
""" | |
save this as sockfun.py, then:: | |
git clone https://github.com/unbit/uwsgi.git && cd uwsgi | |
python2 setup.cpyext.py build | |
PYTHONPATH=build/lib.linux-x86_64-2.7 python2 sockfun.py | |
""" | |
from __future__ import print_function |
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
# encoding: utf-8 | |
# | |
# modules-next | |
# | |
# C Anthony Risinger | |
import sys | |
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
#!/bin/bash | |
IFS=; shopt -s nullglob | |
export PIP_REQUIRE_VIRTUALENV= | |
export PYTHONUNBUFFERED=x | |
export PYTHON=$(type -p python2.7 python2.6 python2 python | head -n1) | |
export PIP=$(type -p pip-2.7 pip-2.6 pip2 pip | head -n1) | |
cat <<'EOF' > controller.py |
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/python2 uwsgiconfig.py --clean; /usr/bin/python2 uwsgiconfig.py --build; /usr/bin/python2 uwsgiconfig.py --plugin plugins/pty default.ini pty; ./uwsgi --socket :3031 --processes 2 --pyshell="from IPython import embed; embed()" --master --plugin pty --pty-socket :5000 --pty-log --pty-input | |
using profile: buildconf/default.ini | |
detected include path: ['/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include', '/usr/local/include', '/usr/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/include-fixed', '/usr/include'] | |
detected CPU cores: 4 | |
configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format -Wno-format-security -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_PCRE -DUWSGI_ROUTING -DUWSGI_CAP -DUWSGI_UUID -DUWSGI_VERSION="\"1.9.15-dev-f027153\"" -DUWSGI_VERSION_BASE="1" -DUWSGI_VERSIO |
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
#!/bin/bash | |
uwsgi --http :9000 --eval ' | |
import sys | |
from time import sleep | |
from pprint import pformat as pf, pprint as pp | |
sys.excepthook = lambda *a, **k: pp(("ARGS:",a)) or pp(("KWDS",k)) |
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 os | |
import sys | |
import time | |
import logging | |
logging.basicConfig() | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) |
NewerOlder