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 | |
PATH=/var/lib/gems/1.9.1/bin:/usr/local/mongodb/bin:/usr/bin | |
cd /usr/local/railsites/zcms | |
unicorn_rails -p 80 -E production -D | |
exit 0 | |
#stop | |
#!/bin/bash | |
pkill unicorn_rails |
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/ruby | |
Backpath = "/backup/apps/dljy" | |
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 | |
Doweekly = 6 # Saturday |
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 DROP | |
iptables -P OUTPUT DROP | |
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
iptables -F | |
# 允许包从22端口进入 | |
iptables -A INPUT -p tcp --dport 22 -j ACCEPT | |
# 允许从22端口进入的包返回 | |
iptables -A OUTPUT -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT | |
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT | |
iptables -A INPUT -p udp --sport 53 -j ACCEPT | |
#允许本机访问本机 | |
iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -j ACCEPT | |
iptables -A OUTPUT -s 127.0.0.1 -d 127.0.0.1 -j 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/local/ruby/bin/ruby -w | |
Dbpath = "/data/db" # database path | |
Backpath = "/data/dbbackup" # 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 | |
DATE = Now.strftime("%Y-%m-%d") |
NewerOlder