Skip to content

Instantly share code, notes, and snippets.

View chengdh's full-sized avatar

chengdh

  • 中国郑州
View GitHub Profile
this is a test
@chengdh
chengdh / unicorn_capistrano.rb
Created May 2, 2012 02:26 — forked from sentientmonkey/unicorn_capistrano.rb
Our deploy for unicorn. It also has magical powers.
set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid"
namespace :unicorn do
desc "start unicorn"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && #{try_sudo} bundle exec unicorn_rails -c #{current_path}/config/unicorn-#{rails_env}.rb -E #{rails_env} -D"
end
desc "stop unicorn"
task :stop, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} kill `cat #{unicorn_pid}`"
@chengdh
chengdh / gist:3271840
Created August 6, 2012 07:12
ubuntu + rails3.2 生产环境配置

预置服务器环境

sudo apt-get update
sudo apt-get upgrade

#### note: ran rvm requirements to get package list:
sudo apt-get install curl build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion -y

在服务器上创建用户

@chengdh
chengdh / ubuntu_rials_server_install
Created August 6, 2012 07:30 — forked from EricLondon/ubuntu_rials_server_install
Ubuntu Rails Server Install
# update installed packages
sudo apt-get update
sudo apt-get upgrade
# ssh server
sudo apt-get install openssh-server -y
# install curl
sudo apt-get install curl -y
@chengdh
chengdh / example_migration.rb
Created August 10, 2012 01:20 — forked from mmrwoods/example_migration.rb
Rails migration helper for dealing with large tables in MySQL
require "mysql_big_table_migration_helper"
class AddIndexOnSomeColumnToSomeTable < ActiveRecord::Migration
extend MySQLBigTableMigrationHelper
def self.up
add_index_using_tmp_table :some_table, :some_column
end
@chengdh
chengdh / unicorn.conf
Created August 13, 2012 06:23 — forked from pshima/unicorn.conf
Unicorn logrotate
/path/to/unicorn/log/unicorn.stderr.log
/path/to/production/log/production.log
{
daily
missingok
rotate 180
compress
dateext
# this is important if using "compress" since we need to call
@chengdh
chengdh / demo.html
Created August 20, 2012 09:48 — forked from insin/index.html
Export a <table> to Excel
<!DOCTYPE html>
<html>
<head>
<title>tableToExcel Demo</title>
<script src="tableToExcel.js"></script>
</head>
<body>
<h1>tableToExcel Demo</h1>
<p>Exporting the W3C Example Table</p>
@chengdh
chengdh / my.cnf.txt
Created August 29, 2012 09:58 — forked from sr75/my.cnf.txt
mysql-innodb-large-server-example-configuration
# *** Application-specific options follow here ***
#
# The MySQL server
#
[mysqld]
# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
@chengdh
chengdh / gist:3760809
Created September 21, 2012 10:29
openerp CI服务器jenkins的安装配置

配置openerp的版本控制环境

安装配置jenkins及其插件

配置git

@chengdh
chengdh / gist:4084763
Created November 16, 2012 06:21
燕赵语音系统安装步骤

安装语音卡驱动,使用DJDBDK V3.3.1

-- 安装完毕后,设备管理器中的PCI设备仍然带有黄色感叹号,但是设备是正常的

进入开始菜单 DJDBDK--DJD161A--Auto Check

点击PCI BORAD CARD检测当前安装的语音卡

点击 save & exit 保存语音卡配置

配置文件如下