在我之前的博文中,我描述了我是如何在容器中使用进程管理器的,并做了一些展开。但我还是觉得有必要针对 Laurent Bercot 开发的 S6 做更详尽的说明。
什么用 S6 而不是 Supervisor?
| # Extended python -m http.serve with --username and --password parameters for | |
| # basic auth, based on https://gist.github.com/fxsjy/5465353 | |
| from functools import partial | |
| from http.server import SimpleHTTPRequestHandler, test | |
| import base64 | |
| import os | |
| class AuthHTTPRequestHandler(SimpleHTTPRequestHandler): |
| vi /etc/environment | |
| add these lines... | |
| LANG=en_US.utf-8 | |
| LC_ALL=en_US.utf-8 |
在我之前的博文中,我描述了我是如何在容器中使用进程管理器的,并做了一些展开。但我还是觉得有必要针对 Laurent Bercot 开发的 S6 做更详尽的说明。
什么用 S6 而不是 Supervisor?
| # Install tmux on Centos release 6.5 or 7.2 | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel | |
| # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
| curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
| tar -xvzf libevent-2.0.22-stable.tar.gz | |
| cd libevent-2.0.22-stable | |
| ./configure --prefix=/usr/local |
| #!/bin/bash | |
| # set -eux | |
| # This a simple script that builds static versions of Python and LibPython using musl-libc | |
| # Find the associated article at: http://general-purpose.io/2015/12/06/compiling-python-and-libpython-statically-using-musl-libc/ | |
| WORKING_DIR="/code/static-python" | |
| MUSL_PREFIX="/code/static-python/musl" | |
| PY_PREFIX="/code/static-python/python" |
| #!/bin/bash | |
| TMUX_VERSION=2.3 | |
| NCURSES_VERSION=6.0 | |
| LIBEVENT_VERSION=2.0.22 | |
| BASEDIR=${HOME}/work/tmux-static | |
| TMUXTARGET=${BASEDIR}/local | |
| mkdir -p $TMUXTARGET | |
| cd $BASEDIR |
(本教程基于此 this pastebin 文档编写, 并且适合于 Yosemite 正式版)
(免责声明: 本教程旨在说明如何在 VirtualBox 中运行 Mac OS X 操作系统, 并且本系统仅供测试使用.)
| import zlib | |
| from base64 import b64decode, b64encode | |
| from django.db import models | |
| # django-jsonfield | |
| from jsonfield import JSONField | |
| class CompressedJSONField(JSONField): |
| #!/bin/sh | |
| # | |
| # git autodeploy script when it matches the string "[deploy]" | |
| # | |
| # @author icyleaf <[email protected]> | |
| # @link http://icyleaf.com | |
| # @version 0.1 | |
| # | |
| # Usage: | |
| # 1. put this into the post-receive hook file itself below |