更新源
sudo apt-get update
安装系统包
sudo apt-get -y install git-core curl zsh exuberant-ctags vim autoconf automake openssl \
ref: http://nathanhoad.net/deploy-from-a-git-tag-with-capistrano | |
Deploy from a Git tag with Capistrano | |
Are you using Capistrano and Git and want to easily deploy from Git tags? It couldn't be simpler | |
Using Git, tag a new release: | |
git tag -a 09.10.02.01 -m "Tagging a release" | |
You can use git tag to list your tags: |
#!/bin/bash | |
HOST=127.0.0.1 | |
USER=root | |
PASS=root | |
# DB="db1 db2 ..." | |
DB="erp" | |
DATE=$(date "+%Y-%m-%d") | |
BACKDIR=/home/rails/backup |
配置外部访问帐号密码 | |
本地登录mysql | |
mysql -u root -p | |
执行 | |
grant all on *.* to rails@'client_ip' identified by 'password' with grant option; | |
例子:所有局域网客户端都可访问 | |
grant all on *.* to root@'192.168.0.%' identified by 'root' with grant option; | |
例子:为boyu数据库设置用户boyu |
#!/bin/sh -e | |
# kirk rails app | |
# | |
# start service for rails app | |
set -e | |
USER=rails | |
NAME=kirk | |
HOME=/home/$USER |
# Set the log level to ALL. | |
log :level => :all | |
rack "/u/apps/erp/current/config.ru" do | |
# Set the host and / or port that this rack application will | |
# be available on. This defaults to "0.0.0.0:9090" | |
listen 10000 | |
# Set the host names that this rack application wll be available | |
# on. This defaults to "*" |
<VirtualHost *:80> | |
ServerName boyu | |
ServerAlias boyu | |
# Point this to your public folder of project | |
DocumentRoot /u/apps/boyu/current/public | |
ErrorDocument 503 /system/maintenance.html | |
RewriteEngine On |
#!/usr/bin/env ruby | |
# | |
# ARGV[0] - msg | |
# ARGV[1] - mailto | |
require 'open-uri' | |
require 'rubygems' | |
require 'action_mailer' | |
ActionMailer::Base.smtp_settings = { |
#!/usr/bin/env ruby | |
# | |
# ARGV[0] - msg | |
# ARGV[1] - mailto | |
# ARGV[2] - filename | |
require 'open-uri' | |
require 'rubygems' | |
require 'action_mailer' |
#!/bin/bash | |
ETH=$1 | |
ETH=${ETH:-eth0} | |
IP=`ifconfig $ETH|awk -F '[ :]+' '/inet addr/{print $4}'` | |
while true;do | |
let I+=1 | |
NOW=`date +"%F %T"` | |
TX1=`ifconfig $ETH|grep bytes|awk -F '[ :]+' '{print $9}'` |