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
| Copyright (c) 2012 Rizal Almashoor | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE |
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
| # 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度 | |
| # 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装 | |
| # 做这个起什么作用? | |
| # rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。 | |
| # 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外 | |
| proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m | |
| inactive=24h max_size=1g; | |
| server { | |
| listen 80; |
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
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
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
| import re | |
| from hashlib import md5 | |
| def gfm(text): | |
| # Extract pre blocks. | |
| extractions = {} | |
| def pre_extraction_callback(matchobj): | |
| digest = md5(matchobj.group(0)).hexdigest() | |
| extractions[digest] = matchobj.group(0) | |
| return "{gfm-extraction-%s}" % digest |
NewerOlder