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
生成命令,/home/howl/.rvm/bin/bootup_puma: | |
rvm wrapper ruby-1.9.3-p125-perf bootup puma | |
创建Puma的配置文件,/etc/puma/puma.rb: | |
bind 'unix:///tmp/puma.sock' | |
pidfile '/tmp/puma.pid' | |
rackup '/home/howl/one/config.ru' | |
创建服务,/etc/init.d/puma: |
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
pid /var/run/nginx.pid; | |
#user nginx nginx; | |
user nobody nogroup; | |
worker_processes 2; | |
events { | |
use epoll; | |
worker_connections 1024; | |
} |
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
upstream festival { | |
server unix://tmp/festival.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name festival; | |
root /data/sites/festival/public; | |
access_log /var/log/nginx/festival_access.log; | |
error_log /var/log/nginx/festival_error.log; | |
location /logos/ { |
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
start on runlevel [2345] or net-device-up IFACE!=lo | |
stop on runlevel [06] | |
env PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/rvm/bin | |
chdir "/data/sites/festival" | |
script | |
rvm 2.0.0 exec bundle exec puma -C "/data/sites/festival/config/puma.conf" | |
end script | |
respawn |
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
Because some developers don't want to use Turbolinks from the Rails 4 default, here's how you do it. | |
In your Gemfile: Remove the line gem 'turbolinks' | |
In your app/views/layouts/application.html.erb: Remove "data-turbolinks-track" => true in stylesheet_link_tag and javascript_include_tag | |
In your app/assets/javascripts/application.js: Remove //= require turbolinks | |
That's it. Prost! :) |
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/sh | |
iptables -F | |
iptables -X | |
iptables -P INPUT DROP | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -t nat -F | |
iptables -t nat -P PREROUTING ACCEPT | |
iptables -t nat -P POSTROUTING ACCEPT | |
iptables -t nat -P OUTPUT ACCEPT |
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 ruby | |
SitesPath = "/data/sites" | |
backPath = "/backup/all" | |
now = Time.now | |
date = now.strftime("%Y-%m-%d") | |
dom = now.mday # Day of month | |
dow = now.wday # Day of week | |
m = now.month # Month of the year | |
w = now.strftime("%W") # Week of the year |
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 ruby | |
#PATH=/bin:/usr/local/bin:/sbin:/usr/bin:/usr/sbin | |
Dbpath = "/data/mongodb" # database path | |
Backpath = "/backup/db" # backup directory | |
Host = "" # mongo host to connect,empty is for local | |
Database = "" # database to use. empty is for all | |
Collection = "" # collection to use | |
User = "" | |
Passwd = "" | |
Now = Time.now |
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
# Ubuntu upstart file at /etc/init/penroll.conf | |
start on runlevel [2345] or net-device-up IFACE!=lo | |
stop on runlevel [06] | |
env PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/local/rvm/bin | |
chdir "/data/sites/dc" | |
script | |
#rvm 2.0.0 exec bundle exec puma -e production -b unix:///tmp/dc.sock | |
rvm 2.0.0 exec bundle exec puma -p 9090 -C "/data/sites/dc/config/puma.conf" |
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
threads 8,16 | |
rackup "/data/sites/dc/config.ru" | |
environment "production" | |
#bind tcp://localhost:9090 | |
directory "/data/sites/dc" | |
preload_app! |