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
| load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |
| ################################## | |
| # Edit these | |
| set :application, "example_node_app" | |
| set :node_file, "hello_world.js" | |
| set :host, "ec2-174-129-114-66.compute-1.amazonaws.com" | |
| ssh_options[:keys] = [File.join(ENV["HOME"], ".ec2", "default.pem")] | |
| set :repository, "git://gist.github.com/479007.git" | |
| set :branch, "master" |
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
| # HTML (from http://960.gs/ code example) | |
| <div class="container_12"> | |
| <div class="grid_7 prefix_1"> | |
| <div class="grid_2 alpha"> | |
| <p>...</p> | |
| </div> | |
| <div class="grid_3"> | |
| <p>...</p> | |
| </div> |
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
| # | |
| # Ruby scrapi 采集口碑房源数据 | |
| # Author: Huacnlee <[email protected]> | |
| # Blog: http://huacnlee.com | |
| # | |
| # Gems install: | |
| # sudo gem install scrapi | |
| # | |
| require 'rubygems' | |
| require 'scrapi' |
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
| # Helper | |
| def grid_row( cols ) | |
| out = "" | |
| cols.each do |col| | |
| out << "<div class=\"grid_#{col[0]}\">#{col[1]}</div>" | |
| end | |
| return out | |
| end |
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
| Coreseek (Sphinx) for MySQL 数据源 安装教程 | |
| 1. 下载源代码 | |
| $ wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.13.tar.gz | |
| $ tar xzf coreseek-3.2.13.tar.gz | |
| $ cd coreseek-3.2.13 | |
| 2. 中文测试环境检查: |
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 file = /var/run/rsyncd.pid | |
| port = 873 | |
| address = 172.28.150.23 | |
| uid = jason | |
| gid = jason | |
| use chroot = yes | |
| read only = yes | |
| hosts allow = 172.28.150.26 | |
| hosts deny = * | |
| max connections = 20 |
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
| # Converts an IP string to integer | |
| def ip2int(ip) | |
| return 0 unless ip =~ /d{1,3}.d{1,3}.d{1,3}.d{1,3}/ | |
| v = ip.split('.').collect { |i| i.to_i } | |
| return (v[0] << 24) | (v[1] << 16) | (v[2] << 8 ) | (v[3]); | |
| end |
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
| 安转 Ruby 和 Rubygems | |
| $ sudo apt-get install ruby1.8 ruby1.8-dev rubygems | |
| 安装 heroku 的程序 | |
| $ sudo gem install heroku | |
| 安装 Git | |
| $ sudo apt-get install git-core | |
| 下载 PersonLab 源代码 |
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
| worker_processes 1; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| passenger_root /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-2.2.14; | |
| passenger_ruby /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby; | |
| include mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; |
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
| #此DEMO的功能:查询手机类的淘客商品 | |
| require 'digest/md5' | |
| require 'net/http' | |
| require 'open-uri' | |
| require 'iconv' | |
| #获得当前时间 | |
| t = Time.new(); | |
| #组装参数 |