分为三步:
-
同步gems mirror
安装rubygems-mirror 原来的rubygems-mirror好像有问题,所以使用@huacnlee改过的gem
按照README.md说明配置.mirrorrc# 国内最好用taobao的源,rubygems经常被墙 --- - from: http://ruby.taobao.org to: /data/rubygems
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: nginx | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the nginx web server | |
| # Description: starts nginx using start-stop-daemon |
| require 'thread' | |
| require 'socket' | |
| class RequestHandler | |
| def initialize(session) | |
| @session = session | |
| end | |
| def process | |
| while @session.gets.chop.length != 0 |
| # stub class | |
| stub_const('ResourceCategory', Class.new) | |
| # stub class and stub it's methods | |
| stub_const('ResourceCategory', Class.new).stub(:all).and_return([]) | |
| # $ gem mirror | |
| # ERROR: Install the rubygems-mirror gem for the mirror command | |
| # From: http://qiita.com/yoshiori/items/463de8be446cda6d67ca | |
| require 'rubygems/mirror/command' | |
| Gem::Commands::MirrorCommand.new.execute |
分为三步:
同步gems mirror
安装rubygems-mirror 原来的rubygems-mirror好像有问题,所以使用@huacnlee改过的gem
按照README.md说明配置.mirrorrc
# 国内最好用taobao的源,rubygems经常被墙
---
- from: http://ruby.taobao.org
to: /data/rubygems| (ns logger.core) | |
| (defn print-logger | |
| [writer] | |
| #(binding [*out* writer] | |
| (println %))) | |
| ;; 将消息打印到一个内存buffer | |
| (def writer (java.io.StringWriter.)) |
| #!/bin/bash | |
| PKG_MANGER="sudo apt-get install" | |
| HOME="/home/simlegate" | |
| echo $PKG_MANGER | |
| echo "正在安装Git......." | |
| nohup $PKG_MANGER git |
💯 👍 👎 🔢 🎱
| // 提高性能 | |
| // 让rails server只处理动态请求,不必浪费资源处理静态文件请求 | |
| // rails server处理静态文件的性能完全不能和nginx,apache之类的比。 | |
| location ~* ^/(images|javascripts|stylesheets|img)/ { | |
| access_log off; | |
| log_not_found off; | |
| expires max; | |
| break; | |
| } |
| # sudo ln -s ~/nginx.conf unicorn.conf | |
| upstream app_server { | |
| server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80; | |
| charset utf-8; | |
| server_name db.innshine.com; |