I hereby claim:
- I am yaiba on github.
- I am yaiba (https://keybase.io/yaiba) on keybase.
- I have a public key ASAmh2lUuB1WMsrj4pWXp8bEP2Z2QzXkDhZ7zsSMaaSoTQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
| #/bin/sh | |
| # ####################################### | |
| # pam REF: https://askubuntu.com/a/448602 https://blog.stalkr.net/2010/11/login-notifications-pamexec-scripting.html | |
| # copy to /usr/local/bin, then +x | |
| # add "session optional pam_exec.so type=open_session seteuid log=/tmp/pam.log /usr/local/bin/login_slack_notify.sh" to /etc/pam.d/sshd | |
| # work on Ubuntu 14.04.5 / Centos 7.9 | |
| # selinux refer https://unix.stackexchange.com/a/474063 https://bugzilla.redhat.com/show_bug.cgi?id=737906#c1 | |
| #echo "User: $PAM_USER" >> /tmp/a.txt | |
| #echo "Ruser: $PAM_RUSER" >> /tmp/a.txt |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |
| import os | |
| import functools | |
| import time | |
| from django.core.wsgi import get_wsgi_application | |
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings") | |
| #import cProfile | |
| #def profiled(func): |
| class RQueue(object): | |
| """ redis queue wrap """ | |
| KEY = "redis" | |
| def __init__(self, redis_conn): | |
| """ | |
| :host: redis host | |
| :port: redis port | |
| :redis_conn: redis connection | |
| """ | |
| self.redis = redis_conn |
| #!/bin/bash | |
| # fix yum | |
| sed -i 's/\/usr\/bin\/python/\/usr\/bin\/python2.6/g' /usr/bin/yum | |
| # requirement | |
| yum -y update | |
| yum groupinstall -y 'development tools' | |
| yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget |
| # DOCKER_VERSION 1.8.3 | |
| # DESCRIPTION: alpine python runtime | |
| FROM gliderlabs/alpine:3.2 | |
| MAINTAINER Yaiba | |
| RUN apk-install --update \ | |
| python \ | |
| python-dev \ | |
| py-pip \ |
##tornado-debug 原理
使用方法: $ tor-deb python -m wcms_front.server
原理流程:
把/usr/lib/python2.7/site-packages/tornado_debug/bootstrap添加到环境变量PYTHONPATH
使用os.execl开启子进程,运行python程序
| # DOCKER_VERSION 1.6.2 | |
| # DESCTIPRION: dockerfile for build pelican | |
| FROM ubuntu:14.04 | |
| MAINTAINER Gavin Fan [email protected] | |
| RUN apt-get update -y | |
| RUN apt-get install -y make python-setuptools | |
| RUN easy_install pip | |
| RUN pip install pelican Markdown typogrify |