Skip to content

Instantly share code, notes, and snippets.

View lajunta's full-sized avatar
🌴
On vacation

lajunta lajunta

🌴
On vacation
View GitHub Profile
# 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/dljy"
script
#rvm 1.9.3 exec bundle exec puma -e production -b unix:///tmp/dljy.sock
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/usr/local/rvm/gems/ruby-2.0.0-p0/bin
# m h dom mon dow user command
upstream dc {
server localhost:9090;
#server unix:/tmp/dc.sock max_fails=3 fail_timeout=60s;
}
server{
access_log /var/log/nginx/access_kpy.log main;
error_log /var/log/nginx/error_kpy.log;
listen 80;
charset utf-8;
server_name kpy.lwqzx.net;
upstream dljyunicorn {
#server unix:/tmp/dljy.sock fail_timeout=0;
server localhost:9999;
}
server {
listen 80;
charset utf-8;
server_name dl.lwqzx.net;
add_header Cache-Control public;
access_log /var/log/nginx/access_dljy.log main;
#######################################################
### Calomel.org /etc/nginx.conf BEGIN
#######################################################
pid /var/run/nginx.pid;
#user nginx nginx;
user nobody nogroup;
worker_processes 2;
events {
use epoll;
threads 8,16
rackup "/data/sites/dc/config.ru"
environment "production"
#bind tcp://localhost:9090
directory "/data/sites/dc"
preload_app!
# 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"
#!/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
#!/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
#!/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